vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   [SOLVED] Need a little help with this code (https://vborg.vbsupport.ru/showthread.php?t=296429)

Divvy 03-23-2013 01:21 PM

[SOLVED] Need a little help with this code
 
Hello guys,

Maybe someone can help me with this little code that I want to use together with VBAdvanced.
So here is the thing.

I use a custom bbcode to align my img to left or right:
PHP Code:

<img src="IMAGE URL" align="right" border="0" hspace="6" vspace="3" alt=""/> 

In my vbadvanced, I have this css in news for image doesnt appear too big:
PHP Code:

.news IMG   

         
max-width:700px
  
widthexpression(this.width 700 700 true); 
         
heightauto


Now I like to use the same, but ONLY for the images posted with my custom bbcode, so I added class="imgportal" to my custom bbcode and added this to CSS:
PHP Code:

.imgportal {
    
max-width:200px;


The problem is that this only works with some images, some are resized to 200 and some not. I think that is a conflict.

Here is the html code for you to see how is shown:
PHP Code:

<div class="news IMG">
<
blockquote class="postcontent restore">
<
img src="IMAGE URL" align="right" class="imgportal" border="0" hspace="6" vspace="3" alt=""><br>
POST TEXT HERE
</blockquote>
</
div

This is my vbadvanced template file:
PHP Code:

<vb:if condition="!$mod_options['portal_news_legacy']">
    <
h2 class="blockrow3">
        <
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.png" 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="blockrow3">
    <
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.png" 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>
<
div class="news IMG">
                <
blockquote class="postcontent restore">{vb:raw news.message}</blockquote>
            </
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:each from="news[attachment]" value="attachment">
                <
vb:if condition="$attachment['hasthumb']">
                    <
a href="{vb:raw vboptions.bburl}/attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;d={vb:raw attachment.dateline}" rel="Lightbox{vb:raw attachment.lightboxid}" id="attachment{vb:raw attachment.attachmentid}"<vb:if condition="$show['newwindow']"target="_blank"</vb:if>><img src="{vb:raw vboptions.bburl}/attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}&amp;stc=1&amp;thumb=1&amp;d={vb:raw attachment.thumbnail_dateline}" class="thumbnail" border="0" alt="{vb:rawphrase image_larger_version_x_y_z, {vb:raw attachment.filename}, {vb:raw attachment.counter}, {vb:raw attachment.filesize}, {vb:raw attachment.attachmentid}}" /></a> &nbsp;
                <
vb:else />
                    <
div>
                        <
img class="inlineimg" src="{vb:stylevar imgdir_attach}/{vb:raw attachment.attachmentextension}.gif" alt="{vb:rawphrase file_type_x, {vb:raw attachment.attachmentextension}}" width="16" height="16" border="0" style="vertical-align:baseline" /> <a href="{vb:raw vboptions.bburl}/attachment.php?{vb:raw session.sessionurl}attachmentid={vb:raw attachment.attachmentid}">{vb:raw attachment.filename}</a>
                        ({
vb:raw attachment.filesize}, {vb:rawphrase x_views, {vb:raw attachment.counter}})
                    </
div>
                </
vb:if>
            </
vb:each>
        </
fieldset>
    </
div>
</
vb:if>
<
div class="postbit vba_news">
    <
div class="postfoot" style="white-space: nowrap">
        <
div class="textcontrols floatcontainer">
            <
span class="postcontrols">
                <
vb:if condition="$show['editbutton']">
                    <
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>
                    <
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_siteicons}/email.png" title="{vb:rawphrase send_to_friend}" 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 /> 

Hope you understand what I mean...
Any idea how to fix this? Thanks :)

--------------- Added [DATE]1364125537[/DATE] at [TIME]1364125537[/TIME] ---------------

Fixed!

Changed .imgportal { } to .news .imgportal { } in the css.

Working fine now :)

Thank you anyway guys.


All times are GMT. The time now is 10:29 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.01034 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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