Herótom lett a CSS hackelésből!

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.

Minden sitebuilder rémálma, hogy különböző böngészőkben hogyan fog szétesni az oldal. Az Internet Explorer CSS kezelése Bill Gates édesanyjának non-stop csuklásának a fő oka, azonban én most konkrétan egy egy pixeles Chrome elcsúszást próbáltam levadászni napok óta..

Az IE bugfix - főleg Zen sminkkel dolgozva - nem nagy truváj hiszen CSS-ben elég jól lehet az IE verziókra célozni. Normálisan használható Chrome hacket azonban nem találtam. Olyan lehetőség nincs, hogy nem lehet megoldani, úgyhogy azt találtam ki, hogyha a Zen amúgy is olyan szépen ellátja extra classokkal a body-t, miért ne tolhatnánk bele azt is, hogy épp milyen böngészővel látogtják az oldalt?

Kruska Roland oldalán találtam meg a szükséges szkriptet, amit a smink template.php-jébe beírva egy mezei page preprocessel elérjük, amit akarunk.

function ieversion() {
  ereg('MSIE ([0-9]\.[0-9])',$_SERVER['HTTP_USER_AGENT'],$reg);
  if(!isset($reg[1])) {
    return -1;
  } else {
    return floatval($reg[1]);
  }
}
function browser(){
  $browser = 'ismeretlen';
  if (stristr($_SERVER['HTTP_USER_AGENT'],"mozilla")){$browser = 'mozilla';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"msie")){$browser = ('ie' .ieversion());};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"netscape")){$browser = 'netscape';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"galeon")){$browser = 'galeon';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"konqueror")){$browser ='konqueror';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"lynx")){$browser = 'lynx';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"opera")){$browser = 'opera';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"icab")){$browser = 'icab';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"safari")){$browser = 'safari';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"amaya")){$browser = 'amaya';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"aweb")){$browser = 'amiga Web';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"beonex")){$browser = 'beonex';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"chimera")){$browser ='chimera';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"dillo")){$browser = 'dillo';};
  if (stristr($_SERVER['HTTP_USER_AGENT'],"chrome")){$browser = 'chrome';};
  return $browser;
}

function SMINKNEVE_preprocess_page(&$vars, $hook) {
  $vars['browser'] = browser();
}

Ezután a page.tpl.php-ban akárhová pakolhatjuk, nekem a bodyba kell:

<body class="<?php print $browser; ?>">

Ilyen szinten nem nagyon túrtam még template.php-t, működni működik, de remélem nem csináltam semmi "drupalellenes" dolgot.

 UPDATE: A kommentekből és az azóta történt utána járásaimból kiderült, hogy ezt nem a legmegfelelőbb módszer a célom eléréséhez. Csak azért hagyom bent a postot, mert arra jó példa, hogy hogyan vezessünk be page.tpl.php-ba új változót smink preprocessen keresztül.

Hozzászólások

Today, I went to the beach

Today, I went to the beach front with my children. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!|

Very good website you have

Very good website you have here but I was curious if you knew of any message boards
that cover the same topics talked about here?
I'd really love to be a part of online community where I can get suggestions from
other knowledgeable individuals that share the same interest.
If you have any suggestions, please let me know.
Thank you!

Howdy! I'm at work browsing

Howdy! I'm at work browsing your blog from my new apple iphone!
Just wanted to say I love reading your blog and look forward to all
your posts! Keep up the great work!

Great work! That is the kind

Great work! That is the kind of info that should be shared around the web.
Disgrace on Google for not positioning this publish
upper! Come on over and talk over with my site . Thanks =)

My brother suggested I would

My brother suggested I would possibly like this
web site. He used to be entirely right. This submit actually made
my day. You cann't consider simply how a lot time I had spent for
this info! Thanks!

Thanks for sharing your

Thanks for sharing your thoughts about ig. Regards

What a information of

What a information of un-ambiguity and preserveness of precious know-how
about unexpected feelings.

It's a pity you don't have a

It's a pity you don't have a donate button! I'd definitely donate to this fantastic blog!
I guess for now i'll settle for book-marking and adding your RSS feed
to my Google account. I look forward to fresh updates and will share this site with my Facebook
group. Talk soon!

