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

* Navigator

Expand - Collapse

* Statistic

  • *Total Posts: 14944
  • *Total Topics: 2271
  • *Online Today: 14
  • *Most Online: 292
(2016 November 12, 09:37:31 am)

SMF Links Directory Block

Started by NIBOGO, 2010 July 17, 01:10:09 am

previous topic - next topic

0 Members and 0 Guests are viewing this topic.

NIBOGO

2010 July 17, 01:10:09 am
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
2010 September 28, 01:14:13 pm
Hello,

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

spoogs

#2
2010 September 28, 04:49:31 pm
Custom php, block

DirtRider

#3
2010 September 28, 06:20:51 pm
Looks like you need to purchase the mod first
"The real question is not whether machines think but whether men do. "


jarska

#4
2010 October 04, 09:44:58 pm
Okay, now I understand, thank you.

NIBOGO

#5
2011 July 29, 06:24:59 am
Yes, you must have that mod installed first and then you must insert the code in a PHP Block

lemontwist

#6
2012 February 02, 05:49:08 pm
Great block!  Is there a way to just have link names listed in the blocks and not the webshot?