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)

GeoffE 03-20-2005 06:05 PM

Quote:

Originally Posted by Delphy
You dont have post icons enabled :) Thats why the thumbnails aren't showing up

Posticons were definitely turned on .. I think I must have changed something with another hack. In the end we decided to go the whole hog and went for the VBA Gallery package but cheers for your help anyway :)

Siouxfire 03-21-2005 12:38 AM

Ahem, excuse me... :speechless:

mathias 03-23-2005 04:22 AM

how do I turn post icons on?

mathias 03-23-2005 04:32 AM

got it to work pretty sweet thanks my cd cover section is going to love it

the123d 03-31-2005 02:13 PM

Hi

I've installed the "Thumnail in forumdisplay" hack By dechevious but would like to make it work differently.

I want to be able to show image attachments inline !! In order to show images inline, normally the "enable thumbnails" needs to be set to "no" in the "message attachment options". Problem is, if you turn thumbnails off you can't create thumnails for the forumdisplay.php page ? (and thus un-doing the whole point of this hack) Is their a way to modify the hack to get this to work ?

If anybody's familiar with this hack - Any tips or ideas would be welcome ?

memobug 04-04-2005 06:05 AM

Quote:

Originally Posted by mathias
how do I turn post icons on?

1. I think it's a forum option in the admincp - look under forums/moderators, however I have it active and the post icons show fine, but the thumbs weren't showing at all. I had to remove the second conditional
Quote:

<if condition="$show['threadicon']">
from the template to see anything at all in the way of thumbnails

2. I am a little confused by the way the template is set up. It seems to be showing thumbnails only if there is a post icon in that thread.

3 If there is no thumb, wouldn't it make more sense to show the post icon, if there is one, instead of that NO THUMBNAIL picture?

Regards,

Matt

Delphy 04-04-2005 08:30 AM

memobug,

2. That is correct. It only shows them if post icons are enabled.

3. Replacing no thumbs with the standard post icon would look *very* strange in terms of rendering - you'd have thumbnails interspersed with very small post icons, and it generally would look horrible.

Hope this helps

memobug 04-04-2005 07:28 PM

Quote:

Originally Posted by Delphy
memobug,

2. That is correct. It only shows them if post icons are enabled.

3. Replacing no thumbs with the standard post icon would look *very* strange in terms of rendering - you'd have thumbnails interspersed with very small post icons, and it generally would look horrible.

Hope this helps

Hi Delphy
2. Actually what I meant is that I only get thumbnails if there is a post icon in that thread, not that post icons have to be enabled (although that is true, too, it is not a problem.). I am probably confused but it wasn't working at all with the provided template:

There are two nested ifs in that template,
Quote:

<if condition="$show['threadicons']">
<if condition="$show['threadicon']">
I guess the first is to see whether post icons are enabled. The second if seems to check to see if there is a post icon for some reason? That one is my problem.

3. On mixing thumbs and post icons. I am sure it is a matter of taste, but I find it doesn't look strange at all if you adjust the row height accordingly. I use <td height="100"> if there is a thumbnail and <td height="25"> if there is not (whether there is a post icon or not) it looks fine.

I am confused why anyone would want a row of thumbnails advertising that there is no thumbnail, which seems to be rather obvious if no thumbnail is printed! Also, advertising "Nothing to see here!" with the non-thumbnail thumbnail pads out the row height excessively.

Regards,

Matt

Delphy 04-06-2005 12:32 PM

memobug,

If I recall I changed something with regards to those nested ifs, but I can't remember what am I'm waiting for one of my dedicated boxes to come back up so I can see :)

With regards to the showing post icon if no thumbnail, now that you've explained it in that way, it makes perfect sense and would be very useful for stickies in otherwise thumbnail enabled forums. :) I might implement this myself on MTS2.

Regards
Delphy

Delphy 04-16-2005 07:30 PM

Just as an update - I've re-coded some parts of my version of this hack to allow per-forum thumbnail views configurable via the Admin CP, as well as showing thumbnails in the search/new posts display.

If anybody would be interested, I can provide an update.

memobug 04-16-2005 09:04 PM

Hi Delphy,

What you're suggesting sounds interesting. I would be interested in seeing it. What I did, to enable USERS to chose the thumbnail option or not is to create a copy of the style with thumbnails turned on. That way the user can make the selection.

People on broadband really like it. The ones on dialup sometimes prefer not to load extra images. So I think it's a feature that might best be in the hands of the user rather than the admin. However, one thing I could really use would be the capability to show fewer threads per page if its a thumbnail view, and more threads per page in nothumbs. That would help to normalize the scrolling and load time.

Regards,

Matt

Delphy 04-17-2005 10:50 AM

memobug,

What I did was set a limit of 10 threads if viewing thumbnails, or the normal 25 if viewing forums without thumbnails.

I agree with you on the user selectable thumbnails though - especially in the New Posts search screen. I hadn't considered a style becuase it would still do the mySQL queries to get the attachment ids even if it's not showing the thumbnails, unless you hardcoded the styleid into the php and checked against that.

To change the number of threads on a forum that has thumbnails:

Edit forumdisplay.php
Find the section where you define forumids
Code:

        $forumids = array(41, 43, 44, 45, 46, 47, 48, 49, 69, 70, 40, 50, 51, 52, 97, 98);
        if (in_array($forumid, $forumids)) {
                $displaythumbs = true;

BELOW this add:

Code:

                $perpage = 10;
Thats it. :) You could add this as a vBulletin option too.

sicloan 04-19-2005 11:26 PM

Quote:

Originally Posted by Delphy
To change the number of threads on a forum that has thumbnails:

Edit forumdisplay.php
Find the section where you define forumids
Code:

        $forumids = array(41, 43, 44, 45, 46, 47, 48, 49, 69, 70, 40, 50, 51, 52, 97, 98);
        if (in_array($forumid, $forumids)) {
                $displaythumbs = true;

BELOW this add:

Code:

                $perpage = 10;
Thats it. :) You could add this as a vBulletin option too.

this worked if you changed the page. But not if you view a forum by itself.

Bent Concepts 04-21-2005 05:16 PM

this is really a great hack -- but i'd love to know how to do it in the search results also. my php knowledge is fairly minimal -- any ideas?

Delphy 04-22-2005 08:46 AM

sicloan, works fine here. Might be becuase of some small other changes I made.

Bent, you need to alter search.php

Find:
Code:

        // #############################################################################
        // show results as threads
        else
        {
                $show['threadicons'] = true;
                $show['forumlink'] = true;

                foreach ($itemids AS $thread)
                {
                        // add highlight words
                        $thread['highlight'] = &$highlightwords;

                        // get info from thread
                        $thread = process_thread_array($thread, $lastread["$thread[forumid]"]);

(Should be around line 2518)

AFTER this add:

Code:

                        // Delphy's Search Thumbnail Hack
                        $thread[attachmentid] = "";
        $forumids = array(1, 2, 3);
        if (in_array($thread[forumid], $forumids)) {
                                        $displaythumbs = true;
                                        $sql_images = "SELECT DISTINCT postid,attachmentid FROM " . TABLE_PREFIX ."attachment WHERE postid IN (0$thread[firstpostid]) AND thumbnail_dateline > 0";
                                        $images = $DB_site->query($sql_images);
                                        while ($image = $DB_site->fetch_array($images)) {
                                                $thread[attachmentid] = $image[attachmentid];
                                        }
                                        $DB_site->free_result($images);
                                        unset($image);
                                }

Replace 1,2,3 with the forum ids similar to the way you did in forumdisplay.php

Bent Concepts 04-22-2005 03:40 PM

thanks a million -- that's really great stuff there. it seems to work, but unfortunately it's only displaying the nothumb.gif image -- as if there was no image in the thread (even though there is)

other thing is that that codeblock was around 1200 something, not 2518 -- must be installed mods on your search.php or something

my codeblock in search.php looks like this:

PHP Code:

// #############################################################################
    // show results as threads
    
else
    {
        
$show['threadicons'] = true;
        
$show['forumlink'] = true;
 
        foreach (
$itemids AS $thread)
        {
            
// add highlight words
            
$thread['highlight'] = &$highlightwords;
 
            
// get info from thread
            
$thread process_thread_array($thread$lastread["$thread[forumid]"]);
 
// Delphy's Search Thumbnail Hack
$thread[attachmentid] = "";
$forumids = array(1,2,3,4,5,6,7,);
if (
in_array($thread[forumid], $forumids)) {
$displaythumbs true;
$sql_images "SELECT DISTINCT postid,attachmentid FROM " TABLE_PREFIX ."attachment WHERE postid IN (0$thread[firstpostid]) AND thumbnail_dateline > 0";
$images $DB_site->query($sql_images);
while (
$image $DB_site->fetch_array($images)) {
$thread[attachmentid] = $image[attachmentid];
}
$DB_site->free_result($images);
unset(
$image);
}
 
            
$itemcount++;
            
exec_switch_bg();
            eval(
'$searchbits .= "' fetch_template('threadbit') . '";');
        }
    }
    
// ############################################################################# 


skokarl 04-23-2005 06:54 AM

I have installed, but i can't see anything.

Must I change something in the admin cp ?

Delphy 04-25-2005 01:21 PM

skokari,

did you change the forum ids to the same ones you want thumbnails to appear in?

bent concepts,

hrm I haven't modified search.php that much at all... so it's weird that yours is on a different line. What version you running? 3.0.7 here

Bent Concepts 04-26-2005 07:36 PM

I'm running 3.07 also.

i hadn't changed it at all from the base unmodified version. what it's doing is displaying the "no thumb" image for all the items in the search.

is that code change the only thing that needs to be done in search.php? is there a specific version of this hack that needs to be used in order to get the search to work? i just changed the hack code i was using to the December 20th, 2004 version.

thanks

Delphy 04-28-2005 06:12 PM

Hrm

It might be your $forumids = array(1,2,3,4,5,6,7,); line. Try taking out the last , in that.

What I found handy when developing the hack was doing this:
Code:

if ($bbuserinfo[userid] == 1) {
  echo "<pre>".print_r($thread, true)."</pre>";
}

Replace 1 with your userid. What this will do is *just* for you, print out ALL the information it's got in your browser window. You can then see what the values are for the $thread[attachmentid] etc

Obviously turn it off before you go live :)

Bent Concepts 05-03-2005 11:02 PM

one thing about that search.php modification -- it's retrieving the second thumbnail in each post -- how do i make it grab the first instead?

ThomasR 05-22-2005 08:39 PM

Is thier a way to display the last attachement of the thread and not the first one ? I will use this mod for a Work in progress section of my forum, then, the last one is more usefull !
Another request: is it possible to display the attachement in full size and not only in thumbnail with this hack?
BTW, thank you very much for this great hack!

Delphy 05-23-2005 07:32 AM

Thomas,

The default will return the last image already.

Also, showing the full size image would severly break your templates, so it's not recommended at all - imagine browsing a forum with a bunch of 1024x768 pictures on the forumdisplay... not a pretty sight :)

memobug 05-23-2005 05:27 PM

Quote:

Originally Posted by Delphy
Thomas,

The default will return the last image already.

Also, showing the full size image would severly break your templates, so it's not recommended at all - imagine browsing a forum with a bunch of 1024x768 pictures on the forumdisplay... not a pretty sight :)

Really? I get an image from the first post in the thread, and only the first post.

Regards,

Matt

Delphy 05-24-2005 07:19 AM

memobug,

Thats correct, I think I misunderstood the question. What I meant to say was that, if given multiple attachments in the first post of a thread, it'll return the last of them. It wont scan anything other than the first post (this would actually be fairly database intensive as it would have to go through every post looking for the last attachment. Well, not *every* one, but probably a fair few.

Regards,
Delphy

vktechnology 06-01-2005 06:24 PM

This is the best..

Very cool hack,, this is in my dream
I like this more than photopost.com system..

it's looke samilar to
www.webshots.com

http://community.webshots.com/topics...69_views_0.htm

--------------
should add more feature something like
admin can add thumbnail for category.

Delphy 06-02-2005 11:03 AM

Not sure what you mean by "thumbnail for category"?

vktechnology 06-02-2005 01:24 PM

Quote:

Originally Posted by Delphy
Not sure what you mean by "thumbnail for category"?

it mean can show smallt image in to category

Delphy 06-03-2005 08:12 AM

You mean for sub-forums?

vktechnology 06-03-2005 09:59 PM

Quote:

Originally Posted by Delphy
You mean for sub-forums?

yes for sub-forums

ThomasR 06-06-2005 12:31 PM

Ok, thank you for your answer Delphy. Damn, I hope for your first answer, I'll have to learn all users to update their first post ;)
By the way, thank you for the hack!

alkatraz 06-28-2005 04:21 AM

one of my FAVOURITE hacks of all time!

will we be seeing this for vb 3.5? please say yes!!

ThomasR 07-05-2005 11:49 AM

Oups, I think we missunderstood ;)

