Posts: 35
Threads: 7
Joined: Aug 2010
Reputation:
1
2012-02-20, 05:10 PM
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!
Posts: 171
Threads: 4
Joined: Apr 2011
Reputation:
13
2012-02-20, 09:07 PM
(This post was last modified: 2012-02-21, 03:54 PM by cfillion.)
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.
Posts: 35
Threads: 7
Joined: Aug 2010
Reputation:
1
2012-02-21, 06:02 AM
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
Posts: 171
Threads: 4
Joined: Apr 2011
Reputation:
13
2012-02-21, 04:05 PM
(This post was last modified: 2012-02-21, 04:09 PM by cfillion.)
You can easily fix yourself:
- Open "aui.php" file.
- 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 />";
}
}
}
- 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' />";
}
}
}
}
- Save.
It is also XHTML compliant now.
Posts: 35
Threads: 7
Joined: Aug 2010
Reputation:
1
2012-02-21, 09:12 PM
Sweet! That worked like I charm =3
Thanks so much for your help <3 I really appreciate it.
Posts: 6
Threads: 1
Joined: Jun 2012
Reputation:
0
2012-06-19, 06:26 PM
(This post was last modified: 2012-06-20, 10:26 AM by foxxie.)
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)
Posts: 12
Threads: 0
Joined: Jul 2013
Reputation:
0
2013-07-06, 02:35 PM
(This post was last modified: 2013-07-06, 03:04 PM by melancholia.)
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.
|