1
Skythe
GoogleAds in Xoops
  • 2004/8/1 22:14

  • Skythe

  • Just popping in

  • Posts: 99

  • Since: 2004/7/2 2


I've tested GoogleAds on my site today and well I gotta say they screwed everything up big time.

I pasted the GoogleAds code into my theme.html, cause I'm not going to put it in a block and have double borders.

Here's what the relevant part of my theme.html looks like:

<
td width="125" valign="top">
<{foreach 
item=block from=$xoops_lblocks}>
<{include 
file="../themes/xxxxx/theme_blockleft.html"}>
<{/foreach}>
td>


I added the code to the cell, right after/below the left menu loop:

<
td width="125" valign="top">
<{foreach 
item=block from=$xoops_lblocks}>
<{include 
file="../themes/PlanetSmilies/theme_blockleft.html"}>
<{/foreach}>

<
script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
script>

td>


...while the rest of the GoogleAds code (the part with colors, ad format, account info and stuff like that) went into the HEAD so it would be good friend with the rest of my jscripts there.

Here's that part too:
<script type="text/javascript">


I tested the whole thing, it worked. I added a
to seperate the ads more from the left hand menu and everything crashed. What I got was a white page, no error messages whatsoever.

I removed the
, and in return got my logo and background color back. -.- I removed all GoogleAds code, got me a new one from GoogleAdsense and this time it worked again. I centered the ads using
<div align="center"><center>center>div>

and it ceased working. I removed some spaces before and after the ad code and it worked once more.

Long story short, it seems absolutely random. A simple   or
or empty line would make the whole page work or crash it. Not just the left hand menu, but THE WHOLE THING. I would sometimes get nothing but the logo, background and random jscript snipplets.

Five minutes ago I went to check my page again and I got a white page and
Error [Xoops]: Unable to connect to database
in file 
class/database/databasefactory.php line 34



Can somebody tell me what on earth is going on?

2
brash
Re: GoogleAds in Xoops
  • 2004/8/1 22:37

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


I just paster the Google ad html code into the htnl area of XOOPS banners. Works fine for me.

3
Bassman
Re: GoogleAds in Xoops
  • 2004/8/1 22:47

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


That database problem you got is usually related to a server problem rather than a XOOPS problem. I was getting the same thing when my host had Apache problems.

4
JMorris
Re: GoogleAds in Xoops
  • 2004/8/2 2:01

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


If you want to statically insert GoodAds into your theme, here are a couple relatively safe places to insert the code [note: I'm using the Default XOOPS theme for this illustration]

Quote:









 





<{if $xoops_showrblock == 1}>

<{/if}>



<{foreach item=block from=$xoops_lblocks}>
<{include file="default/theme_blockleft.html"}>
<{/foreach}>












<{if $xoops_showcblock == 1}>









<{foreach item=block from=$xoops_ccblocks}>
<{include file="default/theme_blockcenter_c.html"}>
<{/foreach}>



<{foreach item=block from=$xoops_clblocks}>
<{include file="default/theme_blockcenter_l.html"}>
<{/foreach}>



<{foreach item=block from=$xoops_crblocks}>
<{include file="default/theme_blockcenter_r.html"}>
<{/foreach}>


<{/if}>


<{$xoops_contents}>



<{foreach item=block from=$xoops_rblocks}>
<{include file="default/theme_blockright.html"}>
<{/foreach}>


















[note: just insert the above code between your body tags to update the default theme]

Alternately, you can use the Google WYSIWYG editor to match the background and border colors so that there "appears" not to be a border around the GoogleAds. This would enable you to insert your code into a block and still keep a clean appearance.

My best suggestion is for you to try out different things, but try it out on either a non-production site in a sub-directory, or install a stand-alone server on your home system and test there.

Hope this helps.

5
Skythe
Re: GoogleAds in Xoops
  • 2004/8/2 15:48

  • Skythe

  • Just popping in

  • Posts: 99

  • Since: 2004/7/2 2


@brash: I did that. how do you make your XOOPS banners actually show up? the googleads banner i added under System > Banners is gathering impressions like crazy (2308 in 2 min) without being on the page wtf

@Bassman: my host is telling me that they cant locate the error without actually seeing the error message e.e

@JMorris: thats about what i did. Just without the extra table but the existant cell :-/

6
Skythe
Re: GoogleAds in Xoops
  • 2004/8/2 16:22

  • Skythe

  • Just popping in

  • Posts: 99

  • Since: 2004/7/2 2


and on a sidenote, how do you make blocks only show up for admins or registered users?

7
theprof
Re: GoogleAds in Xoops
  • 2004/8/2 16:29

  • theprof

  • Quite a regular

  • Posts: 225

  • Since: 2004/7/14


Yeah, I think the easiest way to do this, without going into your code, is making a block. To have the block only appear for reg. users and admin...Go to Admin--> then go to System Admin----> then go to Groups....set that block permissions how you want,....for Webmaster, Register Users...and Anonymous.....



8
JMorris
Re: GoogleAds in Xoops
  • 2004/8/2 16:47

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Quote:

Skythe wrote:
@JMorris: thats about what i did. Just without the extra table but the existant cell :-/


The embedded table is what prevents the XOOPS theme from breaking up.

I tried using an existing cell before I came up with this method, and it broke my site too. The embedded table is how I got around breaking my theme. Give it a shot, it might just work for you too.

9
Skythe
Re: GoogleAds in Xoops
  • 2004/8/2 18:13

  • Skythe

  • Just popping in

  • Posts: 99

  • Since: 2004/7/2 2


Okay I think this has nothing to do with GoogleAds. I'm an HTML god, I know how to paste & implement %§&$.

The same thing is happening with other parts of my website now too. At the end of my theme.html I got this little box with copyrights, blabla and a link to our disclaimer. 3 minutes ago I changed the link to it from /links/disclaimer.php to /static/disclaimer.php and the site stopped working.

I mean wtf, this has nothing to do with the actual link. The kernel does not know if its valid (it is) or not. Its the fact that I changed something in the theme.html, and the database gets screwed up by Xoops.

My host just told me that there are like 10 connections to the database which are practically idle and only blocking resources, but something didnt end those connections. They told ME, the php newb, to look for missing mysql_close() hahahahhhhhhhelp

10
JMorris
Re: GoogleAds in Xoops
  • 2004/8/2 19:05

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


The XOOPS theme system is not just html. You have to take into consideration that php calls are integrated into the theme.html file. Therefore, if you go tinkering with the code like you would traditional static html, you're going to mess something up unless you know what you're doing.

Take a look at the DOCTYPE:
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>


You're not dealing with traditional or even transitional HTML here, it's XHTML.

Now, with that said, what theme are you using? Could you provide a link to your site so we can see what is going on? Have you changed any other hard coded links in your theme?

Also, you remove the XOOPS copyrights and links in a theme from the Admin > Preferences > Meta Tags and Footer Menu.


Login

Who's Online

226 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 226


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits