Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
devilsoulblack
New Member
New Member



Joined: Jul 27, 2004
Posts: 2
Location: Ecuador

PostPosted: Mon Jan 30, 2006 6:59 pm Reply with quote

How to make this possible ?

Image
 
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Mon Jan 30, 2006 8:05 pm Reply with quote

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

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Mon Jan 30, 2006 9:37 pm Reply with quote

devilsoulblack, you can get the code from here:
[ Only registered users can see links on this board! Get registered or login! ]

Of course, you have to place it in your code as evaders has mentioned.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
devilsoulblack







PostPosted: Mon Jan 30, 2006 9:38 pm Reply with quote

a have adsense by google but a look put adsense similar to [ Only registered users can see links on this board! Get registered or login! ]
 
montego







PostPosted: Mon Jan 30, 2006 10:23 pm Reply with quote

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.
 
Stang5_0
Hangin' Around



Joined: Oct 17, 2002
Posts: 49
Location: Phoenix, AZ

PostPosted: Fri Feb 17, 2006 5:18 pm Reply with quote

Can I get some clarification please. Bang Head

I had this working at [ Only registered users can see links on this board! Get registered or login! ] 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
 
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger ICQ Number
evaders99







PostPosted: Sat Feb 18, 2006 4:24 pm Reply with quote

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.
 
Stang5_0







PostPosted: Sat Feb 18, 2006 9:25 pm Reply with quote

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
 
Stang5_0







PostPosted: Sun Feb 19, 2006 12:06 am Reply with quote

Ok, I put my theme.php up on my site here: [ Only registered users can see links on this board! Get registered or login! ]

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
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sun Feb 19, 2006 2:15 am Reply with quote

You would need to do something like this
Code:
if ($name=='News') {


googlecode

}
else { };
 
View user's profile Send private message Send e-mail
Stang5_0







PostPosted: Tue Feb 21, 2006 11:33 am Reply with quote

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
 
Stang5_0







PostPosted: Wed Feb 22, 2006 10:08 am Reply with quote

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
 
Stang5_0







PostPosted: Wed Feb 22, 2006 5:02 pm Reply with quote

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
 
Guardian2003







PostPosted: Wed Feb 22, 2006 5:51 pm Reply with quote

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.
 
Stang5_0







PostPosted: Wed Feb 22, 2006 6:05 pm Reply with quote

Ok, I will step away from the side of the building at not jump. Very Happy

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
 
Guardian2003







PostPosted: Wed Feb 22, 2006 8:20 pm Reply with quote

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.
 
Stang5_0







PostPosted: Wed Feb 22, 2006 11:01 pm Reply with quote

worship 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
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©