Author |
Message |
Argus
Client

Joined: Oct 06, 2003
Posts: 81
|
Posted:
Sat May 29, 2004 2:58 am |
|
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 |
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Sat May 29, 2004 6:02 am |
|
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";
}
|
|
|
|
|
 |
sixonetonoffun

|
Posted:
Sat May 29, 2004 6:11 am |
|
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

|
Posted:
Sat May 29, 2004 3:32 pm |
|
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

|
Posted:
Sat May 29, 2004 7:06 pm |
|
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

|
Posted:
Sat May 29, 2004 7:45 pm |
|
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

|
Posted:
Sat May 29, 2004 9:43 pm |
|
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

|
Posted:
Sun May 30, 2004 2:41 pm |
|
Thanks for the tip on Ganja's post. I responded in his thread and am working on it right now.
Much appreciated,
-Arg |
|
|
|
 |
|