• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: admin/styles.php workaround
PostPosted: Fri Mar 10, 2006 7:45 pm 
I had some problems with admin/style.php, and I've corrected them.
Here goes admin/style.php for you that having the same problem (no style being displayed)
Code:
<?php
// Style.php Workaround by rescbr
//CHANGED
header("Content-type: text/css");
require_once("../include.php");
require_once("../lib/classes/class.user.inc.php");
$theme=get_preference(get_userid(),"admintheme");
$style="style";
if (isset($_GET['ie']))
    {
    $style.="_ie";
    }
$style .= ".css";
if (file_exists(dirname(__FILE__)."/themes/".$theme."/css/".$style))
   {
   
        //change readfile to these commands:
   //readfile(dirname(__FILE__)."/themes/".$theme."/css/".$style);
        $localfile = file_get_contents(dirname(__FILE__)."/themes/default/css/".$style);
   echo($localfile);
   
   }
else if (file_exists(dirname(__FILE__)."/themes/default/css/".$style))
   {
        // Same thing here
   //readfile(dirname(__FILE__)."/themes/default/css/".$style);
   $localfile = file_get_contents(dirname(__FILE__)."/themes/default/css/".$style);
   echo($localfile);
}
?>


That's only this.


Top
  
 
 Post subject: Re: admin/styles.php workaround
PostPosted: Sat Mar 11, 2006 1:14 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jun 11, 2004 6:58 pm
Posts: 3334
Location: Fairless Hills, Pa USA
Hmm.  Interesting.  The only real issue I see is that file_get_contents was introduced in 4.3.0.  However, I think this could be adjusted into an if/else.  At least the majority of people will get file_get_contents and rest will get readfile.

_________________
http://about.me/tedkulp


Top
 Profile  
 
 Post subject: Re: admin/styles.php workaround
PostPosted: Sat Jan 13, 2007 10:11 pm 
Offline
Forum Members
Forum Members

Joined: Tue Dec 12, 2006 2:06 am
Posts: 12
I had this exact problem and tried a number of things to fix it with no success. I decided to give your workaround a try. It worked perfectly! Maybe this code should get added to the code base.

Thanks very much for posting this.

Tony


Top
 Profile  
 
 Post subject: Re: admin/styles.php workaround
PostPosted: Mon Mar 12, 2007 4:17 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Mon Apr 24, 2006 1:01 am
Posts: 811
Location: Deatsville, AL
tonypiazza wrote:
I had this exact problem and tried a number of things to fix it with no success. I decided to give your workaround a try. It worked perfectly! Maybe this code should get added to the code base.

Thanks very much for posting this.

Tony


Hmm.... Any idea why this fixes the problem?

I'd be glad to apply this patch if it would be helpful to everyone and didn't have any downsides.

I'd first like to understand more about this patch though.

Thanks,

Elijah

_________________
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)


Top
 Profile  
 
 Post subject: Re: admin/styles.php workaround
PostPosted: Thu Mar 22, 2007 12:38 am 
I realize that this is an old post, but for what it worths, this workaround works for me too :)
The instalation worked like a charm until I logged in in the admin area ... where I had no style. Browsed the forums like crazy after that until I stumbled on this thread :)
Thx a lot rescbr.


Top
  
 
 Post subject: Re: admin/styles.php workaround
PostPosted: Thu Mar 22, 2007 12:42 am 
Offline
Power Poster
Power Poster
User avatar

Joined: Mon Apr 24, 2006 1:01 am
Posts: 811
Location: Deatsville, AL
Hmm... If I had more time I'd post this in the wiki somewhere. For now I'll bookmark it on my CMSMS tips page.

Thanks  :)

_________________
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)


Top
 Profile  
 
 Post subject: Re: admin/styles.php workaround
PostPosted: Thu Sep 13, 2007 11:01 am 
Offline
Forum Members
Forum Members

Joined: Thu Sep 13, 2007 10:50 am
Posts: 82
Location: Bristol, UK
Hi Everyone,

I appreciate this is an old thread so apologies if this isn't new info to you, however this issue still exists in V1.1.1.

This issue crops up a number of times in the forums so anything you can do to solve it or make it more visible would be a good thing.

For me (and no doubt many others) this problem is caused by my host disabling readfile for security reasons.

The solution for me is to replace readfile with echo file_get_contents

The readfile command occurs in a few files so be sure to replace all of them.

Bob


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


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 post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner