Forum Moderators: coopster
Well I finally found one that is similar to what I want, it's a topsite toplist type script but those featurs can be turned off to make it a free for all link list. The only problem is that newest links are on bottom instead of on top. The creatures of the scripts want to much $ for modifing it so the newest links are on top. Can I do this myself without any knowledge of php programming?
It has the ability to order the list by votes, hits, hits out, rank, but I just want it to order the list by date. Anyone know how to do this?
If you can paste just the SQL line out of the code page where the links are listed, then there should be something like
SELECT * FROM links ORDER BY date ASC
You need to revers the ASC bit at the end. Depending on what it is, ie: ASC changes to DESC, or DESC changes to ASc.
Though this depends on the way the dbase is set up.
Will you be able to find the swl line?
<td width='20%' bgcolor='#FAFAF2' valign='middle' rowspan='5' align='center'>
<b>{$mtl->lang['in']}</b><br />
<select name='asc' class='select'>
<option value='asc'>{$mtl->lang['ascending']}</option>
<option value='desc' selected='selected'>{$mtl->lang['descending']}</option>
</select>
</td>
or maybe it's in this on the ssi.php page?
$order_array = array ('votes','out','hits','rating');
foreach($order_array as $v)
{if($v == $mtl->input['order'])
{$order = $v;
$past = "{$order}_past";}
}
if(!isset($order))
{if(((is_numeric($mtl->input['sum_v']) OR is_numeric($mtl->input['sum_vo']) OR is_numeric($mtl->input['sum_r'])) AND $op = 'input') OR (preg_match("/sum/", $mtl->config['list_order']) AND $op = 'config'))
{if($op == "input")
{$v = "sum({$mtl->input['sum_v']},{$mtl->input['sum_o']},{$mtl->input['sum_h']},{$mtl->input['sum_r']})";
$this->search_url .= "&order={$v}";
}
else
{$v = $mtl->config['list_order'];}
$v = preg_replace("/sum\((.*?)\)/", "\\1", $v);
$sum = explode(",", $v);
$order = "((votes*0.$sum[0])+(out*0.$sum[1])+(hits*0.$sum[2])+((rating/GREATEST(rating_total, 1))*0.$sum[3])) ";
$past = " ((votes_past*0.$sum[0])+(out_past*0.$sum[1])+(hits_past*0.$sum[2])+((rating_past/GREATEST(rating_total, 1))*0.$sum[3])) ";
}
else
{$order = $mtl->config['list_order'];
$past = "{$order}_past";}
}
$DB->query("SELECT id,site_name FROM mtl_sites WHERE a_mail='1' AND a_admin='1' AND a_ban!='1' AND a_hide!='1' $cats ORDER BY $order DESC LIMIT {$mtl->input['no']}");
If this doesn't help, check the table "mtl_sites" for any fields that might contain a date and insert them behind the "ORDER BY"...
Maybe I'll just request a refund for this script and continue my quest to find a free for all type script that allows voting for each link and places newest links on top. Most people have never even heard of such a beast.
Maybe don't give up yet. Keep on searching for the right SQL SELECT-query - if you find it (and there's almost no doubt it exists ;-) ), it's just a matter of a couple of minutes to adjust everything. Plus, you learn a lot this way ;-)