I would say that I like to have the thumbnail version of my attached image in my forumdisplay like you hack do, and have in full size, this image in the threadbit. in fact, use the thumbnail only for the preview you hack do.

If you take a look at CGTalk.com (http://www.cgtalk.com/forumdisplay.php?f=132) this is what it does (and what I want ;)

By th way, thank you for this great hack ;)

Quote:

Originally Posted by Delphy
Thomas,

The default will return the last image already.

Also, showing the full size image would severly break your templates, so it's not recommended at all - imagine browsing a forum with a bunch of 1024x768 pictures on the forumdisplay... not a pretty sight :)


Harald_T 07-18-2005 04:05 PM

I've coded this hack to 3.5.

Anyone still interested in it? I used it again to make a gallery for my forum (what else? ;) ) and this time i used the original hack from dechevious.

Take a look at it:

http://www.scifi-fan.net

mhobelsb 07-18-2005 04:08 PM

wohoooo... already wanted to ask if it would be possible to do it. i would love to if i can use it after the upgrade to 3.5! thank you sooooo much for the work and that you share it with the community!

Martin

Harald_T 07-20-2005 03:55 PM

I'll post it later on this evening.

GrendelKhan{TSU 07-25-2005 04:32 PM

Quote:

Originally Posted by Harald_T
I've coded this hack to 3.5.

Anyone still interested in it? I used it again to make a gallery for my forum (what else? ;) ) and this time i used the original hack from dechevious.

Take a look at it:

http://www.scifi-fan.net


abso-freakin-lutely!! great job integrating it. on your site too.

btw, do I need a photo program (eg: vbgallery) installed first for this to work?

Harald_T 07-25-2005 04:41 PM

I've written the hack further on to a gallery-hack, so you don't need any extra gallery for this. Parts of your forum will act like a gallery. I'm busy on writing the install-text for my gallery-hack for vB 3.5. I'll try to post it this evening.

shardex 08-16-2005 01:38 AM

where is this hack coded for 3.5? That would be awesome, I am having trouble with converting the PHP part in forumdisplay.

bleodler 08-16-2005 03:02 AM

Quote:

Originally Posted by shardex
where is this hack coded for 3.5? That would be awesome, I am having trouble with converting the PHP part in forumdisplay.

https://vborg.vbsupport.ru/showthread.php?t=92565


All times are GMT. The time now is 11:03 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.01540 seconds
  • Memory Usage 1,859KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_php_printable
  • (12)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