Author |
Message |
devilsoulblack
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jul 27, 2004
Posts: 2
Location: Ecuador
|
Posted:
Mon Jan 30, 2006 6:59 pm |
|
How to make this possible ?
![Image Image](http://static.flickr.com/13/93338557_732666eb2b_o.jpg) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
Former Moderator in Good Standing
![](modules/Forums/images/avatars/803d73f6452557b947721.jpg)
Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Mon Jan 30, 2006 8:05 pm |
|
Well if you are talking about the Google ads and search block, you can put your code in the theme header - header.html or theme.php |
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Mon Jan 30, 2006 9:37 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
devilsoulblack
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jan 30, 2006 9:38 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Jan 30, 2006 10:23 pm |
|
devilsoulblack, evaders99 gave you the hint as to where you need to place the code and I gave you the hint are where to get the exact Google code. We are not going to code it for you. Take a look at your theme folder and see if it just has a theme.php script in it or if it also has various .html files such as header.html. You need to just try to place the code from Google in a few places and see if it looks the way you want it. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
Hangin' Around
![](modules/Forums/images/avatars/005.gif)
Joined: Oct 17, 2002
Posts: 49
Location: Phoenix, AZ
|
Posted:
Fri Feb 17, 2006 5:18 pm |
|
Can I get some clarification please.
I had this working at www.stangsgarage.com but then hosed it again while trying to ad my code for adsense. I am working with story_home.html and but this in the very begining of the code. Is that the wrong place? It seems to work, but then wants to place the ads between every story. I'd just like it at the top like the example shown here. Am I in the right place or should I be adding this elsewhere?
Sorry I have been working with this in so many parts of the site I thing I may have gotten mixed up somewhere..
Thanks,
Stang |
|
|
![ICQ Number ICQ Number](themes/RavenIce/forums/images/lang_english/icon_icq_add.gif) |
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Feb 18, 2006 4:24 pm |
|
You don't want to put it in story_home.html - as you said, it will put it on every story. Definitely not allowed by Google.
You'd want to put it on header.html - or probably better you'd need some code in theme.php's themeheader() function to determine if its the News module and then add your code. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Feb 18, 2006 9:25 pm |
|
Thanks Evaders! I pulled it off for time being so as not to upset Google, thank you for the advice.
I will continue to play with this though until I find the right spot.
Do you know of a post here or link off hand that would explain a bit more about how it determines if its a news module?
Thanks again,
Stang |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Feb 19, 2006 12:06 am |
|
Ok, I put my theme.php up on my site here: www.stangsgarage.com/theme.txt
I have also included my adsense code. If you could offer some advice, that would be great. I have tried it in quite a few places but it keeps hosing the page.
Thanks,
Stang |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Sun Feb 19, 2006 2:15 am |
|
You would need to do something like this
Code:if ($name=='News') {
googlecode
}
else { };
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 21, 2006 11:33 am |
|
Thanks Guardian, but still having issues. Now in another post, there was mention of closing and reopening php.
Do I have to have the code for that in there as well? I spent lots of time so far on this trying different combinations but still unable to get it to work. I know this has got to be a simple thing it's just a matter of the right code in the right place.
Thanks,
Stang |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 22, 2006 10:08 am |
|
devilsoulblack, I was just wondering if you ever got yours working correctly?
Would still like to get this on the main part of my site when I can.
Thanks,
Stang |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 22, 2006 5:02 pm |
|
The common thing I seem to be getting when trying to put this in theme.php is parse error.
Any other ideas or code examples I could try?
Thanks,
Stang |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 22, 2006 5:51 pm |
|
OK you have struggled with this long enough - time to put the puppy to bed.
The google code you are using, have you tried it in a plain html page to make sure it is correct.
If it is correct and works on a plain html page, please copt it to a plain text file so I can d/l it safely and also a plain text of your working theme.php file and I will take care of it for you. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 22, 2006 6:05 pm |
|
Ok, I will step away from the side of the building at not jump.
I have uploaded two text files as you requested.
stangsgarage.com/guardian1.txt
stangsgarage.com/guardian2.txt
guardian1.txt is the working theme.php file
guardian2.txt is the google code which I just tested and does work.
Thank you for your help with this Guardian.
Stang |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 22, 2006 8:20 pm |
|
Right lets do this the easy way.
Take what you have in the guardian2.txt file (the google code) copy it into a new file we are going to call it 'google_search.php'
Copy this file into your includes folder - so the path will be
includes/google_search.php
Next open the theme.php
At the end of the function themeheader() you will see this
Code:blocks(left);
$tmpl_file = "themes/fisubice/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
}
|
What we are going to do is 'include' the google code like this
Code:blocks(left);
$tmpl_file = "themes/fisubice/left_center.html";
$thefile = implode("", file($tmpl_file));
$thefile = addslashes($thefile);
$thefile = "\$r_file=\"".$thefile."\";";
eval($thefile);
print $r_file;
include ("includes/google_search.php");
}
|
You may want to experiment with the exact placing. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Stang5_0
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 22, 2006 11:01 pm |
|
THANK YOU!!!
Wow, that little bit of advice has gone a long long way. I still have more themes to change, but thank you so much for clearing that up for me Guardian.
I hope this saves others time. I saw mention of includes but never a straight example.
Thanks Again,
Stang |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|