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
gstrategic
Hangin' Around


Joined: Aug 15, 2005
Posts: 46

PostPosted: Fri Aug 26, 2005 6:41 pm Reply with quote

So I found out that an article has home text, body text and note text and they are sectioned out like that in the php file.

Has anyone tried to insert an Adsense section right after the home text section? Do you know what I'm talking about?

Thanks,
 
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17086

PostPosted: Sat Aug 27, 2005 5:58 am Reply with quote

No. Please explain.
 
View user's profile Send private message
gstrategic
PostPosted: Sat Aug 27, 2005 12:39 pm Reply with quote

I want to insert an Adsense module into an article either at top or middle.

The news submission has 3 parts: home text, extended text and note. So when someone clicks on Readmore all three parts brought together to assembly a complete article (the News module). Is there a way to insert an adsense module right after the home text part?

Thanks,
 
Raven
PostPosted: Sun Aug 28, 2005 4:54 am Reply with quote

You mean like the Test Story on my front page?
Only registered users can see links on this board! Get registered or login!
 
gstrategic
PostPosted: Sun Aug 28, 2005 7:23 am Reply with quote

yes! how did you get that in there like that?
 
Raven
PostPosted: Sun Aug 28, 2005 8:02 am Reply with quote

I just added the code into the Home box. If you are getting HTML tags are not allowed (or something similar) Just apply this fix and all should be well Wink Only registered users can see links on this board! Get registered or login!
 
gstrategic
PostPosted: Sun Aug 28, 2005 11:15 pm Reply with quote

Quote:
foreach ($_GET as $sec_key => $secvalue) {

if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*img*\"?[^>]*>", $secvalue)) ||

(eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) ||

(eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||

(eregi("\"", $secvalue)) ||

(eregi("forum_admin", $sec_key)) ||

(eregi("inside_mod", $sec_key))) {

die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");

}

}



foreach ($_POST as $secvalue) {

if ((eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) || (eregi("<[^>]script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]style*\"?[^>]*>", $secvalue))) {

die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");

}

}


I didn't find the code section like you suggested, and found this instead. I tried at the "if (!is_admin($admin)) {" and the closing tag "}". Reload and the whole page got blank. I put back the original mail file.

I insert the adsense code into the Home box and it just disappeared. I didn't get any error message.


Last edited by gstrategic on Sun Aug 28, 2005 11:29 pm; edited 1 time in total 
Raven
PostPosted: Sun Aug 28, 2005 11:20 pm Reply with quote

That's the correct section and that's the correct wrapper code. Carefully try it again.
 
gstrategic
PostPosted: Sun Aug 28, 2005 11:39 pm Reply with quote

It has not worked. I don't know if you notice how the code in your fix isn't the same as mine. however you did mention "similarity". No, it didn't work.
 
Raven
PostPosted: Sun Aug 28, 2005 11:47 pm Reply with quote

The code similarity or not is not the issue. I use that EXACT code in my mainfile as do many, many others. What version of nuke are you using?
 
gstrategic
PostPosted: Sun Aug 28, 2005 11:53 pm Reply with quote

PHP Nuke 7.7

I added this

"if (!is_admin($admin)) {"

at the beginning and one close tage "}" at the end. It didn't work.
 
Raven
PostPosted: Mon Aug 29, 2005 12:00 am Reply with quote

So you are saying that this doesn't work.
Code:
if (!is_admin($admin)) {

foreach ($_GET as $sec_key => $secvalue) {
   if ((eregi("<[^>]*script*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*object*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*iframe*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*applet*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*meta*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*style*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*form*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*img*\"?[^>]*>", $secvalue)) ||
   (eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) ||
   (eregi("\([^>]*\"?[^)]*\)", $secvalue)) ||
   (eregi("\"", $secvalue)) ||
   (eregi("forum_admin", $sec_key)) ||
   (eregi("inside_mod", $sec_key))) {
      die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");
   }
}

foreach ($_POST as $secvalue) {
   if ((eregi("<[^>]*onmouseover*\"?[^>]*>", $secvalue)) || (eregi("<[^>]script*\"?[^>]*>", $secvalue)) || (eregi("<[^>]style*\"?[^>]*>", $secvalue))) {
      die ("<center><img src=images/logo.gif><br><br><b>The html tags you attempted to use are not allowed</b><br><br>[ <a href=\"javascript:history.go(-1)\"><b>Go Back</b></a> ]");
   }
}
}
 
gstrategic
PostPosted: Mon Aug 29, 2005 12:12 pm Reply with quote

No, it doesn't work.
 
64bitguy
The Mouse Is Extension Of Arm


Joined: Mar 06, 2004
Posts: 1159
Location: Sanbornton, NH USA

PostPosted: Mon Aug 29, 2005 12:52 pm Reply with quote

I realize that Raven is helping you with this, but in reading it, I had a few questions.

Quote:
I insert the adsense code into the Home box and it just disappeared.


What disappeared? The entire homepage? Or just one article? Or what?

Next, were you actually getting the "html tags" error message on your screen when you first tried this without the mods suggested by Raven?

Next, what is your "Patched" version?

Finally, is there anything inside your "error_log" file?

Thanks!

_________________
Steph Benoit Only registered users can see links on this board! Get registered or login!
1CMS, 100% Section 508 and W3C XHTML/CSS Compliant (Truly) 
View user's profile Send private message Visit poster's website
gstrategic
PostPosted: Mon Aug 29, 2005 4:46 pm Reply with quote

I inserted the code in the HOME box two ways: direct input and input in the HTML box. When I do it directly the code shows up as text, and when I entered into the HTML box, the code disappeared the next time I open the HTML box.

I do not get the "HTML tages" error message.

I do not know what my "patched" version is and where to look for that. Sad

I have not checked my "error_log" file. (I'll do that next)

Thank you.
 
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 ©