Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-02-2006, 11:08 PM
pastry pastry is offline
 
Join Date: Jan 2006
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Old Mod, New verison of vB -help me :(

OK heres the damn deal.
This thumbnail display code was written for an older version of vB, I need you to get it work with the new one!

Quote:

MOD: Thumbnail to be displayed in the Forum Display - For vBulletin v3.0.3

By: idolpx & dechevious (idolpx@email4life.com) - Need custom work? E-Mail Me!

Date: December 20th, 2004



Description: If a post has a photo attachment, it will be displayed on the Forum Display.

You can click on the thumbnail to bypass the post itself, and go directly to

the full sized image (if you wish).



Details: The thumbnail size is based upon your default settings in your AdminCP.

You can further resize the thumbnail for the 'universal look' with simple

'height = xx' and width = 'xx' in the template. Thats your call.



Changes: Make 1 Change to forumdisplay.php and 1 Change to template: threadbit

(The forumdisplay.php you wish to alter is in your root forums directory)



Notes: THIS IS A CUSTOM HACK - DO NOT REDISTRIBUTE IT PLEASE!





---------------------------------------------

UPLOAD THE FILE: nothumb.gif to your forums

and place it in your /forums/images/misc DIR!

---------------------------------------------





---------------------------------------------

IN FILE: forumdisplay.php FIND THE FOLLOWING:

---------------------------------------------





$threads = $DB_site->query("

SELECT $votequery $previewfield

thread.threadid, thread.title AS threadtitle, lastpost, thread.forumid, pollid, open, replycount, postusername, postuserid, thread.iconid AS threadiconid,

lastposter, thread.dateline, IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, sticky, votetotal, thread.attach

" . iif($vboptions['threadsubscribed'] AND $bbuserinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed") . "

" . iif(!$deljoin, ", NOT ISNULL(deletionlog.primaryid) AS isdeleted, deletionlog.userid AS del_userid,

deletionlog.username AS del_username, deletionlog.reason AS del_reason") . "

FROM " . TABLE_PREFIX . "thread AS thread

" . iif(!$deljoin, " LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread')") . "

" . iif($vboptions['threadsubscribed'] AND $bbuserinfo['userid'], " LEFT JOIN " . TABLE_PREFIX . "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = $bbuserinfo[userid])") . "

$previewjoin

WHERE thread.threadid IN (0$ids)

ORDER BY sticky DESC, $sqlsortfield $sqlsortorder

");





--------------------------------------------

REPLACE ALL OF THE ABOVE WITH THE FOLLOWING:

--------------------------------------------



// Start: idolpx and dechevious Thumbnail in Forum Display Hack

// CHANGE THE LINE BELOW "4,5,17" TO BE THE FORUM ID # YOU WISH THUMBS TO BE DISPLAYED IN



$displaythumbs = false;

if (strpos("4,5,17", strval($forumid)) !== false)

$displaythumbs = true;



$sql_threads = "SELECT $votequery $previewfield thread.threadid, thread.title AS threadtitle, ".

"lastpost, thread.forumid, pollid, open, replycount, postusername, postuserid, ".

"thread.iconid AS threadiconid, lastposter, thread.dateline, ".

"IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, ".

"sticky, votetotal, thread.attach ".

iif($displaythumbs == true, ", MIN(attachment.attachmentid) AS attachmentid ").

iif($vboptions['threadsubscribed'] AND $bbuserinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed ").

iif(!$deljoin, ", NOT ISNULL(deletionlog.primaryid) AS isdeleted, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason ").

"FROM " . TABLE_PREFIX . "thread AS thread ".

iif(!$deljoin, " LEFT JOIN ".TABLE_PREFIX."deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND type = 'thread') ").

iif($vboptions['threadsubscribed'] AND $bbuserinfo['userid'], " LEFT JOIN ".TABLE_PREFIX."subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = ".$bbuserinfo[userid].") ").

"$previewjoin ".

iif($displaythumbs == true, "LEFT JOIN ".TABLE_PREFIX."attachment as attachment ON(attachment.postid = thread.firstpostid) ").

"WHERE thread.threadid IN (0$ids) ".

"GROUP BY thread.threadid ".

"ORDER BY sticky DESC, $sqlsortfield $sqlsortorder";



$threads = $DB_site->query($sql_threads);



// End: idolpx and dechevious Thumbnail in Forum Display Hack





--------------------------------------------

SAVE YOUR FILE AND UPLOAD IT TO YOUR SERVER!

--------------------------------------------







--------------------------------------------

IN TEMPLATE: threadbit FIND THE FOLLOWING:

--------------------------------------------



<if condition="$show['threadicons']">

<td class="alt2">

<if condition="$show['threadicon']">

<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />

<else />

&nbsp;

</if>

</td>

</if>



--------------------------------------------

REPLACE ALL OF THE ABOVE WITH THE FOLLOWING:

--------------------------------------------



<!-- Start: idolpx and dechevious Thumbnail in Forum Display Hack - 20041220 -->

<if condition="$show['threadicons']">

<if condition="$show['threadicon']">

<td class="alt2" align="center" valign="middle">

<if condition="$displaythumbs">

<if condition="$thread['attachmentid']">

<a HREF="attachment.php?attachmentid=$thread[attachmentid]">

<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" border=0>

</a>

<else />

<img src="$stylevar[imgdir_misc]/nothumb.gif" width=75 height=56 border="0">

</if>

<else />

<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" Border="0">

</if>

</td>

</if>

</if>

<!-- End: Start: idolpx and dechevious Thumbnail in Forum Display Hack - 20041220 -->



--------------------------------------------

SAVE YOUR TEMPLATE -- YOUR HACK IS INSTALLED

--------------------------------------------





Enjoy it - Your all set! - Need more custom work? Contact me for Fast & Reliable Service!
That's the insallation instructions, except while editing forumdisplay.php ....it's different

wtf eh ? So can you like...compair and make a new version of this for 3.5.4 ?

Thanks hunny buns.

oh. Heres the NEW code that 3.4.5 has that you need to change to work with this thumbnail system:

PHP Code:
$threads $db->query_read("
        SELECT 
$votequery $previewfield
thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, replycount, postusername, postuserid, thread.iconid AS threadiconid,
$lastpost_info, thread.dateline, IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, sticky, votetotal, thread.attach,
            hiddencount
iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed") . "
iif($deljoin", deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason")
iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], ', threadread.readtime AS threadread') . "
            
$hook_query_fields
        FROM " 
TABLE_PREFIX "thread AS thread
            
$deljoin
iif($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " TABLE_PREFIX "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " $vbulletin->userinfo['userid'] . " AND canview = 1)") . "
iif($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'], " LEFT JOIN " TABLE_PREFIX "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " $vbulletin->userinfo['userid'] . ")") . "
            
$previewjoin
            
$tachyjoin
            
$hook_query_joins
        WHERE thread.threadid IN (0
$ids$hook_query_where
        ORDER BY sticky DESC, 
$sqlsortfield $sqlsortorder
    "
); 
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 06:14 PM.


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.06722 seconds
  • Memory Usage 2,203KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete