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)

Delphy 12-29-2004 11:26 PM

I just added 1 line I'd missed from the copy paste of my forumdisplay, and added table prefix stuff, thats it.

Does anybody else have a problem with my version?

lasto 12-30-2004 11:36 AM

works perfect now m8 - you even fixed the rar problem.
If a rar is the only attachement it now displays no thumb displayed pic :)

well done m8

mhobelsb 12-30-2004 04:37 PM

i second that! works great! thanks a lot

???`S?LV?R???` 12-30-2004 06:18 PM

I installed Delphy's version also, and it seems to be working right.

gkar 12-31-2004 03:51 PM

Doesn't work here, all post dissapear when I've installed the hack, it seems to be a problem with the forumdisplay.php modification. I've tried the Dechevious and the Delphy variant, but none works. Any suggestions? Best regards

lasto 12-31-2004 05:25 PM

Quote:

Originally Posted by gkar
Doesn't work here, all post dissapear when I've installed the hack, it seems to be a problem with the forumdisplay.php modification. I've tried the Dechevious and the Delphy variant, but none works. Any suggestions? Best regards

yeah redo it all again as ive tried both versions and the first worked but showed a red x when a rar was an attachment - the second one works perfect so if u got none of them to work then its down to user error m8 and you need to re-do your steps and see where u went wrong.

Delphy 12-31-2004 05:28 PM

gkar,

Make sure you start from a fresh forumdisplay when installing my version, don't start from an existing thumbnailed forumdisplay base.

Also make sure you have the updated txt file above

alkatraz 01-02-2005 08:10 AM

Great hack!

Sadie Frost : thanks for your code, worked great

alkatraz 01-02-2005 10:59 AM

Ug oh.. just noticed that the 2 forums I want this to work in are showing thumbs, but so is one forum I don't want to show thumbs in...

anyone have this problem? It's just one extra forum but it doesn't make sense. Triple checked the #'s in forumdisplay.php... using the code above for "no default post icon" but have tried enabling the icon and using the stock code and the modified code, no change..

Forum number's are 42 and 95 for the ones i WANT it to work in, and 2 for the one that I don't want thumbs to be displayed. Is there a possibility strpos is matching the #2 from 42 with the forum # 2?

PHP Code:

$displaythumbs false;
    if (
strpos("42,95"strval($forumid)) !== false)
        
$displaythumbs true


Delphy 01-02-2005 05:00 PM

alkatraz, yes thats what happening.

If you want to still use the original hack replace the code you have with:

Code:

        $displaythumbs = false;
        $forumids = array(42,95);
        if (in_array($forumid, $forumids)) {
                $displaythumbs = true;
        }

Works much better. :)

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

memobug 01-04-2005 08:19 PM

Dear Aceman,

The conditional looks like it is working well. I think rather than the repeated text you might consider an icon of some kind with an alt text that says "Only members can view thumbnails"

it would clean up the layout a lot.

Dear Dechevious,

You might want to add this behavior (broken thumbs if you are logged out) to the known behaviors list.

Regards,

Matt

Nordinho 01-04-2005 11:39 PM

Heya,

The hack works great, but I have 1 weird issue...if a new post is made, the thumbnail doesn't show up, even though it's attached, it shows the 'no thumbnail available'. If I rebuild the attachments after posting it shows up fine. If I attach a attachment to an existing post it shows up fine, without rebuilding the attachments. Any ideas??

gkar 01-05-2005 09:13 AM

Thanks aceman for the code, now it works but with a little change.
This code
PHP Code:

 // The next line after this should be:
                // while ($thread = $DB_site->fetch_array($threads)) 

I've change to this
PHP Code:

 // The next line after this should be:
                 
while ($thread $DB_site->fetch_array($threads)) 

and it works fine, don't know why, but it works.
Thanks for the hack guys.

rnmcd 01-05-2005 04:28 PM

HI. Sorry I'm a little lost...are we installing the Dechevious hack or is there one that Delphy has modded that we are using?

Thanks.

Harald_T 01-10-2005 12:17 PM

I've a little problem here, too:

The hack always displays the last attachment of a post, not the first one. Strange, isn't?

Harald_T 01-12-2005 09:46 PM

I used the code to build up a simple gallery, but changed it so, that allways five thumbs are displayed in one row. Now i'm checking how to change the templates, so i can use this hack completly as a gallery.

Lee Wilde 01-13-2005 05:40 AM

I love this hack. The thumbnails don't show up in search results, but I'm not too concerned about that.

memobug 01-13-2005 08:22 AM

Quote:

Originally Posted by Lee Wilde
I love this hack. The thumbnails don't show up in search results, but I'm not too concerned about that.

Just wondering how the thumbnails would show up in search results? Like Google Images or something?

Regards,

Matt

Harald_T 01-13-2005 11:06 AM

Has anyone an idea, how to integrate the condition $displaythumbs in postbit?

Harald_T 01-13-2005 11:21 PM

Here, that's what i've got so far. What do you think of it?
(it's a german site, but i think for showing it, it's enough, isn't it?)


http://www.scifi-fan.net/forumdispla...=60&styleid=19

memobug 01-14-2005 03:38 AM

I think it's very interesting and that you're on to something Harald. The page is too wide (too many columns) for your page layout though.

Regards,

Matt

Harald_T 01-14-2005 06:57 AM

Yup, but that's because of the size of the attachments. It's no problem to set the columns to 3 or 4 (or set the size of the attachments down).

I'm not finished yet, as i want to change the templates a little bit further.

Mostly of adding to the hack of Delphy is template work. There is only some very simple PHP-work to do.

Harald_T 01-14-2005 08:35 AM

This is, what it looks like, with size of thumbs set to 140 (see attachment).

I still trying to find out, how to change the layout for showthread-template, cause i don't have $displaythumbs in showthread.php. I need it for checking only, if i'm in the gallery or not. Any ideas (i'm not the expert in PHP i have to say).?

Harald_T 01-15-2005 01:47 PM

Found out how i had to check it. So now i can use special-templates for the gallery.

Harald_T 01-16-2005 10:25 AM

Anyone interested in making this hack into a gallery?

Delphy 01-17-2005 07:59 AM

Actually, I would :)

Harald_T 01-17-2005 09:49 AM

O.k., i'll write it down and post it later on this day.

ryancooper 01-17-2005 03:38 PM

THis hack is awesome!! thanks.

I would love to see images in the search as well and the gallery idea sounds amazing!!

Thanks for all your hard work ;)

Harald_T 01-17-2005 09:04 PM

O.k., i think, i've got it so far. :nervous:

I included all files in a zip-files, including an image for the upload-button.

This hack isn't still finished, i'm trying to find out other things to do, so be patient.

I hope you like it.

Edit: Included a screenshot, how it looks like now.

Erwin 01-17-2005 09:21 PM

Quote:

Originally Posted by Harald_T
O.k., i think, i've got it so far. :nervous:

I included all files in a zip-files, including an image for the upload-button.

This hack isn't still finished, i'm trying to find out other things to do, so be patient.

I hope you like it.

You know what - that is a fantastic idea. :)


All times are GMT. The time now is 06:17 PM.

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.02401 seconds
  • Memory Usage 1,848KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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