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.

Logician 05-07-2002 02:22 PM

Quote:

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

@Commish: As I promised: https://vborg.vbsupport.ru/showthrea...threadid=38373 :glasses:

Logician 05-07-2002 02:30 PM

Quote:

Originally posted by mashby
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.

@mashby: Thx for the feedback.

As I wrote to you, the problem was with the strange space character which look like a space but actually was not. Now we understand that it is because of Opera's encoding.

Glad we solved the issue, because it was really baffling me!

Regards,

Heineken77 07-18-2002 11:19 PM

Hey Logician :) Great hack once again. Thanks!

X-Fan 07-19-2002 03:09 AM

Yep, very cool, and very handy too!

Logician 07-19-2002 09:42 PM

Quote:

Yep, very cool, and very handy too!
Thx. I use this hack in my site and really like this hack a lot but considering the fact that I released this hack exactly 4 months ago and in 4 months it got only 5 installers (1 is me, so it's 4 actually), I thought it was only me who found it useful. Then Heineken77 bumped the thread yesterday and it got 3 new installers in only 1 day. So it seems there are really too many hacks released in this board and only active threads gets the attention while others are forgotten in the dark..

Ps. if anybody want to grant the viewing of subscribers to only Admins/mods etc holler and I can give you the code..

Me2Be 07-19-2002 10:00 PM

Logician,

Is there a way to have this hack and only have it as a link where someone can click on it to see a list of members? We have thousands of threads and some with more than one hundred subscribers and I'd prefer to not have it on the showthread :)

(I should have known this was your hack -- you come up with perfect ones for my group!)

Logician 07-22-2002 08:06 AM

Quote:

Originally posted by Me2Be
Logician,

Is there a way to have this hack and only have it as a link where someone can click on it to see a list of members? We have thousands of threads and some with more than one hundred subscribers and I'd prefer to not have it on the showthread :)

(I should have known this was your hack -- you come up with perfect ones for my group!)

Although your request requires some modifications in the hack structure, I can code it for you but please give me a few days.. (and holler to remind me if I forget it! thx) :)

BTW how do you like it be done: Every member can see the link and click it to get subscribers info, or just special usergroups like Admins/Mods etc.?

Me2Be 07-22-2002 03:07 PM

Take your time, I've enjoyed your ideas in the past and I'm sure time will just fly by!

Actually, I'd prefer it to be just moderators and administrators only (and that way I can just add it to the admin options).

Thanks!

Chris M 07-22-2002 08:49 PM

Sounds good!

Will check back...

Satan

Logician 07-23-2002 11:58 AM

As I promised:

This version of hack does not display the thread subscribers while you read the thread. Instead it displays a link "Display Thread Subscribers" next to "Subscribe to This Thread" and when you click it, a new window opens and display your thread's subscribers.

By default this link will be visible to Admins, S.Mods and Mods only but if you want to see it other members too, holler and I'll give you the code you need to change. (Please notice original hack displays the thread subscribers in the screen where you read the thread AND to all thread viewers)

Ps. I appreciate if someone who applied this version post a screenshot, thx..

Me2Be 07-23-2002 03:45 PM

Logician,

Thank you my friend!

todd.o.callen 12-20-2002 11:59 AM

Can you code this for forums?

This is extraordinarily useful for our corporation, and we will probably install it on all of our vB installs.

Kars10 03-07-2003 08:32 AM

Cool, installed! :)
Thanks Logician

todd.o.callen 03-10-2003 12:01 PM

Quote:

Originally posted by todd.o.callen
Can you code this for forums?

This is extraordinarily useful for our corporation, and we will probably install it on all of our vB installs.

I haven't heard back on this. Is it still a possibility? Is it in vB3?

mashby 03-11-2003 01:47 PM

This is just a great hack. I just re-installed it on my 2.3.0 board and it's working like a charm.

Any chance of adding this feature to Forums as well and not just to threads? :cross-eyed:


All times are GMT. The time now is 01:18 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.01480 seconds
  • Memory Usage 1,814KB
  • 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
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (25)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete