Cool, we are getting closer. My code looks like this now...
if(ISSET($_GET['imgsort'])) {
if ($_GET['imgsort'] == "views") {
$imgsortby = "hitcounter";
$imgorder = "DESC";
setOption('image_sorttype','hitcounter',FALSE);
setOption('image_sortdirection',$imgorder,FALSE);
}
else if ($_GET['imgsort'] == "rating") {
$imgsortby = "total_value";
$imgorder = "DESC";
setOption('image_sorttype','total_value',FALSE);
setOption('image_sortdirection',$imgorder,FALSE);
}
else if ($_GET['imgsort'] == "lastcomment") {
$imgsortby = "custom_data";
$imgorder = "DESC";
setOption('image_sorttype','custom_data',FALSE);
setOption('image_sortdirection',$imgorder,FALSE);
}
}
The problem is if I set the persistent parameter to false, it does not work at all and I do not want the option change to be permenant, especially for all users. If I leave the persistent parameter blank (TRUE), it has the desired outcome except for it being permenant.