Latest Register Log In

+ Advanced Search

Link Importance Formula

Link Importance Formula
By
Aug 24, 2004 (Edited Jan 29, 2014)

Occasionally, you may want to sort listings by a criteria more complicated than a single field. The 'importance' field exists to allow you to do this. At Admin Panel -> Listings -> Link Settings -> "Listing 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:" -> "Listings 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->numcomments) + 6
This takes the number of views per month the listing recieves, adds the number of comments posted to that listing, 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 listings at Admin Panel -> Maintenance -> Regenerate in order to get your preexisting links updated to the new formula's value.





Description Creating complex sorting algorithms.
Rating
Views 1,915 views. Averaging 0 views per day.
Similar Listings