FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » default theme css split
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
default theme css split [message #13818] Tue, 28 October 2003 08:00 Go to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

I have an idea, perhaps it's idiotic, but here it is.

Split the forum.css.tmpl in three, and have one more "static" that specify how big boxes is, size of fonts etc... and one only specify colors on different items, and one specify all the images used in the theme.
Re: default theme css split [message #13820 is a reply to message #13818] Tue, 28 October 2003 15:27 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
What would be the advantage? The disadvantage is that browser will be making 3 seperate requests rather then 1. Plus nearly all styles inherit properties from one or more style. It is easier to visualize and edit when all the styles are in one place.

FUDforum Core Developer
Re: default theme css split [message #13879 is a reply to message #13820] Wed, 29 October 2003 23:24 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

ok, it was perhaps to much for a change Embarassed

bur I would like a separate config-file for all images, because for the theme I did I "converted" all the images to png, and now when I did the theme for 2.6 I begun from scratch, and running like "for e in $(perl -e 'chdir("../images"); ($i = `ls *.png`) =~ s/\.png//g; print $i'); do perl -pi -e "s/$e\\.gif/$e\\.png/g" *; done" is not a nice one. Rolling Eyes
Re: default theme css split [message #13880 is a reply to message #13879] Wed, 29 October 2003 23:35 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
There are only 2 images that are controlled by CSS, background gradients for 2 row types. The rest of the images are embeded. I am not sure why you've decided to converted to png, but that's up to you Smile

You could just run

perl -p -i -e 's/\.gif"/.png"/g' *.tmpl, which would fix all instances of .gif images inside the templates.


FUDforum Core Developer
Re: default theme css split [message #13881 is a reply to message #13880] Wed, 29 October 2003 23:41 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

Ilia wrote on Thu, 30 October 2003 00:35

There are only 2 images that are controlled by CSS, background gradients for 2 row types. The rest of the images are embeded. I am not sure why you've decided to converted to png, but that's up to you Smile

You could just run

perl -p -i -e 's/\.gif"/.png"/g' *.tmpl, which would fix all instances of .gif images inside the templates.

yes I know, but I have not converted all the images Smile just about 90% of them. the primary objective was that png supports alpha-channel, and the seccondary objective was that I dont like gif Very Happy . And I wasn't in this reply refering to only css, I ment more like a "normal" config-file.
Re: default theme css split [message #13882 is a reply to message #13881] Wed, 29 October 2003 23:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Alpha channel is great, but only when the browser supports it. Many versions of IE still do not, and alas that is the browser 90% of the user base uses.

Well, I do not see what is so abnormal about existing config, you get access to a powerful templating system that lets you do just about anything you want...

You could just convert the remaining 10% of images using ImageMagick's convert utility (installed on most *nix oses by default) and happily replace all .gif links with .png.


FUDforum Core Developer
Re: default theme css split [message #13883 is a reply to message #13882] Thu, 30 October 2003 00:07 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

yes yes yes... I was just thinking it should be a nice move, to structurize the theme a bit. and that IE doesn't support it, we wont obey the laws of Internet Explorer. png is a w3c-standard since 1996, and end of story, if Windows-users want to render it properly, they have to use a proper browser Twisted Evil Twisted Evil Twisted Evil
Re: default theme css split [message #13885 is a reply to message #13883] Thu, 30 October 2003 00:50 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
AzaToth wrote on Wed, 29 October 2003 19:07

yes yes yes... I was just thinking it should be a nice move, to structurize the theme a bit. and that IE doesn't support it, we wont obey the laws of Internet Explorer. png is a w3c-standard since 1996, and end of story, if Windows-users want to render it properly, they have to use a proper browser Twisted Evil Twisted Evil Twisted Evil


Fine stance, but is not practical until majority of the userbase adopts alternate browsers, which is something I am all for. I won't force a browser on people in a distributable application, maybe on a homepage, but definately not on FUDforum.

As for images, well, the 'problem' is that you've changed the image extension, which is why you need to run a few perl scripts. In most cases you just replace 1 gif with another and you are all set. All images are inside a single directory.


FUDforum Core Developer
Re: default theme css split [message #13913 is a reply to message #13885] Fri, 31 October 2003 12:02 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

i was not thinking about my selve, I can if I want rut all temp-files uspidedown Smile but I was thinking to new users whu like to make a new thema, and dont know how to fix the images. etc...

And I'm not forcing a browser on people, that's what you are dooing. the only thing I'm forcing is w3c.
Re: default theme css split [message #13914 is a reply to message #13913] Fri, 31 October 2003 14:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, if a person does not know how to fix the images and cannot figure out the "images/" directory they can ask on this forum and I'll gladly tell them Smile.

FUDforum Core Developer
Re: default theme css split [message #13915 is a reply to message #13914] Fri, 31 October 2003 14:34 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

Ilia wrote on Fri, 31 October 2003 15:21

Well, if a person does not know how to fix the images and cannot figure out the "images/" directory they can ask on this forum and I'll gladly tell them Smile.

muhahah Laughing

I was most refering is somebody want's to make a NON gif image. png, jpg etc...
and IF a person want's to use same picture at multiple places, and not want to directly duplicate the image, and IF he want to use an external image etc...

I was just suggesting a simple config-file like:
# images.conf

mainBackGround: path({THEME_IMAGE_ROOT}/bg.png)
tableBackGround: color(#FFFFFF);
ButtonReply: url(http://www.foo.bar/image.jpg)
Re: default theme css split [message #13917 is a reply to message #13915] Fri, 31 October 2003 14:37 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Would this work fine for the image tag, could you please give me a complete example?

Would the img src be blank and just have <img src="" alt="Button A" class="buttonA"> or something else?

I do not have a problem with such an approach, but I need to see a working example and then I'll test it in various browsers.


FUDforum Core Developer
Re: default theme css split [message #13919 is a reply to message #13818] Fri, 31 October 2003 15:15 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

o, I ment more like:
{SECTION: dmsg_quote_link}
<a class="GenLink" href="{TEMPLATE: dmsg_quote_link_lnk}">
{SOMETHING-DATA: msg_quote}
</a>
{SECTION: END}


And when rebuilding the theme, replacing it acoring to a "file"
if it a image then it's became:
<img src="path/url" alt="[quote]" />


or it's just a color, then:
<img alt="[quote]" src="blank.gif" style="background: color; width: 71px; height: 18px" />


or if it's just a text:
text


Edit: expanded my idea

[Updated on: Fri, 31 October 2003 15:21]

Report message to a moderator

Re: default theme css split [message #13920 is a reply to message #13919] Fri, 31 October 2003 15:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
CSS I idea I liked, this one I do not. That said I've done a little research and it does not seem possible to do what you suggest within the CSS1 framework.

FUDforum Core Developer
Re: default theme css split [message #13921 is a reply to message #13920] Fri, 31 October 2003 16:09 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The expanded idea using the blank.gif trick works, but that means we'd end up making 1 extra request (for blank.gif) for every image found on the page, which would be bad.

FUDforum Core Developer
Re: default theme css split [message #13922 is a reply to message #13818] Fri, 31 October 2003 16:26 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

Ok, I was tired, offcourse it chould be like this:

If image specified:
<img src="image" alt="..." />


If color specified:
<div style="background: color; width: 71px; height: 18px"></div>


If only text specified:
text


perhaps color and text then could be used together...

offcourse I hate that "blank.gif", that a UGLY thing Rolling Eyes
Re: default theme css split [message #13923 is a reply to message #13922] Fri, 31 October 2003 16:32 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
AzaToth wrote on Fri, 31 October 2003 11:26

Ok, I was tired, offcourse it chould be like this:

If image specified:
<img src="image" alt="..." />





Can't work, because browser will try to open "image" and you'll end up with the normal image as background & a broken image super-imposed over it. That's how mozilla does it anyhow.

Quote:


<div style="background: color; width: 71px; height: 18px"></div>




Does not work because it creates a newline before & after the div tag, making it impossible to position text next to a button.


FUDforum Core Developer
Re: default theme css split [message #13924 is a reply to message #13818] Fri, 31 October 2003 17:23 Go to previous messageGo to next message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

I men offcourse that image is the text insertet by the script, so if you specified in config:
msg_quote: path('../msg_quote.gif')

then the script build it as:
<img src="http://www.com/path/to/fud/images/msg_quote.gif" alt="[quote]" />


and if:
msg_quote: text('Quote', '#FFFFFF', '#000000', 70, 20)


then it is like:
<a style="background: #FFFFFF; color: #000000; width: 70; height: 20">Quote</a>

if it's a link...

I saw now that this was a hard bit Smile but I have one soultion, that is like this:

{SECTION: dmsg_delete_link}
<td align="right"><a class="GenLink" href="{TEMPLATE: dmsg_delete_link_lnk}"><img alt="" src="{THEME_IMAGE_ROOT}/msg_delete.png" /></a>&nbsp;</td>
{SECTION: END} 

{SECTION: dmsg_edit_link_lnk}
{ROOT}?t=post&amp;msg_id={VAR: obj->id}&amp;{DEF: _rsid}
{SECTION: END}

{SECTION: dmsg_edit_link}
<td align="right"><a class="GenLink" href="{TEMPLATE: dmsg_edit_link_lnk}"><img alt="" src="{THEME_IMAGE_ROOT}/msg_edit.png" /></a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
{SECTION: END}

{SECTION: dmsg_reply_link_lnk}
{ROOT}?t=post&amp;reply_to={VAR: obj->id}&amp;{DEF: _rsid}
{SECTION: END}

{SECTION: dmsg_reply_link}
<td align="right"><a class="GenLink" href="{TEMPLATE: dmsg_reply_link_lnk}"><img alt="" src="{THEME_IMAGE_ROOT}/msg_reply.png" /></a>&nbsp;</td>
{SECTION: END}

{SECTION: dmsg_quote_link_lnk}
{ROOT}?t=post&amp;reply_to={VAR: obj->id}&amp;quote=true&amp;{DEF: _rsid}
{SECTION: END}

{SECTION: dmsg_quote_link}
<td align="right"><a style="background: #FFFFFF; color: #000000; width: 71px; height: 18px" class="GenLink" href="{TEMPLATE: dmsg_quote_link_lnk}">Quote</a></td>
{SECTION: END}

{SECTION: dmsg_message_toolbar message toolbar, normally contains post/quote type buttons}
<tr><td colspan="2" class="MsgToolBar"><table border=0 cellspacing=0 cellpadding=0 width="100%"><tr>
<td align="left">{TEMPLATE-DATA: user_profile}&nbsp;{TEMPLATE-DATA: email_link}&nbsp;{TEMPLATE-DATA: private_msg_link}</td>
<td width="100%" align="center" class="GenText">{TEMPLATE-DATA: next_page}</td>
{TEMPLATE-DATA: delete_link}{TEMPLATE-DATA: edit_link}{TEMPLATE-DATA: reply_link}{TEMPLATE-DATA: quote_link}
</tr></table></td></tr>
{SECTION: END}
Re: default theme css split [message #13925 is a reply to message #13924] Fri, 31 October 2003 17:36 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The links are done the way they are to allow simply the PATH_INFO templates, which now only define the URLs.

Unless you can suggest a way to do with CSS without making requests to blank.gif or similar I do not see myself making any changes to the current system.


FUDforum Core Developer
Re: default theme css split [message #13926 is a reply to message #13818] Fri, 31 October 2003 17:36 Go to previous message
AzaToth is currently offline  AzaToth   Sweden
Messages: 125
Registered: October 2003
Karma: 0
Senior Member

So an example would be like this:

# config

msg_reply: path("{THEME_IMAGE_ROOT}/msg_delete.png")
msg_quote: text('Quote', '#ffffff', '#000000', 71, 18)



and the template like:

{SECTION: dmsg_reply_link}
<td align="right"><a class="GenLink" {TEMPLATE: style_msg_reply} href="{TEMPLATE: dmsg_reply_link_lnk}">{TEMPLATE: content_msg_reply}</a></td>
{SECTION: END}

{SECTION: dmsg_quote_link}
<td align="right"><a class="GenLink" {TEMPLATE: style_msg_quote} href="{TEMPLATE: dmsg_quote_link_lnk}">{TEMPLATE: content_msg_quote}</a></td>
{SECTION: END}


would render one image and one text... if it's a image, then there is no extra style, {TEMPLATE: style_msg_reply} results as nothing.

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Maximum smileys
Next Topic: Global Admin DB Password field shouldn't be plain text
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 16:21:13 GMT 2024

Total time taken to generate the page: 0.03618 seconds