Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Some php-warnings here and there
Avatar
Gomlers
Member
Free Members
sp_UserOfflineSmall Offline
Apr 12, 2013 - 3:52 pm

First of all - we relaunched our site tonight - so far everything has been great :)

First time ever on simple:press, after converting from phpbb3 - OMG what a difference! And SO much better with simple:press. I have to give a big THANK YOU to everyone who has made simple:press - it really is simple. And moderating / administrating is just awesome! :D :D :D

And thank you for all your help so far mr. papa :)

But there are always something, isn't it? ;)

When we open up the friends / adversaries list i get this (on the friends tab, NOT on the adversaries-list):

Warning: Invalid argument supplied for foreach() in /public_html/mydomain/wp-content/sp-resources/forum-plugins/private-messaging/forms/sp-pm-buddies-form.php on line 41

When pressing a users PM-button, to send a PM, this is right beneath "Your inbox is empty" message:

Warning: Invalid argument supplied for foreach() in /public_html/mydomain/wp-content/sp-resources/forum-plugins/private-messaging/library/sp-pm-database.php on line 167

Don't know if there is further warnings around in my forum, but these are the two I have noticed so far.

Any suggestions?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 12, 2013 - 7:22 pm

good to hear on the site and forum!  thanks for the kind words!

as to the first error, not sure why or how you are getting that...  since I have development version handy, can you confirm in your version, that line 41 is here:

if ($spProfileUser->buddies) {
    foreach ($spProfileUser->buddies as $buddy) {

not sure how you get that error since there is a check for existence...  have you added any buddies yet?

same for second one too...  verifying that line 167 is

        foreach ($buddies as $buddy) {

there is also a check for that too...

so lets step back...  please look in your database... lets look at the sfmembers table...  the buddies column... for your user, what do you have in there?

Avatar
Gomlers
Member
Free Members
sp_UserOfflineSmall Offline
Apr 13, 2013 - 7:35 pm

I have not added buddies in simple:press, but I did have some buddies in the phpbb-version.

Yes, in the first one - on line 40:

line 40:   if ($spProfileUser->buddies) {
line 41:       foreach ($spProfileUser->buddies as $buddy) {

The second one:

line 167  foreach ($buddies as $buddy) {
line 168     $buddylist[$x] = new stdClass();

 

The warning-message in the PM-section:

Apparently, the error does not come up for regular members, as I have a couple of test members who are not admins, but they come out for admins.

The warining-message for sp-pm-buddies-form.php shows for everyone (apparently) I havent logged into all of my user's accounts :)

 so lets step back…  please look in your database… lets look at the sfmembers table…  the buddies column… for your user, what do you have in there?

It has a "1" in it, for everyone, at least the first 500 users.

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 13, 2013 - 8:03 pm

a 1???  dont see how that is possible...  would either be null, empty array or an array...  quite odd - and of course singular report...

that wont mean or do anything...

can you change them to:

a:0:{}

Avatar
Gomlers
Member
Free Members
sp_UserOfflineSmall Offline
Apr 14, 2013 - 6:30 am

I've changed it to a:0:{} for my admin-user. Glad to say it solved both the issues. Friendslist, and PM.

But as for the rest of the members, can I run this:

UPDATE wp_sfmembers SET buddies=a:0:{}
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 14, 2013 - 9:16 am

yes... of course that will empty out an buddies they might have...

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 14, 2013 - 9:17 am

actually, for a query, you will want

UPDATE wp_sfmembers SET buddies='a:0:{}'

Avatar
Gomlers
Member
Free Members
sp_UserOfflineSmall Offline
Apr 14, 2013 - 2:28 pm

Yea, I figured it out, and didn't break anything :) Thanks.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 14, 2013 - 3:03 pm

cool. thanks for the update.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625