Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-2012, 03:08 PM
dutchbb dutchbb is offline
 
Join Date: Nov 2003
Posts: 899
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Members can see how many are subscribed to their thread

Does this mod exist? If not, someone interested in creating it?
Reply With Quote
  #2  
Old 09-29-2012, 12:40 AM
dutchbb dutchbb is offline
 
Join Date: Nov 2003
Posts: 899
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #3  
Old 09-29-2012, 12:13 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can do something like this: create a plugin using hook showthread_complete and this code:

Code:
if ($thread['postuserid'] == $vbulletin->userinfo['userid'])
{
    $res = $vbulletin->db->query_first_slave("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "subscribethread WHERE threadid = $thread[threadid]");
    $subscribed_count = $res['count'];
}

Then edit the SHOWTHREAD template and use $subscribed_count where you want the count to appear, maybe like:

Code:
<if condition="$thread[postuserid] == $bbuserinfo[userid]">
$subscribed_count subscribed to this thread
<if>
Reply With Quote
  #4  
Old 09-29-2012, 02:07 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@ kh99 - How would you do this for vb4?
Reply With Quote
  #5  
Old 09-29-2012, 02:12 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol, I originally posted it for vb4 then noticed the request was posted in the vb3 section. Anyway, here it is for vb4:

Code:
if ($thread['postuserid'] == $vbulletin->userinfo['userid'])
{
    $res = $vbulletin->db->query_first_slave("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "subscribethread WHERE threadid = $thread[threadid]");
    vB_Template::preRegister('SHOWTHREAD', array('subscribed_count' => $res['count']));
}
Code:
<vb:if condition="$thread[postuserid] == $bbuserinfo[userid]">
{vb:raw subscribed_count} subscribed to this thread
</vb:if>
Reply With Quote
  #6  
Old 09-29-2012, 02:14 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol ! Thank you so much kh99, I "did' notice the (Last edited by kh99 : Today at 06:30. Reason: changed for vb3 ) , let me try this out...brb..

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

Ok, I got the following:

The following error occurred when attempting to evaluate this template:
Invalid Tag Nesting
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

I am trying to add it right below the (Thread Information Block) and the code for that looks like this:

<div id="thread_info" class="thread_info block">
<vb:if condition="$show['activeusers']">
<h4 class="threadinfohead blockhead">{vb:rawphrase thread_information}</h4>
<div id="thread_onlineusers" class="thread_info_block blockbody formcontrols">
<div class="inner_block">
<h5>{vb:rawphrase users_browsing_this_thread}</h5>
<div>
<p>{vb:rawphrase users_currently_browsing_x_y_z, {vb:raw totalonline}, {vb:raw numberregistered}, {vb:raw numberguest}}</p>
<ol class="commalist">
<vb:each from="activeusers" value="row">
<li><a class="username" href="{vb:link member, {vb:raw row}}">{vb:raw row.musername}</a>{vb:raw row.invisiblemark}{vb:raw row.buddymark}{vb:raw row.comma}</li>
</vb:each>
</ol>
</div>
</div>
</div>
</vb:if>

Something missing here?

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

Ok, I got the code in but nothing will display. I did make sure someone is subscribed to the thread and nothing.
Reply With Quote
  #7  
Old 09-29-2012, 02:30 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems to work for me, like if I add it here (showing only the end of the above code):

Code:
</vb:each>
</ol>
</div>
<vb:if condition="$thread[postuserid] == $bbuserinfo[userid]">
{vb:raw subscribed_count} subscribed to this thread
</vb:if>
</div>
</div>
</vb:if>

If you're trying to put it somewhere else you'll have to show us exactly what you're doing.
Reply With Quote
  #8  
Old 09-29-2012, 02:30 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Ok, I got the code in but nothing will display. I did make sure someone is subscribed to the thread and nothing.
Is it your thread? The <vb:if> makes it so it only displays if you started the thread.
Reply With Quote
  #9  
Old 09-29-2012, 02:33 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, it's not my thread.

So what's the code so it shows on any thread?

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

Ok, I am trying to add it here......Marked in red....


<!-- / next / previous links -->
</vb:if>
<div id="thread_info" class="thread_info block">
<vb:if condition="$show['activeusers']">
<h4 class="threadinfohead blockhead">{vb:rawphrase thread_information}</h4>
<div id="thread_onlineusers" class="thread_info_block blockbody formcontrols">
<div class="inner_block">
<h5>{vb:rawphrase users_browsing_this_thread}</h5>
<div>
<p>{vb:rawphrase users_currently_browsing_x_y_z, {vb:raw totalonline}, {vb:raw numberregistered}, {vb:raw numberguest}}</p>
<ol class="commalist">
<vb:each from="activeusers" value="row">
<li><a class="username" href="{vb:link member, {vb:raw row}}">{vb:raw row.musername}</a>{vb:raw row.invisiblemark}{vb:raw row.buddymark}{vb:raw row.comma}</li>
</vb:each>
</ol>
</div>
</div>
</div>
{vb:raw subscribed_count} subscribed to this thread
</vb:if>
{vb:raw similarthreads}
{vb:raw template_hook.showthread_after_activeusers}
<vb:if condition="$show['tag_box']">
<h4 class="threadinfohead blockhead">{vb:rawphrase tags_for_this_thread}</h4>
<div id="thread_tags_list" class="thread_info_block blockbody formcontrols">
<div class="inner_block">
<vb:if condition="$show['manage_tag']">
<a id="tag_edit_link" href="threadtag.php?{vb:raw session.sessionurl}t={vb:raw thread.threadid}" class="textcontrol" style="float:{vb:stylevar right}; font-size:11px; margin:10px;">{vb:rawphrase edit_tags}</a>
</vb:if>
<div id='tag_list_cell'>
{vb:raw tag_list}
</div>
<p>
<a href="tags.php{vb:raw session.sessionurl_q}">{vb:rawphrase view_tag_cloud}</a>
</p>
</div>
</div>
</vb:if>

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

This is what I get:

Reply With Quote
  #10  
Old 09-29-2012, 02:39 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That should work, but I forgot that you'd also need to remove the if from the plugin code, like:

Code:
$res = $vbulletin->db->query_first_slave("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "subscribethread WHERE threadid = $thread[threadid]");
vB_Template::preRegister('SHOWTHREAD', array('subscribed_count' => $res['count']));
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 06:32 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.04576 seconds
  • Memory Usage 2,267KB
  • Queries Executed 13 (?)
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
  • (6)bbcode_code
  • (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
  • (2)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_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