vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   vBulletin Attachment Lightbox (https://vborg.vbsupport.ru/showthread.php?t=115701)

ryancooper 05-16-2006 12:35 AM

Any idea about the other error? I am still getting a bunch of undefined (undefined) errors

I hope this get fixed. THis is one of my alltime favorite hacks! :)

Barakat 05-16-2006 12:40 AM

open the includes\class_bbcode.php and find

PHP Code:

function handle_bbcode_img_match($link)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));

        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace('  '''$link);

        return 
'<img src="' .  $link '" border="0" alt="" />';
    } 

and replace it with

PHP Code:

function handle_bbcode_img_match($link)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));
        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace('  '''$link);
        if (
$NLP = @getimagesize($link))
        {
            if(
$NLP[0] > 500)
            {
                
$NLP_W $NLP[0] / 2;
                
$NLP_H $NLP[1] / 2;
                return 
'<table width="' $NLP_W '" border="0" cellspacing="0" cellpadding="0"><tr><td style="border: 1px solid #ABABAB"><a href="' .  $link '" rel="lightbox" title="picture width in its full size"><img src="' .  $link '" width="' $NLP_W '" height="' .  $NLP_H '" border="0" alt="press here to view the picture in its original size" /></a></td></tr><tr><td align=center><a href="' .  $link '" rel="lightbox" title="view the picture in its full size"><img border="0" src="images/NLP_button.gif"></a></td></tr></table>';
            }
            else
            {
                return 
'<img src="' .  $link '" border="0" alt="" />';
            }

         }
         else
         {
             return 
'<img src="' .  $link '" border="0" alt="" />';
         }
    } 


ryancooper 05-16-2006 12:57 AM

Quote:

Originally Posted by Barakat
open the includes\class_bbcode.php and find

PHP Code:

function handle_bbcode_img_match($link)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));

        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace('  '''$link);

        return 
'<img src="' .  $link '" border="0" alt="" />';
    } 

and replace it with

PHP Code:

function handle_bbcode_img_match($link)
    {
        
$link $this->strip_smilies(str_replace('\\"''"'$link));
        
// remove double spaces -- fixes issues with wordwrap
        
$link str_replace('  '''$link);
        if (
$NLP = @getimagesize($link))
        {
            if(
$NLP[0] > 500)
            {
                
$NLP_W $NLP[0] / 2;
                
$NLP_H $NLP[1] / 2;
                return 
'<table width="' $NLP_W '" border="0" cellspacing="0" cellpadding="0"><tr><td style="border: 1px solid #ABABAB"><a href="' .  $link '" rel="lightbox" title="picture width in its full size"><img src="' .  $link '" width="' $NLP_W '" height="' .  $NLP_H '" border="0" alt="press here to view the picture in its original size" /></a></td></tr><tr><td align=center><a href="' .  $link '" rel="lightbox" title="view the picture in its full size"><img border="0" src="images/NLP_button.gif"></a></td></tr></table>';
            }
            else
            {
                return 
'<img src="' .  $link '" border="0" alt="" />';
            }

         }
         else
         {
             return 
'<img src="' .  $link '" border="0" alt="" />';
         }
    } 



That didn't work???

Barakat 05-16-2006 01:18 AM

this is the same hack with a small changes....
to resize the picture to a small view and after pressing on it it will open in its original size >

u can increase or decrease the size pic code

PHP Code:

if($NLP[0] > 500

make it 800 or 400 and it will work perfect .

and about the picture u can do like it and write inside it


press here to view the picture in its original size or what ever u want to wirte inside it <>

you will save you style in a nice way

tei727 05-16-2006 02:47 AM

Great! I love it!

Doesn't work for me with FF on my site (although it did on the demo site).

Dr.Viggy 05-16-2006 02:49 AM

tei727, did you give the js files time to load? i had the same issue but doing a control-F5 and letting the javascript fully load did the trick

Ntfu2 05-16-2006 03:26 AM

I have returned with a fix..i think

Open your HeadInclude template.

Erase
Code:

<!--Light Box By Dave At FightRice -->
<script type="text/javascript" src="clientscript/prototype.js"></script>
<script type="text/javascript" src="clientscript/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="clientscript/lightbox.js"></script>

Go to Your Postbit Template (note i've only tested on postbit legacy)
At the very top add
Code:

<!--Light Box By Dave At FightRice -->
<script type="text/javascript" src="clientscript/prototype.js"></script>
<script type="text/javascript" src="clientscript/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="clientscript/lightbox.js"></script>

Save


*Note sure if this will save resources or not, but my thinking is it will not call upon the javascript files unless needed in postbit*
Use this code instead
Code:

<if condition="$show['thumbnailattachment']">
<!--Light Box By Dave At FightRice -->
<script type="text/javascript" src="clientscript/prototype.js"></script>
<script type="text/javascript" src="clientscript/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="clientscript/lightbox.js"></script>
<!-- / Light Box -->
<else />
<!-- Nothing To See Here Folks -->
</if>

Quote:

Originally Posted by Microstats With Attachments in post
Page generated in 0.37192 seconds with 12 queries [Server Loads: 18.55 27.73 : 23.86]

*Please note server load is not due to this hack, its from me running a gazillion sites at one time right now :D*
Quote:

Originally Posted by Microstats With-Out Attachments in post
Page generated in 0.19489 seconds with 11 queries [Server Loads: 24.73 26.15 : 23.72]

Hopefully that will speed things up for users
Report back

MentaL 05-16-2006 09:03 AM

cool O_o

ryancooper 05-16-2006 11:32 AM

Well that got rid of the iundefined problem But now in forefox it shows the opening screen then jumps to the image. In IE it works great.

Did I miss something?

Dr.Viggy 05-16-2006 12:11 PM

when you say it jumps to the image... it's opening the image where? in a new window?


All times are GMT. The time now is 04:50 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.01356 seconds
  • Memory Usage 1,784KB
  • 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
  • (5)bbcode_php_printable
  • (3)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