Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: need a little help with coding the next image, or previous  (Read 3078 times)

0 Members and 1 Guest are viewing this topic.

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
need a little help with coding the next image, or previous
« on: October 17, 2004, 08:13:57 pm »

hey everyone! i have run into a problem while modding my midsize image display (what you would call "displayimage.php").

i have tried modding it to look like this:
(http://www.tangiblebrit.com/TangibleImage/92001939/01/)

here's how far i've gotten:

(http://www.tangiblebrit.com/TangibleImage/92001939/02/)

does any one know how they can help me achieve this?:

(http://www.tangiblebrit.com/TangibleImage/92001939/03/)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: need a little help with coding the next image, or previous
« Reply #1 on: October 18, 2004, 08:53:16 am »

this section is labelled "filmstrip" in Coppermine. Adjust your theme by looking into theme.php, search for the "filmstrip" definition and move it around accordingly.

Joachim
Logged

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
Re: need a little help with coding the next image, or previous
« Reply #2 on: October 18, 2004, 11:28:16 pm »

k i'll play with it gaugau thanks- i'll update on here once it works ;)
Logged

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
Re: need a little help with coding the next image, or previous
« Reply #3 on: October 19, 2004, 03:21:03 am »

ok i've gotten further, and played around with the code, but it just won't work!

I'm almost for certain that this is what i need to edit, but i can't edit it right-i just doesn't work.
(in functions.inc.php)
Code: [Select]
function display_film_strip($album, $cat, $pos)
{
        global $CONFIG, $AUTHORIZED, $HTTP_GET_VARS;
        global $album_date_fmt, $lang_display_thumbnails, $lang_errors, $lang_byte_units;
        $max_item=$CONFIG['max_film_strip_items'];
        //$thumb_per_page = $pos+$CONFIG['max_film_strip_items'];
        $thumb_per_page = $max_item*2;
        $l_limit = max(0,$pos-$CONFIG['max_film_strip_items']);
        $new_pos=max(0,$pos-$l_limit);

        $pic_data = get_pic_data($album, $thumb_count, $album_name, $l_limit, $thumb_per_page);

        if (count($pic_data) < $max_item ){
                $max_item = count($pic_data);
        }
        $lower_limit=3;

        if(!isset($pic_data[$new_pos+1])) {
           $lower_limit=$new_pos-$max_item+1;
        } else if(!isset($pic_data[$new_pos+2])) {
           $lower_limit=$new_pos-$max_item+2;
        } else if(!isset($pic_data[$new_pos-1])) {
           $lower_limit=$new_pos;
        } else {
          $hf=$max_item/2;
          $ihf=(int)($max_item/2);
          if($new_pos > $hf ) {
             //if($max_item%2==0) {
               //$lower_limit=
             //} else {
             {
               $lower_limit=$new_pos-$ihf;
             }
          }
          elseif($new_pos < $hf ) { $lower_limit=0; }
        }

        $pic_data=array_slice($pic_data,$lower_limit,$max_item);
        $i=$l_limit;
        if (count($pic_data) > 0) {
                foreach ($pic_data as $key => $row) {
                        $hi =(($pos==($i + $lower_limit)) ? '1': '');
                        $i++;

What i want to do is have a maximum of 3 images in the film strip, but remove the current image from that, now leaving 2 images, a back and next image. (refer to the first picture posted) can anyone please help me?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: need a little help with coding the next image, or previous
« Reply #4 on: October 19, 2004, 09:39:50 am »

In config, you can set the number of images that display, so you don't have to code that. As for hiding the current image, you could use a conditional so that the current image doesn't get displayed in the filmstrip.
Logged

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
Re: need a little help with coding the next image, or previous
« Reply #5 on: October 19, 2004, 01:36:06 pm »

i'm not that good at php, can you show me what a conditional is? and where to put it into the code?
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: need a little help with coding the next image, or previous
« Reply #6 on: October 20, 2004, 12:38:05 am »

Conditional statements are like this:  if ($somevariable) then ...

Visit the online php documentation at www.php.net for more info.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

bit bit spears

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 240
    • TangibleBrit.com
Re: need a little help with coding the next image, or previous
« Reply #7 on: October 22, 2004, 12:07:09 am »

i understand that, but i don't understand the meaning of the variables in that code that i posted. i know that gaugau wants us to have fun coding and figuring stuff out, but i have reached my maximum coding ability. If someone out there knows how to hide the current image, can you please post?
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.