Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.0
Author Message
Argus
Client



Joined: Oct 06, 2003
Posts: 81

PostPosted: Sat May 29, 2004 2:58 am Reply with quote

Hey there,

I noticed in a post of chatserv's somewhere that mainfile.php blocks the style tag. I'm curious why. I am calling a perl script off another web server and wanting to override the default .css with one of my own. I was trying to do something like this:

Code:


<iframe src="http://sub.domain.com/query/stat.pl?
style=http://mysubdomain.domain.com/white.css&id=myid" width=400 height=600 frameborder=0 />


Can you tell me if there is another way to do this?

Thanks much,

-Arg
 
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Sat May 29, 2004 6:02 am Reply with quote

Here is one way to do it this would let you either have a new style.css for the page you want or no style sheet. I did this when I had a style that worked great for the site but made the admin area almost unviewable. Just replace admin with the name of you module.

In header.php find
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
Replace it with this after making the needed changes. The first part is just to make it IIS compatable you can leave that out if you don't need it.

Code:


// Switch Styles for Admin
if(!isset($_SERVER['REQUEST_URI'])) {
       $_SERVER['REQUEST_URI'] = substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1);
       }
       if (!strpos($_SERVER['REQUEST_URI'], 'admin')){
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
 }
 if (strpos($_SERVER['REQUEST_URI'], 'admin')){
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/alt_style.css\" TYPE=\"text/css\">\n\n\n";
 }
 
View user's profile Send private message
sixonetonoffun







PostPosted: Sat May 29, 2004 6:11 am Reply with quote

I just re read your post the Why? part is because the attributes for style are easily exploited with java redirects and so on. You could probably stick your whole I-Frame code in the attributes for a <b tag if the style attributes didn't get stripped.
 
Argus







PostPosted: Sat May 29, 2004 3:32 pm Reply with quote

SO I change admin to content and then when creating content there is an option to change the style sheet? And thx much for the reply.

-Arg
 
sixonetonoffun







PostPosted: Sat May 29, 2004 7:06 pm Reply with quote

Now that I think about what you are doing this might work better but you might have figured that out by now.
Code:


if(!isset($_SERVER['REQUEST_URI'])) {
       $_SERVER['REQUEST_URI'] = substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1);
       }
if (strpos($_SERVER['REQUEST_URI'], 'Content')){
// path to style that works with Content
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/alt_style.css\" TYPE=\"text/css\">\n\n\n";
 }else{
// Default path to style.css
echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
}
 
Argus







PostPosted: Sat May 29, 2004 7:45 pm Reply with quote

lol, ok. I just figured out I rode this topic right off the rails with the original post. At least I think I did. Let me explain better what is happening. I am remotely calling a script which a. is hosted on another webserver not belonging to me, it's my game server host and b. is formatted by a css called by the script itself. This is the css I am trying to override. So I have no control over the script itself and simply want to format the output in a manner more consistent with my site. Sorry for any confusion.

Thanks,

-Arg
 
sixonetonoffun







PostPosted: Sat May 29, 2004 9:43 pm Reply with quote

Ok you'll probably get better results with one of the url grabber scripts then instead of an I-frame. I'm not sure which of the ones out there is "best" but there are a load of em around. In fact Ganja just posted a block version of one for someone not long ago here. The basic code should work in a module as well as a block. Then you can begin your grab of the html after the style's are included. Works great till they change the page (which on most isn't real often).

There is CrossNuke Browser but that gets a little wierd sometimes too and can be really slow because of the rewriting of urls that it does. I'd just use something simpler. Of course that depends on having fopen url enabled on your site.
 
Argus







PostPosted: Sun May 30, 2004 2:41 pm Reply with quote

Thanks for the tip on Ganja's post. I responded in his thread and am working on it right now.

Much appreciated,

-Arg
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.0

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 ©