Wordpress Threads in vBulletin Forum

Discussion in 'WordPress' started by keyloger, Feb 2, 2012.

  1. #1
    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...
     
    keyloger, Feb 2, 2012 IP
  2. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #2
    You should probably ask this in the V- Bulletin support forums. I'm sure I've seen it addressed there multiple times.
     
    hmansfield, Feb 2, 2012 IP
  3. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #3
    Yes of course but there is no solution :)
     
    keyloger, Feb 2, 2012 IP
  4. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #4
    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.
     
    hmansfield, Feb 2, 2012 IP
  5. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #5
    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... :(
     
    keyloger, Feb 2, 2012 IP
  6. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #6
    Won't the trackback function in WordPress do that for you? Seems like an adjustment to that would do that trick.
     
    hmansfield, Feb 2, 2012 IP
  7. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #7
    Hell yeah it could :) I couldn't think it before, i will look for it :)
     
    keyloger, Feb 2, 2012 IP
  8. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #8
    Keep us posted. I'm interested to see how it comes out.
     
    hmansfield, Feb 2, 2012 IP
  9. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #9
    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.
     
    hmansfield, Feb 2, 2012 IP
  10. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #10
    Ok, i will post here the result ;)
     
    keyloger, Feb 2, 2012 IP
  11. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #11
    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:
     
    keyloger, Feb 3, 2012 IP
  12. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #12
    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?
     
    hmansfield, Feb 3, 2012 IP
  13. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #13
    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...
     
    keyloger, Feb 3, 2012 IP
  14. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #14
    hmansfield, Feb 3, 2012 IP
  15. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #15
    I will try this but am i in loop? Because as i post in #11 is the all of my post..
     
    keyloger, Feb 3, 2012 IP
  16. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #16
    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.
     
    hmansfield, Feb 3, 2012 IP
  17. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #17
    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?
     
    keyloger, Feb 3, 2012 IP
  18. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #18
    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/
     
    hmansfield, Feb 3, 2012 IP
  19. keyloger

    keyloger Active Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #19
    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? :)
     
    keyloger, Feb 3, 2012 IP
  20. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #20
    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.
     
    hmansfield, Feb 3, 2012 IP