TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 447
  • Total: 447

[Block] Recent Social Groups

Started by NIBOGO, March 10, 2010, 02:41:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NIBOGO

This is a block to show the recent groups in the SMF Social Groups Mod:

Create a new php block and add this content:

SMF 2.0:

global $smcFunc, $scripturl;

echo'Recent Groups:<br />';

$dbresult = $smcFunc['db_query']('', '
   SELECT id_group, group_name, image
   FROM {db_prefix}social_groups
   ORDER BY id_group DESC
   LIMIT 5'); 
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
   echo'<a href="'.$scripturl.'?action=sgroups;sa=view;id='.$row['id_group'].'"><img src="'.$row['image'].'" alt="'.$row['group_name'].'" /></a>';
}
$smcFunc['db_free_result']($dbresult);


SMF 1.1.X:

global $db_prefix, $scripturl;

echo 'Recent Groups:<br />';

$dbresult = db_query('
   SELECT ID_GROUP, groupName, image
   FROM {$db_prefix}social_groups
   ORDER BY ID_GROUP DESC
   LIMIT 5', __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($dbresult))
{
   echo'<a href="'.$scripturl.'?action=sgroups;sa=view;id='.$row['ID_GROUP'].'"><img src="'.$row['image'].'" alt="'.$row['groupName'].'" /></a>';
}
mysql_free_result($dbresult);


Best Regards

Freddy


NIBOGO


samo_zin123

is there afree version of that mode ?

This website is proudly hosted on Crocweb Cloud Website Hosting.