HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


How do I make gallery images appear side by side?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#2422 (In Topic #530)

Fan in action

How do I make gallery images appear side by side?

How do I make gallery images appear side by side??

I'm looking at the images.php module now but I can't seem to find it :(

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#2424
Avatar

Line 388 to 398 would need to be changed.

You'd have to do something like this…

Code

   // Display images
   $images=blank_tempcode();
   $per_row=2;
   $current_row=-1;
   $image_rows=array();
   foreach ($rows as $i=>$row_images)
   {
      $view_url=build_url(array('page'=>'images','type'=>'view','wide'=>1,'id'=>$row_images['id'],'sr'=>$start,'rs'=>$max,'s'=>1));
      $thumb_url=$row_images['thumb_url'];
      $thumb=do_image_thumb($thumb_url,text_lookup_comcode($row_images['comments']));

      if ($i%$per_row==0)
      {
         $current_row++;
         $image_rows[$current_row]=blank_tempcode();
      }

      $image_rows[$current_row]->attach(do_template('GALLERY_IMAGE',array('THUMB'=>$thumb,'VIEW_URL'=>$view_url)));

   }
   foreach ($image_rows as $row)
   {
      $images->attach(do_template('GALLERY_IMAGE_ROW',array('ROW'=>$row)));
   }
   if ($images->is_blank()) $images=do_lang('NO_ENTRIES');

GALLERY_IMAGE.tpl would need changing to…

Code

<td>

{$START_TABLE,internal,THIN}

   <a href="{VIEW_URL*}">{THUMB}</a>

{$END_TABLE}

</td>

and GALLERY_IMAGE_ROW would need to be created…

Code

<tr>
{ROW}
</tr>

and GALLERY_PAGE.tpl would need changing so that line 5 has stuff put around it…

Code

<table width="100%">
{IMAGES}
</table>


Remember that if you edit templates outside the ocPortal template editor, then the template cache needs rebuilding. I have the cache turned off during development myself.


There we go, I've pretty much just coded what you want :). I haven't given precise instructions, I want you to understand you're way through it ;).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#2425

Fan in action

Yay!! Many thanks :)

Now I gotta find where to turn off the fading feature for thumbnails :lol:

Many thanks again :)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#2426
Avatar

IMG_THUMB.tpl


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#2429

Fan in action

:lol: No wonder I couldn't find it. Was looking for a checkbox :D

Many thanks again :)

ocProducts :wub: :wub:

Click here to drop by my website!
Back to the top
 
Posted
Rating:
#10092
Avatar

Community saint

I'm also trying to place the gallery images side by side, but when I open /sources/images.php there are only 308 lines. Do I have the wrong file???


Greetingzzz DJ Buzz Fuzz

Tune! Radio
www.pcc-lab.nl
tuneradio@pcc-lab.nl
Back to the top
 
Posted
Rating:
#10093
Avatar

Community saint

Srry,

I have found the solution already @ index.php?page=topicview&id=1542


Greetingzzz DJ Buzz Fuzz

Tune! Radio
www.pcc-lab.nl
tuneradio@pcc-lab.nl
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: