Sign in to follow this  
Followers 0
sandman

Pretty HTML Oriented.. but give it a try

10 posts in this topic

#1 ·  Posted (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:

;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

Now, 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 = FAILED
  • moving default.css to the same directory as page and changing the href link = FAILED
This has been an extremely frustrating addition.. if the code even shows in the page source, WHY ISN'T IT WORKING?!?!

Sorry for yelling :shocked: ,

SANDMAN!

Edited 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]

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Saunders

Share this post


Link to post
Share on other sites

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 &copy; 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 &copy; 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. :shocked:

Also, I forgot to revert it back to the skin switcher version.. OOPS! I'll do that right now :(

Correct index.auw code:

;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]

Share this post


Link to post
Share on other sites

#4 ·  Posted (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. :shocked:

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 by Saunders

Share this post


Link to post
Share on other sites

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. :shocked:

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???

Share this post


Link to post
Share on other sites

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. :shocked:

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]

Share this post


Link to post
Share on other sites

Oh, I feel stupid now....

That worked...

:shocked:

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]

Share this post


Link to post
Share on other sites

Ugh, wait...

It just stopped working again... :shocked:

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]

Share this post


Link to post
Share on other sites

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! :)

Share this post


Link to post
Share on other sites

AHA!!

#1 proved to be the error, although I haven't tried the other solutions, although I don't think I need to now :D

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0