Help - Search - Members - Calendar
Full Version: Offset pings??
Movable Type Community Forum > Additional Resources > Tips and Tricks
medic119
I am sure this is not called for often, but I need to offset MTPings by one.

I am using it in my Now playing list and I highlight the current track. I need to offset the remaing tracks by one so That my current track doesn't display twice.

the offset attribute doesn't work... argh!
medic119
Is there no way to offset pings then??
kadyellebee
I think you'd have to use some MySQL or a plugin to offset pings - I can't think of any other way to do it by default ohmy.gif I have my original code that I used before MTPings was a container up at ScriptyGoddess, if that helps.

Kristine
medic119
thanks..
medic119
Just for future records, the problem was solved with stepan's new MTCollate plugin.

And here is the template I use to display my current WinAmp Tracks. It uses MTCollate to collect the Pings. The current Track is displayed and then MTCollate's recordset displays the Last 5 tracks played offset by one.

A wonderful solution to a problem.

I stripped all the formatting out so just the appropriate tags would be displayed.

CODE
<MTCollateCollect>
   <MTPings category="nowplaying" lastn="6">
       <MTCollateRecord>
           <MTCollateSetField name="song"><$MTPingExcerpt$></MTCollateSetField>            
       </MTCollateRecord>
    </MTPings>
</MTCollateCollect>


Current Track

<MTPings category="nowplaying" lastn="1">
<$MTPingExcerpt$><br/>
</MTPings>

Last 5 Tracks

<MTCollateList limit="5" offset="1">
<MTCollateField name="song"><br/>
</MTCollateList>
kadyellebee
Ahh, that's great! I'm glad Stepan came out with this plugin, because it does fit great with what you were trying to do smile.gif

Kristine
stepan
Yeah, the plugin was partially inspired by this request. smile.gif
The other inspiration came from me wanting to list items from multiple RSS feeds by "most recently updated".
rayners
Of course, this all happens as I add lastn and offset arguments to the new MTBlogPings tag in my MTBlogPings plugin. tongue.gif
medic119
QUOTE (rayners @ May 13 2003, 04:27 PM)
Of course, this all happens as I add lastn and offset arguments to the new MTBlogPings tag in my MTBlogPings plugintongue.gif

Actually, Rayners, your plugin would probably have been a much simpler solution as it is focused on pings and doesn't require all the recordsetting that MTCollate does. MTCollate is for much more generalized use.

But I try to follow the motto, "If it ain't broke, Don't Fix it."

Now if I could only get all this to work with MTAmazon so people could click on my Tracks and get the album via Amazon and I could put my associate ID to good use.. smile.gif

(All this work for such a minor module to my sidebar. I hate being a Type-A sometimes. tongue.gif )
bmk
Cool! I was offsetting my winamp ping list by one using a php kludge:

CODE
<b><MTDate format="%B %d - %X"><br /></b>
<MTPings category="nowplaying" lastn="1">
<$MTPingExcerpt$><br />
</MTPings>

<br />

<? $i = 0; ?>
<MTPings category="nowplaying" lastn="6">
<?
$pingexcerpt[$i] = '<$MTPingExcerpt encode_php="q"$>';
$i++;
?>
</MTPings>

previously:<br />
<?
for ($j=1; $j<=(sizeof($pingexcerpt)-1); $j++) {
echo "• ";
echo $pingexcerpt[$j];
echo "<br />";
}
?>


I'll hafta check out these other new additions now! smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.