Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Ok css AND php Q for you...  (Read 5719 times)

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Ok css AND php Q for you...
« on: February 24, 2006, 01:13:38 pm »

Hey, I have a tricky one here, I think...

In snews the H2 is styled from whatever I tell the CSS to, right. But if I where to take it a bit further. Say I wanted every first capital letter of every H2 in the to be different. Say I wanted every capital leter of those H2 to be something like:
Code: [Select]
.headtext span{
font-size: 160%;
color: #A60102;
}

and then of course tagged with ...Is this do-able and in such case, how the feck do I accomplish that ?

Patric.
Logged
"It's only dead fish that goes with the flow... "
Updated

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
Ok css AND php Q for you...
« Reply #1 on: February 24, 2006, 01:38:57 pm »

ok found this code for you, but I'm not sure if the validator allows within

tags? you'll have to experiment with this Patric ok..I personally don't like CAPS like that :)

Code: [Select]
h2
{
margin: 0;
padding: 0;
text-indent: 35%;
}

.initialcap
{
font-size: 600%;
font-weight: bold;
line-height: 0.8em;
}

Lorem
 ipsum dolor sit amet, consetetur


apparently behaves well in most browsers..but once again you'd need to check that ;D

Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Ok css AND php Q for you...
« Reply #2 on: February 24, 2006, 02:51:46 pm »

Thanks, bryn...but this I have figured out by myself (head title: http://p-ahlqvist.com/sNews/patric_10).

I might have been unclear. I'll have another go at explaining:

I want the script, by itself, to span the initial cap. I have the CSS for it the old fashion way, as in hardcode it like on link above.
But I wanted to examen if it was possible to make it done automaticly...

As I enter a title in "new article", and text to it aswell, and press publish - Whambam, thank you ma'm...There's an article with a "spanned" initial cap...You understand ??

P
Logged
"It's only dead fish that goes with the flow... "
Updated

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
Ok css AND php Q for you...
« Reply #3 on: February 24, 2006, 03:16:49 pm »

ah ok I getya I think? you need it hardcoded into snews.php so it automatically displays in your



I'm not sure Patric..how do you tell snews.php to surround the first unknown letter with a span..how does it check for that? and will it affect the SEF title or mess with the javascript routine? tricky

well..here's an interesting thing..see if you can replicate this ok
List:
make sure you have the posted code in your css

go to Admin and create a new article..in the title fields for both..paste in..

Lorem
ipsum dolor sit amet, consetetur



the error routine will tell you that you have illegal characters..ignore it and just go to the bottom of the page and submit again

you see what happens? you can put html code into the header field..not that it would do any good 'cos it messes up all the SEF's etc..but..that shouldn't be possible should it?


Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Ok css AND php Q for you...
« Reply #4 on: February 24, 2006, 03:25:26 pm »

Quote
you need it hardcoded into snews.php so it automatically displays in your

Well, yes...or...I don't need to. But I was curious to find out if it was possible. A newspaperish site should have initial caps on it, I think...Hehe.

Ok, see what you mean, and it works, but as you say...it messes up the SEF's and it shouldn't be possible, no don't think so...Mhmm, Lu huu ka ??
Logged
"It's only dead fish that goes with the flow... "
Updated

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
Ok css AND php Q for you...
« Reply #5 on: February 24, 2006, 03:26:10 pm »

I think entering a title like this could work:

My Title

Although I haven't tried it, it should automatically add

and

at the end so there you have it...
Logged

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
Ok css AND php Q for you...
« Reply #6 on: February 24, 2006, 03:40:45 pm »

no in mine that messes with the title as the javascript strips it out..and forces the text to become a link..and the SEF displays all the text  ???
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Ok css AND php Q for you...
« Reply #7 on: February 24, 2006, 03:42:22 pm »

Yupp, in my aswell...It worked the first time though, but then when I did another class (more suitable for the headings) it got this way...Half of the title in the upper box, was displayed out of the box next to the "make SEF title" link... ?
Logged
"It's only dead fish that goes with the flow... "
Updated

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
Ok css AND php Q for you...
« Reply #8 on: February 24, 2006, 05:18:12 pm »

Yeah I see...

I tried it here: http://solucija.com/home/span-title-example/

But the problem is with the JS SEF. I'll have to correct that, and the thing it puts javascript when viewing source.

EDIT --> I've corrected the link
Logged

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
Ok css AND php Q for you...
« Reply #9 on: February 24, 2006, 07:10:28 pm »

it's quite a specific thing to want to put spans inside of titles..but a workaround would indeed be handy for anyone who wanted to..

Patric's initial cap request is something I have seen on many a blog :)
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Ok css AND php Q for you...
« Reply #10 on: February 24, 2006, 07:22:01 pm »

Quote from: Luka
Yeah I see...

I tried it here: http://solucija.com/span-title-example/

But the problem is with the JS SEF. I'll have to correct that, and the thing it puts javascript when viewing source.

Gives:
Quote
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/solucija/public_html/snews.php on line 637

@brynnie
Well, that is a commonly asked Q. But the "initial request" isn't a problem I think, might be for the CSS newbie, but I think we can explain that to'm, right ?

If I don't use JS (wasn't there a choice in snews.php somewhere, or am I being dumb) would it work then...I'll go have a looksie.
Logged
"It's only dead fish that goes with the flow... "
Updated

bryn

  • Hero Member
  • *****
  • Karma: 2
  • Posts: 934
    • http://www.cssugly.com
Ok css AND php Q for you...
« Reply #11 on: February 24, 2006, 07:36:41 pm »

yeah it's around line 63 of snews.php..to turn it off.

funny thing is I have mine set to 'No'..and it uses it anyway..so I just ignore it for now

to be honest I am running a modified version for the moment..there are all kinds of things I'm trying to play with, for example, I'm trying to shift the artuicle date to the same line as the article header, or even just below would do,, but not having much like right now..I'll get there maybe eventually ;)
Logged
Over 1,000 posts of joy, sNews is not only brilliant, but fun too! thanks guys :D

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Ok css AND php Q for you...
« Reply #12 on: February 24, 2006, 07:56:56 pm »

As will I...eventually...get there, I mean ;) Or get it...eventually.
Logged
"It's only dead fish that goes with the flow... "
Updated