forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: Rodinou on September 22, 2004, 12:12:53 pm
-
// 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 ...
// 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
-
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... ;)
-
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 ?
-
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
tags. Please use them in future.
I have editted your post.
-
All controlled by this array in displayimage.php
$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.
-
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
-
Victory too fast !!! :)
I would like to know how now, with this example ...
<!-- 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 ...
-
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 :
-
Try:
<!-- BEGIN title -->
{TITLE}
<!-- END title -->
'{TITLE}' => (isset($CURRENT_PIC_DATA['title'])) ? '<span class="title">'.$CURRENT_PIC_DATA['title'].'</span>' : '',
-
I have done the modifications ...
in displayimage.php
$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
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) ...