View Single Post
  #1239  
Old 10-17-2008, 09:25 PM
rcadden rcadden is offline
 
Join Date: Sep 2008
Location: Texas
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome mod, works like a charm, but I've run into a bit of an issue - I have had my blog going for nearly 2 years, and am just now adding this forum.

1. As I have seen thus far, this is not retro-active, creating a new forum thread for every old post (which is a GOOD thing).
2. When I replace the comment text in my wordpress template, I've noticed that comments completely disappear for posts that do not currently have a vBulletin thread, which makes sense.

Would it be possible to include some php that says, basically, 'if this post was published before MM/DD/YYYY, then continue using the existing Wordpress comments code. If this post was published AFTER MM/DD/YYYY, then use this new vBulletin comment code.'

I realize I would then still need to monitor Wordpress' comments for older posts, but I think that would be the cleanest integration.

Or did I miss something?

Update: I got it taken care of, here's the code I used:

PHP Code:
<?php
$date1 
strtotime('2008-10-17');
$date2 strtotime$post->post_date );
if (
$date1 $date2) { 
#### Vbridge Replacement code for comments
    
if ($vbridge[id] > 0) {
    echo 
"<div class='comments'>";
    if(
is_single()) {
    if (
is_array($vbridge[replies])) {
    echo 
"<br /><br /><h3 id='comments'>Comments</h3><ol class='commentlist'>";

    foreach (
$vbridge[replies] as $reply) {
            echo 
"<li class=";
            echo 
$oddcomment;
            echo 
"id='comment-'";
            echo 
comment_ID();
            echo 
">";
            echo 
$vbridge[vb_parser]->do_parse($reply[pagetext], falsetrue);
            echo 
"<small class='commentmetadata'>";
            echo 
"&nbsp;&nbsp;&nbsp;&nbsp;";
            echo 
"<img src='";
            echo 
bloginfo('stylesheet_directory');
            echo 
"/images/comment_arr.gif' />";
            echo 
"by <cite> <a href=;";
            echo 
get_option('vbb_VBURL');
            echo 
"/member.php?u='";
            echo 
$reply[userid];
            echo 
">";
            echo 
$reply[username];
            echo 
"</a></cite></small><br /></li>";
        if (
'alt' == $oddcomment$oddcomment '';
        else 
$oddcomment 'alt';
    }
}
echo 
"</ol>";
}
echo 
"<a href=";
echo 
get_option('vbb_VBURL');
echo 
"/showthread.php?t=";
echo 
$vbridge[id];
echo 
">";
echo 
intval($vbridge[count]);
echo 
"comments</a> |";
echo 
"<a href=";
echo 
get_option('vbb_VBURL');
echo 
"/newreply.php?do=newreply&noquote=1&t=";
echo 
$vbridge[id];
echo 
">";
echo 
"Add your comments</a></div>";
}
##End Vbridge Replacement
} else {
echo 
"<div id='comments-template'>";
comments_template();
echo 
"</div>";}
?>
The date at the top is the cutoff date, so that newer posts use the forum comments, whereas older posts use the legacy Wordpress comments function. My old comments code is found in the last 4 lines, after the "} else {"
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01151 seconds
  • Memory Usage 1,797KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete