forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: dahak on November 13, 2004, 10:49:43 pm

Title: I can't seem to add Google Adsense to my gallery properly, help?
Post by: dahak on November 13, 2004, 10:49:43 pm
I'm using the Igames theme.  I added the Adsense code to the bottom of "// HTML template for main menu" in theme.php but it causes all the header images on my site to be misaligned.  Can anyone tell me how to properly add the code?  Thanks.
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: dahak on November 14, 2004, 04:52:38 am
I'm trying to add the banner centered in the area between the user buttons and "Category, Albums, Files" header.
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: Joachim Müller on November 14, 2004, 01:38:23 pm
I never used the adsense code, but afaik it's no php code, but plain HTML/JavaScript. If my assumption is true, then just put the code into themes/yourtheme/template.html.

Joachim
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: dahak on November 14, 2004, 11:27:13 pm
Yes, it is JavaScript.

Code: [Select]
<script type="text/javascript"><!--
google_ad_client = "pub-9099051356821394";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_color_border = "000000";
google_color_bg = "F0F0F0";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


I tried adding it to the template.html like you said but the banner isn't showing up.  Where in the code do I place it?  Here is my unmodified template.html

Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{LANG_DIR}">
<head>
<title>{TITLE}</title>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
{META}
<link rel="stylesheet" href="themes/igames/style.css" />
<script type="text/javascript" src="scripts.js"></script>
<!--
$Id: template.html,v 1.5 2004/07/28 08:53:42 gaugau Exp $
-->
</head>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
<body>
<div id="Menu1" style="position:absolute; width:800px; height:30px; z-index:1; left: 20px; top: 100px; visibility: hidden;">
                <span class="topmenu">
                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                        <td>
                                        {MAIN_MENU1}
                                        </td>
                                </tr>
                        </table>
                </span>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="top_panel">
  <!-- fwtable fwsrc="top_panel.png" fwbase="top_panel" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
  <tr>
    <td><table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td background="themes/igames/images/top_panel_r1_c1.jpg">
            <h1>{GAL_NAME}</h1>
            <h3>{GAL_DESCRIPTION}</h3></td>
            <td background="themes/igames/images/top_panel_r1_c4.jpg" ><img src="../../images/spacer.gif" width="1" height="70" border="0" alt="" /></td>
          <td width="50%" background="themes/igames/images/top_panel_r1_c4.jpg" valign="center" align="right">{THEME_SELECT_LIST}&nbsp;{LANGUAGE_SELECT_LIST}&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td><table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td><img name="top_panel_r2_c1" src="themes/igames/images/top_panel_r2_c1.jpg" width="20" height="35" border="0" id="top_panel_r2_c1" alt="" /></td>
          <td background="themes/igames/images/top_panel_r2_c2.jpg">{MAIN_MENU2}</td>
          <td width="100%" background="themes/igames/images/top_panel_r2_c3.jpg" style="background-repeat : no-repeat;
background-position : right;
">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="20">
  <tr>
    <td align="center">{ADMIN_MENU} {GALLERY} </td>
  </tr>
</table>
<p>&nbsp;</p>
{LANGUAGE_SELECT_FLAGS}
</body>
</html>
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: Joachim Müller on November 15, 2004, 07:02:08 am
Wherever you want it to appear. It's just plain HTML - the stuff in curly braces are place holders - don't remove them. Apart from that, just add the code anywhere and that's it.

Joachim
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: dahak on November 16, 2004, 03:35:10 am
Thank you! Got it working.  Apparently, my server was caching an old version of template.html which is why the banner wasn't showing up.
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: Mac on November 20, 2004, 11:52:24 am
Hi... I'm trying to add a *vertical* Adsense banner, to my displayimages page, to the right of the main image or possibly to the right of the file info (Vii template). I'm looking at this part of the template file:

Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="20">
  <tr>
    <td align="center">{ADMIN_MENU} {GALLERY}</td>
  </tr>
  <tr>
    <td align="center">{THEME_SELECT_LIST}&nbsp;{LANGUAGE_SELECT_LIST}&nbsp;{LANGUAGE_SELECT_FLAGS}</td>
  </tr>
</table>

If I put my Adsense code after {GALLERY}, the banner obviously appears at the bottom of the page, below all the file info. If I put it between {ADMIN_MENU} and {GALLERY}, it appears near the top of the page, between the breadcrumbs and the admin menu. It seems to me that I need to edit the file that {GALLERY} refers to, but I have yet to track this down... Am I looking along the right lines?

And a much more general question - is there a document that describes how CPG works, or outlines its structure, to help beginners know where to start?

Thanks,
Mac
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: Casper on November 20, 2004, 12:28:10 pm
You should try placing it in a new table cell, after the gallery cell, but in the same row.
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: Joachim Müller on November 21, 2004, 07:33:28 am
And a much more general question - is there a document that describes how CPG works, or outlines its structure, to help beginners know where to start?
Yes, it comes with the coppermine package: browse the docs folder. The documentation is also available online, click the link that says "documentation" at the very top of this screen.

Joachim

P.S. We have a "one question per thread" policy on this board, you agreed to respect it when signing up for your account on this board...
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: Mac on November 22, 2004, 07:52:06 am
You should try placing it in a new table cell, after the gallery cell, but in the same row.


Thanks for that. I must admit, it looks better than expected... but not quite what I had in mind, as the Google Ads are still "floating" some distance away from the main picture & file info; and vertically they are half way between both. Even with the align tags of those cells set to "right" and "left", they can't be pushed together, and the page breaks slightly at 800x600.

If it's insanely complicated to achieve this, I can live with the current solution. In general I could imagine others wanting to put adverts between pic and file info, among file info, etc; or hack the file info for other purposes...

P.S. GauGau, thanks, I'd forgotten about the one-question rule. I've reposted it with your reply and my further comment, in this thread: http://forum.coppermine-gallery.net/index.php?topic=11962.0
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: ganesh on November 19, 2005, 06:36:05 pm
Wherever you want it to appear. It's just plain HTML - the stuff in curly braces are place holders - don't remove them. Apart from that, just add the code anywhere and that's it.

Joachim
I can't make it work!
But I don't know why... ???
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: Joachim Müller on November 20, 2005, 08:28:03 pm
it doesn't make sense just to post that you have issues with this without posting a link to your site and describing what you did. If you want help, post details.
Title: Re: I can't seem to add Google Adsense to my gallery properly, help?
Post by: ganesh on November 22, 2005, 09:47:52 am
Sorry, but I solved... it was a caching problem ::)
Excuse me!  ;D