Hi Dear, are you genuinely

Hi Dear, are you genuinely visiting this website on a regular basis,
if so then you will without doubt take fastidious experience.

Anaheim Divorce Lawyers in Practice
204 S Illinois St, Anaheim, CA 92805
714-410-5333
sabihafelix09835 [at] gmail [dot] com

It's enormous that you are

It's enormous that you are getting thoughts from this post as well as from our
argument made at this place.

Unquestionably believe that

Unquestionably believe that which you said. Your favorite justification seemed to be on the web the
easiest thing to be aware of. I say to you, I definitely
get irked while people consider worries that they plainly don't know about.
You managed to hit the nail upon the top and defined out the whole thing without having side effect , people can take a signal.

Will probably be back to get more. Thanks

Great post. I used to be

Great post. I used to be checking constantly this weblog and I'm
inspired! Very helpful information specially the remaining phase :)
I take care of such information much. I used to be seeking this certain info for a
long time. Thanks and good luck.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Hi would you mind stating

Hi would you mind stating which blog platform you're working with?
I'm going to start my own blog soon but I'm
having a difficult time choosing between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design and style seems different then most blogs and
I'm looking for something unique. P.S Sorry
for being off-topic but I had to ask!

I enjoy what you guys are

I enjoy what you guys are usually up too. This sort of clever
work and exposure! Keep up the amazing works guys I've
incorporated you guys to my own blogroll.

Hi to every body, it's my

Hi to every body, it's my first visit of this website; this weblog
contains awesome and really good data in support of readers.

It's going to be finish of

It's going to be finish of mine day, however before finish I am reading this impressive article to improve my know-how.

Everyone loves what you guys

Everyone loves what you guys are usually up too.
This type of clever work and coverage! Keep up the terrific works guys I've included you guys
to our blogroll.

Fantastic website you have

Fantastic website you have here but I was curious if you knew of any forums that cover the same topics talked about in this article?
I'd really like to be a part of online community
where I can get responses from other experienced individuals that share the same interest.
If you have any suggestions, please let me know.
Bless you!
Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Hi friends, its impressive

Hi friends, its impressive article about tutoringand entirely explained,
keep it up all the time.

I am curious to find out what

I am curious to find out what blog system you're using? I'm experiencing some small security issues
with my latest site and I would like to find something more secure.
Do you have any solutions?

Thanks for your personal

Thanks for your personal marvelous posting! I genuinely enjoyed reading it, you can be a great author.I will always bookmark your blog and will often come back sometime soon. I
want to encourage you to continue your great job, have a nice day!

Wow, that's what I was

Wow, that's what I was looking for, what a information! present here at this blog, thanks admin of this web site.|

Incredible! This blog looks

Incredible! This blog looks exactly like my old one! It's on a entirely
different subject but it has pretty much the same layout and
design. Excellent choice of colors!

Hi there to every one, the

Hi there to every one, the contents existing at this web site
are actually awesome for people knowledge, well,
keep up the nice work fellows.

Very nice article, just what

Very nice article, just what I needed.

Hey! Would you mind if I

Hey! Would you mind if I share your blog with
my zynga group? There's a lot of people that I think would really enjoy your content.
Please let me know. Thank you
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Great information. Lucky me I

Great information. Lucky me I came across your website by accident (stumbleupon).
I've saved it for later!

Nice blog here! Also your

Nice blog here! Also your website loads up fast! What host are you using?
Can I get your affiliate link to your host? I wish my website loaded up as fast as
yours lol

Great blog here! Also your

Great blog here! Also your website lots up fast! What web host are you the usage of? Can I get your associate link to your host? I want my web site loaded up as quickly as yours lol|

Very good information. Lucky

Very good information. Lucky me I ran across your website by accident
(stumbleupon). I've book marked it for later!

I am extremely impressed with

I am extremely impressed with your writing skills as well as with the layout on your blog.
Is this a paid theme or did you modify it yourself?
Anyway keep up the nice quality writing, it's rare to see a great blog like this one these days.

