TinyPortal

Development => Support => Topic started by: voyager on July 06, 2009, 03:25:11 AM

Title: Adsense...
Post by: voyager on July 06, 2009, 03:25:11 AM
I am officially the stupidest forum member. On TP 1 there is no scriptbox, so how do I add in my code for adsense? HTML and Javascript doesn't work, it just shows up as the code on it.
Title: Re: Adsense...
Post by: Skhilled on July 06, 2009, 04:28:14 AM
There has been a scriptbox on every version of TP that I can remember and I've been using it since version .74. I believe you are either missing some code and/or have incorrect file permissions. You have to check the code and manually add what is missing.

Manual Install Guide (http://docs.tinyportal.co.uk/index.php?topic=140)
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 05:21:30 AM
I don't see it on any of the dropdown options, and I had no problems installing TP.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 05:22:05 AM
Permissions are all right too, and I'm not missing anything. Everything else is there.
Title: Re: Adsense...
Post by: ZarPrime on July 06, 2009, 05:31:41 AM
voyager,

It would be nice if you would Please Read and Follow the Posting Guidelines (http://www.tinyportal.net/index.php/topic,581) so that we would know which version of TinyPortal you are using.

If you are using TP 1.0 beta 4, use the block type "HTML & Javascript Code".  Once you have saved the block for the first time the editor will show up.  Down near the bottom of the editor you will see a button that looks something like this in green --> <>

Click that and you will be able to post your code into the code area.

ZarPrime
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 05:32:31 AM
Ah thanks! That's probably what my problem is.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 05:41:58 AM
Hmm, when I press the HTML button nothing happens. I'm using 1.0.4.
Title: Re: Adsense...
Post by: ZarPrime on July 06, 2009, 05:51:05 AM
Is the highlighted button shown in the pic below the one that you are trying to push and it's not working?

ZP
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 05:51:57 AM
Yep. When I press it nothing happens.
Title: Re: Adsense...
Post by: ZarPrime on July 06, 2009, 05:55:26 AM
Well, if that is the case then I have no idea what's going on.  Something must not have gotten installed correctly when you upgraded.

Do this ...

Change your block to a php block and paste your code in.  Save it and then change the block to an HTML & Javascript block and then save it again and see if that works.

ZP
Title: Re: Adsense...
Post by: ZarPrime on July 06, 2009, 05:57:37 AM
BTW, are you using a custom theme while you are doing this?

ZP
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 06:19:47 AM
Yes it is a custom theme. I'll try it.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 06:22:25 AM
When I change it back to HTML and Javascript it goes blank. I didn't upgrade from anything, I just fresh installed 1.0.4.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 06:24:20 AM
Here's the adsense I'm trying to paste in, is there anything wrong with it?

<script type="text/javascript">
<!--google_ad_client = "pub-1226564767153163";
/* 728x90, Erstellt 05.07.09 */
google_ad_slot = "8101615957";
google_ad_width = 728;
google_ad_height = 90;//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Title: Re: Adsense...
Post by: ZarPrime on July 06, 2009, 01:18:33 PM
I don't know anything about this code.  Maybe it takes a while for it to kick in.  I seem to remember reading something about that before.  Maybe somebody else knows.

ZarPrime
Title: Re: Adsense...
Post by: Freddy on July 06, 2009, 01:23:01 PM
Yeah I have adsense on one of my sites.  It can take a while to start working.  If you get a blank page after doing what ZarPrime said, then maybe it is actually working but the ads aren't ready yet.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 01:42:10 PM
No the text in the editor dissapears when I change the block back from PHP to HTML.
Title: Re: Adsense...
Post by: Zetan on July 06, 2009, 01:45:25 PM
Start again with a Script type block.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 01:45:56 PM
There's no option for that.
Title: Re: Adsense...
Post by: Zetan on July 06, 2009, 01:47:35 PM
Scriptbox. It's still an option as far as I know.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 01:48:50 PM
Nope, on the dropdown it's missing...that's why I started this topic in the first place.
Title: Re: Adsense...
Post by: Zetan on July 06, 2009, 01:54:30 PM
I'd turn off the Editor in the options. And if that doesn't help, then you'll need to run  through the manual install guide and make sure all of the files have been edited correctly.
Title: Re: Adsense...
Post by: Freddy on July 06, 2009, 02:08:10 PM
I can confirm there is no Script block.

But using my existing script for adsense I got it to work fine with the HTML & Javascript setting.

I did this:

• Add left block
• Choose HTML & Javascript from the drop down.
• You get a prompt to save it because the block type has changed.
So I saved it.
• Then pressed the HTML button <>.  The form changes to a grey background with green ink.
• IPasted in my adsense code.
• Set the areas where it was viewable and activated it.
• Then saved the whole thing.

I did notice that the adsense code gets altered by TP somehow.  When I went back to look at the code there was a whole bunch of other code in there too.  Not sure why but the whole thing works.

Now I tried this with your adsense code too, and when displayed on the forum it is blank, making me think it is not active yet...hence my earlier point.

As you can see from my screeny...there is no longer a 'Script' block.  You can see behind the drop down it does actually work.
Title: Re: Adsense...
Post by: Zetan on July 06, 2009, 02:09:33 PM
Same thing, only it's been renamed and I haven't bothered upgrading my site for ages.

Turn the editor off, it isn't helping.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 02:38:47 PM
Then pressed the HTML button <>.  The form changes to a grey background with green ink.

Mine isn't doing that for some reason. Nothing happens when I press the <>.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 02:40:04 PM
How do you turn off the editor?
Title: Re: Adsense...
Post by: Zetan on July 06, 2009, 02:40:59 PM
Just turn it off.. I have no problems with ads, mainly because I'm not using an editor. It messes with the code. When You've got it working right, turn it back on again.

[Edit] Don't tell me there's no way to turn off the block WYSIWYG editor? You can with the Articles.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 02:41:46 PM
There's nowhere that I can just turn it off that I can see...
Title: Re: Adsense...
Post by: ZarPrime on July 06, 2009, 02:43:25 PM
voyager,

As freddy said, I think your code is working fine and the ads may just not be showing up yet.  However, the other problem with not being able to activate the html button in the editor still seems to be a problem.  Try switching to the SMF default core theme and setting up an html block and see if the button in the editor is working.  If it isn't working in the default theme then you may have to check your TP 1.0 beta 4 install since it should work as freddy said.

ZarPrime
Title: Re: Adsense...
Post by: Zetan on July 06, 2009, 02:44:23 PM
Also, see my edit.
Title: Re: Adsense...
Post by: ZarPrime on July 06, 2009, 02:50:22 PM
Zetan is correct.  If you turn the editor off for articles, it turns it off for blocks as well.

If you want to turn it off, you do it here ...
Admin --> TinyPortal --> Articles and Categories --> Settings --> Use the WYSIWYG editor?

ZarPrime
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 03:00:31 PM
Nope, you can't turn it off.

I'll try the default theme.
Title: Re: Adsense...
Post by: voyager on July 06, 2009, 03:06:13 PM
The HTML works on the default theme, but still no adsense. I'm starting to think the block isn't ready because it still shows the code for it.
Title: Re: Adsense...
Post by: Freddy on July 06, 2009, 03:19:58 PM
There's another option.

You could create an HTML article and just make it so it doesn't show all the usual information - I mean so it's just plain - then put your adsense code into that.

Then use a block and from the drop-down set to show a single article - meaning the one with the adsense code in it.

I find the editor to be a bit buggy (so which ones are not!?).  Like when I save sometimes it duplicates the code, so in this case I had two adsense slots showing, meaning I had to go back and re-enter just the one block of code.
Title: Re: Adsense...
Post by: Zetan on July 07, 2009, 12:54:04 AM
The other way I thought of as I walked out the door earlier would be to simply use a PHP Block, for now, and just echo the code.. If it works.

Code (PHP block) Select


echo '

<google code here>

';

Title: Re: Adsense...
Post by: voyager on July 23, 2009, 03:44:06 AM
So nothing I've tried here works, and I'm still having the same problem. When you go to the forum, only this code shows up:

<script type="text/javascript"><!--
google_ad_client = "pub-1226564767153163";
/* 728x90, Erstellt 05.07.09 */
google_ad_slot = "8101615957";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Update: I tried it on another one of my SMF forums, both are using 1.1.4 and the other forum didn't show anything at all when I put the code in.
Title: Re: Adsense...
Post by: Zetan on July 23, 2009, 08:40:07 AM
Well, we're all out of ideas then, because most people seem to be able to get Google Adsense to work, among other ads, Amazon for example forks fine on my site and happily sits next to Adsense in a rotating banner.

Have you tried a simple html page, just to test the code?
Title: Re: Adsense...
Post by: voyager on July 23, 2009, 09:38:43 AM
Yep, it works perfectly in a tester. I wonder if it's because the width of the ad is too large for the width of the theme? I would think that the code would still show up though.
Title: Re: Adsense...
Post by: Zetan on July 23, 2009, 11:11:01 AM
I have no idea what the problem might be.
Title: Re: Adsense...
Post by: Freddy on July 23, 2009, 11:51:31 AM
Quote from: voyager on July 23, 2009, 09:38:43 AM
I wonder if it's because the width of the ad is too large for the width of the theme? I would think that the code would still show up though.

If the ad is too large, it normally just get's cut off and you only see part of it - I don't think that is causing your problem.

Did you try the plain HTML page idea and echoing too then ?

How about if you look at the source of the page the advert is on ?  Does it look the same as the code you pasted in the script block or wherever ?
Title: Re: Adsense...
Post by: i-bystander on August 26, 2009, 05:59:41 PM
Do you have any ad-blocking app on your browser? I have ABP and of course it wouldn't show the ads. Something simple, but that was the key to my ads not showing up at first...
Title: Re: Adsense...
Post by: Zetan on August 27, 2009, 07:04:34 AM
Quote from: Zetan on July 23, 2009, 08:40:07 AM
Well, we're all out of ideas then, because most people seem to be able to get Google Adsense to work, among other ads, Amazon for example forks fine on my site and happily sits next to Adsense in a rotating banner.

Have you tried a simple html page, just to test the code?

Quote from: voyager on July 23, 2009, 09:38:43 AM
Yep, it works perfectly in a tester. I wonder if it's because the width of the ad is too large for the width of the theme? I would think that the code would still show up though.


Quote from: i-bystander on August 26, 2009, 05:59:41 PM
Do you have any ad-blocking app on your browser? I have ABP and of course it wouldn't show the ads. Something simple, but that was the key to my ads not showing up at first...

We had the code tested in a simple HTML page and it worked fine. So I don't think it's ad blocking software. Unless the OP has blocked pages of their SFM / TP site.