Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Nothing like wp_ajax_hook on my code… the code just loaded pages with javascript, no ajax was used there, ajax was just some side cool think like “send a message without refreshing” and super-easy things like that.
    Anyhow my suggestion was just to try and watch what happens on that sort of things, I wasn’t actually asking for a new template, that’s just how I have things going and how the problem arose. :)

    Sadly it’s not something I can decide to share, it’s a work and I don’t really feel like asking this thing.
    Anyhow the problem I believe was that if I accessed the variables from index everything was fine, friends were found, etc. The problem is that by the means of a javascript slider I use to import pages that then executed the code… maybe this was puzzling some of the very basic variables of wordpress and returned bad results.

    What can I suggest to you as developers it to try to implement a custom template (even a simple page that uses the wordpress variables) and on top of that implement some javascript that loads another php page on top of the index (no page reloading) that uses again the wordpress variables… this I think would arise the error again. I think this is a major bug and should be documented / resolved, but it’s up to you ;).
    Thanks again for the support. I really appreciated that.

    I’ve rewritten all the code for friends and messages myself. Thanks anyway for the support.

    I’ve discovered that if I access the page outside the scope of buddypress and wordpress (that is, accessing to the direct link without passing by my website) the thing returns a correct result for the friends (if I hardcode the input of course).
    What could this mean? I require_once in my index wp-config.php and also in my friend_page (which is loaded on top of the index, in a slider that comes down). Is there a problem with this approach?

    I’ve reinstalled BP and WP… the error remains but now it does find methods for sending messages.
    There is a bug in the get_inbox_count method if you want to know.

    ( !$unread_counts = $wpdb->get_results($sql) )
    return false;

    This line in my case had an error, even though the result existed, it entered inside the if and returned nothing as result, while the query existed, the get_results returns an (empty) array. I commented it out and now it works.

    But the friends error remains as is. Any ideas?

    Bump! It’s really of extreme importance.
    Moreover I figured out also that messages don’t work either: actually if I try to call a function defined in bp-messages-classes.php it says it doesn’t exist… while for friends the methods are found by the compiler this doesn’t happen for the messages… I’ve checked on the admin board and the messages are enabled (I also have the tables in my database to handle messages).

    May the problem with friends be related with this one?

    Anyhow since I set manually the friendship I tried to call another function (the one that counts the number of friends you have) and also that one returns 0. This is truly unbelievable.

    Again I used your code and the result is:
    SELECT id, is_confirmed FROM wp_bp_friends WHERE (initiator_user_id = ” AND friend_user_id = ”) OR (initiator_user_id = ” AND friend_user_id = ”)
    Which is normal I guess, because the passed variables are integers, right?

    I’m using the BP function.
    It is the former indeed, and I managed to trace the input down to $wpdb->query (if avoid using prepare) or to prepare, to see that it doesn’t work (with prepare the $args = func_get_args() gets nothing as parameter even though I checked they are correct the second is wrong in that line I posted above).

    Anyhow here is the result:
    SELECT id, is_confirmed FROM wp_bp_friends WHERE (initiator_user_id = 0 AND friend_user_id = 0) OR (initiator_user_id = 0 AND friend_user_id = 0)
    This is what I get printed out. If I inspect the values $loggedin_userid, $possible_friend_userid, $possible_friend_userid, $loggedin_userid they have the correct values.
    In prepare the problem is this line “$args = func_get_args();” that gets wrongly the parameters (inspecting args returns nothing).

    I’ve done all the inspection I could, I discovered that
    1) the prepare function when doing func_get_args (or whatever is the name) it gets NOTHING as result, so the query is indeed with ids 0s. Didn’t do what you said, Boone Gorges, even though I really thank you for your concern, I think I would have arrived to the same result :).
    2) if I avoid calling prepare and feed the query directly to $wpdb->get_results (I’m always in check_is_friend function of buddypress) when it does $this->result = @mysql_query( $query, $dbh ); the result is NOTHING. No idea why, because $query just before this function call is the correct query with the correct IDs.

    Any ideas?

    I don’t think the problem is the number of queries actually…
    I did a print_r over the $wpdb and the last query done after my call to friends_check_friendship_status is
    SELECT id, is_confirmed FROM wp_bp_friends WHERE (initiator_user_id = 0 AND friend_user_id = 0) OR (initiator_user_id = 0 AND friend_user_id = 0)
    Which is pretty strange since I am SURE 100% I pass some real ids to the function.
    Any ideas?

    Ok I just sent them an e-mail, thanks.
    What could be the “relevant things” in the log file that may arise? Do you think that they are “lowering” the number of allowed queries per second and this may be the issue for which the functions are not returning the proper result?

    Thanks a lot for the reply!
    It’s not indeed my own server, I’m working on someone else’s. What should exactly ask them? To allow a greater number of active connections?
    Thanks!

    I’ve just realized I have a couple of warnings from WordPress, don’t know if this can be helpful to help me out:

    Warning: mysql_real_escape_string(): 11 is not a valid MySQL-Link resource in /path/to/wp-includes/wp-db.php on line 785
    Warning: mysql_error(): 11 is not a valid MySQL-Link resource in /path/to/wp-includes/wp-db.php on line 1119

    These happens only when calling the above stated functions of BuddyPress.
    Thanks!

    Bump. Sorry don’t want to be annoying, but it’s pretty important and I’m in a hurry.

Viewing 15 replies - 1 through 15 (of 15 total)
Skip to toolbar