Quote:
Originally Posted by AndrewD
Thanks - it is not hard to change the template to display stars (I think someone already sorted that out - will try to track it down) - if someone tries to vote a second time, this is allowed, but it cancels their previous vote, i.e. their vote only gets counted once.
|
As a workaround for that (only wanted people to vote once) I did the following:
Changed the query in get_linklistbit to this:
PHP Code:
$query = "
SELECT link.linkid AS linkid, link.linkname AS linkname, link.linkuserid AS linkuserid,
link.linkusername AS linkusername, link.linkurl AS linkurl, link.linkdesc AS linkdesc,
link.linkhits AS linkhits, link.linkstatus AS linkstatus, link.linkdate AS linkdate, linkrate.linkvote
FROM ".THIS_TABLE."linkslink AS link
LEFT JOIN ".THIS_TABLE."linksltoc AS ltoc
ON link.linkid = ltoc.linkid
LEFT OUTER JOIN local_linksrate AS linkrate
ON ( ( link.linkid = linkrate.linkid ) AND ( linkrate.linkuserid =" . intval($bbuserinfo['userid']) ." ) )
$squery
ORDER BY linkname
";
Then under this:
PHP Code:
$linknew = iif($bbuserinfo['lastvisit'] < $myrow['linkdate'],1,0);
I stuck this:
PHP Code:
$linkvoted=intval($myrow["linkvote"]);
Then in the list_linkbit template, I changed
PHP Code:
<if condition="$links_permissions[can_rate_link]">
To this:
PHP Code:
<if condition="$links_permissions[can_rate_link] AND $linkvoted==0">
May not be the best, but thought I would post it in case anyone else wanted it. As for the star, tmeplate thing... I didnt look in the 27 page thread here, but you are right... its about as easy as could be.
Just change the lins_ratebit template to this:
PHP Code:
<br /> <br /><img src="images/rating/rating_$linkrate.gif">
Kick ass mod m8.