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 />
</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
");
|