Jay's Santa Clarita Tree Removal Kings
26174 Las Lanas Ct, Santa Clarita, CA 91355
661-464-1270
laureljefferson09875 [at] gmail [dot] com

Terrific post but I was

Terrific post but I was wanting to know if you could write a litte more on this topic?
I'd be very thankful if you could elaborate a little bit
further. Bless you!

Hi there, I do think your

Hi there, I do think your site could possibly be having internet browser compatibility issues.

Whenever I look at your blog in Safari, it looks fine however when opening in IE,
it has some overlapping issues. I merely wanted to provide you with a quick heads up!
Aside from that, fantastic site!

Hi there! This article could

Hi there! This article could not be written much better!
Looking through this article reminds me of my previous roommate!
He continually kept talking about this. I
am going to send this post to him. Pretty sure
he's going to have a good read. Thanks for sharing!

Fantastic beat ! I wish to

Fantastic beat ! I wish to apprentice whilst you amend your website, how could i subscribe for a blog
site? The account helped me a acceptable deal.
I had been a little bit acquainted of this your broadcast provided vivid transparent idea

What's Taking place i am new

What's Taking place i am new to this, I stumbled upon this I've found It absolutely helpful and it has helped me out loads.
I hope to contribute & help other users like its helped me.

Great job.

I'm gone to tell my little

I'm gone to tell my little brother, that he should also go to see this weblog on regular
basis to take updated from hottest news.

I absolutely love your blog..

I absolutely love your blog.. Very nice colors & theme. Did you make this web site yourself? Please reply back as I'm looking to create my very own website and want to know where you got this from or exactly what the theme is called. Thanks!|

I think this is among the

I think this is among the most significant info for me. And i'm
glad reading your article. But should remark on few general things,
The website style is perfect, the articles is really great :
D. Good job, cheers

This is a good tip especially

This is a good tip especially to those fresh to the blogosphere.
Simple but very precise info… Appreciate your sharing this one.
A must read article!

Its like you read my mind!

Its like you read my mind! You appear to know a lot about this, like you wrote
the book in it or something. I think that you can do with some pics to drive
the message home a bit, but other than that, this is wonderful blog.
A fantastic read. I will definitely be back.

Hi! This is kind of off topic

Hi! This is kind of off topic but I need some advice from an established blog.
Is it hard to set up your own blog? I'm not very techincal but I can figure things out pretty fast.

I'm thinking about setting up my own but I'm not sure where to start.

Do you have any ideas or suggestions? With thanks

I loved as much as you will

I loved as much as you will receive carried
out right here. The sketch is attractive, your
authored material stylish. nonetheless, you command get got an nervousness over that
you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly very often inside case you shield this hike.

OutOfSight Hayward Junk Removal Pros
1366 Homestead Ln, Hayward, CA 94545
510-621-6379
joeyedmonds38572 [at] gmail [dot] com

Wonderful beat ! I would like

Wonderful beat ! I would like to apprentice at the same time as you amend your web site, how can i subscribe for a weblog web site?
The account aided me a appropriate deal. I have been a little bit acquainted of this your broadcast offered bright transparent concept

For hottest information you

For hottest information you have to pay
a quick visit the web and on web I found this web site as a most excellent site for most up-to-date updates.

It's remarkable in favor of

It's remarkable in favor of me to have a web site, which is
helpful for my experience. thanks admin

Pretty great post. I just

Pretty great post. I just stumbled upon your weblog and wanted to mention that I have really loved surfing around your weblog posts.
After all I will be subscribing for your feed and I hope
you write again soon!

Hello there, You have done a

Hello there, You have done a great job. I will certainly digg it and
personally suggest to my friends. I'm confident they'll be benefited from this web site.

Wow! At last I got a website

Wow! At last I got a website from where I be capable of
truly obtain valuable information regarding my
study and knowledge.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Hello, yes this piece of

Hello, yes this piece of writing is really nice and I have learned lot of things from it about
blogging. thanks.
Jim's San Jose Carpet Cleaning
780 S 3rd St, San Jose, CA 95112
3408-351-1063
colettemackie2641 [at] gmail [dot] com

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.