SimplePortal
Development => Bugs => Fixed or Bogus Bugs => Topic started by: [SiNaN] on July 28, 2008, 03:10:52 AM
-
Seems like this recent topics guy doesn't show me up. Any ideas?
-
Its happening to me too, it was working this morning so...
It was being caused by the "Member Color Link" mod that was installed, I uninstalled it and now its working perfectly.
-
We might want to have a look at the compatibility issue, although it doesn't seem too important...
-
Strange. I can see it right now.
-
Yep, its was definetly the "Member Color Link" Mod, it was installed on this forum for some reason. ;)
-
What was the error?
-
http://jeunosky.net/simpleportal/index.php?action=viewErrorLog;desc
8: Undefined index: link
File: /home/em1lycat/public_html/simpleportal/Sources/SPortal.php
Line: 958
-
I fixed it.I did this:
//Add Colors to the Output link :)if( !empty( $colorids ) ) {global $color_profile;sp_loadColors( $colorids );foreach( $posts as $k => $p ) {if( !empty( $color_profile[$p['poster']['id']] ) )$profile = $color_profile[$p['poster']['id']];if( !empty( $profile ) ) {$posts[$k]['poster']['link'] = $profile['link']; }else {$post[$k]['poster']['link'] = ''; }}}
-
Have you done it for this website? Because at the moment its not working. ;)
Notice the error on this page:
http://jeunosky.net/simpleportal/index.php
I know its difficult to find, but there are errors. :P
-
Okay let's try this:SPortal.phpFind:
//This is a small Skript to load colors for ssifunction sp_loadColors($users = array()) {global $color_profile, $db_prefix, $scripturl;// Can't just look for no users :P.if (empty($users))return false;// Make sure it's an array.$users = !is_array($users) ? array($users) : array_unique($users);//First check is it already loaded?if(empty($color_profile))$color_profile = array();else {foreach($users as $k => $u)if(isset($color_profile[$u]))unset($users[$k]);}if (empty($users))return false;// Load the data.$request = db_query("SELECT mem.ID_MEMBER, mem.memberName, mem.realName, mem.ID_GROUP,mg.onlineColor AS member_group_color, pg.onlineColor AS post_group_colorFROM {$db_prefix}members AS mem LEFT JOIN {$db_prefix}membergroups AS pg ON (pg.ID_GROUP = mem.ID_POST_GROUP)LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP)WHERE mem.ID_MEMBER ".(count($users) == 1 ? " = '" . current($users) . "'" : " IN ('" . implode("', '", $users) . "')"), __FILE__, __LINE__);$loaded_ids = array();while ($row = mysql_fetch_assoc($request)){$loaded_ids[] = $row['ID_MEMBER'];$color_profile[$row['ID_MEMBER']] = $row;$color_profile[$row['ID_MEMBER']]['link'] = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . (!empty($row['member_group_color']) || !empty($row['post_group_color']) ? '<span style="color:'. (!empty($row['member_group_color']) ? $row['member_group_color'] : $row['post_group_color'] ) .';">' : '' ) . $row['realName'] . (!empty($row['member_group_color']) || !empty($row['post_group_color']) ? '</span>' : '' ).'</a>';}mysql_free_result($request);return empty($loaded_ids) ? false : $loaded_ids;}
Replace:function sp_loadColors($users = array()) {global $db_prefix, $scripturl;if (empty($users))return false;$users = !is_array($users) ? array($users) : array_unique($users);if(empty($color_profile))$color_profile = array();else {foreach($users as $u)if(isset($color_profile[$u]))unset($users[$u]);}if (empty($users))return false;$request = db_query("SELECT mem.ID_MEMBER, mem.memberName, mem.realName, mem.ID_GROUP,mg.onlineColor AS member_group_color, pg.onlineColor AS post_group_colorFROM {$db_prefix}members AS mem LEFT JOIN {$db_prefix}membergroups AS pg ON (pg.ID_GROUP = mem.ID_POST_GROUP)LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP)WHERE mem.ID_MEMBER ".(count($users) == 1 ? " = '" . current($users) . "'" : " IN ('" . implode("', '", $users) . "')"), __FILE__, __LINE__);$loaded_ids = array();while ($row = mysql_fetch_assoc($request)){$loaded_ids[] = $row['ID_MEMBER'];$color_profile[$row['ID_MEMBER']] = $row;$color_profile[$row['ID_MEMBER']]['link'] = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . (!empty($row['member_group_color']) || !empty($row['post_group_color']) ? '<span style="color:'. (!empty($row['member_group_color']) ? $row['member_group_color'] : $row['post_group_color'] ) .';">' : '' ) . $row['realName'] . (!empty($row['member_group_color']) || !empty($row['post_group_color']) ? '</span>' : '' ).'</a>';}mysql_free_result($request);return empty($color_profile) ? false : $color_profile;}
Find://Add Colors to the Output link :)if(!empty($colorids)) {global $color_profile;sp_loadColors($colorids);foreach($posts as $k => $p) {if(!empty($color_profile[$p['poster']['id']]))$profile = $color_profile[$p['poster']['id']];if(!empty($profile)) {$posts[$k]['poster']['link'] = $profile['link'];}}}
Replace:if(!empty($colorids)) {$color_profile = sp_loadColors($colorids);foreach($posts as $k => $p) {if(!empty($color_profile[$p['poster']['id']])) {$profile = $color_profile[$p['poster']['id']];if(!empty($profile)) {$posts[$k]['poster']['link'] = $profile['link'];}}}}
Just works for recent posts now. Can you check too?
-
Hmm, those edits just seem to completely remove the colors for me.
-
Okay, checking that again.
-
Actually the second edit can appear more than once. Go to line 953 and change that one.
-
Hmm, it still isn't working for some reason, although it may be that particular smf install.Attached is my dodgy Sportal.php file, its probably pretty hacky, because its almost midnight and I did the edits quickly. ;)
-
Well, it works, I am only getting errors for lines 721 and 1276. Which are different block types.
I am now *officially* sleeping.
-
Okay Nath, have a good sleep. Thanks.
Bug knocked down. 8)
-
Bug knocked down. 8)
Hmm, not so sure about that. We are still getting errors on this website. Are we running the lastest version of Simple Portal? With all the updates and fixes? Preferably a clean version?
-
We're running SiNaN's beta package. If you've got edits to commit to it, feel free to log into the FTP and do so.
-
This bug wasn't included in that package, I'll include in the release.