vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Need help altering a piece of code (https://vborg.vbsupport.ru/showthread.php?t=32497)

bira 11-18-2001 05:24 PM

Hi all,

I posted this on vbulletin.com, only later to discover this renewed site :)

Hopefully someone has an idea here with the following:

I would like to alter the code in admin/functions.php
which replaces [img ]xxxx[/ img] with <img scr= > code.

The original code is:

PHP Code:

if($dobbimagecode and ($bbuserinfo[userid]==or $bbuserinfo[showimages])) {
      
// do [img ]xxx[ /img]
      
$bbcode preg_replace("/(\[)(img)(])(\r\n)*([^\"".iif($allowdynimg,"","\?\&")."]*)(\[\/img\])/siU""<img src=\"\\5\" border=\"0\" alt=\"\">"$bbcode);


What I would like to do is (described in general):

PHP Code:

$image_size getimagesize("-- the URL inbetween the img vbcode --");

if (
$image_size[0] > '120') {

      
$bbcode preg_replace("/(\[)(img)(])(\r\n)*([^\"".iif($allowdynimg,"","\?\&")."]*)(\[\/img\])/siU""<a href=\"\\5\" target=\"_blank\"><img src=\"\\5\" border=\"2\" width=\"120\" alt=\"Click image to view in full size\"></a><br><font face=\"Verdana\" size=1>(Click image for full size)</font><br>"$bbcode);

} else {

      
$bbcode preg_replace("/(\[)(img)(])(\r\n)*([^\"".iif($allowdynimg,"","\?\&")."]*)(\[\/img\])/siU""<img src=\"\\5\" border=\"0\" alt=\"\">"$bbcode);



In other words, I want to resize images larger than a certain
width into thumbnails and I know how to do it, except I don't
know how to extract the image's URL for the 'getimagesize' :)

Help would be appreciated. Right now, I'm using the thumbnails
by default, however it is giving a width='120' even to external
smilies which are usually 10 times smaller than that :D

Thanks,

Bira

bira 11-20-2001 09:32 PM

Anyone? :)

Admin 11-21-2001 07:45 AM

I'd help, but I have no idea. :o

bira 11-21-2001 07:48 AM

ok, toda she'anita :D

Admin 11-21-2001 07:53 AM

ein be'aya! :D

Seriously, I have no idea when it comes to regex.. :(


All times are GMT. The time now is 11:11 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.01078 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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