To use this website completely, it is necessary to store cookies on your computer.
 

SMF Links Directory Block

Started by NIBOGO, 7 years ago

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

NIBOGO

7 years ago
SMF 2.0 Block for SMF Links Directory

Horizontal:


Code Select
global $smcFunc, $scripturl;

echo'Recent Links:<br />';

$dbresult = $smcFunc['db_query']('', '
   SELECT id_link, name, url
   FROM {db_prefix}links
   ORDER BY id_link DESC
   LIMIT 5');
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
   echo'<a href="'.$scripturl.'?action=links;sa=details;lid='.$row['id_link'].'"><img src="http://open.thumbshots.org/image.aspx?url='.$row['url'].'" alt="'.$row['name'].'" /><br />'.$row['name'].'</a>';
}
$smcFunc['db_free_result']($dbresult);



Vertical:


Code Select
global $smcFunc, $scripturl;

echo'Recent Links:<br />';

$dbresult = $smcFunc['db_query']('', '
   SELECT id_link, name, url
   FROM {db_prefix}links
   ORDER BY id_link DESC
   LIMIT 5');
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
   echo'<a href="'.$scripturl.'?action=links;sa=details;lid='.$row['id_link'].'"><img src="http://open.thumbshots.org/image.aspx?url='.$row['url'].'" alt="'.$row['name'].'" /><br />'.$row['name'].'</a><br />';
}
$smcFunc['db_free_result']($dbresult);

jarska

#1
6 years ago
Hello,

I`m new here and dont understand where do I put that code? :-[

spoogs

#2
6 years ago
Custom php, block

DirtRider

#3
6 years ago
Looks like you need to purchase the mod first
"The real question is not whether machines think but whether men do. "


jarska

#4
6 years ago
Okay, now I understand, thank you.

NIBOGO

#5
5 years ago
Yes, you must have that mod installed first and then you must insert the code in a PHP Block

lemontwist

#6
5 years ago
Great block!  Is there a way to just have link names listed in the blocks and not the webshot?