Not Solved Additional Usergroup Images - Broken Images
#1
Not Solved
Hi there! Hopefully someone here can help me. I recently installed the Additional Usergroup Images plugin on my forum, and it works great except for one thing: the additional usergroup images are broken.

Now, I figured out why they are. I use {theme} in my usergroup image url paths seeing I'm intending on having multiple skins where the usergroup images will not match, and {theme} gets replaced in the primary usergroup with the appropriate path, but the additional images do not replace {theme} when displayed.

Is there any way to add something to the coding so that {theme} does get replaced by the appropriate path when it is rendered?

Thanks in advance for any help!
Reply
#2
Not Solved
Do you need additional user groups to be displayed in postbit?
If no (just in user profile), I made a plugin for that with the same bug (see signature). I'll update it tonight.

EDIT: Fixed.
Reply
#3
Not Solved
Yeah, I want the additional usergroups in the postbit as well. My forum's a role-play one, and the characters will have the option to join "guilds" (additional groups), which I'd like to be a bit more publicly displayed than just on the user profile xD

Though if no one can offer a fix for the postbit I'll definitely look into your plugin =3 At least the guilds would be displayed somewhere xD
Reply
#4
Not Solved
You can easily fix yourself:
  1. Open "aui.php" file.
  2. Replace aui_profile function with:
    function aui_profile()
    {
    	global $templates, $theme, $xfire, $memprofile, $mybb, $db, $memprofile, $gi;
    	$gids = $memprofile['additionalgroups'];
    	$gids = explode(",",$gids);
    	$gi = "";
    	
    	if(!empty($mybb->user['language']))
    	{
    		$language = $mybb->user['language'];
    	}
    	else
    	{
    		$language = $mybb->settings['bblanguage'];
    	}
    	
    	foreach($gids as $gid)
    	{
    		$getaui=$db->query("SELECT image FROM ".TABLE_PREFIX."usergroups WHERE gid='".$gid."'");
    		$getaui=$db->fetch_array($getaui);
    		$aui = $getaui['image'];
    		
    		if($aui != "")
    		{
    			$aui = str_replace("{lang}", $language, $aui);
    			$aui = str_replace("{theme}", $theme['imgdir'], $aui);
    			$gi = $gi."<img src='$aui' /><br />";
    		}
    	}
    }
  3. Replace aui_post function with:
    function aui_post($post)
    {
    	global $templates, $theme, $xfire, $memprofile, $mybb, $db, $auigi, $gi, $aui, $memprofile;
    	$gids = $post['additionalgroups'];
    	$gids = explode(",",$gids);
    	$gi = "";
    	
    	if(!empty($mybb->user['language']))
    	{
    		$language = $mybb->user['language'];
    	}
    	else
    	{
    		$language = $mybb->settings['bblanguage'];
    	}
    	
    	foreach($gids as $gid)
    	{
    		$getaui = $db->query("SELECT image FROM ".TABLE_PREFIX."usergroups WHERE gid='".$gid."'");
    		$getaui = $db->fetch_array($getaui);
    		$aui = $getaui['image'];
    		if($aui != "")
    		{
    			$aui = str_replace("{lang}", $language, $aui);
    			$aui = str_replace("{theme}", $theme['imgdir'], $aui);
    			
    			if($mybb->user['classicpostbit'] == 1)
    			{
    				$post['groupimage'] = $post['groupimage']."<img src='$aui' /><br />";
    			}
    			else
    			{
    				$post['groupimage'] = $post['groupimage']."<br /><img src='$aui' />";
    			}
    		}	
    	}
    }
  4. Save. Smile
It is also XHTML compliant now.
Reply
#5
Not Solved
Sweet! That worked like I charm =3

Thanks so much for your help <3 I really appreciate it.
Reply
#6
Not Solved
Hey there!

I had/have the same problem like Lost Eventide. After finding this thread I could fix the profile at least. The group images are finally there. But even after editing the plugin for the posts nothing changes. Any ideas? I use the default templates for a new design, so there is everything at its proper place and nothing changed there, yet.

Thx



Edit: I found something after a few more hours auf searching (found it in the reviews:

Solution is to open aui.php and change

function aui_post($post)

to

function aui_post(&$post)
Reply
#7
Not Solved
Is it possible to separate these two images like in the profile where you are able to move the additional picture with the variable {$gi}.

Edit: And it would be nice if the additional usergroup is also shown on memberlist.
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)