Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons

Reply
 
Thread Tools
Live Topic - AJAX Details »»
Live Topic - AJAX
Version: 1.07b, by Coders Shack Coders Shack is offline
Developer Last Online: Sep 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.x Rating:
Released: 01-13-2009 Last Update: 02-28-2009 Installs: 108
DB Changes Uses Plugins Auto-Templates
Is in Beta Stage  
No support by the author.

. . . . . . . . Brought to you by scriptasy.com

Live Demo:
Live Topic 1.07b Demo (you must be logged in, and the topic must be "live")


Videos: 1.00b 1.06b

watch the damn videos... ^_^
Description:
This product is different from anything you have seen before, it raises the bar for forums. It will make your forums much more interactive, and also reduce server load.

Technical Details:
If a thread has been posted in X seconds then its now Live, if other users are viewing the Live topic and are on the last page they will experience a clean ajax experience while talking to other members. Once the thread is older than X seconds its no longer Live and it will now act like a normal thread. Also if a user edits one of their posts that's inside of the thread, it will be updated too so there is no longer a reason to ever have to refresh.

There is also logic for the viewer, the viewer of the thread has to be in an active state to see responses. An active user state is determined upon the users actions, if no actions were made in X seconds then the user is marked as inactive.

Also you may wonder why this could save your server bandwidth and CPU. If a user is refreshing to talk to another members the queries on a normal thread load are way more intense than the ajax call that this modification makes. So if you have 5 people talking to each other none of them have to refresh the page, all they are doing is simple page requests and one intense request when there has actual change.

You can test Live Topic with two users, you will see how amaizing this is... And probably spontaneously combust.

Found a bug? Want to request a feature?
Live Topic - Project Manager
Installation:
This is take less than 3 minutes to install, takes longer to notice its amazing feature. (you need multiple people to be active in the same topic)

Works With (FF2, FF3, IE6, IE7, IE8, SF2, SF3, CHROME):
vBulletin [3.7.4] (have not tested it with other 3.7.X versions)

for vBulletin [3.8.X] go here

INCOMPATIBLE HACKS:
Versions:
1.04b
fixes
javascript error for guests
fixed live topic activation (first poster to raise a dead topic)
changes
auto quick reply focus after post
1.05b
fixes
css flaw

js error for unsupported browsers (random)


fixed chrome issue
ideas
edit notification - thanks to nso

rebuilding some of the original logic to hopefully prevent product conflicts

1.06b
fixes
fixed a little javascript issue that had to do with displaying posts

uses GPC cleaner now
changes
limit the number of ajax posts on the live topic (example 40) and fade them away.

changed the way the hooks are used

tightened up everything a bit

1.07b
fixes
fixed a bug where the live topic notification always making an ajax call
changes
support user ignore list
changed the way the javascript logic worked (hopefully there are less compatibly issues) added support for IE6 and IE8
1.10
...

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #92  
Old 02-04-2009, 06:14 PM
Coders Shack Coders Shack is offline
 
Join Date: Apr 2007
Location: Culver City, CA
Posts: 807
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by patsfans View Post
Thank you. It looks like that link wasn't added in my navbar on the install. But I'm satisfied with your default, and as I said my users enjoyed it as well. We had nearly 300 people active in one thread last night and it worked incredibly well. So again, thank you for putting it together
happy to hear this
Reply With Quote
  #93  
