coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: JohannM on March 21, 2007, 11:21:23 PM

Title: New type of "File Information" box
Post by: JohannM on March 21, 2007, 11:21:23 PM
Hi

When you are in "displayimage.php" page view, you can click on the "i" image, and the page extend to show the file information box.

I want to add a button "basket" there and have a similar extention table to appear with all my basket options.

How do I do this ?

Hope someone can help.
Title: Re: New type of "File Information" box
Post by: Joachim Müller on March 22, 2007, 09:03:42 AM
Mods: Selling pictures (http://forum.coppermine-gallery.net/index.php?board=73.0)
Title: Re: New type of "File Information" box
Post by: JohannM on March 22, 2007, 10:28:37 AM
Hi GG

Thanx for the link, but perhaps I don't explain myself good enough.

I already have shopping basket system I'm using for over a year now.  ( http://www.youth-sport-fotos.com  for 1.4.3) and the new one im busy with at ( http://www.youth-sport-fotos.com/fotos/    1.4.10 ).  I need to know where and how to change so that I can have that extra function that works the same as the "info" one.
Title: Re: New type of "File Information" box
Post by: Joachim Müller on March 22, 2007, 12:43:17 PM
The section you'll probably want to edit is called "image navigation bar". Edit themes/yourtheme/theme.php, find$template_img_navbar = <<<EOTand edit as suggested below. If such a piece of code doesn't exist in your custom theme, copy// HTML template for the image navigation bar
$template_img_navbar = <<<EOT

        <tr>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{THUMB_TGT}" class="navmenu_pic" title="{THUMB_TITLE}"><img src="{LOCATION}images/thumbnails.gif" align="middle" border="0" alt="{THUMB_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="javascript:;" class="navmenu_pic" onclick="blocking('picinfo','yes', 'block'); return false;" title="{PIC_INFO_TITLE}"><img src="{LOCATION}images/info.gif" border="0" align="middle" alt="{PIC_INFO_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{SLIDESHOW_TGT}" class="navmenu_pic" title="{SLIDESHOW_TITLE}"><img src="{LOCATION}images/slideshow.gif" border="0" align="middle" alt="{SLIDESHOW_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="100%">
                        {PIC_POS}
                </td>
<!-- BEGIN report_file_button -->
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{REPORT_TGT}" class="navmenu_pic" title="{REPORT_TITLE}"><img src="{LOCATION}images/report.gif" border="0" align="middle" alt="{REPORT_TITLE}" /></a>
                </td>
<!-- END report_file_button -->
<!-- BEGIN ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{ECARD_TGT}" class="navmenu_pic" title="{ECARD_TITLE}"><img src="{LOCATION}images/ecard.gif"  border="0" align="middle" alt="{ECARD_TITLE}" /></a>
                </td>
<!-- END ecard_button -->
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{PREV_TGT}" class="navmenu_pic" title="{PREV_TITLE}"><img src="{LOCATION}images/prev.gif"  border="0" align="middle" alt="{PREV_TITLE}" /></a>
                </td>
                <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{NEXT_TGT}" class="navmenu_pic" title="{NEXT_TITLE}"><img src="{LOCATION}images/next.gif"  border="0" align="middle" alt="{NEXT_TITLE}" /></a>
                </td>
        </tr>

EOT;
from themes/sample/theme.php into a new line before?>into the file themes/yourtheme/theme.php

To add another button to the image navigation bar, just add                 <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="link/to/your/basket.foo" class="navmenu_pic" title="take me to the shopping basket"><img src="{LOCATION}images/basket.gif" align="middle" border="0" alt="Shopping basket" /></a>
                </td>
somewhere into the section I refered to above (after all, this is plain HTML). Don't forget to add the custom basket icon to your_coppermine_folder/themes/yourtheme/images/ (if you have defined in your theme that you have theme-specific navigation bar buttons) or into your_coppermine_folder/images/ if you don't.

Moving to themes board, as this is a question related to this topic.
Title: Re: New type of "File Information" box
Post by: JohannM on March 22, 2007, 03:09:13 PM
Hi GG

Have a look at  http://www.youth-sport-fotos.com/fotos/

I did add the button long time ago, just the function woun't work.  You know, the function that will extend the page as soon as you click on the image.

I need to get the function coding ...
Title: Re: New type of "File Information" box
Post by: Joachim Müller on March 23, 2007, 08:14:10 AM
wrap the section that is suppossed to be expanded when the button is being clicked into a div container like this:<div id="unique_id" name="unique_container_name" style="display:none">
  your custom content
</div>
Then you'll need to come up with some custom JavaScript for the button, something like this:<a href="javascript:;" onclick="document.getElementById('unique_id').style.display = 'block';">

If the button is meant to behave like the pic info button (i.e. toggle the expand/unexpand), then you'll need to come up with a little JavaScript function that can accomplish this. Alternatively, you could use the JavaScript function show_section() that is being defined in script.js
Title: Re: New type of "File Information" box
Post by: JohannM on March 23, 2007, 11:21:13 AM
GG

look at http://www.youth-sport-fotos.com/fotos/displayimage.php?album=8&pos=0

I got the button to work now, but can't find a way to add the contents:

I placed this in my theme.php

    $buynowbuttons = isset($_COOKIE['buynowbuttons']) ? $_COOKIE['buynowbuttons'] : ($CONFIG['display_buynow_info'] ? 'block' : 'none');
    echo "<div id=\"buynowbuttons\" style=\"display: $buynowbuttons;\">\n";
    starttable();
    echo $buynowbuttons;
    endtable();
    echo "</div>\n";

  and

<a href="javascript:;" class="navmenu_pic" onclick="blocking('buynowbuttons','yes', 'block'); return false;" title="{BUYNOWBUTTONS_TITLE}"><img src="{LOCATION}images/cart.gif" border="0" align="middle" alt="" /></a>

Do I need to add the function

if (!function_exists('theme_html_buynowbuttons')) {  //{THEMES}
function theme_html_buynowbuttons(&$info)
{
    global $lang_picinfo;

    $html = '';

    $html .= "        <tr><td colspan=\"2\" class=\"tableh2_compact\"><b>{$lang_picinfo['title']}</b></td></tr>\n";
    $template = "        <tr><td class=\"tableb_compact\" valign=\"top\" >%s:</td><td class=\"tableb_compact\">%s</td></tr>\n";
    foreach ($info as $key => $value) $html .= sprintf($template, $key, $value);

    return $html;
}
}  //{THEMES}

and then fix displayimage.php ?

Title: Re: New type of "File Information" box
Post by: Joachim Müller on March 23, 2007, 02:47:07 PM
Why not add the JavaScript function definition to themes/yourtheme/template.html or script.js? It's pretty leightweight and shouldn't hurt if it existed on all pages.

Not sure what theme_html_buynowbuttons is suppossed to do, as you haven't posted the code that actually ads it in. It's hard to recommend anything without seeing all your code changes, and I'm currently to busy to look into this custom code issue in details. I suggest attaching your zipped theme to your posting - maybe someone else is willing to look into your code in detail.