I want to open threads for all my wordpress posts in my vBulletin forum and also add my new threads' link to wordpress post. I tried to write a vBulletin plugin like this; if(is_array($feed)){ if(!$conn = mysql_connect('localhost', 'root', '60644')) echo fails_connection; mysql_set_charset('utf8',$conn); if(!mysql_select_db('hatunca_wp', $conn)) echo fails_selection; $title = $this->thread['title']; $link = '<a href="">linkkk</a>'; $subject = $rss['url'];echo $feed['url']. " and " . $rss['url']; $pattern = 'http://(.*?)/([0-9]+)-'; if (preg_match('@^(?:http://)?([^/]+)/([0-9]+)-@i', $subject, $matches)); print_r($matches); //$post_id = 1854; $query = 'update wp_posts set post_content = concat(post_content,"'. $link .'") where id = '. $matches[2]; echo $query; if (mysql_query($query)); echo mysql_error(); mysql_close();} PHP: But this not works, i don't know where is the mistake? Also i tried to use this plugin http://wordpress.org/extend/plugins/wordpress-vbulletin-threads/ but it's not working, if it works i guess i can add new link to my wordpress posts...
You should probably ask this in the V- Bulletin support forums. I'm sure I've seen it addressed there multiple times.
I don't know of a way to do this except for manually. I've never had anyone want to do this automatically. They either discuss the blog post in the comments section, or create a forum thread. Since V-Bulletin has WordPress sign in integration. You can put you latest posts in the side bars. Has blogging capabilities on it's own. And WordPress has forum plug in options...this is just not something I hear people asking for anymore because it already has so many other features that are more advanced. Sorry I can't help more, but I would suggest that you look at the V-Bulletin side of this and look at it from a forum import function using RSS, rather than trying to attack it from the WordPress side. I know there are forum import scripts out there. If it's your intention to create PHP to handle this, you may find better luck in the programming section.
I can create threads with built-in rss plug-in but this time i want to add this created threads link to wordpress post. And i tried to write a plugin to vBulletin as i said in first post, but i can not complete it...
Won't the trackback function in WordPress do that for you? Seems like an adjustment to that would do that trick.
I know you can adjust it to approve only specific trackbacks. That should be a start. And then just adjust the text to say something like "This post is being discussed here" and adjust where it displays in the single.php file and that should do it.
I couldn't find how can i use the current post? How can i find the current post's id in wordpress? I tried something like this; add_filter('trackback_post', 'comment_to_track'); function comment_to_track($pid) { $link = trackback_url(); $pattern = '@^(?:http://)?([^/]+)/([0-9]+)-@i'; preg_match($pattern, $subject, $matches); if($matches[1] ==/*checking domain*/){ $my_post = get_post($pid); $my_post->post_content = $my_post->post_content + "!!added!!" + $link; wp_update_post( $my_post ); } } PHP:
You can find each post ID by going hovering over the edit link of the post and you'll see something like this: http://yourwebsite.com/wp-admin/post.php?post=1618&action=edit Is that what you are asking?
No no, i want to update post in my plugin, in this example this must be $pid so when i use get_post($pid) i can access to current post's content, and i can update it's content...
Sorry. Can't help you with that off of the top of my head. You'll have to refer to the Wordpress.org Docs: http://codex.wordpress.org/Function_Reference/the_ID
Yeah, that's just something that I too would have to study for a minute, because it's not something that I do everyday. But I'm sure there is a way. There is always a way. WordPress has never let me down.
It's not worked How can i debug this plugin? But i do not want to see all the errors and warnings about theme and other plugins... Can write this attributes to a log file easily?
I don't understand. If you are adjusting the trackbacks so that they show a link to the forum, why are you trying to add a function for the Wordpress post ID? Seems like you would just need to allow trackbacks and then insure that your Forum sends them and that should do it. Here's an article that speaks more about it: http://www.optiniche.com/blog/117/wordpress-trackback-tutorial/
I know this feature. But i want to disable this comment post and i want to add this comment to post_content. Is it more clear now?
Sorry, I'd have to investigate that myself. I'm sure the answer you seek is in the WordPress Docs. It always is. Wish I could help more.