Old 02-05-2009, 04:02 PM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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(">&nbsp;</td>", ">&nbsp;</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(">&nbsp;</td>", ">&nbsp;</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(">&nbsp;</td>", ">&nbsp;</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.

Reply With Quote
  #94  
Old 02-05-2009, 05:41 PM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One Question About the "N New Messages (Live Topic)" Message on the Bottom-Right Corner of the Window:

I noticed that if I access a Dead Topic (with FireFox) and I place myself on one of the Pages of the Thread, (Not the Last One), and some User Come and Post a Reply to the Thread (gets the Topic Live), then for the User that Accessed the Topic while it was Dead this Message is Displayed.

Seems like that Particular Code of that Message is Still Active even if the Topic is Dead. Is this the way is Designed to Work or perhaps is a Bug and that Code is not supposed to Work if the Topic is Dead or if it Gets Dead after the X Minutes Specified for it to Die?

Edit: Idea: If it is supposed to work like that, then I think that if a Topic Dies and a User is in the Last Page of that Thread, then that Message Should Display to that User to Tell Him/Her that the Topic Have New Messages and for Him/Her to be able to Browse to see them. (This moment if the User is in the Last Page of the Thread while it is Dead, Nothing Happens, but if the User is in any other Page happens what is previously Described)

My Best Regards.

Reply With Quote
  #95  
Old 02-06-2009, 03:12 AM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I Forgot to Mentione it.

I Nominated this Mod for MOTM, is a Great Mod. :up::up::up:

My Best Regards.

Reply With Quote
  #96  
Old 02-06-2009, 10:36 AM
Nightmare-GameZ Nightmare-GameZ is offline
 
Join Date: Feb 2008
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

woopdeedoo! This add-on is cool! xD Installed!
Reply With Quote
  #97  
Old 02-08-2009, 01:56 AM
Coders Shack Coders Shack is offline
 
Join Date: Apr 2007
Location: Culver City, CA
Posts: 807
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by inciarco View Post
One Question About the "N New Messages (Live Topic)" Message on the Bottom-Right Corner of the Window:

I noticed that if I access a Dead Topic (with FireFox) and I place myself on one of the Pages of the Thread, (Not the Last One), and some User Come and Post a Reply to the Thread (gets the Topic Live), then for the User that Accessed the Topic while it was Dead this Message is Displayed.

Seems like that Particular Code of that Message is Still Active even if the Topic is Dead. Is this the way is Designed to Work or perhaps is a Bug and that Code is not supposed to Work if the Topic is Dead or if it Gets Dead after the X Minutes Specified for it to Die?

Edit: Idea: If it is supposed to work like that, then I think that if a Topic Dies and a User is in the Last Page of that Thread, then that Message Should Display to that User to Tell Him/Her that the Topic Have New Messages and for Him/Her to be able to Browse to see them. (This moment if the User is in the Last Page of the Thread while it is Dead, Nothing Happens, but if the User is in any other Page happens what is previously Described)

My Best Regards.

I'm not sure why you guys are getting bad notices.

But yea the notice system is only in place if your on a page other than the last page of the thread and the actual topic is active. The nice will stay up. I will add logic to hide the notice once it stops checking for new posts. But currently once it sees that the topic is dead it stops making calls.
Reply With Quote
  #98  
Old 02-08-2009, 05:29 AM
inciarco's Avatar
inciarco inciarco is offline
 
Join Date: Mar 2007
Posts: 758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Coders Shack View Post
I'm not sure why you guys are getting bad notices.

But yea the notice system is only in place if your on a page other than the last page of the thread and the actual topic is active. The nice will stay up. I will add logic to hide the notice once it stops checking for new posts. But currently once it sees that the topic is dead it stops making calls.
Actually that's the Bug, for some reason the Notice System Keeps Tracking for New Posts, even if the Thread is Dead; I made lots of Tests about this issue and All the Times when an User Accessed a Dead Thread and X Minutes Later another User Posted a Message and Activated the Thread, then the Other User (that Accessed the Thread when it was Dead), Started Getting Notices about the New Posts. That makes me think that the Notice System is Active All the Time and Consuming Resources. I also made the same Test by letting the User to Stay in the Thread for some minutes after it Goy Dead, and then Other User to Access the Thread and Start Posting Messages, and then the Other User Started Getting Notice Messaged, which also makes me think that the Notice System was Active even if the Thread was Dead.

About the Code to Partially Solve (in my Case 100% because I Only Nominate Threads / First Posts) the Problem with the Mod to Nominate Topics, what do You Think about it? Would it cause any Considerable Extra Server Load or is it a Normal Code in terms of Server Load?

My Best Regards.

Reply With Quote
  #99  
Old 02-09-2009, 09:53 PM
TitanJeff's Avatar
TitanJeff TitanJeff is offline
 
Join Date: Jul 2002
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmmm... doesn't work for me in 3.7.3.

Would love it though.
Reply With Quote
  #100  
Old 02-14-2009, 09:14 AM
MTGDarkness MTGDarkness is offline
 
Join Date: Dec 2008
Posts: 270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is really cool.
Reply With Quote
  #101  
Old 02-14-2009, 05:35 PM
Jari37 Jari37 is offline
 
Join Date: May 2008
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working perfectly up to now in 3.7.1. Brilliant work, much appreciated.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04999 seconds
  • Memory Usage 2,355KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete