PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

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

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: 2499

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

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
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

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.
View user's profile Send private message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

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

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
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

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";
}
View user's profile Send private message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

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

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
View user's profile Send private message
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2499

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

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.
View user's profile Send private message
Argus
Client


Joined: Oct 06, 2003
Posts: 81

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

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

Much appreciated,

-Arg
View user's profile Send private message
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum