collapse collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 114
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Re: How to Add signature in Simple Portal? by tocnaza
[July 06, 2019, 12:04:00 PM]


Re: Yeni Sürüm Çıkacak mı? by mkuru
[July 01, 2019, 03:05:44 AM]


Re: Yeni Sürüm Çıkacak mı? by akorkut
[June 28, 2019, 05:38:26 AM]


Re: Yeni Sürüm Çıkacak mı? by mkuru
[June 26, 2019, 12:09:02 PM]


Yeni Sürüm Çıkacak mı? by akorkut
[June 25, 2019, 04:53:54 AM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: SMF Social Groups Block  (Read 15243 times)

0 Members and 1 Guest are viewing this topic.

Offline NIBOGO

  • Semi Newbie
  • *
  • Posts: 35
  • Gender: Male
    • SMFPacks
  • SMF Version: 2.0.2
  • SP Version: None
SMF Social Groups Block
« on: March 09, 2010, 09:36:05 PM »
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

Code: [Select]
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:

Code: [Select]
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
« Last Edit: March 12, 2010, 02:42:48 PM by NIBOGO »


Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: SMF Social Groups Block
« Reply #1 on: March 10, 2010, 01:26:46 AM »
Moved to the Blocks and Modifications board.

Note for all, this block will only work for SMF 2.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Offline NIBOGO

  • Semi Newbie
  • *
  • Posts: 35
  • Gender: Male
    • SMFPacks
  • SMF Version: 2.0.2
  • SP Version: None
Re: SMF Social Groups Block - Only for SMF 2.0
« Reply #2 on: March 11, 2010, 09:09:48 PM »
Moved to the Blocks and Modifications board.

Note for all, this block will only work for SMF 2.

Thanks for remind me, already added to the topic title


Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: SMF Social Groups Block - Only for SMF 2.0
« Reply #3 on: March 12, 2010, 12:50:57 AM »
For SMF 1.1...

Code: [Select]
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($members_result))
{
   echo'<a href="'.$scripturl.'?action=sgroups;sa=view;id='.$row['ID_GROUP'].'"><img src="'.$row['image'].'" alt="'.$row['groupName'].'" /></a>';
}
mysql_free_result($dbresult);

Offline NIBOGO

  • Semi Newbie
  • *
  • Posts: 35
  • Gender: Male
    • SMFPacks
  • SMF Version: 2.0.2
  • SP Version: None
Re: SMF Social Groups Block - Only for SMF 2.0
« Reply #4 on: March 12, 2010, 02:41:16 PM »
For SMF 1.1...

Code: [Select]
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($members_result))
{
   echo'<a href="'.$scripturl.'?action=sgroups;sa=view;id='.$row['ID_GROUP'].'"><img src="'.$row['image'].'" alt="'.$row['groupName'].'" /></a>';
}
mysql_free_result($dbresult);


There is a error in that code that I already fix in the SMF 2.0 version, here is the patched version:

Code: [Select]
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);

Thanks ccbtimewiz :)


Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: SMF Social Groups Block
« Reply #5 on: March 12, 2010, 11:25:36 PM »
You're welcome.

Offline Mick.

  • Comrade
  • *
  • Posts: 77
  • Gender: Male
  • Premium SMF Themes
    • idesignSMF
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: SMF Social Groups Block
« Reply #6 on: March 29, 2010, 07:22:21 PM »
Can the group name be added above the group image?  :|

Offline NIBOGO

  • Semi Newbie
  • *
  • Posts: 35
  • Gender: Male
    • SMFPacks
  • SMF Version: 2.0.2
  • SP Version: None
Re: SMF Social Groups Block
« Reply #7 on: April 02, 2010, 11:23:41 PM »
Can the group name be added above the group image?  :|

Sure:

Code: [Select]
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'].'" /><br />'.$row['group_name'].'</a>';
}
$smcFunc['db_free_result']($dbresult);

You can use some tags to center the text like <div align="center">'.$row['group_name'].'</div>


Offline EvilGeneral

  • Semi Newbie
  • *
  • Posts: 13
  • Gender: Male
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: SMF Social Groups Block
« Reply #8 on: May 04, 2011, 04:38:30 PM »
Isn't work for me. =[
The image path is wrong.

PS: Most difficult thing in this forum is type the correct captcha. lol

Offline angeljs

  • Newbie
  • Posts: 2
  • Gender: Female
    • UK Council House Exchanges
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: SMF Social Groups Block
« Reply #9 on: June 18, 2015, 10:09:01 AM »
The image link isn't working, how can this be fixed?

Offline angeljs

  • Newbie
  • Posts: 2
  • Gender: Female
    • UK Council House Exchanges
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: SMF Social Groups Block
« Reply #10 on: June 18, 2015, 10:28:20 AM »
Okay, I managed to fix the broken image link. Simply replace this piece of code:

Code: [Select]
<img src="'.$row['image'].'" alt="'.$row['group_name'].'" />
With this:

Code: [Select]
<img src="http://www.fullurltoyourboard.com/sogroups/'.$row['image'].'" alt="'.$row['group_name'].'" />
Replace the link with the full link to your forum installation and it should work. I'm not a coder, so this is only a quick fix, if anyone has a better idea it would be appreciated.  :D
« Last Edit: June 19, 2015, 05:02:52 PM by angeljs »