форум vBSupport.ru > vBulletin > Old vB versions (3.0.x & 2.x.x) > vBulletin 3.5.x > Hacks, mods and scripts [3.5.x]
  • »
VBsupport перешел с домена .ORG на родной .RU Ура! Пожалуйста, обновите свои закладки - VBsupport.ru
 
 
 
 
КотЪ
Администратор
Неадекватный
 
КотЪ's Avatar
Default [img] tag thumbnail maker / Превьюшки при вставке изображений
5

Очень полезная вещь:
при использовании тэга [img] вставляется не полное изображение, а превью заданного размера.

----------------------------------

This makes it so whenever you use the
PHP Code:
[img]

bbcode, instead of a real picture it will post a thumbnail instead. when you click that thumbnail it will bring you to the actual image.


open includes/class_bbcode.php
find:


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

replace with:

PHP Code:
return '<a href="' . $link . '" target="_blank"><img border="0" width="250" alt="Thumbnail" src="' . $link . '" /></a>';


This will convert all images so they have a width of 250 and make them clickable to the original image. note: if you have a oblong image, the hight will stay preportionate so it may cause thumbnails to look strange, you can also specify a height but the thumbnails will not be preportionate. Change the width="250" to whatever you want :-)
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
legomaxi
Продвинутый
 
legomaxi's Avatar
Default
0

Супер, спасибо огромное, а то я уже хотел и сам поспрашивать про эту проблемку с IMG.
Всё работает на супер отлично.

Last edited by legomaxi : 06-28-2006 at 12:58 PM.
 
 
SevenUp
Продвинутый
Default
0

это нормально что он маленькие картинки увеличивает на "250" ?

Last edited by SevenUp : 06-28-2006 at 02:52 PM.
 
 
ka81
Продвинутый
 
ka81's Avatar
Default
0

вопрос - там же вроде как работает GD для подобных целей?..
 
 
КотЪ
Администратор
Неадекватный
 
КотЪ's Avatar
Default
0

и где он так работает, не подскажешь?
 
 
ka81
Продвинутый
 
ka81's Avatar
Default
0

мм...
если я не ошибся. то данный мод делает тумбнейлы (маленькое превью оригинально-вставляемого в пост рисунка).
дк, у меня на форуме включена ГД+, и при вставке изображения, оно в посте выглядит превьюшкой, и соответственно при нажатии в новом коне будет оригинал...
 
 
SevenUp
Продвинутый
Default
0

Quote:
Originally Posted by ka81
мм...
если я не ошибся. то данный мод делает тумбнейлы (маленькое превью оригинально-вставляемого в пост рисунка).
дк, у меня на форуме включена ГД+, и при вставке изображения, оно в посте выглядит превьюшкой, и соответственно при нажатии в новом коне будет оригинал...
так это если ты вставляешь картинку вложением в форум

а если просто через тэг img, то ничего автоматически там не уменьшится
 
 
kerk
k0t
 
kerk's Avatar
Default
5

у меня немного модифицированная версия стоит:
найти:
PHP Code:
return '<img src="' $link '" border="0" alt="" />'
и заменить на:
PHP Code:
     $navigator_user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
     if (
stristr($navigator_user_agent"msie"))
        {
          return 
'<a href=' $link ' target="_blank"><img src="' $link '" onload="if(screen.width-600 < this.width) {this.width=screen.width-600;this.alt=\'в полный размер\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" style="width: expression(this.width > 600 ? 600 : true);" border="0" /></a>';
        }
          else
        {
          return 
'<a href=' $link ' target="_blank"><img src="' $link '" onload="if(screen.width-600 < this.width) {this.width=screen.width-600;this.alt=\'в полный размер\';}" onmouseover="if(this.alt) this.style.cursor=\'hand\';" border="0"></a>';
        } 
размеры выставляем свои...
а еще есть такое (ахтунг инглиш, всем недругам инглиша - курить...):
======================
Finally, let's edit!
(Or you can download the .txt file for the installation instructions)

1. Back up your templates!

2. In your postbit or postbit_legacy template find this or something similar to:

Code:
<!-- message -->
<div id="post_message_$post[postid]">$post[message]</div>
<!-- / message -->

Replace it with:

Code:
<!-- message -->
<div id="post_message_$post[postid]" class="hidemsg">$post[message]</div>
<!-- / message -->

3. Click "Save".

4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hidemsg {
width:700px;
padding-bottom:20px;
overflow:auto;
overflow-x:auto;
overflow-y:hidden;
}

5. Change the width "700px" to whatever you want. All other settings keep.

6. Click "Save".

7. Click if you use it.

Finished!


*For those of you who use a fluid layout take a look at this post. Thanks 007 for sharing.


=====================

Optional Modifications (Below)!!!:

*The 3 (A, B & C) optional modifications below follow the same steps as above with the exception of #2, #4 and #5.

A) For Signatures (Hide Oversized Images width & height):

2. In your postbit or postbit_legacy template find this or something similar to:

Code:
<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->

Replace it with:

Code:
<!-- sig -->
<div class="hidesig">
__________________<br />
$post[signature]
</div>
<!-- / sig -->


4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hidesig {
width:700px;
height:400px;
overflow:hidden;
}


5. Change the width "700px" and height "400px" to whatever you want. Signatures (text or image) that exceed either width or height limit will be cut off. This code does not affect the message Table. Keep the remaining codes the same.

*If the center tag doesn't work in the signature after implementing the code above see this post for the solution.

---------------------------------

B) For vBAdvanced Newsbits:

2. In your vBadvanced CMPS Templates --> adv_portal_newsbits template find this or something similar to:

Code:
$news[message]

Replace it with:

Code:
<!-- message -->
<div class="hideadvnews">
$news[message]
</div>
<!-- / message -->


4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hideadvnews {
width:700px;
padding-bottom:20px;
overflow:auto;
overflow-x:auto;
overflow-y:hidden;
}



5. Change the width "700px" to whatever you want. All other settings keep.

---------------------------------

C) For vBAdvanced Newsbits (Signature):

2. In your vBadvanced CMPS Templates --> adv_portal_newsbits template find this or something similar to:

Code:
<if condition="$show['signature']">
<div>__________________<br />
$news[signature]</div>
</if>

Replace it with:

Code:
<if condition="$show['signature']">
<div class="hideadvsig">__________________<br />
$news[signature]</div>
</if>


4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hideadvsig {
width:700px;
height:400px;
overflow:hidden;
}

5. Change the width "700px" and height "400px" to whatever you want. Signatures (text or image) that exceed either width or height limit will be cut off. This code does not affect the vBadvanced message Table. Keep the remaining codes the same.
 
 
SevenUp
Продвинутый
Default
0

спасибо kerk!

твоя модификация делает именно то что ей нужно (по сравнению и спредыдущим кодом)

только:
там и задумано что изображения, которые не были уменьшены, всё равно кликабельны?
 
 
ka81
Продвинутый
 
ka81's Avatar
Question
0

Quote:
Originally Posted by SevenUp
так это если ты вставляешь картинку вложением в форум

а если просто через тэг img, то ничего автоматически там не уменьшится
понял!
прошу прощения за необознанность!

добавлено через 13 минут
Вопросы:
1)
PHP Code:
<!-- message -->
<
div id="post_message_$post[postid]class="hidemsg">$post[message]</div>
<!-- / 
message --> 
на что собственно влияет данная замена?
следующие как я понял на подписи, а вот эта?!...

2)
Quote:
In Main CSS go to the bottom at Additional CSS Definitions and add code bit:
там два окна - Дополнительные определения CSS - в которое из них вставлять код?

3)
Quote:
B) For vBAdvanced Newsbits:
объясните глупому чот за Ньюсбитс?

Спасибо!!

Last edited by ka81 : 06-28-2006 at 06:57 PM. Reason: Добавлено сообщение
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT +4. The time now is 07:34 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Loading...