I have been messing around with the $orderby tag, and the only values that seem to work are "title" and "timestamp". "viewcount", "commentcount", and "rating" have no effect. Anyone else have this problem / is this a bug? Or am I doing something wrong?
side note (didn't want to make a new post) - I used http://network-13.com/thread/1338-News-filter-by-category#1341 and switched $cat[] to $orderby to create links that allow users to sort by different variables. The default newsorder is DESC, however, so if you sort by title (or in theory viewcount, commentcount or rating) it shows the last (lowest) first. I would like to switch the newsorder to ASC when viewing title, viewcount, commentcount or rating, but I'm not sure how to create a link that changes both $orderby and $newsorder. Could you explain how to do this?
Ah you've found a bug in the documentation. On the Integration page, it said the following
<?php $orderby = 'timestamp'; include 'news/index.php'; ?>
The order your news will be displayed, default is timestamp, possible options are rating, viewcount, title & commentcount
What that should have said is
The order your news will be displayed, default is timestamp, possible options are rating, views, title & comments
I suspect this is the problem you were having. Try using views & comments to see if that works.
Ah, that works! Haha, thanks, what a silly mix up :P
Well, I've just realized that the links I'm using to set $orderby don't stick if you go to the next page. Is there any way to fix that, so that clicking to page 2 shows the next news in the order selected, instead of reverting to displaying the second page of $orderby = timestamp?
<?php $linkprefix = 'variable=value&'; ?>
This will be added to the beginning of all hyperlinks to help users who are incorporating the script into another system
This is what you're looking for. You could do something like this
<?php
$linkprefix = 'order=' . $_GET['order'] . '&';
include 'news/index.php';
?>
Now the pagintation links should have order=something
added to each URL.
Ah! Thank you so much! :D