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
  #22  
Old 03-12-2002, 12:22 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

GK-ng,

Good update. I'll test it out and then update to my original if ok w/you. I had tried the single database query similar to how you had it but missed a parameter I think on my "ON" clause which resulted in single threads showing up multiple times in a row on a page as my database query was not correct. Because of this I went the other route of a seperate query.

If your board is not heavily loaded you are just as well off with either version but if your board is more heavily loaded it's wise to save the query as you point out. I fall into the heavy traffic board so I'll be testing out the query and see if I can remember exactly why I couldn't get it just right back then. Thanks for helping out
Reply With Quote
  #23  
Old 03-12-2002, 01:07 PM
GK_ng GK_ng is offline
 
Join Date: Nov 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by mvigod
Good update. I'll update my original if ok w/you.
Thanks

And surely not a problem from my side.
Reply With Quote
  #24  
Old 04-19-2002, 01:58 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by mvigod
GK-ng,

Good update. I'll test it out and then update to my original if ok w/you. I had tried the single database query similar to how you had it but missed a parameter I think on my "ON" clause which resulted in single threads showing up multiple times in a row on a page as my database query was not correct. Because of this I went the other route of a seperate query.
[...]
Hi. Great hack even the variation.
Do you plan to update the original instructions, so long ?
Thanks
Reply With Quote
  #25  
Old 04-19-2002, 02:13 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by GK_ng
as this Hack added a bunch of Queries, I did a redesign of this genious hack:

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
	");
Full Credits to mvigod for the idea and the first release of this hack ...
Excuse me, GK_ng...
Just something.
Are you sure if inserting such a LEFT JOIN between
thread and subscribethread tables,
the later LEFT JOIN with the icon table
would be run correctly ?

I'm just thinking... what about you ?

Thanks
Reply With Quote
  #26  
Old 04-19-2002, 03:57 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually I think I tried the changes Gk-ng made and got an error so I had to change the query...I'll go back and see what I finally ended up with and repost the variation...my original is easiest for a lower volume board and if you really need to optimize by saving a query then the other version I'll post will work...have to go run through the changes I made now...
Reply With Quote
  #27  
Old 04-19-2002, 04:13 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.
Hwr. I made it worked simply by moving the
LEFT JOIN subscribethread ON .... just before the WHERE clause.
This way, the entire table BEFORE is left joint with the subscribethread....

Now it works fine... without adding any query to the page (verified by the Nakkid's Hack...)

Thanks again
Reply With Quote
  #28  
Old 04-19-2002, 04:48 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the alternate form of this hack which will save the query which can be used. Either one will work fine but for those concerned about queries you may certainly wish to use this variation.

In forumdisplay.php

ADD THIS:

PHP Code:
//Subscribed hack begin
unset($show_subscribed); // empty variable out
if ($thread[subscribed])
{
$show_subscribed=" <a href=\"member2.php?s=$session[sessionhash]&action=viewsubscription&daysprune=1000\"><img
 src=\"http://www.yourdomain.com/images/subscribed-icon.gif\" align=\"middle\" width=15 height=15 border=0 a
lt=\"You are subscribed to this thread. Click to view all subscriptions\"></A> "
;
}
//Subscribed Hack End 

BEFORE THIS:

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

Next again in forumdisplay.php


Find:

PHP Code:
$threads=$DB_site->query("
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
    "
); 


Change to:

PHP Code:
$threads=$DB_site->query("
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
    "
); 

Now 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
and change 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

That's all...the users can click the "S" icon (download icon from first post) and view all their subscribed threads as well.
Reply With Quote
  #29  
Old 05-05-2002, 11:37 PM
mashby's Avatar
mashby mashby is offline
 
Join Date: Jan 2002
Location: Nashville, TN - USA
Posts: 736
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed the original version and it works like a champ. Thank you!

Any chance of getting this to work on Subscribed Forums as well?
Reply With Quote
  #30  
Old 05-06-2002, 02:45 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mashby,

I'll check into it for you once I get a little time to code it and test..should not be hard to add though.
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:08 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.04900 seconds
  • Memory Usage 2,347KB
  • Queries Executed 24 (?)
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)bbcode_code
  • (10)bbcode_php
  • (3)bbcode_quote
  • (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