News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Stars and Badges

Started by Bulakbol, February 29, 2008, 11:59:19 PM

Previous topic - Next topic

Bulakbol

Uh uh. Any error in the error log?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

ManilaGurL

There are login errors there. Not sure if they can be associated with the mod. All I see in posts are additional stars and no group name. If I look in profile, the additional membergroup is there.

Bulakbol

Ow, this mod only display the additional badge or stars but not the name of the additional group. You have to tweak your Display.template.php to show the additional groups' color and name the way you like it. I was expecting a badge with a name on it.

Something like this:
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

ManilaGurL

Oh sorry, lol. Then I have to create a badge for that group. Thank you! :)

bros

Quote from: Bulakbol on February 25, 2009, 09:51:38 PM
@ManilaGurL
Attach your Load.php or send me through email. Sorry for the delay.

@bros
If installation went well, it should display all the additional badges by default. Please post any errors in the error log. Or attach your Load.php and I will look at it.

I would recommend what Garou said. Thanks Garou.



Garou

#585
Bros I looked at your attached Load.php, everything was installed where it was supposed to be according to the Installation Instructions for 2.0 RC1 but a huge section for the mod was commented out. That's weird and I'm not sure why that happened

/* $context['badges']['ownline'] = !empty($modSettings['badge_ownline']) ? explode(',', $modSettings['badge_ownline'], 20) : '';
 
$groups = $profile['additional_groups'];
// Load additional membergroups
if (!empty($groups))
{
$result_stars = $smcFunc['db_query']('', '
SELECT id_group, group_name, stars, online_color
FROM {db_prefix}membergroups
WHERE id_group IN (' . $groups . ')
',
array()
);

// additional groups
while ($row_stars = $smcFunc['db_fetch_assoc']($result_stars))
if (!empty($row_stars['stars']))
{
$memberContext[$user]['additional_groups']['id'][] = $row_stars['id_group'];
$memberContext[$user]['additional_groups']['stars'][] = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($row_stars['stars'][1]) ? $settings['images_url'] . '/' . $smcFunc['substr']($row_stars['stars'], 2, strlen($row_stars['stars'])) : '') . '" alt="*" border="0" />', empty($row_stars['stars'][0]) || empty($row_stars['stars'][1]) ? 0 : $row_stars['stars'][0]);
$memberContext[$user]['additional_groups']['name'][] = $row_stars['group_name'];
$memberContext[$user]['additional_groups']['ag_color'][] = $row_stars['online_color'];
}
$smcFunc['db_free_result']($result_stars);
}

return trued;
}*/


Remove the /* at the beginning and the */ at the end and the mod should work.

bros

Parse error: syntax error, unexpected '}' in /home/xxxxx/public_html/boards/Sources/Load.php on line 1500

Garou

oops, if you grabbed that file I attached in the last post it was the same one you originally attached.

Also I noticed that at the end of the code above which I copied out of your load.php said return trued; instead of return true;
I believe that is what is causing the current syntax error.

bros

Did that, same exact error.

Line 1500 = }

Garou

Ok I think I see whats its doing and it has to do with the other mod that was installed in there.

Try removing the
         
   return true;
}


It looks like its already in there on line 1316 as another mod inserted itself  between the return and the // Load a theme, by ID. If that dont work try putting it back and removing the it in the other spot.

bros

Parse error: syntax error, unexpected '}' in /home/xxx/public_html/boards/Sources/Load.php on line 1500

Garou

Alright then it looks like the different mods are conflicting all together, list them all and I'll have to rebuild the entire Load.php from scratch.

bros

Quote from: Garou on February 27, 2009, 06:00:49 PM
Alright then it looks like the different mods are conflicting all together, list them all and I'll have to rebuild the entire Load.php from scratch.

Are you sure it isn't just something in display.template.php? Since that is what the problem was in the last time. It only displays one membergroup star. I want it to display the stars for all of the membergroups a person has.

