Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2015, 05:39 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Watched threads in menubar

Folks-

I've got Subscribed Threads in Notifications Link installed, and it works fine.

However, I've decided to eliminate friends and private messages entirely... which leaves subscribed threads as the only notification. I'd like to just put it directly into the menubar.

So, can i just change the hook location for the plugin (and to which)—or do I need to do something else?

Thanks!

--don
Reply With Quote
  #2  
Old 04-01-2015, 02:25 AM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Don,
The first thing you need to do is change the plugin hook location to global_start

Save

Then in your navbar template

Find:

Code:
		<phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
Add below:
Code:
<br />
                  <a href="subscription.php">$vbphrase[new_subscribed_threads]</a> <strong>$new_subscribed_threads</strong>
Save
Reply With Quote
Благодарность от:
kh99
  #3  
Old 04-01-2015, 02:07 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Tim!

I'll move the plugin to global start... but there's something missing from the template edit you suggested.

Currently, I have:
HTML Code:
      <span  id="notifications_menu">
        <a rel="nofollow" href="usercp.php$session[sessionurl_q]" id="notifications">
          <if condition="$notifications_total>0">
            <span class="icon">&commat;</span><span class="word">Notifications</span><span id="notifications_number">$notifications_total</span>
          <else />
            <span class="icon" style="color:#deccb5;">&commat;</span><span class="word" style="color:#deccb5;">Notifications</span>
          </if>
        </a>
        <!-- notifications menu -->
        <div class="dropdown">
          $notifications_menubits
        </div>
        <!-- / notifications menu -->

      </span>
in the navbar template, and:
HTML Code:
<a href="$notification[link]"<if condition="$notification['total'] > 0"> style="font-weight:bold"</if> class="menu_item"><span class="padder">$notification[phrase] ($notification[total])</span></a>
in the navbar_notifications_menubit template.

The plugin seems to be passing variable here:
PHP Code:
 $vbulletin->userinfo['adam_subsct_count'] = $new_subscribed_threads

     
$notifications['adam_subsct_count'] = array( 
        
'phrase' => $vbphrase['new_subscribed_threads'], 
        
'link'   => $vbulletin->options['bburl'] . '/subscription.php?do=viewsubscription&daysprune=-1&folderid=all'
        
'order'  => 50 
    
); 
I tried:
HTML Code:
        <a rel="nofollow" href="usercp.php$session[sessionurl_q]" id="notifications">
          <if condition="$userinfo[adam_subsct_count]>0">
            <span class="icon">&commat;</span><span class="word">$vbphrase[new_subscribed_threads]</span><span id="notifications_number">$userinfo[adam_subsct_count]</span>
          <else />
            <span class="icon" style="color:#deccb5;">&commat;</span><span class="word" style="color:#deccb5;">$vbphrase[new_subscribed_threads]</span>
          </if>
The phrase works fine, but the subscription count seems to be empty. Is it a syntax error in my template edit, or something else?

--don
Reply With Quote
  #4  
Old 04-01-2015, 02:38 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Don,
I was under the impression you were removing that code and were no longer using the notification dropdown.
What I posted works perfectly on my 3.8.8 site.
It will show zero if there are no replies.
Reply With Quote
  #5  
Old 04-01-2015, 02:44 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am removing the dropdown!

What I can't do, at this point, is get the number of new watched threads to display (or work within the conditional). I'm sure its something I'm doing wrong.

A thought: The value I want is displayed on the subscribed threads section of the UserCP template, in the variable $numthreads. Might I be better off ditching this plugin and getting a simpler one that just fetches this value?

--don
Reply With Quote
  #6  
Old 04-01-2015, 03:00 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works just as it did when it was in the drop down but you always see it now at zero until one of your subscribed threads are replied on.
I may be able to hide the whole thing until a reply has been posted.
When I get home, I will see what I can do.
Reply With Quote
  #7  
Old 04-01-2015, 03:44 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it working!

I was using the wrong variable for the count.

Thanks for your help.

Here's what works:
HTML Code:
        <a rel="nofollow" href="usercp.php$session[sessionurl_q]" id="notifications">
          <if condition="$new_subscribed_threads>0">
            <span class="icon">&commat;</span><span class="word">$vbphrase[new_subscribed_threads]</span><span id="notifications_number">$new_subscribed_threads</span>
          <else />
            <span class="icon" style="color:#deccb5;">&commat;</span><span class="word" style="color:#deccb5;">$vbphrase[new_subscribed_threads]</span>
          </if>
        </a>
Reply With Quote
  #8  
Old 04-01-2015, 04:36 PM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why have it show at all, why not show it when new replies to subscribed threads are posted.

I now have this.

Code:
<br />
          <if condition="$new_subscribed_threads>0">
                  <a href="usercp.php">$vbphrase[new_subscribed_threads]</a> <span style="color:#FFA5A5;"><strong>$new_subscribed_threads</strong></span></if>
Reply With Quote
  #9  
Old 04-01-2015, 04:50 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dunno... I guess there is no real reason to show it if there are no new posts.
Reply With Quote
  #10  
Old 04-03-2015, 02:05 AM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay... weird side-effect—
When I use the "Find all posts by..." link in the postbit, It displays the posts, but displays the following error message:
Code:
Warning: Cannot use a scalar value as an array in [path]/search.php on line 2504
deactivating the plugin eliminates the error.

I don't know why this interacts with search.php. Any ideas, folks?
Reply With Quote
Reply


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 03:19 AM.


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.04294 seconds
  • Memory Usage 2,279KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete