http://forum.coppermine-gallery.net/index.php/topic,47177.0.html
after studying the above topic I am posting this one.
Q: I want to add banner codes / html link's table e.g. only at homepage, like:
[Edit GauGau] Replaced hotlinked image with attachment [/Edit]
now I added these codes in template.html, therefor It is visible on every page of the site, I don't want this, but only at bottom of homepage
Using Stramm modepack and Oraje Theme.
URL : www.PICSnCLIPS.net (http://www.picsnclips.net)
Check which page you're on in a PHP script, and only output the HTML if it's the Gallery home page:
Create a file using Notepad called something like: theme_footer.php
The script needs to be like this:
<?php
global $ORIGINAL_PHP_SELF;
if ($ORIGINAL_PHP_SELF=="/gallery/index.php)
{
echo " put your banner HTML between these quotes";
}
?>
Then use Admin>Config>Themes to point to theme_footer.php as the Custom Footer.
Hope that makes sense!
Whoops, missed the closing quotes. Try this:
<?php
global $ORIGINAL_PHP_SELF;
if ($ORIGINAL_PHP_SELF=="/gallery/index.php")
{
echo " put your banner HTML between these quotes";
}
?>
thanks for your response!
I added given codes within the " html codes " but i faced the error below and also disappeared the side-menu
[Edit GauGau] Replaced hotlinked image with attachment [/Edit]
my footer.php file is as
<?php
global $ORIGINAL_PHP_SELF;
if ($ORIGINAL_PHP_SELF=="/gallery/index.php")
{
echo " <a title="Pakistan's Online Public Community" target="_blank" href="http://www.jangforum.com/">Jang Forum</a>";
}
?>
I want to add complete html table codes within quotes, starts from "<table border="1" width="100%" id="table1">
<tr>
<td align="center">
<a title="Paki... </table>"
or is it possible that i write the html file's path within quotes like "[path]/footer.htm".
because i want to add partners' links in html table and scrolling banners e.g. now visible at my site's ( www.picsnclips.net (http://www.picsnclips.net)) every page
Use quotes properly, like this.
<?php
global $ORIGINAL_PHP_SELF;
if ($ORIGINAL_PHP_SELF=="/gallery/index.php")
{
echo '<a title="Pakistan\'s Online Public Community" target="_blank" href="http://www.jangforum.com/">Jang Forum</a>';
}
?>
PS. Why post a screenshot of an error message that you can far more easily copy/paste?
Just to amplify what Nibbler said ...
If you want to use double-quotes (") inside the string that you're going to echo, you need single quotes (') as the wrapper. You then get the problem that if you want to include a single quote, too, the parser will think that's the end of the string. So you escape it by putting \ in front. So:
echo " output string "; is OK
echo ' output string' ; is OK
echo " output "string" "; is BAD
echo ' output "string" '; is OK
echo ' nibbler's message'; is BAD
echo ' nibbler\'s message'; is OK
The easiest rule for me to remember is: use single quotes as the wrapper and escape\ any internal single quotes; then internal double quotes are OK.
Hope that helps, from one PHP newbie to another:)
@Qayyom: stop hotlinking images - I'm fed up having to clean up after you. You posted
[center][img width=800 height=45]http://qayyom.qa.funpic.org/gallery/1_27_03_08_10_09_56.jpg[/img][/center]
, I replaced with
Quote from: Qayyom on March 27, 2008, 10:40:05 AM[Edit GauGau] Replaced hotlinked image with attachment [/Edit]
Did so countless times already for you - it's time for you to start respecting board rules.
Very Sorry!
sorry "GauGau" and "Nibbler" I'll never do it again, thanks for your support and tolerance
sorry again