WSN Links
Featuresspacer Showcasespacer Reviewsspacer Demosspacer Purchasespacer Manualspacer Support

Register | Forgot Password
Cross-Script Toplists
Cross-Script Toplists
By Paul

Presuming you own multiple WSN scripts, sometimes you may wish to show toplists of items from a different WSN script than the one you're in.

The toplist syntax remains the same as usual for the most part, with the first term changing to indicate the desired database table. It's easiest to explain this by example. Here's a toplist that will show the five newest images from WSN Gallery within any of the other scripts:

<!-- BEGIN TOPLIST 11 -->
<CONFIG>wsngallery_links,id,5,descending</CONFIG>
<a href="http://scripts.webmastersite.net/wsnlinks/wsnmanual410/{IMAGEDETAILSURL}"><img src="http://galleryurl/thumbnail.php?id={IMAGEID}" border="0"></a>
<!-- END TOPLIST 11 -->


wsngallery_links is simply the name of the database table you want the data from, which you can find in phpmyadmin.

For another example, here's a way to show the most recently posted in ten threads from WSN Forum within WSN Links (or Gallery or KB):

<!-- BEGIN TOPLIST 11 -->
<CONFIG>wsnforum_links,lastcomment,10,descending</CONFIG>
<a href="http://scripts.webmastersite.net/wsnlinks/wsnmanual410/{TOPICTHREADURL}">{TOPICTITLE}</a> by {TOPICOWNERNAME}
<br>{TOPICMESSAGE[50]}
<br>
<!-- END TOPLIST 11 -->


Finally, you can show similar threads from your forum within WSN Links (or vice versa, or any other combination) with a special toplist condition like this:

<!-- BEGIN TOPLIST 11 -->
<CONFIG>wsnforum_links,time,5,descending,MATCH (title) AGAINST('{LINKTITLE}')</CONFIG>
<a href="http://scripts.webmastersite.net/wsnlinks/wsnmanual410/{TOPICTHREADURL}">{TOPICTITLE}</a><br />
<!-- END TOPLIST 11 -->


You can do cross-script toplists for comments, categories/forums, etc as well just by using the appropriate table name.

Troubleshooting

Important note: when doing URL rewriting, you must have the same rewrite formatting (except for template variables being of the host script's type of course) on all the scripts involved for it to rewrite correctly in cross-script toplists.

Rating:


4/5 based on 1 vote. The median rating is 4.

Submitted: 06/21/05 (Edited 10/10/07)

Description: Making a toplist of items from one WSN script while in another.

Views: 950 views. Averaging 1 per day.
In the most recent 30 day period, there've been 7 views.

Next Article

Home    |    Features    |    Showcase    |    Reviews    |    Demos    |    Purchase    |    Manual    |    Support