Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Resize Images in vBadvanced News Module Details »»
Resize Images in vBadvanced News Module
Version: 1.1, by asabet asabet is offline
Developer Last Online: Apr 2015 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.5 Rating:
Released: 07-27-2010 Last Update: Never Installs: 30
Template Edits
Re-useable Code Translations  
No support by the author.

This mod will automatically resize images in the vBadvanced News Module to a given maximum width.

Step 1:

Go to adv_portal_newsbits template (under vbAdvanced CMPS templates) and search for:
PHP Code:
$news[message

If you can't find that, then search for:
PHP Code:
<blockquote class="postcontent restore">{vb:raw news.message}</blockquote

Immediately before whichever of those you find in your template, add:
PHP Code:
<div class="news IMG"

Save

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

Step 2:

Go to additional.css template (under CSS templates) and add the following to that template (replace "512" with whatever max width you want):
PHP Code:
.news IMG  
{
         
max-width512px;
         
heightauto;


or for better (but still not perfect) support in Internet Explorer, use this instead:

PHP Code:
.news IMG  
{
         
max-width:512px;
  
widthexpression(this.width 512 512true);
         
heightauto;


Save


That's it. Worked for me. This mod is unsupported, as I have almost no knowledge about these things. I was able to get it working based on what I found here: http://www.vbadvanced.com/forum/showthread.php?t=40139

The vB3.8 version of this mod is here: https://vborg.vbsupport.ru/showthread.php?t=247437

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
donkspurs

Comments
  #2  
Old 07-28-2010, 03:12 AM
FReeSTER FReeSTER is offline
 
Join Date: Jun 2006
Location: Rome
Posts: 730
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like a great idea but i dont have neither of those codes on my template.

Code:
<vb:if condition="!$mod_options['portal_news_legacy']">
	<h2 class="blockrow">
		<vb:if condition="$mod_options['portal_news_showicon']">{vb:raw vba_style.portal_blockbullet}</vb:if> {vb:raw news.prefix} <a href="{vb:raw vboptions.bburl}/{vb:link thread, {vb:raw news}}">{vb:raw news.title}</a>
	</h2>
</vb:if>
<div class="<vb:if condition="$mod_options['portal_news_legacy']">blocksubhead<vb:else />blockrow</vb:if>">
	<div<vb:if condition="$mod_options['portal_news_showrating'] AND $news['rating']"> class="vba_rating{vb:raw news.rating}"</vb:if>>
		<vb:if condition="$news['subscribed'] AND $mod_options['portal_news_showsubscribed']">
			<img alt="" class="inlineimg" src="{vb:stylevar imgdir_misc}/subscribed.gif" title="{vb:rawphrase you_are_subscribed_to_this_thread}" />
		</vb:if>
		{vb:raw news.dateposted} - {vb:rawphrase by_x, {vb:link member, {vb:raw news}, null, 'postuserid', 'postusername'}, {vb:raw news.postusername}}
	</div>
</div>
<div class="blockrow">
	<vb:if condition="$show['paperclip']">
		<span style="float:{vb:stylevar right}">
			<a href="#" onclick="vba_attach_win({vb:raw news.threadid}); return false"><img class="inlineimg" src="{vb:stylevar imgdir_misc}/paperclip.gif" border="0" title="{vb:rawphrase x_attachments, {vb:raw news.attach}}" alt="" /></a>
		</span>
	</vb:if>
	<table width="100%">
		<tr>
			<td valign="top">
				<vb:if condition="$news['avatarpath']">
					<img align="{vb:stylevar left}" style="padding: 0 {vb:math {vb:stylevar padding}/2} {vb:math {vb:stylevar padding}/2} 0" alt="{vb:rawphrase xs_avatar, {vb:raw news.postusername}}" border="0" src="{vb:raw news.avatarpath}" />
				</vb:if>
				{vb:raw news.message}
			</td>
		</tr>
	</table>
		
	<vb:if condition="$show['signature']">
		<div>__________________<br />{vb:raw news.signature}</div>
	</vb:if>
</div>
<vb:if condition="$news['attachment']">
	<div class="attachments">
		<fieldset>
			<legend>{vb:rawphrase attached_files}</legend>
			{vb:raw news.attachment}
		</fieldset>
	</div>
</vb:if>
<div class="postbit vba_news">
	<div class="postfoot" style="white-space: nowrap">
		<div class="textcontrols">
			<span class="postcontrols">
				<vb:if condition="$show['editbutton']">
					<a class="editpost" href="{vb:raw vboptions.bburl}/editpost.php?{vb:raw session.sessionurl}do=editpost&amp;p={vb:raw news.postid}"><img src="{vb:stylevar imgdir_button}/trans_40b.png" id="editimg_{vb:raw news.postid}" alt="{vb:rawphrase edit_delete_message}" /> {vb:rawphrase edit_post}</a>
				</vb:if>
		
				<vb:if condition="$show['replybutton']">
					<span class="seperator">&nbsp;</span>
					<a class="quickreply" href="{vb:raw vboptions.bburl}/newreply.php?{vb:raw session.sessionurl}do=newreply&amp;t={vb:raw news.threadid}" rel="nofollow"><img id="replyimg_{vb:raw news.postid}" src="{vb:stylevar imgdir_button}/trans_40b.png" alt="{vb:rawphrase quick_reply_to_this_message}" /> {vb:rawphrase reply}</a>
				</vb:if>

				<vb:if condition="$mod_options['portal_news_showsendfriend']">
					<span class="seperator">&nbsp;</span>
					<a href="{vb:raw vboptions.bburl}/sendmessage.php?{vb:raw session.sessionurl}do=sendtofriend&amp;t={vb:raw news.threadid}" rel="nofollow" style="padding: 0"><img alt="" border="0" src="{vb:stylevar imgdir_button}/sendtofriend.gif" title="{vb:rawphrase send_to_friend}" style="position: relative" /></a>
				</vb:if>
		
				<vb:if condition="$mod_options['portal_news_showprintable']">
					<span class="seperator">&nbsp;</span>
					<a href="{vb:raw vboptions.bburl}/printthread.php?{vb:raw session.sessionurl}t={vb:raw news.threadid}" rel="nofollow" style="padding: 0"><img alt="" border="0" src="{vb:stylevar imgdir_button}/printer.gif" title="{vb:rawphrase show_printable_version}" style="position: relative" /></a>
				</vb:if>

			</span>
			<span class="postlinking">
				<vb:if condition="$mod_options['portal_news_allowreplies']">
					{vb:raw news.replycount} <vb:if condition="$news['reply_noformat'] == 1">{vb:rawphrase reply}<vb:else />{vb:rawphrase replies}</vb:if>
				</vb:if>
				<vb:if condition="$mod_options['portal_news_showviews'] AND $mod_options['portal_news_allowreplies']"> | </vb:if>
				<vb:if condition="$mod_options['portal_news_showviews']">
					{vb:raw news.views} {vb:rawphrase views}
				</vb:if>
			</span>
		</div>
	</div>
</div>
<br />
<br />
Reply With Quote
  #3  
Old 07-28-2010, 04:16 AM
Blooded Blooded is offline
 
Join Date: Feb 2010
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didnt work just broke everything when i click in portal send me to mysite.com/register.php :s and everything looks bad
Reply With Quote
  #4  
Old 07-28-2010, 03:31 PM
asabet asabet is offline
 
Join Date: Dec 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

El Intocable, in your case I think you'd add it just before
PHP Code:
{vb:raw news.message
Blooded, sorry it isn't working for you. Works perfect on my site running vB4.0.5 and vBa CMPS 4.0.1.
Reply With Quote
  #5  
Old 07-29-2010, 01:29 AM
FReeSTER FReeSTER is offline
 
Join Date: Jun 2006
Location: Rome
Posts: 730
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by asabet View Post
El Intocable, in your case I think you'd add it just before
PHP Code:
{vb:raw news.message
Thank you bro, it worked very good on vb 4.0.3
Reply With Quote
  #6  
Old 07-29-2010, 05:15 AM
Blooded Blooded is offline
 
Join Date: Feb 2010
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by asabet View Post
El Intocable, in your case I think you'd add it just before
PHP Code:
{vb:raw news.message
Blooded, sorry it isn't working for you. Works perfect on my site running vB4.0.5 and vBa CMPS 4.0.1.
i have the same version as you maybe i edit wrong
Thanks anyway
Reply With Quote
  #7  
Old 08-29-2010, 09:46 PM
Winter Sonata Winter Sonata is offline
 
Join Date: Apr 2010
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works like a sharm

but there are 2 of ''' {vb:raw news.message} ''' choose the first one not the other

installed
Reply With Quote
  #8  
Old 09-13-2010, 12:13 AM
zonaenlinea's Avatar
zonaenlinea zonaenlinea is offline
 
Join Date: Dec 2009
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

for vBadvanced 4.0.0 ?

in vbulletin 4.0.6 ?
Reply With Quote
  #9  
Old 09-13-2010, 07:17 PM
DNDJ DNDJ is offline
 
Join Date: May 2009
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

work great thank very much.
Reply With Quote
  #10  
Old 09-23-2010, 03:44 AM
elwachiman's Avatar
elwachiman elwachiman is offline
 
Join Date: Nov 2009
Location: Venezuela
Posts: 191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works Perfect In Vb 4.0.7 And Vbadv 4.0.1
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 08:47 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06032 seconds
  • Memory Usage 2,342KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (8)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete