Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] Display additional usergroups on threads.
#1
Not Solved
I have a plugin where I can have additional usergroups on profiles but I want to make it so it'll display on threads as well, is their a way to do this? Thanks!
#2
Not Solved
What plugin is it?
My Website: LSGForums
Add me via Skype! LSGForums
#3
Not Solved
Bumping this up. I still need this. Thanks! Wink
#4
Not Solved
Which plugin is that plz post your profile templete here
#5
Not Solved
additional usergroup images plugin by jammerx2 works fine for me and shows additional groups in threads
#6
Not Solved
This user has been denied support. This user has been denied support.
May be just Pull all the groups from the database store them in some array, or variable & eval them using a for loop.

Like this:


	$cache = $cache->read("usergroups");
	$groups = explode(',',$memprofile['additionalgroups']);	

	foreach($groups as $group)
	{
            $userbarimage = $groupcache[$group]['image'];
            $imghtml = "<img src=\"$userbarimage\">";
            eval("\$groupimages .= \"".$imghtml."\";");
        }

Now to go to your template & use {$groupimages} to display the images Smile

I just made a raw code. Modify it as per your needs.
#7
Not Solved
(2013-08-01, 10:29 AM)Cedric Wrote: May be just Pull all the groups from the database store them in some array, or variable & eval them using a for loop.

Like this:


	$cache = $cache->read("usergroups");
	$groups = explode(',',$memprofile['additionalgroups']);	

	foreach($groups as $group)
	{
            $userbarimage = $groupcache[$group]['image'];
            $imghtml = "<img src=\"$userbarimage\">";
            eval("\$groupimages .= \"".$imghtml."\";");
        }

Now to go to your template & use {$groupimages} to display the images Smile

I just made a raw code. Modify it as per your needs.


Why use "eval" ? No need, just concatenate the contents of $imghtml and use {$imghtml}:

Quote: $cache = $cache->read("usergroups");
$groups = explode(',',$memprofile['additionalgroups']);

foreach($groups as $group)
{
$userbarimage = $groupcache[$group]['image'];
$imghtml .= "<img src=\"$userbarimage\">";
}
#8
Not Solved
This user has been denied support. This user has been denied support.
Using EVAL to properly parse PHP VARS inside the $imghtml.
#9
Not Solved
(2013-08-01, 10:38 AM)Cedric Wrote: Using EVAL to properly parse PHP VARS inside the $imghtml.

What lol ? Thats completely not correct.

Infact you shouldn't even be using eval. Read this and learn.

http://dandoescode.com/blog/2012/08/28/i...ot-and-no/
#10
Not Solved
(2013-08-01, 10:38 AM)Cedric Wrote: Using EVAL to properly parse PHP VARS inside the $imghtml.

You don't need eval() for that. Double quotes expand variables.
No longer involved in the MyBB project.


Forum Jump:


Users browsing this thread: 1 Guest(s)