TinyPortal

Development => Block Codes => Topic started by: fussilet on October 13, 2008, 08:18:06 PM

Title: [block] Top Rated Links for SMF Links
Post by: fussilet on October 13, 2008, 08:18:06 PM
 Top Rated Links for SMF Links (http://custom.simplemachines.org/mods/index.php?mod=381)

form phpbox :

add into:


global $db_prefix, $scripturl, $txt, $settings, $modSettings, $subcats_linktree;
if (!empty($modSettings['smflinks_setshowtoprate']))
{
echo '<div class="tborder" style="margin: 2%;"><div class="catbg2">' . $txt['smflinks_topfiverated'] . '</div>';
echo '<table>';

$dbresult = db_query("SELECT l.ID_LINK, l.rating, l.title,l.date, m.realName, l.ID_MEMBER, l.description,l.hits FROM {$db_prefix}links AS l LEFT JOIN {$db_prefix}members AS m ON (l.ID_MEMBER = m.ID_MEMBER)  WHERE l.approved = 1 ORDER BY l.rating DESC LIMIT 5", __FILE__, __LINE__);
while($row = mysql_fetch_assoc($dbresult))
{
echo '<tr>
<td>
<a href="' . $scripturl . '?action=links;sa=visit;id=' . $row['ID_LINK'] . '" target="blank"><img src="' .$settings['tp_images_url']. '/TPdivider2.gif" alt="" />' . $row['title'] . '</a> ';


echo $txt['smflinks_rating'] . $row['rating'];

if ($editlink)
echo ' <a href="' . $scripturl . '?action=links;sa=editlink;id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtedit'] . '</a> ';
if ($deletelink)
echo '<a href="' . $scripturl . '?action=links;sa=deletelink;id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtdel'] . '</a>';

echo '</td></tr>';
}
echo '</table>';
mysql_free_result($dbresult);
echo '</div>';
}


regards... ;)


Title: Re: [block] Top Rated Links for SMF Links
Post by: Ianedres on October 13, 2008, 09:18:30 PM
Looked at your code- it all looks to very well written and organized. Though I am unable to test it, I'm sure it works.

Good work!

Themes, code, what is next?
Title: Re: [block] Top Rated Links for SMF Links
Post by: fussilet on October 13, 2008, 09:22:59 PM
dear lanedres  sory, I understood very little
Title: Re: [block] Top Rated Links for SMF Links
Post by: IchBin on October 13, 2008, 10:11:56 PM
This is basically what he said Fussilet.

Your code = good. :)

You're good at themes, and at code. So what are you going to do now? :)
Title: Re: [block] Top Rated Links for SMF Links
Post by: fussilet on October 14, 2008, 01:00:17 AM
Thanks for your help IchBin , I'm working on improving myself lanedres...
:))
Title: Re: [block] Top Rated Links for SMF Links
Post by: alhaudhie on December 11, 2008, 12:15:54 AM
for this mod SMFLINKS - how about the latest link blocks?