Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
sab_NowPlaying version .6 already!
Alrighty,
It has all the great functionality as before now with polish! http://www.bluecamel.org/software/textpattern/sab_NowPlaying.txt Added:
- Ability to show any element outside the normal loop
- Show the last time the file was updated 3 different ways:
- Original timestamp (looks computer-ie)
- Formatted any way you like, using the format codes listed here
- Time elapsed since “now”, for example (“5 minutes and 10 seconds ago”).
- Original timestamp (looks computer-ie)
- Formatted any way you like, using the format codes listed here
- Time elapsed since “now”, for example (“5 minutes and 10 seconds ago”).
Reference:
<txp:sab_NowPlaying />
- show=ANYEXISTINGTAG – This is if you want to display an element outside the main loop.
- *show=“LASTUPDATED” – Use this to display the date and time you last played something. If you use this option you also have a couple other attributes you can specify:
<ul>
- dateformat= – This is a date format string. It generally will look something like “F j, Y, g:i a”, to your discression. The “codes” for this can be found here .
- fromnow={0|1} – Used if you want to return the time elapsed since you last played a file. This will return something like, “10 hours, 4 minutes and 43 seconds”.
</ul>
- urlonly={0|1} – if you want to show the album art (“show=‘IMAGE’), this will only return the URL to the image instead of creating the entire <code><IMG src=”“ alt=”“ /></code> tag. Used for setting the block background, for example.
- link={amazon|apple|source} – This isn’t new but it can also be used here. Use this attribute if you want to create the <code><IMG src=”“ alt=”“ /></code> tag surrounded by a link to Amazon, Apple, or Source(?).
For example, I list 5 of my last songs in the XML file, but I want to only display the very last song’s album’s cover art. I use this code in my form:
<pre>
<code>
<div class=“body” id=“recentlyplayed”>
<div class=“albumCover”>
Updated <txp:sab_NowPlaying xmlfile=“itunes.xml” show=“lastupdated” fromnow=“1” /> ago
<br />
<txp:sab_NowPlaying xmlfile=“itunes.xml” show=“image” idx=“1” alt=“Currently listing to…” link=“amazon” />
</div>
<br />
<ul id=“itunes”>
<txp:sab_NowPlaying xmlfile=“itunes.xml” form=“now_listening” />
</ul>
<br />
<p class=“center”>
<a href=“http://brandon.fuller.name/archives/hacks/nowplaying/”>
<img src=“http://brandon.fuller.name/images/now_playing.png” alt=“Now Playing” />
</a>
</p>
</div>
</code>
</pre>
<ul>
</ul>
Any questions?
-Steve
Last edited by supa (2005-02-17 18:08:11)
Offline
Re: sab_NowPlaying version .6 already!
any reason why your site is on lockdown? username, password, anyone?? :)
Offline
Pages: 1