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

Reply
 
Thread Tools Display Modes
  #21  
Old 03-16-2013, 05:51 PM
FTG LIQUID CL FTG LIQUID CL is offline
 
Join Date: Jan 2012
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im gonna try putting the js code right below the <title>tag!
Reply With Quote
Благодарность от:
findingpeace
  #22  
Old 03-16-2013, 06:29 PM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FTG LIQUID CL View Post
Im gonna try putting the js code right below the <title>tag!
Cool let me know if that at least gets the title changing! That part should work, even without the hook plugin
Reply With Quote
  #23  
Old 03-16-2013, 07:53 PM
FTG LIQUID CL FTG LIQUID CL is offline
 
Join Date: Jan 2012
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is wht my forumdisplay template looks like,the blue is what I changed and added.Is this right or wrong?




{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if> dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
{vb:raw headinclude}
<title><vb:if condition="$title_note_count">({vb:raw title_note_count}) </vb:if>{vb:raw pagetitle} - {vb:raw vboptions.bbtitle}</title>


<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>




<script type="text/javascript" src="clientscript/vbulletin_read_marker.js?v={vb:raw vboptions.simpleversion}"></script>
<vb:if condition="$vboptions['storecssasfile']">
{vb:cssfile forumhome-rollup.css}
<vb:else />
{vb:cssfile forumbits.css,forumhome.css,options.css}
</vb:if>
<!--[if lt IE 8]>{vb:cssfile forumbits-ie.css,options-ie.css}<![endif]-->
<vb:if condition="$show['sidebar']">
{vb:cssfile sidebar.css,widgets.css,tagcloud.css}
<!--[if lt IE 8]>{vb:cssfile sidebar-ie.css}<![endif]-->
<script type="text/javascript">
<!--
document.write('<script type="text/javascript" src="' + yuipath + '/animation/animation-min.js?v={vb:raw vboptions.simpleversion}"></script>');
var sidebar_align = '{vb:raw show.sidebarposition}';
var content_container_margin = parseInt('{vb:math {vb:stylevar forum_sidebar_width}+{vb:math {vb:stylevar padding}*2}}');
var sidebar_width = parseInt('{vb:stylevar forum_sidebar_width}');
//-->
</script>
<script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-sidebar.js?v={vb:raw vboptions.simpleversion}"></script>
</vb:if>
{vb:raw headinclude_bottom}
</head>
<body>

{vb:raw header}

{vb:raw navbar}

<div id="pagetitle">
<h1>{vb:raw vboptions.bbtitle}</h1>
<p id="welcomemessage" class="description">{vb:rawphrase welcome_to_the_x, {vb:raw vboptions.bbtitle}}</p>
</div>

<vb:if condition="$show['sidebar']">
<div id="content_container" class="{vb:raw $sidebar_class} <vb:if condition="$show['sidebarposition'] == 'left'">contentright</vb:if>">
<div id="content" <vb:if condition="$sidebar_class">class="{vb:raw $sidebar_class}"</vb:if>>
</vb:if>
<!-- main -->
{vb:raw template_hook.forumhome_above_forums}
<ol id="forums" class="floatcontainer">
{vb:raw forumbits}
</ol>
{vb:raw template_hook.forumhome_below_forums}
<!-- /main -->

<div class="navlinks">
<a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}forumdisplay.php?{vb:raw session.sessionurl}do=markread&amp;markreadhash={v b:raw bbuserinfo.securitytoken}" rel="nofollow">{vb:rawphrase mark_forums_read}</a>
<vb:if condition="$vboptions['forumleaders']">|
<a href="showgroups.php{vb:raw session.sessionurl_q}" rel="nofollow">
<vb:if condition="$vb_suite_installed">
{vb:rawphrase view_site_leaders}
<vb:else />
{vb:rawphrase view_forum_leaders}
</vb:if>
</a></vb:if>
</div>
{vb:raw ad_location.board_after_forums}
<!-- what's going on box -->
<div id="wgo" class="collapse wgo_block block">
<h2 class="blockhead">{vb:rawphrase whats_going_on}</h2>
<div class="blockbody formcontrols floatcontainer">
{vb:raw template_hook.forumhome_wgo_pos1}
<vb:if condition="$show['loggedinusers']">
<!-- logged-in users -->
<div id="wgo_onlineusers" class="wgo_subblock section">
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="{vb:rawphrase currently_active_users}" />{vb:rawphrase currently_active_users}</h3>
<div>
<p>{vb:rawphrase there_are_x_y_online_link, {vb:raw totalonline}, {vb:raw session.sessionurl_q}} <span class="shade">{vb:rawphrase x_members_and_y_guests, {vb:raw numberregistered}, {vb:raw numberguest}}</span></p>
<p>{vb:rawphrase most_users_ever_online_was_x_y_at_z, {vb:raw recordusers}, {vb:raw recorddate}, {vb:raw recordtime}}</p>
<vb:if condition="$activeusers">
<ol class="commalist" id="wgo_onlineusers_list">
<vb:each from="activeusers" value="loggedin">
{vb:raw post.signature}
{vb:stylevar dirmark} <a class="username" href="{vb:link member {vb:raw loggedin}}">{vb:raw loggedin.musername}</a>{vb:raw loggedin.invisiblemark}{vb:raw loggedin.buddymark},
</vb:each>
</ol>
</vb:if>

</div>

</div>
<!-- end logged-in users -->
</vb:if>
{vb:raw template_hook.forumhome_wgo_pos2}
<vb:if condition="$show['upcomingevents']">
<div id="wgo_events" class="wgo_subblock section">
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/event.png" alt="{vb:rawphrase todays_events}" /><vb:if condition="$show['todaysevents']">{vb:rawphrase todays_events}<vb:else />{vb:rawphrase upcoming_events_for_the_next_x_days, {vb:raw vboptions.showevents}}</vb:if></h3>
<ol>
{vb:raw upcomingevents}
</ol>
</div>
</vb:if>
{vb:raw template_hook.forumhome_wgo_pos3}
<vb:if condition="$show['birthdays']">
<!-- today's birthdays -->
<div id="wgo_birthdays" class="wgo_subblock section">
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/birthday.png" alt="{vb:rawphrase todays_birthdays}" />{vb:rawphrase todays_birthdays}</h3>
<ol class="commalist">
<vb:each from="birthdays" value="row">
<li><a href="{vb:link member, {vb:raw row}}">{vb:raw row.username}</a><vb:if condition="$row['age']"> ({vb:raw row.age})</vb:if>{vb:raw row.comma}</li>
</vb:each>
</ol>
</div>
<!-- end today's birthdays -->
</vb:if>
{vb:raw template_hook.forumhome_wgo_pos4}
<div id="wgo_stats" class="wgo_subblock section">
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/forum_stats.png" alt="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" />{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}</h3>
<div>
<dl>
<dt>{vb:rawphrase threads}</dt>
<dd>{vb:raw totalthreads}</dd>
<dt>{vb:rawphrase posts}</dt>
<dd>{vb:raw totalposts}</dd>
<dt>{vb:rawphrase members}</dt>
<dd>{vb:raw numbermembers}</dd>
<vb:if condition="$show['activemembers']">
<dt>{vb:rawphrase active_members}</dt>
<dd>{vb:raw activemembers}</dd>
</vb:if>
</dl>
<p>{vb:rawphrase welcome_to_our_newest_member_x, {vb:link member, {vb:raw newuserinfo}}, {vb:raw newuserinfo.username}}</p>
{vb:raw template_hook.forumhome_wgo_stats}
</div>
</div>
<div id="wgo_legend" class="wgo_subblock section">
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/legend.png" alt="{vb:rawphrase icon_legend}" />{vb:rawphrase icon_legend}</h3>
<div>
<dl id="icon_legends" class="icon_legends">
<dt><img src="{vb:stylevar imgdir_statusicon}/forum_new-16.png" alt="{vb:rawphrase new_posts_forum}" /></dt><dd>{vb:rawphrase new_posts_forum}</dd>
<dt><img src="{vb:stylevar imgdir_statusicon}/forum_old-16.png" alt="{vb:rawphrase no_new_posts_forum}" /></dt><dd>{vb:rawphrase no_new_posts_forum}</dd>
<vb:if condition="$vboptions['showlocks']"><dt><img src="{vb:stylevar imgdir_statusicon}/forum_lock-16.png" alt="{vb:rawphrase forum_is_closed_for_posting}" /></dt><dd>{vb:rawphrase forum_is_closed_for_posting}</dd></vb:if>
<dt><img src="{vb:stylevar imgdir_statusicon}/category-16.png" alt="{vb:rawphrase category_forum}" /></dt><dd>{vb:rawphrase category_forum}</dd>
<dt><img src="{vb:stylevar imgdir_statusicon}/forum_link-16.png" alt="{vb:rawphrase link_forum}" /></dt><dd>{vb:rawphrase link_forum}</dd>
{vb:raw template_hook.forumhome_icon_legend}
</dl>
</div>
</div>
{vb:raw template_hook.forumhome_wgo_pos5}
</div>
</div>
<!-- end what's going on box -->

{vb:raw ad_location.board_below_whats_going_on}
<vb:if condition="$show['sidebar']">
</div>
</div>

<div id="sidebar_container" class="<vb:if condition="$show['sidebarposition'] == 'left'">sidebarleft</vb:if><vb:if condition="$close_sidebar"> sidebar_closed</vb:if>">
<a id="sidebar_button_link" href="#">
<vb:if condition="$show['sidebarposition'] == 'left'">
<img id="sidebar_button" src="{vb:stylevar imgdir_misc}/<vb:if condition="$close_sidebar">tab-expanded-left.png<vb:else />tab-collapsed-left.png</vb:if>" alt="" />
<vb:else />
<img id="sidebar_button" src="{vb:stylevar imgdir_misc}/<vb:if condition="$close_sidebar">tab-expanded.png<vb:else />tab-collapsed.png</vb:if>" alt="" />
</vb:if>
</a>
<ul id="sidebar" <vb:if condition="$close_sidebar">class="sidebar_hidden"</vb:if> >
{vb:raw sidebar}
</ul>
</div>
</vb:if>
<script type="text/javascript">
<!--
vbphrase['doubleclick_forum_markread'] = "{vb:rawphrase doubleclick_forum_markread}";
init_forum_readmarker_system();
//-->
</script>
{vb:raw footer}
</body>
</html>

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

i see test showing in the page tab now but it does not change to test 2?
Reply With Quote
  #24  
Old 03-16-2013, 08:31 PM
findingpeace's Avatar
findingpeace findingpeace is offline
 
Join Date: Nov 2011
Posts: 268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome! That means the script stuff is working fine now - you can remove the blue code - now we just have to figure out how to grab the total notifications count for you Check out this thread, which was my original source for the idea:

https://vborg.vbsupport.ru/showthread.php?t=281435

This should give you an idea of how to code the plugin

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

OH! Here's the problem - need to call bbuserinfo if you're using the non-vbNotifications method. I'm so sorry for such an awful explanation

Here is what I would do for the title:

Code:
<title>({{vb:raw bbuserinfo.title_note_count}) {vb:raw pagetitle} - {vb:raw vboptions.bbtitle}</title>
I'm testing without the vb:if conditional right now - that way we can rule out the conditional as a source of the problem.
Reply With Quote
  #25  
Old 03-16-2013, 10:06 PM
FTG LIQUID CL FTG LIQUID CL is offline
 
Join Date: Jan 2012
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will give this a try now!

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

I noticed my page title now loks like this ({)
Attached Images
File Type: jpg Capture.JPG (10.7 KB, 0 views)
Reply With Quote
  #26  
Old 08-15-2019, 02:33 AM
iA1 iA1 is offline
 
Join Date: Jul 2018
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone tried this on vB 4.2.5? Does not seem to work for me.
Reply With Quote
  #27  
Old 08-15-2019, 04:00 AM
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working fine for me on 4.2.5

I added the plugin

Hook: process_tempates_complete
Title: Notifications
Order: 5
Code:
PHP Code:
$vbulletin->userinfo['notifications_total'] = $notifications_total


Then in FORUMHOME, FORUMDISPLAY, SHOWTHREAD I added the following code before the title tag.
Code:
<vb:if condition="$show['member']">
<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 = data.match(/<title>(.+)<\/title>/)[1];
    });
}, 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 = data.match(/<title>(.+)<\/title>/)[1];
    });
}, 1000);
</script>
</vb:if>

Then edited the start of the title tag to add this.
PHP Code:
<vb:if condition="$show['member'] AND $bbuserinfo[notifications_total]">({vb:raw bbuserinfo.notifications_total}) </vb:if> 

Forum home example below.
PHP Code:
<title><vb:if condition="$show['member'] AND $bbuserinfo[notifications_total]">({vb:raw bbuserinfo.notifications_total}) </vb:if>{vb:raw vboptions.bbtitle}</title

Addition mods I'm using that work with this:
Subscribed threads in notifications
FractalizeR: Show items, awaiting moderation in notifications area
Advanced user tagging
Reply With Quote
Благодарность от:
iA1
  #28  
Old 08-15-2019, 09:36 AM
iA1 iA1 is offline
 
Join Date: Jul 2018
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the confirmation. The plugin is working for me, but the javascript fails. It shows this at the top of the page:

Code:
(.+)<\/title>/)[1]; }); }, 1000);
Reply With Quote
  #29  
Old 08-15-2019, 09:40 AM
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll attach it in a text file, try copy and pasting it from there.

Edit
Or try this minified version.

Code:
<script type="text/javascript">setInterval(function(){$.get(document.location.toString()).then(function(t){document.title=t.match(/<title>(.+)<\/title>/)[1]})},3e4),setTimeout(function(){$.get(document.location.toString()).then(function(t){document.title=t.match(/<title>(.+)<\/title>/)[1]})},1e3);</script>
Attached Files
File Type: txt notification.txt (593 Bytes, 4 views)
Reply With Quote
  #30  
Old 08-15-2019, 10:05 AM
iA1 iA1 is offline
 
Join Date: Jul 2018
Posts: 150
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried removing the quotation marks from var data = "{vb:raw relpath}"; and the error is gone. But the notification number in the title did not update.

Do you know what is the use of relpath in this script?
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 10:36 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.04930 seconds
  • Memory Usage 2,312KB
  • 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
  • (4)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (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
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete