vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Show Thread Subscribers in All Threads (https://vborg.vbsupport.ru/showthread.php?t=36544)

Logician 03-24-2002 10:00 PM

Show Thread Subscribers in All Threads
 
Hiya,

This hack shows who subscribed to a particular thread at the end of all threads while you're reading it. Very easy to implement:

1- Edit showthread.php, Find:
PHP Code:

  } else {
    
$postdone[$post[postid]]=1;
  }
  
$postbits .= getpostbit($post);


AFTER THAT ADD:

PHP Code:

// LOGICIAN THREAD SUBSCRIBERS HACK:
$log_subscribers=$DB_site->query("SELECT s.userid, u.username FROM subscribethread s, user u WHERE u.userid=s.userid AND s.threadid='$threadid' ORDER BY u.username");
$log_sayac=0;$log_subscribers_birik='';
while (
$log_subscriber=$DB_site->fetch_array($log_subscribers)) {$log_subscribers_birik.="<a href=$bburl/member.php?s=&action=getinfo&userid=".$log_subscriber['userid'].">".$log_subscriber['username']."</a>, ";$log_sayac++;}
if (
$log_sayac!=0) {$log_subscribers_birik=substr($log_subscribers_birik0strlen($log_subscribers_birik)-2);}
if (
$log_sayac==0) {$log_subscribers_table="<b>Thread Subscribers</b> : N/A";}
elseif (
$log_sayac==1) {$log_subscribers_table="<b>Thread Subscriber</b> : $log_subscribers_birik";}
else {
$log_subscribers_table="<b>Thread Subscribers</b> ($log_sayac) : ".$log_subscribers_birik;}
// LOGICIAN THREAD SUBSCRIBERS HACK: 

2- LOGIN CP/ MODIFY TEMPLATE/EDIT showthread templates/showthread

FIND:

PHP Code:

<!-- time zone and post buttons --> 

AFTER THAT ADD:

PHP Code:

<table width="100%" border="1" cellspacing="0" cellpadding="0">
<
tr>
<
td bgcolor="{_firstaltcolor}"><smallfont>$log_subscribers_table</smallfont></td>
</
tr>
</
table

(Remove _ at {_firstaltcolor} above!)

if you liked this hack, you may want to take a look at these hacks too:
* Change "Subscribe to This Thread" link to "Unsubscribe" if already subscribed too. (IMO They make a good couple..)
* Confirm Unsubscribe From All Threads Requests

This hack has another version released in this thread too. In that version thread subscribers are not displayed in the thread view, instead there appears a link next to "Subscribe This Thread" to display them in a new window.. Choose your pick..

Hack works with any vb versions I know, dont hesitate to apply..

If you install the hack please click INSTALL, thank you..

Enjoy!
Regards,
Logician \\=^))

Ps. Not likely, but if you get a Parse Error while applying the hack, try to copy paste not from this message but from the TEXT instructions I attached a few messages below instead.

djr 03-25-2002 07:02 PM

Although a bit off-topic, but you seem really busy with the whole subscribe/unsubscribe thing. May I point you to a really old request of mine and let me know if this is a request you're willing to consider?

mass unsubscribe selected messages:
https://vborg.vbsupport.ru/showthrea...threadid=33619

and btw: kudos for the webtemplates hack.. didn't install it yet, but the idea sounds very very promising!

- djr

TWTCommish 03-26-2002 12:16 AM

Please allow me to say that, though I like your hacks, naming variables after your username is...odd. :D

nafae 03-26-2002 01:18 AM

Quote:

Originally posted by TWTCommish
Please allow me to say that, though I like your hacks, naming variables after your username is...odd. :D
Hey, you wouldn't imagine what my variables would be ;) (there is nothing wrong with a little self gratification in knowing that these people have your name embedded into their site) :p

Logician 03-26-2002 05:06 AM

Hiyas,
Quote:

Originally posted by TWTCommish
Please allow me to say that, though I like your hacks, naming variables after your username is...odd. :D
Nope.. there is a very good reason:

vbulletin is a sophisticated script and since I am not the coder of it, it's sometimes impossible to know what variable names coders use in the original script.

If I use a variable such as "$count", it's very likely that it will clash with a vbulletin variable and if you apply such a hack, then you'll see what "odd" really means LOL. ;)

So I need a prefix which I will be sure that coders didnt use in their code and my nickname is a good start. :)

In my next hack, I will name a few variables after you, promise! :p

Regards,
Logician

mashby 05-05-2002 01:53 PM

I'm getting a parse error on the following line in showthread.php
PHP Code:

while?($log_subscriber=$DB_site->fetch_array($log_subscribers))?{$log_subscribers_birik.="<a?href=$bburl/member.php?s=&action=getinfo&userid=".$log_subscriber['userid'].">".$log_subscriber['username']."</a>, ";$log_sayac++;} 

I'm running 2.2.5

Admin 05-05-2002 01:56 PM

Jesus Logician, add some linebreaks in your code, it's 100% unreadable!

Logician 05-05-2002 04:23 PM

Quote:

Originally posted by mashby
I'm getting a parse error on the following line in showthread.php
PHP Code:

while?($log_subscriber=$DB_site->fetch_array($log_subscribers))?{$log_subscribers_birik.="<a?href=$bburl/member.php?s=&action=getinfo&userid=".$log_subscriber['userid'].">".$log_subscriber['username']."</a>, ";$log_sayac++;} 


Mashby there is nothing wrong with this line. In fact the hack is working in my board for 1.5 months with no problems. I thought may be there can be a copy/paste error while moving the hack code here, but there is none, I checked 3 times.

I dont know how can I help you but here are a few suggestions:
1- Please reapply the hack from the begining carefully. You may miss something.
2- There may be a problem from copying/pasting from your browser, I attached the text instructions to this message try to copy/paste from there.

mashby 05-05-2002 10:19 PM

Logician,

Thank you for your help today! The file that you sent back did the trick. :)

<look gift horse in the mouth>
Now that it's working, is there any way to modify this hack so that it works with subscribed forums as well?
</look gift horse in the mouth>

mashby 05-05-2002 11:49 PM

I found the culprit. It was my browser - Opera.

I installed a different hack and ran into the same problem, so I launched IE and re-copied the code - it worked just fine. So, it's a browser issue.

And while we're on the subject, I'd recommend that all hacks be included as a .txt attachment. That way it would prevent this type of thing from happening and it also makes it easier for people like me who keep all hacks they install in a special file.

Just a thought.


All times are GMT. The time now is 11:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01211 seconds
  • Memory Usage 1,768KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete