forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: v8central on June 15, 2005, 03:27:01 pm

Title: Random banner in the header of all pages
Post by: v8central on June 15, 2005, 03:27:01 pm
I've read a few posts that say "read the docs" on how to do this, but I'm new to PHP and I can't find the exact steps in the docs either.

I'm using the Classic theme, and I would like to place a banner at the top of every page.  The code is included on a lot of other pages on my site, but they are written in ASP.  I know I have to convert the banner code to PHP, but I can't get anything included in the template.html and I don't understand where to make the changes in template.php

If anyone can help it would be greatly appreciated :)
Title: Re: Random banner in the header of all pages
Post by: snork13 on June 15, 2005, 05:06:12 pm
well, i would need to see the code, but you should be able to add to the template.html file within the theme you use.

--snork13
Title: Re: Random banner in the header of all pages
Post by: v8central on June 15, 2005, 10:46:16 pm
I've tried this ...

Code: [Select]
<body>
<table border="4" cellspacing="2" cellpadding="3" width="100%" bordercolor="#000000">
<tr>
        <td valign="top" bordercolor="#666666" bgcolor="#FFFFFF" style="border: 1px solid;">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                       <tr>
                                <td>
<!--#include file="top.inc"-->                               
                                <br /><a href="index.php"><img src="/v8central.jpg" alt="" border="0" /><br /></a></td>
                                <td width="100%" align="center">
                                        <h1>{GAL_NAME}</h1>
                                        <h3>{GAL_DESCRIPTION}</h3><br />
                                        {MAIN_MENU}
                                </td>
                        </tr>
                </table>

and this :

Code: [Select]
<body>
<table border="4" cellspacing="2" cellpadding="3" width="100%" bordercolor="#000000">
<tr>
        <td valign="top" bordercolor="#666666" bgcolor="#FFFFFF" style="border: 1px solid;">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                       <tr>
                                <td>
<?php
srand
((double)microtime()*1000000); 
echo 
rand(0,100); 
?>
                               
                                <br /><a href="index.php"><img src="/v8central.jpg" alt="" border="0" /><br /></a></td>
                                <td width="100%" align="center">
                                        <h1>{GAL_NAME}</h1>
                                        <h3>{GAL_DESCRIPTION}</h3><br />
                                        {MAIN_MENU}
                                </td>
                        </tr>
                </table>

neither work.  The other (normal) HTML changes work well, but I need the ability to do an SSI or some PHP code
Title: Re: Random banner in the header of all pages
Post by: snork13 on June 15, 2005, 11:25:25 pm
i would try this in the theme.php


http://coppermine.sourceforge.net/faq.php#customHeader

Title: Re: Random banner in the header of all pages
Post by: v8central on June 15, 2005, 11:57:39 pm
I think I have it - progress at least :)

Will post later, work beckons atm

Thanks for the help :)
Title: Re: Random banner in the header of all pages
Post by: Joachim Müller on June 16, 2005, 08:02:47 am
you can't use PHP nor SSI in template.html, so your first suggestions are bound not to work. Snork13 is right: do as he suggests.