Mods:
Stars and Badges
Member Color Link
PM Informer
SMF Arcade
Membergroup Color Legend
Profil Moderator Management

Garou

I came into this conversation a bit late and I'm not sure where your problems started or what was done to try and fix them, I just know that whats in the file isn't right doesn't look correct. For starters part of you problem with the Stars and badges mod is due to the fact that a good chunk of it is commented out in that file.

If that's not the source of your problem at hand its still a problem. I don't know all the ins and outs of this mod but I'm surprised that it works at all with part of the code being ignored like that.

Then when you put the code back in, your running into the other errors. That's because the way these mods layer over each other is causing them not to play nice with each other. The best thing I know to do is try to layer them different ways till they do all work together.

Will this solve the problem at hand? I don't know but I do know it needs to be addressed.


Anub1s

#594
im on 2.0 rc1 and the load wont install

iv tryed earching for the last replace in load but can not find it

attatched is my load file. it may just be because im sleepy lol

but if anyone can help i would be most greatfull.


Its ok i fixed it. member colours was blocking it deeerrrr lol so its working

Garou

Ok I think I have it figured out for both of you.

The code from the last part of the Load.php
$context['badges']['ownline'] = !empty($modSettings['badge_ownline']) ? explode(',', $modSettings['badge_ownline'], 20) : '';
 
$groups = $profile['additional_groups'];
// Load additional membergroups
if (!empty($groups))
{
$result_stars = $smcFunc['db_query']('', '
SELECT id_group, group_name, stars, online_color
FROM {db_prefix}membergroups
WHERE id_group IN (' . $groups . ')
',
array()
);

// additional groups
while ($row_stars = $smcFunc['db_fetch_assoc']($result_stars))
if (!empty($row_stars['stars']))
{
$memberContext[$user]['additional_groups']['id'][] = $row_stars['id_group'];
$memberContext[$user]['additional_groups']['stars'][] = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($row_stars['stars'][1]) ? $settings['images_url'] . '/' . $smcFunc['substr']($row_stars['stars'], 2, strlen($row_stars['stars'])) : '') . '" alt="*" border="0" />', empty($row_stars['stars'][0]) || empty($row_stars['stars'][1]) ? 0 : $row_stars['stars'][0]);
$memberContext[$user]['additional_groups']['name'][] = $row_stars['group_name'];
$memberContext[$user]['additional_groups']['ag_color'][] = $row_stars['online_color'];
}
$smcFunc['db_free_result']($result_stars);
}
      
This needs to go before

return true;
}

//This is the universial load colors function,


bros

#596
Parse error: syntax error, unexpected '}' in /home/xxxx/public_html/boards/Sources/Load.php on line 1473

Fatal error: require_once() [function.require]: Failed opening required '/home/xxxx/public_html/boards/Sources/Load.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxxx/public_html/boards/index.php on line 62

Garou

Try this one. Out of the mods listed the only ones that edit the Load.php are Stars And Badges, Pm_Informer, and Member Color Link. Just installing those 3 in that order produced a good file where all three work well together and all the stars show up in the posts.

If that doesn't fix it you can try the display template but I think you might do better to install all the mods and make sure those three mods are installed in that order.

bros

Quote from: Garou on February 28, 2009, 01:02:12 AM
Try this one. Out of the mods listed the only ones that edit the Load.php are Stars And Badges, Pm_Informer, and Member Color Link. Just installing those 3 in that order produced a good file where all three work well together and all the stars show up in the posts.

If that doesn't fix it you can try the display template but I think you might do better to install all the mods and make sure those three mods are installed in that order.


That fixed it. But now there is something odd.

http://thecastlehall.com/boards/index.php Look at the top. That white bar.

Garou

That shouldn't have anything to do with the Load.php, its either doing to be found in the index.template.php or the or the style.css of the theme you are using. Since I don't really know themes that well, I'm not sure which to tell you but I would compare them to the same files from the default theme.

Advertisement: