vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > Add-On Modules & Modifications > vBa CMPS v3.x & 2.x > Modifications (version 3.x & 2.x)

Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2007, 10:02 AM
glorify's Avatar
glorify glorify is offline
Senior Member
 
Join Date: Jun 2005
Posts: 201
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 ptourvi1@twcny 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.
Attached Images
File Type: jpg alternate.jpg (116.9 KB, 632 views)

Last edited by glorify; 09-11-2007 at 07:35 PM.
Reply With Quote
  #2  
Old 09-09-2007, 10:24 AM
tresor tresor is offline
Member
 
Join Date: Nov 2005
Posts: 99
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
Reply With Quote
  #3  
Old 09-11-2007, 07:34 PM
glorify's Avatar
glorify glorify is offline
Senior Member
 
Join Date: Jun 2005
Posts: 201
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.
Reply With Quote
  #4  
Old 09-19-2007, 08:29 PM
Ben5150's Avatar
Ben5150 Ben5150 is offline
Junior Member
 
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
Reply With Quote
  #5  
Old 10-15-2007, 01:57 PM
fozo fozo is offline
Senior Member
 
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
Quote:
<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 02:23 PM.
Reply With Quote
  #6  
Old 11-16-2007, 06:23 AM
Allie Allie is offline
Junior Member
 
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
Reply With Quote
  #7  
Old 08-06-2008, 08:21 PM
MonkY MonkY is offline
Member
 
Join Date: Jun 2008
Posts: 50
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 !
Reply With Quote
  #8  
Old 08-12-2008, 02:18 AM
MonkY MonkY is offline
Member
 
Join Date: Jun 2008
Posts: 50
Default

Nobody knows ?
Reply With Quote
  #9  
Old 08-05-2009, 10:15 AM
ryan ryan is offline
Junior Member
 
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!
Reply With Quote
  #10  
Old 11-02-2009, 01:50 PM
kjsmith84 kjsmith84 is offline
Member
 
Join Date: Sep 2009
Posts: 39
Default

cool- works great
Reply With Quote
  #11  
Old 11-06-2009, 02:46 PM
kjsmith84 kjsmith84 is offline
Member
 
Join Date: Sep 2009
Posts: 39
Default

how do you get the attachments bigger in the news page?
Reply With Quote
  #12  
Old 06-12-2011, 06:53 AM
draque1 draque1 is offline
Junior Member
 
Join Date: Apr 2010
Posts: 22
Default

I want this for vbulletin 4 .
Reply With Quote
  #13  
Old 11-09-2011, 06:41 PM
ryan ryan is offline
Junior Member
 
Join Date: Jan 2005
Posts: 7
Default

Would also like to see this for VB4
Reply With Quote
  #14  
Old 08-27-2012, 04:24 PM
ryan ryan is offline
Junior Member
 
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 05:06 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Dyna's attachments be in the vBulletin attachments folder too? eJM "How Do I..." Questions 2 08-19-2007 01:31 PM
Alternating banner links Zooktalk "How Do I..." Questions 1 08-09-2005 11:08 AM


All times are GMT -4. The time now is 07:20 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.