One Possible Solution for Conflict with product "
Topic Of The Week_Month Nomination", at least for the Display of Nominated/Winner on the First Post of the Thread, (on all other Posts it won't Display because of the "if" Conditional).
The Conflict with this Product is on the Template "
nominate_topic_stamps" that is Triggered by some of the Last Lines of the Plugin "Topic Of The Week_Month Nomination" that uses the Hook "global_setup_complete", lines that will be Commented (to Not be Used) on the Following Solution, and Changed of place to use the Conditional Explained later to Only Use this Template on the First Post of a Thread (whic won't interfere with the Quick Replies).
"
Coders Shack" if you can Please Check the mentioned Plugin and the mentioned Template, Analyze the Code, and propose a Better Solution to be able to Not Disable the Code mentioned on the Solution for ALL Posts Except the First One of a Thread, I think many Users will Appreciate that, (I can only offer this Solution with my Limited Knowledge).
Also, if you can Please Confirm me/us if the following Solution Provided won't have any Problems with the Performance of the Display of the Posts, I/we will appreciate it a lot; as you'll see I've changed the Location of that specific Code that causes the Problem to another Plugin where I can use the Conditional to Use it only on the First Post of a Thread, but what I don't know is if that Change can cause Problems on the Performance/Optimization of the Speed and Memory Use of the Displaying of the Posts on the Forum and on the Usage of the DataBase and of the Server. I had to Create that Plugin because on the Original One I received an Error that told me that on that Global Location I wasn't able to use those Variables that can be used without Problems on Hook Locations related with Postbit.
I/we Appreciate Your Guide.
Solution:
Step 1:
Create New Plugin.
Product: vBulletin
(if you create it on the "Topic Of The Week_Month Nomination" and you Update and overwrite the Product you'll lose this Plugin because it'll be Deleted)
(if you Disable or Uninstall the "Topic Of The Week_Month Nomination" Product you'll have to Disable this Plugin so that it don't cause Problems)
Name/Title: Topic Of The Week_Month Nomination - Live Topic Solution - Postbit_Display_Complete
Hook Place: Postbit_Display_Complete
Execution Order: 5
PHP Code:
Code:
if ($post['postid']==$this->thread['firstpostid'])
{
if ($vbulletin->options['legacypostbit']) {
$vbulletin->templatecache['postbit_legacy'] = str_replace("<!-- / icon and title -->", $vbulletin->templatecache[nominate_topic_legacy_stamps]."<!-- / icon and title -->", $vbulletin->templatecache[postbit_legacy]);
}
else{
$vbulletin->templatecache['postbit'] = str_replace("> </td>", "> </td>".$vbulletin->templatecache['nominate_topic_stamps'], $vbulletin->templatecache['postbit']);
}
}
Notice the "nominate_topic_stamps", it'll Display the "Nominated Topic" or "Winner Topic" Logo and Link that is Created with the Template "
nominate_topic_stamps",
ONLY ON THE FIRST POST of the Thread, which is the Only One that is not Created via Quick Reply.
If you have Set your Mod Options to Nominate Any Post and Not Only the First One, then, if that Post is Nominated and is not the First One, then it'll Not Display the Top-Right Image that Says (Nominated and/or Winner TOTW TOTM), but the Below Options will Appear without any Problem, (the ones that Allow you to Retire your Nomination and Visit the Hall of Fame and the Nomination Thread).
Step 2:
Commenting the Previous Code Lines on the Plugin "Topic Of The Week_Month Nomination" Hook Location "global_setup_complete", which after the Changes will be like this:
Code:
if (THIS_SCRIPT === 'blog'){
if ($vbulletin->options['nominate_topic_blog_on_off']){
$vbulletin->templatecache['blog_entry_with_userinfo'] = str_replace("<!-- message -->", "<!-- message -->".$vbulletin->templatecache[nominate_topic_list_blog_stamps_box], $vbulletin->templatecache[blog_entry_with_userinfo]);
$vbulletin->templatecache['blog_entry_without_userinfo'] = str_replace("<!-- message -->", "<!-- message -->".$vbulletin->templatecache[nominate_topic_list_blog_stamps_box], $vbulletin->templatecache[blog_entry_without_userinfo]);
$vbulletin->templatecache['blog_show_entry'] = str_replace("<!-- ads could go here -->", "<!-- ads could go here -->".$vbulletin->templatecache[nominate_topic_blog_stamps_box], $vbulletin->templatecache[blog_show_entry]);
// $vbulletin->templatecache['blog_show_entry'] = str_replace("<div style=\"clear:both; margin-top:10px\"></div>", "<div style='clear:both; margin-top:10px'></div>".$vbulletin->templatecache[nominate_topic_blog_button], $vbulletin->templatecache[blog_show_entry]);
$string = htmlentities($vbulletin->templatecache['blog_show_entry'], ENT_QUOTES);
$searchee = '<div style=\"clear:both; margin-top:10px\"></div>';
$searchee = htmlspecialchars($searchee, ENT_QUOTES);
$replace_by = $searchee.htmlentities($vbulletin->templatecache[nominate_topic_blog_button], ENT_QUOTES);
$string = str_replace($searchee, $replace_by, $string);
$searchee = '<div class=\"alt2 smallfont\" style=\"text-align:';
$searchee = htmlspecialchars($searchee, ENT_QUOTES);
$replace_by = htmlentities($vbulletin->templatecache[nominate_topic_blog_box], ENT_QUOTES).$searchee;
$string = str_replace($searchee, $replace_by, $string);
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
$string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string);
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
$vbulletin->templatecache['blog_show_entry'] = strtr($string, $trans_tbl);
}
}
// else {
// if ($vbulletin->options['legacypostbit']) {
// $vbulletin->templatecache['postbit_legacy'] = str_replace("<!-- / icon and title -->", $vbulletin->templatecache[nominate_topic_legacy_stamps]."<!-- / icon and title -->", $vbulletin->templatecache[postbit_legacy]);
// }
// else{
// $vbulletin->templatecache['postbit'] = str_replace("> </td>", "> </td>".$vbulletin->templatecache['nominate_topic_stamps'], $vbulletin->templatecache['postbit']);
// }
// }
eval('$template_hook[navbar_search_menu] .= "' . fetch_template('nominate_topic_navbar_search') . '";');
if ($vbulletin->options[nominate_topic_receiving_forumid]){
eval('$template_hook[navbar_quick_links_menu_pos1] .= "' . fetch_template('nominate_topic_vbnav_quicklink') . '";');
}
Notice the Commented Code Lines with the "//":
Code:
// else {
// if ($vbulletin->options['legacypostbit']) {
// $vbulletin->templatecache['postbit_legacy'] = str_replace("<!-- / icon and title -->", $vbulletin->templatecache[nominate_topic_legacy_stamps]."<!-- / icon and title -->", $vbulletin->templatecache[postbit_legacy]);
// }
// else{
// $vbulletin->templatecache['postbit'] = str_replace("> </td>", "> </td>".$vbulletin->templatecache['nominate_topic_stamps'], $vbulletin->templatecache['postbit']);
// }
// }
Step 3:
ENJOY !!
I Hope for another Solution that could involve perhaps some small Changes on the Template "
nominate_topic_stamps", so that both Mods can Work Fine on ALL Cases and on ALL Posts.
My Best Regards.