Occasionally, you may want to sort topics by a criteria more complicated than a single field. The 'importance' field exists to allow you to do this. At Admin Panel -> Topics -> Topic Settings -> "Topic Importance Formula" you can define a custom formula for determining the value to fill this field. Select to sort by the importance field at Admin Panel -> Settings -> General -> "Default Ordering:" -> "Topics order".
A bit of PHP knowledge is helpful for creating a formula, but please feel free to contact support to ask how to impliment whatever importance formula you'd like to use. The current default formula, which you can customize, is
$importance = ($this->hitsoutpermonth() + $this->numposts) + 6
This takes the number of views per month the topic recieves, adds the number of posts posted to that topic, and then adds 6.
You can reference any mysql field in the form $this->fieldname, or use any methods of the classes/onelink.php or classes/generic.php classes with $this->methodname().
Important Note: After you change the importance formula you must regenerate topics at Admin Panel -> Maintenance -> Regenerate in order to get your preexisting links updated to the new formula's value.
Link Importance Formula
Link Importance Formula
By Paul
08/24/04 (Edited 01/29/14)
By Paul
08/24/04 (Edited 01/29/14)
Description | Creating complex sorting algorithms. |
Rating | |
Views | 1908 views. Averaging 0 views per day. |