Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: How to use ...  (Read 4772 times)

0 Members and 1 Guest are viewing this topic.

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
How to use ...
« on: September 22, 2004, 12:12:53 pm »

Code: [Select]
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

<div id="img_navbar">

       <span>{PIC_POS}</span><br />
               
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}">{THUMB_TITLE}</a>
               
                        <a href="javascript:;" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}">{PIC_INFO_TITLE}</a>
               
                       <!-- <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}">{SLIDESHOW_TITLE}</a> -->
       
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}">{ECARD_TITLE}</a>
               
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}">{PREV_TITLE}</a>
               
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}">{NEXT_TITLE}</a>

</div>

EOT;
Here's my code for thumb' navigation ...

I don't want to play with many float CSS properties ...

I would like to include in this code the title of the pic

But ...

Code: [Select]
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

<div id="img_navbar">

       <span>{PIC_POS}</span><br />
               
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}">{THUMB_TITLE}</a>
               
                        <a href="javascript:;" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}">{PIC_INFO_TITLE}</a>
               
                       <!-- <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}">{SLIDESHOW_TITLE}</a> -->
       
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}">{ECARD_TITLE}</a>
               
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}">{PREV_TITLE}</a>
               
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}">{NEXT_TITLE}</a>

[b]<!-- BEGIN title -->
                                                {TITLE}
<!-- END title -->[/b]

</div>

EOT;



If I do THIS, I see {TITLE} instead of the real title of the pic

I would like to know where I must modify the code (and if this case, I'll change with the same technic after)

Thanx
« Last Edit: September 22, 2004, 10:48:56 pm by Casper »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: How to use ...
« Reply #1 on: September 22, 2004, 05:04:11 pm »

Rodinou,

Please reformat your code using the code-formatting button that looks like #. Red text is too difficult to read and should be used minimally for emphasis.

Also, could you show an example of this code in action? I'm not sure what this code does... ;)
« Last Edit: September 22, 2004, 05:22:00 pm by TranzNDance »
Logged

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Re: How to use ...
« Reply #2 on: September 22, 2004, 05:43:52 pm »

OK reformated ... :)

This is the example page

http://www.sortons.net/photos/displayimage.php?album=940&pos=30

I'm doing a 100% tableless coppermine site (user ... admin = impossible for moment !)

And I would like the title (or ANYTHING else, like comments, or pic infos ...) will be under the right menu ...

With the actual code, if you put {DATA} > it appears like {DATA} and not a value which is parsed ...

So, where can I modify this ?

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: How to use ...
« Reply #3 on: September 22, 2004, 10:54:55 pm »

Rodinou,

TranzNDance was not asking you to change the colour, but to use the correct method of posting code, in a code box, see the attached pic.   Clicking on that button provides the
Code: [Select]
tags.  Please use them in future.

I have editted your post.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Nibbler

  • Guest
Re: How to use ...
« Reply #4 on: September 22, 2004, 11:04:34 pm »

All controlled by this array in displayimage.php

Code: [Select]
    $params = array('{THUMB_TGT}' => $thumb_tgt,
        '{THUMB_TITLE}' => $lang_img_nav_bar['thumb_title'],
        '{PIC_INFO_TITLE}' => $lang_img_nav_bar['pic_info_title'],
        '{SLIDESHOW_TGT}' => $slideshow_tgt,
        '{SLIDESHOW_TITLE}' => $lang_img_nav_bar['slideshow_title'],
        '{PIC_POS}' => $pic_pos,
        '{ECARD_TGT}' => $ecard_tgt,
        '{ECARD_TITLE}' => $ecard_title,
        '{PREV_TGT}' => $prev_tgt,
        '{PREV_TITLE}' => $prev_title,
        '{NEXT_TGT}' => $next_tgt,
        '{NEXT_TITLE}' => $next_title,
        '{PREV_IMAGE}' => ($lang_text_dir=='LTR') ? 'prev' : 'next',
        '{NEXT_IMAGE}' => ($lang_text_dir=='LTR') ? 'next' : 'prev',
        );

You just add an entry for th new {TAG} for whatever variable you want to replace it with. You have the $CURRENT_PIC_DATA array available for you which has the row from the pictures table for that particular picture.
Logged

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Re: How to use ...
« Reply #5 on: September 23, 2004, 12:35:20 am »

Sorry Casper !!! :(

Nibbler, MANY THANX for your help !!

You can see the modifications (IE ONLY FOR MOMENT !)

http://www.sortons.net/photos/displayimage.php?album=915&pos=19

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Re: How to use ...
« Reply #6 on: September 23, 2004, 12:40:19 am »

Victory too fast !!! :)

I would like to know how now, with this example ...

Code: [Select]
<!-- BEGIN title -->
           <span class="title">{TITLE}</span>
<!-- END title -->

<!-- BEGIN caption -->
                     <span class="caption">{CAPTION}</span><br />
<!-- BEGIN caption -->

If there is title, the title span appears / if not, it's not shown ...

idem for caption ...

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: How to use ...
« Reply #7 on: September 23, 2004, 12:46:26 am »

When I clicked on the next/prev links, I got this error:

Template error
Failed to find block 'caption'(#(<!-- BEGIN caption -->)(.*?)(<!-- END caption -->)#s) in :
Logged

Nibbler

  • Guest
Re: How to use ...
« Reply #8 on: September 23, 2004, 12:48:39 am »

Try:

Code: [Select]
<!-- BEGIN title -->
           {TITLE}
<!-- END title -->

Code: [Select]
'{TITLE}' => (isset($CURRENT_PIC_DATA['title'])) ? '<span class="title">'.$CURRENT_PIC_DATA['title'].'</span>' : '',
Logged

Rodinou

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Re: How to use ...
« Reply #9 on: September 23, 2004, 02:09:31 pm »

I have done the modifications ...

in displayimage.php

Code: [Select]
    $params = array('{THUMB_TGT}' => $thumb_tgt,
        '{THUMB_TITLE}' => $lang_img_nav_bar['thumb_title'],
        '{PIC_INFO_TITLE}' => $lang_img_nav_bar['pic_info_title'],
        '{SLIDESHOW_TGT}' => $slideshow_tgt,
        '{SLIDESHOW_TITLE}' => $lang_img_nav_bar['slideshow_title'],
        '{PIC_POS}' => $pic_pos,
        '{ECARD_TGT}' => $ecard_tgt,
        '{ECARD_TITLE}' => $ecard_title,
        '{PREV_TGT}' => $prev_tgt,
        '{PREV_TITLE}' => $prev_title,
        '{NEXT_TGT}' => $next_tgt,
        '{NEXT_TITLE}' => $next_title,
        '{PREV_IMAGE}' => ($lang_text_dir=='LTR') ? 'prev' : 'next',
        '{NEXT_IMAGE}' => ($lang_text_dir=='LTR') ? 'next' : 'prev',
      //  '{TITLE}' => $CURRENT_PIC_DATA['title'],
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        '{TITLE}' => (isset($CURRENT_PIC_DATA['title'])) ? '<span class="title">'.$CURRENT_PIC_DATA['title'].'</span>' : '',
        );

And in my theme.php

Code: [Select]
EOT;
// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

<div id="img_navbar">

       <h3>{PIC_POS}</h3>

<!-- BEGIN title -->
          {TITLE}
<!-- END title -->

<!-- BEGIN caption -->
                     <span class="caption">{CAPTION}</span><br />
<!-- BEGIN caption -->

               
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}">{THUMB_TITLE}</a>
               
                        <a href="javascript:;" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}">{PIC_INFO_TITLE}</a>
               
                       <!-- <a href="{SLIDESHOW_TGT}" title="{SLIDESHOW_TITLE}">{SLIDESHOW_TITLE}</a> -->
       
                        <a href="{ECARD_TGT}" title="{ECARD_TITLE}">{ECARD_TITLE}</a>
               
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}">{PREV_TITLE}</a>
               
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}">{NEXT_TITLE}</a><br /><br />

</div>

EOT;

But I have the same result : if the pic has title, it's perfect : title appears ... but if the pic has no title, the span attribute appears empty (and not invisible) ...

Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.