Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 03-14-2013, 08:48 PM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The last part would go in a new plugin (ignore the a, b, c, d plugin) like this:

Hook: process_templates_complete
Execution Order: 5

Code:
$vbulletin->userinfo['notifications_total'] = $title_note_count;
vB_Template::preRegister('FORUMHOME',array('title_note_count' => $title_note_count));
vB_Template::preRegister('SHOWTHREAD',array('title_note_count' => $title_note_count));
vB_Template::preRegister('recent_thanks',array('title_note_count' => $title_note_count));
vB_Template::preRegister('FORUMDISPLAY',array('title_note_count' => $title_note_count));
vB_Template::preRegister('USERCP_SHELL',array('title_note_count' => $title_note_count));
vB_Template::preRegister('newthread',array('title_note_count' => $title_note_count));
vB_Template::preRegister('newreply',array('title_note_count' => $title_note_count));
Reply With Quote
  #12  
Old 03-15-2013, 04:52 PM
FTG LIQUID CL FTG LIQUID CL is offline
 
Join Date: Jan 2012
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK I will give this a try.

--------------- Added [DATE]1363366543[/DATE] at [TIME]1363366543[/TIME] ---------------

Do I leave out the entire first plugin or just the a,b,c,d, part?
Reply With Quote
  #13  
Old 03-15-2013, 06:28 PM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah just leave out the first plugin entirely - that's if you need to recalculate everything, which you shouldn't if you don't have the vbNotifications mod
Reply With Quote
  #14  
Old 03-15-2013, 08:25 PM
FTG LIQUID CL FTG LIQUID CL is offline
 
Join Date: Jan 2012
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok great ,Im gonna go test this out!
Reply With Quote
  #15  
Old 03-15-2013, 10:54 PM
dizzynation's Avatar
dizzynation dizzynation is offline
 
Join Date: Jun 2011
Posts: 279
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, can you clarify if you are not using th DB tech mod then what code do we use exactly?
Reply With Quote
  #16  
Old 03-16-2013, 01:01 AM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep! This one:

https://vborg.vbsupport.ru/showpost....9&postcount=11

The rest of it is all the same as the first post (adding the Javascript & titles into Templates). The only difference is the plugin - sorry for the confusing posts
Reply With Quote
  #17  
Old 03-16-2013, 01:47 PM
FTG LIQUID CL FTG LIQUID CL is offline
 
Join Date: Jan 2012
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cant seem to get this to work,I am using 4.1.12. I used the same templates as you.Does it matter where I put the code in these templates
Reply With Quote
  #18  
Old 03-16-2013, 02:23 PM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

JS should always be in the header tag, so as long as it's somewhere in there! Test to see if the JS is working, simply by changing it to this code:

<script type="text/javascript">
setInterval(function() {
var data = "{vb:raw relpath}";
$.get(document.location.toString()).then(function (data){
//find and set the title of the page
document.title = "Test2";
});
}, 30000);

setTimeout(function() {
var data = "{vb:raw relpath}";
$.get(document.location.toString()).then(function (data){
//find and set the title of the page
document.title = "Test";
});
}, 1000);
</script>

Load the relevant page, and the page title should change to "Test" after 1 second, and "Test2" after 30 seconds
Reply With Quote
  #19  
Old 03-16-2013, 02:59 PM
FTG LIQUID CL FTG LIQUID CL is offline
 
Join Date: Jan 2012
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont see anything changing to test or test 2,I must be doing something wrong?

--------------- Added [DATE]1363447219[/DATE] at [TIME]1363447219[/TIME] ---------------

I changed this

<title>{vb:raw vboptions.bbtitle}</title>

to this

<title><vb:if condition="$title_note_count">({vb:raw title_note_count}) </vb:if>{vb:raw pagetitle} - {vb:raw vboptions.bbtitle}</title>

is this correct?
Reply With Quote
  #20  
Old 03-16-2013, 03:42 PM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, that is 100% correct, but the JS not changing your title immediately is a problem - are you putting the script code in that same template? It can go right below the <title> tag
Reply With Quote
Reply

Thread Tools
Display Modes

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 09:59 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.07776 seconds
  • Memory Usage 2,265KB
  • Queries Executed 12 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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