SimplePortal

Development => Bugs => Fixed or Bogus Bugs => Topic started by: [SiNaN] on July 28, 2008, 03:10:52 AM

Title: [Bug] Recent Posts
Post by: [SiNaN] on July 28, 2008, 03:10:52 AM
Seems like this recent topics guy doesn't show me up. Any ideas?
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on July 28, 2008, 03:19:59 AM
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.
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on July 28, 2008, 03:21:49 AM
We might want to have a look at the compatibility issue, although it doesn't seem too important...
Title: Re: [Bug] Recent Posts
Post by: [SiNaN] on July 28, 2008, 03:33:30 AM
Strange. I can see it right now.
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on July 28, 2008, 03:34:51 AM
Yep, its was definetly the "Member Color Link" Mod, it was installed on this forum for some reason. ;)
Title: Re: [Bug] Recent Posts
Post by: [SiNaN] on July 28, 2008, 03:45:25 AM
What was the error?
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on July 28, 2008, 03:58:57 AM
http://jeunosky.net/simpleportal/index.php?action=viewErrorLog;desc

8: Undefined index: link
File: /home/em1lycat/public_html/simpleportal/Sources/SPortal.php
Line: 958
Title: Re: [Bug] Recent Posts
Post by: ccbtimewiz on August 01, 2008, 02:32:57 PM
I fixed it.I did this:
Code: (SPortal.php) [Select]
//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'] = ''; }}}
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on August 01, 2008, 08:19:28 PM
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
Title: Re: [Bug] Recent Posts
Post by: [SiNaN] on August 02, 2008, 09:26:59 AM
Okay let's try this:SPortal.phpFind:
Code: [Select]
//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:
Code: [Select]
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:
Code: [Select]
//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:
Code: [Select]
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?
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on August 02, 2008, 09:32:36 AM
Hmm, those edits just seem to completely remove the colors for me.
Title: Re: [Bug] Recent Posts
Post by: [SiNaN] on August 02, 2008, 09:37:13 AM
Okay, checking that again.
Title: Re: [Bug] Recent Posts
Post by: [SiNaN] on August 02, 2008, 09:41:01 AM
Actually the second edit can appear more than once. Go to line 953 and change that one.
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on August 02, 2008, 09:49:42 AM
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. ;)
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on August 02, 2008, 09:58:24 AM
Well, it works, I am only getting errors for lines 721 and 1276. Which are different block types.

I am now *officially* sleeping.
Title: Re: [Bug] Recent Posts
Post by: [SiNaN] on August 02, 2008, 09:59:17 AM
Okay Nath, have a good sleep. Thanks.

Bug knocked down. 8)
Title: Re: [Bug] Recent Posts
Post by: Nathaniel on August 07, 2008, 03:39:27 AM
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?
Title: Re: [Bug] Recent Posts
Post by: Eliana Tamerin on August 07, 2008, 12:38:28 PM
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.
Title: Re: [Bug] Recent Posts
Post by: [SiNaN] on August 09, 2008, 10:12:50 AM
This bug wasn't included in that package, I'll include in the release.
SimplePortal 2.3.8 © 2008-2024, SimplePortal