Results 1 to 14 of 14

Thread: Attachments with alternating left/right images

  1. #1

    Default Attachments with alternating left/right images

    I have been using this for years and surprisingly, it still works in 3.0 RC1. I have put what works for me from this long, old, confusing, VBA CMPS 1.x thread. This takes the attachments out of the attached images fieldset, then alternates them from left to right down your page.

    The original code breakers were [email protected] and Tom M.

    In adv_portal_newsbits, find:
    Code:
    $news[message]
    
    		<if condition="$show['signature']">
    		<div>__________________<br />
    		$news[signature]</div>
    		</if>
    
    		</td>
    	</tr>
    
    	<if condition="$news['attachment']">
    		<tr class="alt1">
    			<td>
    				<fieldset class="fieldset">
    				<legend>Attached Files</legend>
    				<div style="padding:$stylevar[formspacer]px">
    					$news[attachment]
    				</div>
    				</fieldset>
    			</td>
    		</tr>
    	</if>
    Replace with:
    Code:
    <if condition="$news['attachment']">
                <span style="float: left; margin: $stylevar[cellpadding]px $stylevar[cellpadding]px $stylevar[cellpadding]px 0px">
                    $news[attachment]
                </span>
            </if>
    
                $news[message]
    
                <if condition="$show['signature']">
                <div>__________________<br />
                $news[signature]</div>
                </if>
    
                </td>
            </tr>

    To get the images to alternate left/right:
    Find:
    Code:
    <if condition="$news['attachment']">
                <span style="float: left; margin: $stylevar[cellpadding]px $stylevar[cellpadding]px $stylevar[cellpadding]px 0px">
                    $news[attachment]
                </span>
            </if>
    Replace with:
    Code:
    <if condition="$news['attachment']">
                    <if condition="$newscount % 2">
                    <span style="float: left; margin: $stylevar[cellpadding]px $stylevar[cellpadding]px $stylevar[cellpadding]px 0px">
                <else />
                    <span style="float: right; margin: $stylevar[cellpadding]px 0px $stylevar[cellpadding]px $stylevar[cellpadding]px">
                </if>
                    $news[attachment]
                </span>
            </if>
    Save, Done.
    Last edited by glorify; 09-11-2007 at 08:35 PM.

  2. #2
    Join Date
    Nov 2005
    Posts
    100

    Default Re: Attachments with alternating left/right images

    How can I do in order to show thumbnail always in top left?
    Now is showing in the middle of the new:
    Demo:

    www.technogalicia.com

  3. #3

    Default Re: Attachments with alternating left/right images

    Only the bottom part of the code is for the images to alternate left/right. Just do the first edit.

    This was for a single column news so I don't know how it will work with your 2 column news.

  4. #4
    Join Date
    Nov 2004
    Posts
    14

    Question Re: Attachments with alternating left/right images

    Hello I tried using this mod and I still get the picture on top of the news Look hereHow would I make this work right ? I used insert image for the image and tried align left and align Right and also decrease left and right I would love to used this mod please if anybody can work me thought this Ill be very greatful
    Thanks

  5. #5
    Join Date
    Oct 2007
    Posts
    100

    Default Re: Attachments with alternating left/right images

    Can someone apply the highslide or lightbox/thickbox into this hack? Right now, if you click on the image on the CMPS page, it opened to a new page.

    Edit: I figured it out myself. Here is how to do it.

    1/ Go to your admincp, select your style, All style options, headinclude and put the below code at the end
    Code:
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="js/lightbox.js"></script>
    <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
    2/ In the same style, go to Edit Template, vBadvanced CMPS Tempates, adv_portal_newsbits_attach_thumb, add on the red highlight item into your current code
    <a rel="lightbox" href="$vboptions[bburl]/attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>><img src="$vboptions[bburl]/attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1&amp;d=$attachment[thumbnail_dateline]" class="thumbnail" border="0" alt="<phrase 1="$attachment[filename]" 2="$attachment[counter]" 3="$attachment[filesize]" 4="$attachment[attachmentid]">$vbphrase[image_larger_version_x_y_z]</phrase>" /></a> &nbsp;
    3/ Download, unzip and upload the files from this link:
    http://www.vbulletin.org/forum/showthread.php?t=123235

    And that's it.
    Last edited by fozo; 10-15-2007 at 03:23 PM.

  6. #6
    Join Date
    Nov 2007
    Posts
    5

    Default Re: Attachments with alternating left/right images

    Can u tell me what exactly u put in just to get highslide to work on the frontpage?

    thanks

  7. #7

    Default

    Can somebody tell me what do i need to modify so that when the user clicks on thumnbail to go to the post where is attached, and not to actually open the picture ?

    Thx in advance !

  8. #8

    Default

    Nobody knows ?

  9. #9
    Join Date
    Jan 2005
    Posts
    7

    Default

    I know this post is old but... Anyone know how to just show the first atached image?

    Thansk!

  10. #10

    Default

    cool- works great

  11. #11

    Default

    how do you get the attachments bigger in the news page?

  12. #12
    Join Date
    Apr 2010
    Posts
    22

    Default

    I want this for vbulletin 4 .

  13. #13
    Join Date
    Jan 2005
    Posts
    7

    Default

    Would also like to see this for VB4

  14. #14
    Join Date
    Jan 2005
    Posts
    7

    Default

    For those who want this for V4 here you go:

    Find:

    Code:
    <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>
    and change to

    Code:
    <blockquote class="postcontent restore">
    				<span style="float: left; margin: $stylevar[cellpadding]px $stylevar[cellpadding]px $stylevar[cellpadding]px 0px">
                       
    				
    				<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>
    				     </span>
    				{vb:raw news.message}</blockquote>
    Last edited by ryan; 08-27-2012 at 06:06 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 08-19-2007, 02:31 PM
  2. Alternating banner links
    By Zooktalk in forum "How Do I..." Questions
    Replies: 1
    Last Post: 08-09-2005, 12:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •