Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

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
  #12  
Old 03-03-2002, 07:46 AM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same here... worked with "if 0==0", each post had an "S" .... just wished I knew a bit of php cuz this is probably a real easy thing to fix. Love the idea though, definitely not gonna give up on this one....
Reply With Quote
  #13  
Old 03-03-2002, 12:06 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK...I found the problem...in the if statement I missed the dollar sign ($) when changing over the variable names to make them easier to read

it should be:
PHP Code:
if ($subscribed_id>0

Note the dollar sign before "subscribed_id" now...before it didn't have it on the original post so it never satisfied the condition.

I'll fix the original post so it's updated too.

LMK if it works now...must have been a long day when I missed that one
Reply With Quote
  #14  
Old 03-03-2002, 12:28 PM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default



Works Thanks man ! Cool hack.
Reply With Quote
  #15  
Old 03-03-2002, 12:45 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AndyTSJ - Looks like you have a border around the icon there....in the image tag make sure you have "border=0" so it shows up as a round circle unless you wanted it that way with the border for some reason. The original code above does in fact already have the "border=0" reference within the image tag.
Reply With Quote
  #16  
Old 03-03-2002, 12:58 PM
AndyTSJ AndyTSJ is offline
 
Join Date: Feb 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, just the way I did my graphic as opposed to being a border around the image.
Reply With Quote
  #17  
Old 03-03-2002, 01:00 PM
Tim Wheatley's Avatar
Tim Wheatley Tim Wheatley is offline
 
Join Date: Nov 2001
Location: England
Posts: 489
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I modified it to show text instead of an icon, but it works like a dream -- thanks!
Reply With Quote
  #18  
Old 03-03-2002, 01:13 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had text originally for this hack too actually but liked the icon look for my site...images convey meaning to the brain faster than reading which is why I changed over to the icon.

If any user wants to substitute text for the icon just replace the <img> tag code with the text they want to see instead.

So if you prefer to use text instead of small "S" icon just replace the piece below from the original code with whatever text you want (i.e. subscribed):

PHP Code:
<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\"> 
Reply With Quote
  #19  
Old 03-10-2002, 05:15 AM
Warez Warez is offline
 
Join Date: Oct 2001
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm. even with the $ in front, nothing shows up .
Reply With Quote
  #20  
Old 03-10-2002, 02:04 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

make sure you are looking at a forum which has a thread that you are definitely subscribed to or you won't see the "S". Also be sure you uploaded the small S image to your images folder. Let me know if this works.
Reply With Quote
  #21  
Old 03-12-2002, 11:56 AM
GK_ng GK_ng is offline
 
Join Date: Nov 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

as this Hack added a bunch of Queries, I did a redesign of this genious hack:

find:
Code:
SELECT $dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
	thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postuserid,
	lastposter,thread.dateline,views,thread.iconid,notes,thread.visible,sticky,votetotal,attach
	FROM thread
	".iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
	$dotjoin
	WHERE $threadids
	ORDER BY sticky DESC, $sortfield $sqlsortorder
	");
replace it with
Code:
SELECT $dotuserid $votequery ".iif($foruminfo[allowicons],'icon.title as icontitle,icon.iconpath,','')."
	thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postuserid,
	lastposter,thread.dateline,views,thread.iconid,notes,thread.visible,sticky,votetotal,attach,subscribethread.subscribethreadid AS subscribed
	FROM thread
	LEFT JOIN subscribethread 
	  ON (subscribethread.threadid=thread.threadid AND subscribethread.userid='".$bbuserinfo['userid']."')
	".iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
	$dotjoin
	WHERE $threadids
	ORDER BY sticky DESC, $sortfield $sqlsortorder
	");
and then find:
PHP Code:
    eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";"); 
and place ABOVE ist:
PHP Code:
//Subscribed thread with S icon hack begin
if ($thread[subscribed]) { 
  
$thread[title]="<i>".$thread[title]."</i>";
}
//Subscribed Icon Hack End 

Instead of
Code:
$thread[title]="<i>".$thread[title]."</i>";
you can place whatever you want to do, like
Code:
$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> ";
etc pp..


Full Credits to mvigod for the idea and the first release of this hack ...
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 12:41 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.09117 seconds
  • Memory Usage 2,331KB
  • Queries Executed 25 (?)
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
  • (4)bbcode_code
  • (8)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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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