Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Add "S" icon next to Subscribed Threads w/link to view all subscriptions Details »»
Add "S" icon next to Subscribed Threads w/link to view all subscriptions
Version: 1.00, by mvigod mvigod is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-01-2002 Last Update: Never Installs: 19
 
No support by the author.

This is my first "released" hack so I can give something back for all the cool hacks I found here.

This one is fairly simple. What it does is put a small icon next to the title in any thread that the user has subscribed to.
The small icon is a clickable link which will take the user to a page where they can view all of their subscriptions.

This requires modifying forumdisplay.php and one template file "forumdisplaybit".
Also you must upload the image icon file to your images directory.

First let's modify the forumdisplay.php file:

Find:

PHP Code:
    eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";"); 
And above it put:

PHP Code:
//Subscribed thread with S icon hack begin
$show_subscribed=''// empty variable out for each pass in while loop
$s_iconhack_userid=$bbuserinfo['userid'];
$check_user_subscribed=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE threadid=$thread[threadid] AND userid='$s_iconhack_userid' LIMIT 1");
$subscribed_id=$check_user_subscribed[subscribethreadid];
if (
$subscribed_id>0)

$show_subscribed=" <a href=\"member2.php?s=$session[sessionhash]&action=viewsubscription&daysprune=1000\"><img src=\"images/subscribed-icon.gif\" align=\"middle\" width=15 height=15 border=0 alt=\"You are subscribed to this thread. Click to view all subscriptions\"></A> ";

//Subscribed Icon Hack End 

Now go into the admin cp and change the template forumdisplaybit as follows:

Find:

PHP Code:
    <td bgcolor="#13486D" align="left" width="70%"><normalfont>$thread[gotonew$paperclip$thread[movedprefix]$thread[typeprefix]<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a></normalfont> <smallfont>$thread[pagenav]</smallfont></td
Change this to:

PHP Code:
    <td bgcolor="#13486D" align="left" width="70%"><normalfont>$thread[gotonew$paperclip$thread[movedprefix]$thread[typeprefix]<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a></normalfont>$show_subscribed <smallfont>$thread[pagenav]</smallfont></td
Then upload the icon below to your image directory and that's it!

I'll try to upload a demo page in a minute or so.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-02-2002, 07:50 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is a Screenshot:
Reply With Quote
  #3  
Old 03-02-2002, 08:24 PM
Floris Floris is offline
 
Join Date: Jan 2002
Posts: 1,898
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey
that idea is really good!!
Thank you for working it out to a full hack very nice!
I am not sure if I am going to implement it to my forum, but sure will give it a try on my beta version
Reply With Quote
  #4  
Old 03-02-2002, 10:09 PM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didn't seem to work for me. Followed the instructions and installed ok, no technical problems or errors showing, just the small icon and link don't show next to the thread.
Reply With Quote
  #5  
Old 03-02-2002, 10:43 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AndyTSJ - Are the threads you are looking at ones you are sure you have yourself subscribed to? It will only show on those threads so if a page has threads but none are subscribed it will not show.
Reply With Quote
  #6  
Old 03-02-2002, 10:50 PM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, and I deliberately suscribed to a thread to test it and no luck The code is all in as you posted it in your instructions so I can't figure out why it won't work.
Reply With Quote
  #7  
Old 03-02-2002, 11:09 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you put the code above the line?

PHP Code:
eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";"); 
If it's after it then it won't work.

Also is the variable in the "forumdisplaybit" template and the icon in your image directory?

I tested this on 2.2.1 but it should work in 2.2.2 and even earlier versions without problems.
Reply With Quote
  #8  
Old 03-02-2002, 11:15 PM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
  $bgclass "alt1";
    }
//Subscribed thread with S icon hack begin 
$show_subscribed=''// empty variable out for each pass in while loop 
$s_iconhack_userid=$bbuserinfo['userid']; 
$check_user_subscribed=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE threadid=$thread[threadid] AND userid='$s_iconhack_userid' LIMIT 1"); 
$subscribed_id=$check_user_subscribed[subscribethreadid]; 
if (
subscribed_id>0

$show_subscribed=" <a href=\"member2.php?s=$session[sessionhash]&action=viewsubscription&daysprune=1000\"><img src=\"images/subscribed-icon.gif\" align=\"middle\" width=15 height=15 border=0 alt=\"You are subscribed to this thread. Click to view all subscriptions\"></A> "

//Subscribed Icon Hack End
eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";");

  }
  
$DB_site->free_result($threads);

  
$pagenav getpagenav($totalthreads,"forumdisplay.php?s=$session 
yup, inserted code above the line. Also posted the $show_subscribed in the forumdisplaybit template.

Maybe there is a conflict with another hack already installed.
Reply With Quote
  #9  
Old 03-03-2002, 12:56 AM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

when you pull up the source code for the html on one of the pages which has a thread you susbscribed to does any of the code appear after the thread title on the one you subscribed to?

Your code above looks ok. Try this just to troubleshoot. Change the if statement from

if (subscribed_id>0)

to:

if (0==0)

This will guarantee a true condition. All threads should show up with an S then. Do this quickly to test it if it's on a live board and then undo it fast so all your members don't wonder what all those S's are!

If they show up then we've narrowed the problem down or if something is in the html source next to your thread. Let me know as it should be working.
Reply With Quote
  #10  
Old 03-03-2002, 04:20 AM
Gamingforce's Avatar
Gamingforce Gamingforce is offline
 
Join Date: Oct 2001
Location: New York City
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am having the same problem as well. I subscribed to some threads but the S icon does not display. I did a quick test with the if 0==0 statement and all threads displayed the S icon.
Reply With Quote
Reply

Thread Tools

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 01: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.04546 seconds
  • Memory Usage 2,314KB
  • Queries Executed 23 (?)
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
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)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
  • (9)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
  • 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