vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBgarage (https://vborg.vbsupport.ru/forumdisplay.php?f=104)
-   -   REQUEST: Random Photo in garage list to replace member ID number! (https://vborg.vbsupport.ru/showthread.php?t=76516)

Rick Sample 02-17-2005 06:30 PM

REQUEST: Random Photo in garage list to replace member ID number!
 
I've mentioned it in someone elses thread and other people have mentioned it in the garage threads themselves, but I don't think anyone has created a thread about it!

Anywase, my garage is growing pretty fast and litterally a ton of users have PM'd me on my forums asking for a random picture to replace the user id number on the left of their garage and if they don't have any photos uploaded, to have a "picture pending" type photo to appear. Having a huge list of usernames, just doesn't cut it if you know what I mean when your forums get so big because users don't have time to click every one, they want a quick and easy way to 'quick preview' so they can click on only the garages that appeal to them!

This is not a service request by all means, but if someone could develop such an add-on to the garage, I would be willing to give you a 1 month advertising package to my site that receives an average of 2500 uniques per day! Just a little something to show my appritiation, thats all :) I'm sure everyone that uses the garage will thank you because this subject has been brought up many many times in a ton of threads!

noppid 02-17-2005 08:58 PM

For what version of vBGarage are you requesting this?

I'm not even sure I understand you correctly, however what you are asking is probably doable despite me not understanding the explaination.

Rick Sample 02-17-2005 09:03 PM

1 Attachment(s)
Quote:

Originally Posted by noppid
For what version of vBGarage are you requesting this?

I'm not even sure I understand you correctly, however what you are asking is probably doable despite me not understanding the explaination.

4.1.0

In short, in the garage list it goes: member number, username, car, and last activity

Just replace the member number with a random or fixed photo from the members garage. If the member doesn't have a photo, make it show a fixed "image pending" photo!

Action N used to have this on his release over at his site, but he took that option down for some reason! :) I've just been getting a HUGE request for this over at my forums from all members. One member mentions it to someone, the next thing you know, the whole board is PMing you lol

If it helps any, here is a quick photochop of what I mean :) Just have every garage have a random photo from that garage and the garages with no photos will get a different image saying no photo avail

Rick Sample 02-19-2005 06:01 PM

Do I have any takers??? :) I'm sure its a very simple hack, I have limmited knowledge of PHP though, so I wouldn't even know where to begin with something of this size :)

BamaStangGuy 02-20-2005 04:03 AM

http://www.mustangevolution.com/forum/vbgarage.php

Like this I take it :)

Rick Sample 02-20-2005 09:04 AM

Quote:

Originally Posted by BrentWilson

Of course :) would you be willing to hook a brother up with a few lines of code? :) I'd be willing to hook you up with free site-wide text links or whatever else you may want :)

jayhawk785 03-04-2005 04:52 PM

It would be nice if you could share this?

Rick Sample 03-06-2005 04:07 PM

Quote:

Originally Posted by jayhawk785
It would be nice if you could share this?

I actually found someone to do this on my site in database mode, realy nice! I switched over to File mode, and now I just have red X's. Anyone wouldn't know how to take a hack like this and convert it from using the database images over to the file system??


Here is the garage code found in my vbgarage.php for the random images, if that wil help anyone thats wants to give this code a shot to tell it to pull the random pics from the file system instead of the database

PHP Code:

// START OPAQUE

if ($_REQUEST['do'] == 'randompic')
{
    
globalize($_REQUEST, array( 'id' => INT ));
    
globalize($_REQUEST, array( 'garage' => INT ));
 
    if (empty(
$id) )
    {
        eval (
print_standard_error('error_requiredfields'));
    }

    
// filesystem hack (nop)
    
if( !$vbg_use_fs )
    {
        
// get thumbnail from DB
        
$image $DB_site->query_first("
            SELECT thumb,userid FROM " 
TABLE_PREFIX ."vbgarage_images WHERE userid = $id AND id = $garage LIMIT 1
        "
);
        
        if(!
$image)
        {
            
            
$imagee $DB_site->query_first("
            SELECT thumb FROM " 
TABLE_PREFIX ."vbgarage_images WHERE name = 'noimage' LIMIT 1
            "
);

            
$thumb = @imagecreatefromstring($imagee['thumb']); 
    
            unset(
$imagee);
    
            
imagejpeg($thumb,'',75);
    
            
// clean up GD
            
imagedestroy ($thumb); 
            exit;
        }

    }    

    if( 
$vbg_use_fs )
    {
        
        
// get thumbimage name from DB
        
$image $DB_site->query_first("
            SELECT name FROM " 
TABLE_PREFIX ."vbgarage_images WHERE vbgarageid = $id LIMIT 1
        "
);
    
        if( !
$image )
        {
            eval (
print_standard_error('error_requiredfields'));
        }
        
        
// create thumb name
        
$vbg_thumb $vbg_path "t" $id ".jpg";

        
// get image from filesystem
        
if(file_exists($vbg_thumb) && filesize($vbg_thumb))
        {
            
$vbg_handle fopen($vbg_thumb'rb');
            if(
$vbg_handle)
            {
                
$image['thumb'] = fread($vbg_handlefilesize$vbg_thumb ));
                @
fclose($vbg_handle);
            }
        }
        else
        {
            
// need image error message here
            
echo "Bad Thumb File!";
            exit;    
        }

    }
    
// end filesystem hack

    
    // use GD to display image
    
$thumb = @imagecreatefromstring($image['thumb']); 
    
    if( !
$thumb )
    {
        
// need bad image create message here
        
echo "Unable to create thumb!";
        exit;    
    }
    
    unset(
$image);
    
    
imagejpeg($thumb,'',75);
    
    
// clean up GD
    
imagedestroy ($thumb); 
}

// END OPAQUE 


noppid 03-06-2005 05:34 PM

I didn't take this on because I was not publishing a hack that does 20 calls for thumbnails to vbgarage.php. To do this properly, there needs to be a significant change in the code IMO.


All times are GMT. The time now is 06:09 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.01500 seconds
  • Memory Usage 1,764KB
  • 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
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete