Latest Register Log In

+ Advanced Search

Introduction to Toplists

Introduction to Toplists
By
09/25/03 (Edited 03/10/14)

Toplists are lists of data from your site, ordered and formatted in the manner of your choosing. For example, you could make a list of the 5 most recent topics or the 10 top rated topics, or the 8 most recent posts on topic #14 that have at least one upvote. Your admin panel includes a toplist generator to help you make toplists. Go to Admin Panel -> Themes -> Toplist Gernerator and answer its questions.

Toplists can be used in any template (Admin -> Themes -> Manage Templates), and also in all emails. They can be especially useful in the bulk emails which you send from the Admin Panel -> E-mails -> Send E-mails page, if for example you want to send a newsletter that automatically lists the most recent new topics.

Even though the toplist generator makes the code for you, you may wish to understand in more depth how the feature works. Here's an example:

<!-- BEGIN TOPLIST 1 -->
<CONFIG>links[,]id[,]5[,]ascending[,]votes>5[,]0[,]0[,]1</CONFIG>
content
<!-- END TOPLIST 1 -->


The example config line for toplist 1 above makes a toplist of links ordered by their rating, showing 10 links in descending order, excluding any links which have less than 5 votes, not skipping past any of these defined results, and not showing unvalidated items. You don't need to understand the CONFIG line though, just use the toplist generator.

If you want more than one toplist on the same page, they must all use unique numbers. For example the 2nd one could use the number 2 in the beginning and end declaration... and the third could use 3, et cetera. If they're on different pages this doesn't matter and you can just use 1. Please note that the wrapper is considered to be a part of every page.

Note the power of the filtering condition option. With it you can filter to only the toplist of links owned by a particular member, for example, using the condition ownerid={MEMBERID}. You could also show top links for only a particular forum, using catid={CATID}.

If you want a numbered list (for example, a top 10), use {NUMBER} where you want the number displayed.

Be careful to check after changing a toplist to be sure it worked. If you make a little mistake, you'll end up with errors on the page... thus, always be prepared to change it back and don't assume that you couldn't have made a typo. Of course it won't cause any problems that can't be fixed by simply changing/removing the toplist, but it's not good for visitors to see such errors.

Advanced Tricks

You can dyamically alter a toplist by supplying terms in the url of the page or in a form post. For a toplist numbered 1, you could use &field[1]=votes to change the field we are ordering by to be votes regardless of what is specified in the config line in the template. Options: type[1], thefield[1], number[1], order[1], thecondition[1], thestart[1], thecolumns[1], theunval[1], thehidden[1], thealbums[1]. (On the 'edit' pages, to avoid a conflict you need to use thefield[1] instead.)





Description Tips on proper use of this powerful feature.
Rating
Views 4301 views. Averaging 1 view per day.