vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Thumbnail of Attachments on forum display (https://vborg.vbsupport.ru/showthread.php?t=73220)

gkar 01-03-2005 08:13 AM

Delphy, thanks but I have the same problem, I've installed this hack:

Quote:

MOD: Modified Thumbnail In Forum Display
By: delphy@modthesims2.com

Original 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).

This hack modifies the original Thumbnail In Forum Display to accomodate threads
where the first attachment is not an image file. It does this by compiling a list
of posts, querying the attachment table and selecting the *last* image file

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 changes to forumdisplay.php and 1 Change to template: threadbit
(The forumdisplay.php you wish to alter is in your root forums directory)

Notes: This adds 1 extra query to your forumdisplay page
Thanks: To idolpx and dechevious for the original hack
all in a fresh forumdisplay.php but when I go to the post, everyone has dissapear, in all forums. Take a look at the attachment, there you can view everything has gone away, and there are 96 pages of post, no one of then are visible, any help would be great. Thanks a lot.

Aceman 01-03-2005 02:31 PM

I have this hack fully functional on my site which you can see running here.

http://www.scifi-meshes.com/forums/forumdisplay.php?f=6

Using conditionals I was able to add "ads" column in specific forums, that's not part of this hack. I've also modified this code so that the image shown on forumdisplay links to the thread NOT the attachment. I found this more useful.

Below you will find a copy of code I used to link to THREAD and not the attachment - threadbit template:

Code:

<a HREF="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]"><img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" border=0></a>
Hope this helps someone.
Aceman

alkatraz 01-03-2005 10:45 PM

Delphy: works perfect! thanks!!!

Is there a way to strip ' and " from the title? I put up a note saying not to type those but my members can't read apparently and keep getting errors. (when the script ads the forum info to the db)

Delphy 01-04-2005 01:45 AM

alkatraz,

Do you mean when they add posts in those forums, or what? I'm sorry I don't know what you mean...

Aceman, yeah I find linking to the actual thread much better too :)

alkatraz 01-04-2005 01:59 AM

When the script creates a new thread in a forum,

PHP Code:

INSERT INTO " . TABLE_PREFIX . "thread(titlelastpostforumidopenreplycount,
                                
postusernamepostuseridlastposterdatelineiconidvisibleattach)
                                
VALUES
                                        
('$ad_type $ad_title '" . TIMENOW . "$formforumid,
                                         
10'" . addslashes($bbuserinfo['username']) . "'$bbuserinfo[userid],
                                         
'" . addslashes($bbuserinfo['username']) . "'" . TIMENOW . "01,
                                         
0)
                        
"); 

an error occurs if a member has posted a ' in the thread title.

I'd like to process $ad_title (the var. i've used for the title) to strip out ' and " or any characters that could cause a problem.

doing some research into it, the trim function might do it
http://ca.php.net/trim

Think this would remove ' ? How would I remove "?
trim($ad_title, " ' ");

Delphy 01-04-2005 02:21 AM

alkatraz,

Neither mine nor the original hack contains that code, so you're looking at a problem which isn't related to this thread.

What you probably want, btw, is $ad_title = html_entities($ad_title, ENT_QUOTES)

Hope this helps

alkatraz 01-04-2005 03:02 AM

lol wrong thread, my bad!
forgot i was dealing with this thread:
https://vborg.vbsupport.ru/showthread.php?t=66082 (which is a perfect addition to this thumbnail browsing script)

memobug 01-04-2005 06:46 AM

Quote:

Originally Posted by Aceman
I have this hack fully functional on my site which you can see running here.

http://www.scifi-meshes.com/forums/forumdisplay.php?f=6

Hi Aceman,

You might want to move the image display into a template conditional if you don't have attachments enabled for guests. Otherwise your page becomes a column of red Xs separated by the occasional THUMBNAIL NOT AVAILABLE.

(log out of your forum and check your link)

Regards,

Matt

Aceman 01-04-2005 03:44 PM

Thanks for the heads up Memobug. I'll use a if not registered conditional to remove the thumbnail column or something.. haven't figured it out yet. :)

I guess it would have helped to logout and see what the visitors see.

Aceman

Aceman 01-04-2005 04:32 PM

MemoBug -

I fixed this oversite by modifying the could to see if the member/guest is registered or not. IF they are not the message, "Only Registered Members can view thumbnails" shows, IF they ARE the thumbnail shows up. This is the code for the <TR> that I used.

This is just the code for the table cell that shows the thumbnail.
Code:

<td class="alt2" align="center" valign="middle">
                        <if condition="$displaythumbs">
                            <if condition="$thread['attachmentid']">
                                        <if condition="$bbuserinfo[userid] == 0">
                                                        <span class="smallfont"><b>Only Registered Members can view thumbnails.</b></span>
                                                <else />
                                                    <a HREF="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">       
                                                          <img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" border=0>
                                                </a>
                                                </if>
                            <else />
                                <img src="$stylevar[imgdir_misc]/nothumb.gif" width=100 height=75 border="0">
                            </if>
                        <else />
                            <img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" Border="0">
                        </if>
                </td>

I hope this helps people.
Aceman


All times are GMT. The time now is 12:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01397 seconds
  • Memory Usage 1,765KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete