I tried adding it to the Extends section and gave my own URL in place of Plugin URI. I thought the next page would allow me to submit it or something. How it is done?
Rather than add the plugin (which isn’t working, right?) to the Extend section, why not just post the code you need help with, unless I am misunderstanding your question.
You can post your code at pastebin.com and post the link here.
Manually calling it in a template works fine for me too. So what were you trying to do that does not work? Can you post how you hooked it exactly? Thanks.
If I uncomment the 22 line, then it doesn’t output anything.
It prints the error on the line 44 which means that $recent_reply is empty. That means query wasn’t executed.
When I tried this (not using a manual call), it seemed that $limit was being passed something, but it wasn’t numeric. So I added in before the global
line:
if (!is_numeric($limit))
$limit = 5;
I also changed $query_recent_replies to:
$query_recent_replies = "SELECT * FROM $bbdb->topics JOIN $bbdb->posts ON $bbdb->topics.topic_id = $bbdb->posts.topic_id $where ORDER BY post_time DESC LIMIT $limit";
and first echo inside the foreach to:
echo "n<li>". bb_get_profile_link( array( 'id' => $recent_reply->poster_id, 'text' => get_user_display_name( $recent_reply->poster_id ) ) ) . ' on <a href="' . get_topic_link($recent_reply->topic_id);
but that’s more just my idea of cleaner code
@chris
Somehow I missed replying sensibly. I just want it to hook with the post_post_form
action. Looks like Kawauso got it fixed but I am looking for explainations. Thanks!
@Kawauso
Why the $limit was passed something which wasn’t numeric? and how did you find it? I would like to know your approach.
And I didn’t get the point of using $bbdb over $bb_table_prefix ? Is there any performance gain?
and yes your code for profile link works more efficiently than mine. Thanks!
$limit was passed something which wasn’t numeric because… I guess that’s what do_action() does when it doesn’t have any arguments? Doing a var_dump(), it appears to be an empty string, so I guess it just passed the default value of the argument variable.
I found it because I noticed the SQL query wasn’t valid when it was run in phpMyAdmin and then noticed that there wasn’t anything after LIMIT.
I don’t know if there’s any performance gain, but it’s how bbPress code is written iirc and in the case of calling the user table, it’s essential when you’re working with a WP/bbP integration (as the table prefix is different).
So mostly it allows for the table names to be entirely variable, which is probably better practice in case a plugin changes them.
I guess that's what do_action() does when it doesn't have any arguments?
do_action() must be called with which action to do. no?
$bb_table_prefix already takes care of different table prefixes. I didn’t get your point.
function do_action($tag, $arg = '')
do_action() has an arguments variable as it’s 2nd argument, sorry for not being clearer. That’s passed when it runs an action function and if nothing is passed, it defaults to an empty string.
$bb_table_prefix
would be the prefix for the bbPress tables though, wouldn’t it? In the case of a WP/bbP integration, the bbPress user data is stored in the WordPress user tables, so those aren’t under the same prefix as the bbPress tables. Unless it changes automatically for WordPress user tables somehow?
I got it. Thanks buddy!
Offtopic : Any pointers on how to add plugins to the extend section. i have the latest code in trunk. I will probably figure out to tag them too but how to add information on the plugin page itself