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)
-   -   vB3 Member Album 2.0 (https://vborg.vbsupport.ru/showthread.php?t=63733)

Slynderdale 08-28-2004 10:58 AM

In vBulletin 3.0.3 the thumbnail code changed a bit so invalid thumbnails were made.

If you already installed this hack and Weasel's update:
( Weasles update can be found here: https://vborg.vbsupport.ru/showpost....&postcount=281 )
In the file path/to/forums/includes/functions_upload.php, find
PHP Code:

      if ($thumbnail)
       {        
         
$image['update'] = ", thumbnaildata = '"$DB_site->escape_string($thumbnail)."'";
           
$image['insert'] = "'".$DB_site->escape_string($thumbnail)."',"

Replace that with:
PHP Code:

      if ($thumbnail)
       {        
           
$image['update'] = ", thumbnaildata = '$thumbnail'";
           
$image['insert'] = "'$thumbnail',"

and then in admincp/albumcp.php find:
PHP Code:

         $DB_site->query("
             UPDATE " 
TABLE_PREFIX "customprofilepic
             SET thumbnaildata = '" 
$DB_site->escape_string($thumbnail) . "' 
             WHERE picture_id = 
$image[picture_id]
         "
); 

and replace it with:
PHP Code:

         $DB_site->query("
             UPDATE " 
TABLE_PREFIX "customprofilepic
             SET thumbnaildata = '
$thumbnail
             WHERE picture_id = 
$image[picture_id]
         "
); 


indiamike 08-28-2004 12:53 PM

THANK YOU Slynderdale!!

Fixes applied and it works.

Thank you, thank you, thank you. :) :) :)

http://www.indiamike.com/india/album.php

For those applying these changes make sure that you empty your browsers cache or you may not see the results immediately.

Thank you again it works dammit....it works :)

Mike

Onkel_Tom 08-28-2004 02:02 PM

Many thanks to Slynderdale !
your fix has done it ;)

Ted S 08-28-2004 05:07 PM

Awesome! Out of 1100 photos atleast 85% built properly with this new code which is a lot better than 0%!!! Hopefully the hack creator can include this all in an update along with some system to have multiple pages in the acp for verrifying photos. Thanks!

Zelda-King 08-29-2004 11:12 AM

Just a note to say the posts I'd made about not seeing other's profile pics' are void now I've discovered what was going on and it had nothing to do with this hack.

Slynderdale 08-29-2004 01:10 PM

Working out a couple bugs if you have it so attachments are saved to the file system and writing some code that lets you rebuild the album thumbnails.

Make my above fixes, that will fix images from being escapes twice. The image gets escaped already if you have it so your attachments are saved in the MySQL data base. This would cause errors with the thumbnails. The thumbnail doesn't get escaped when you save the files to the file system so this code fixes that and also fixes a small bug if theres an error with the thumbnail.


After you installed this hack and weasles fix,
find in path/to/forums/includes/functions_upload.php:
PHP Code:

      if ($type == 'profilepic')
      {
          require_once(
'./includes/functions_image.php');
          
          
$image['name'] = $upload_name;
          
$image['tmp_name'] = $filename;
          
          
$thumbnail fetch_thumbnail_from_image($image);
          
$thumbnail $thumbnail['filedata'];
  
         
// Display thumbnail error to admins in an attempt to cut down on support requests due to failed thumbnails.
         
if (!$thumbnail AND $imageerror AND $permissions['adminpermissions'] & CANCONTROLPANEL)
          {
             eval(
'$error = "' fetch_phrase($imageerrorPHRASETYPEID_ERROR) . '";');
              
$errors[] = array(
                 
'filename' => $attachment_name,
                  
'error' => $error
              
);
          }
      } 

and replace it with:
PHP Code:

    if ($type == 'profilepic')
      {
          require_once(
'./includes/functions_image.php');
  
          
$image['name'] = $upload_name;
          
$image['tmp_name'] = $filename;
  
          
$thumbnail fetch_thumbnail_from_image($image);
          
$imageerror $thumbnail['imageerror'];
      
$thumbnail $thumbnail['filedata'];
  
      if (
$vboptions['attachfile'])
      {
        
$thumbnail $DB_site->escape_string($thumbnail);
      }
  
         
// Display thumbnail error to admins in an attempt to cut down on support requests due to failed thumbnails.
         
if (!$thumbnail AND $imageerror AND $permissions['adminpermissions'] & CANCONTROLPANEL)
          {
             eval(
'$error = "' fetch_phrase($imageerrorPHRASETYPEID_ERROR) . '";');
              
$errors[] = array(
                 
'filename' => $attachment_name,
                  
'error' => $error
              
);
          }
      } 

The rebuilding of the album thumbnails code is almost done.

MissKalunji 08-29-2004 01:32 PM

Quote:

Originally Posted by Slynderdale
Working out a couple bugs if you have it so attachments are saved to the file system and writing some code that lets you rebuild the album thumbnails.

Make my above fixes, that will fix images from being escapes twice. The image gets escaped already if you have it so your attachments are saved in the MySQL data base. This would cause errors with the thumbnails. The thumbnail doesn't get escaped when you save the files to the file system so this code fixes that and also fixes a small bug if theres an error with the thumbnail.

After you installed this hack and weasles fix, find:
PHP Code:

     if ($type == 'profilepic')
     {
         require_once(
'./includes/functions_image.php');
         
         
$image['name'] = $upload_name;
         
$image['tmp_name'] = $filename;
         
         
$thumbnail fetch_thumbnail_from_image($image);
         
$thumbnail $thumbnail['filedata'];
 
         
// Display thumbnail error to admins in an attempt to cut down on support requests due to failed thumbnails.
         
if (!$thumbnail AND $imageerror AND $permissions['adminpermissions'] & CANCONTROLPANEL)
         {
             eval(
'$error = "' fetch_phrase($imageerrorPHRASETYPEID_ERROR) . '";');
             
$errors[] = array(
                 
'filename' => $attachment_name,
                 
'error' => $error
             
);
         }
     } 

and replace it with:
PHP Code:

   if ($type == 'profilepic')
     {
         require_once(
'./includes/functions_image.php');
 
         
$image['name'] = $upload_name;
         
$image['tmp_name'] = $filename;
 
         
$thumbnail fetch_thumbnail_from_image($image);
         
$imageerror $thumbnail['imageerror'];
     
$thumbnail $thumbnail['filedata'];
 
     if (
$vboptions['attachfile'])
     {
       
$thumbnail $DB_site->escape_string($thumbnail);
     }
 
         
// Display thumbnail error to admins in an attempt to cut down on support requests due to failed thumbnails.
         
if (!$thumbnail AND $imageerror AND $permissions['adminpermissions'] & CANCONTROLPANEL)
         {
             eval(
'$error = "' fetch_phrase($imageerrorPHRASETYPEID_ERROR) . '";');
             
$errors[] = array(
                 
'filename' => $attachment_name,
                 
'error' => $error
             
);
         }
     } 

The rebuilding of the album thumbnails code is almost done.


IN wich file should i replace?

Onkel_Tom 08-29-2004 01:44 PM

It's in file /includes/functions_upload.php

Slynderdale 08-29-2004 01:45 PM

Quote:

Originally Posted by MissKalunji
IN wich file should i replace?

Oops, I'll update my above fix, its:
path/to/forums/includes/functions_upload.php

Zelda-King 08-29-2004 05:46 PM

I tested the fixes. Just to confirm they seem to be running ok on 3.0.3.


All times are GMT. The time now is 10:54 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.01490 seconds
  • Memory Usage 1,797KB
  • 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
  • (8)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
  • (2)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