sandman Posted April 25, 2007 Posted April 25, 2007 (edited) In experimentation for BlogIt 0.22, I decided to test out a skin switcher. I set things up, and to my surprise, everything worked the first time. Just to show you, here is index.auw: expandcollapse popup;index.auw ;for BlogIt ;coding by sandman ;skins by www.freecsstemplates.org #include "web.au3" If _Get("preview") <> "" Then $prevskin = _Get("preview") $skinlist = FileRead("skins.txt") $findskin = StringInStr($skinlist, $prevskin) If $findskin = 0 Then _MsgBox("Invalid skin name.") Else _StartWebApp("BlogIt Skin Preview :: " & $prevskin, "<link rel='stylesheet' href='skins/"&$prevskin&"/default.css'>") $pgheader = FileRead("html/index_header.html") Echo($pgheader) $content = FileRead("html/postheader.html") Echo($content) $pgfooter = FileRead("html/index_footer.html") Echo($pgfooter) EndIf Else ;load skin $rskin = IniRead("options.ini", "Settings", "skin", "chromz") ;start page, and show skin _StartWebApp("BlogIt :: Index", "<link rel='stylesheet' href='skins/"&$rskin&"/default.css'>") ;load constant headers $pgheader = FileRead("html/index_header.html") Echo($pgheader) ;load main content $content = FileRead("html/postheader.html") Echo($content) ;load constant footers $pgfooter = FileRead("html/index_footer.html") Echo($pgfooter) EndIfNow, this actually works fine. I don't even really need to post it. The <link rel='stylesheet'... actually shows up in the HTML code.But for some EXTREMELY ANNOYING reason, the CSS doesn't show up.By default, default.css sets a background and other things that do not require correct <div> tags. I have no idea why it is not showing these.Things I have already tried:commenting out numerous sections of index.auw = FAILEDmoving default.css to the same directory as page and changing the href link = FAILEDThis has been an extremely frustrating addition.. if the code even shows in the page source, WHY ISN'T IT WORKING?!?!Sorry for yelling ,SANDMAN! Edited April 26, 2007 by sandman [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
therks Posted April 26, 2007 Posted April 26, 2007 (edited) Could you view source and post the code from that please? It might help. *Edit: Your two _StartWebApp lines are confusing me. How come in one the second parameter is a full <link> tag, and in the other, it's just a relative path? Edited April 26, 2007 by Saunders My AutoIt Stuff | My Github
sandman Posted April 26, 2007 Author Posted April 26, 2007 1. Sure.. I'll comment it a bit too. Comments are marked with a ;.<html><head>;SEE, IT'S RIGHT HERE!!<link rel='stylesheet' href='skins/chromz/default.css'><title>BlogIt :: Index</title></head><div id="logo"> <h1><a href="#">blogit</a></h1> </div> <div id="menu"> <ul> <li class="active"><a href="index.auw" title="">View Posts</a></li> <li><a href="admin.auw" title="">Write a post</a></li> </ul> </div> <div id="wrapper"> <div id="col-two"> <div id='footer'><p id="legal">Copyright © 2007 Chromz. All Rights Reserved.</p><p align='right' id='legal'><a href='http://www.autoitscript.com/forum/index.php?showtopic=44582'>BlogIt v0.21 © sandman 2007.</a></p></div> 2. Sorry, during the time I was trying to fix this I changed the parameters a bit.. must have forgotten to change that. Also, I forgot to revert it back to the skin switcher version.. OOPS! I'll do that right now Correct index.auw code:expandcollapse popup;index.auw ;for BlogIt ;coding by sandman ;skins by www.freecsstemplates.org #include "web.au3" If _Get("preview") <> "" Then $prevskin = _Get("preview") $skinlist = FileRead("skins.txt") $findskin = StringInStr($skinlist, $prevskin) If $findskin = 0 Then _MsgBox("Invalid skin name.") Else _StartWebApp("BlogIt Skin Preview :: " & $prevskin, "<link rel='stylesheet' href='skins/"&$prevskin&"/default.css'>") $pgheader = FileRead("html/index_header.html") Echo($pgheader) $content = FileRead("html/postheader.html") Echo($content) $pgfooter = FileRead("html/index_footer.html") Echo($pgfooter) EndIf Else ;load skin $rskin = IniRead("options.ini", "Settings", "skin", "chromz") ;start page, and show skin _StartWebApp("BlogIt :: Index", "<link rel='stylesheet' href='skins/"&$rskin&"/default.css'>") ;load constant headers $pgheader = FileRead("html/index_header.html") Echo($pgheader) ;load main content $content = FileRead("html/postheader.html") Echo($content) ;load constant footers $pgfooter = FileRead("html/index_footer.html") Echo($pgfooter) EndIf [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
therks Posted April 26, 2007 Posted April 26, 2007 (edited) Would it be safe to assume that if you wrote that HTML into a separate file and loaded that, it still does not work? I notice two things right off the bat, no <body> tags, and no closing <html> tag. Don't know if that will fix the problem, but it's bad form. I'll have a look at it some more later, right now I'm going to bed. *Edit: Just had to mention, you don't close two of the <div>'s either ("wrapper" and "col-two"). Edited April 26, 2007 by Saunders My AutoIt Stuff | My Github
BrettF Posted April 26, 2007 Posted April 26, 2007 Would it be safe to assume that if you wrote that HTML into a separate file and loaded that, it still does not work?I notice two things right off the bat, no <body> tags, and no closing <html> tag. Don't know if that will fix the problem, but it's bad form. I'll have a look at it some more later, right now I'm going to bed.*Edit: Just had to mention, you don't close two of the <div>'s either ("wrapper" and "col-two").Too right! What you doing up so early your time??? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
sandman Posted April 26, 2007 Author Posted April 26, 2007 Would it be safe to assume that if you wrote that HTML into a separate file and loaded that, it still does not work?I notice two things right off the bat, no <body> tags, and no closing <html> tag. Don't know if that will fix the problem, but it's bad form. I'll have a look at it some more later, right now I'm going to bed.*Edit: Just had to mention, you don't close two of the <div>'s either ("wrapper" and "col-two").Yeah, I noticed that too.. I didn't think that that would change much, though.I have already tried copying it into a HTML file and opening it, same result.Tested in both IE and FF. But, as my last resort, I will try adding in the body and closing div tags. I will post the results soon. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
sandman Posted April 26, 2007 Author Posted April 26, 2007 Oh, I feel stupid now.... That worked... Thank you Saunders! [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
sandman Posted April 26, 2007 Author Posted April 26, 2007 Ugh, wait... It just stopped working again... I didn't even change anything [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
therks Posted April 28, 2007 Posted April 28, 2007 Sorry I took so long, been a little busy. Strange that it worked, then didn't... strange indeed. I do have some other suggestions. Ensure that the path is correct as far as the browser is concerned. Easy enough to do, just add a link to that same page, like <a href="skins/chromz/default.css">Test</a>. You wouldn't believe how many times that's screwed me up (some servers are picky about case sensitivity too, skins/chromz is different from Skins/ChromZ, etc).Try adding type="text/css" to the link tag that calls your CSS file. (<link rel="stylesheet" href="skins/chromz/default.css" type="text/css">)If that doesn't work, you can also import the CSS file in a standard <style> tag. Like so:<style type="text/css"> @import url("skins/chromz/default.css"); </style>Try using an absolute path to the CSS file instead of a relative one.And last, I really don't think this will make a difference, but maybe use double quotes (") instead of single quotes (') for the attributes.Hopefully something works for you.Keep me posted! My AutoIt Stuff | My Github
sandman Posted April 28, 2007 Author Posted April 28, 2007 AHA!! #1 proved to be the error, although I haven't tried the other solutions, although I don't think I need to now I have no idea why, but when I clicked the link it gave me a Not Found page.. I am 100% sure that it is there, so this is really confusing.. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now