Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-09-10 03:14:14

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

[plugin] [ORPHAN] ako_ifBrowser

Howdy all. I’d like to announce my newest plugin, ako_ifBrowser. As you can probably guess, this conditionally includes enclosed text based on the browser user agent.

More info

Download ako_ifBrowser v0.1

I’m more than happy to entertain questions, comments, complaints, concerns, bugs (and fixes), and of course, donations (I’ll be good for this one within a week or so).

Enjoy folks…

Last edited by akokskis (2005-09-10 03:16:19)


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#2 2005-09-10 04:23:02

Vitruvius
Plugin Author
Registered: 2004-09-21
Posts: 125

Re: [plugin] [ORPHAN] ako_ifBrowser

Well done akokskis – I’m sure this will come in handy. I’m downloading and testing right now…

Offline

#3 2005-09-10 04:39:15

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

Works like a charm! Thank you!

Feature request: Is it possible to add an additional attribute for removing the browser message after the first visit?


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#4 2005-09-10 04:55:34

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

Feature request: Is it possible to add an additional attribute for removing the browser message after the first visit?

I’m not entirely sure what you mean by this. Could you explain it a bit more?

Do you basically mean that it will only display the conditional message the first time a user visits the site? (ie: set some sort of cookie, etc).


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#5 2005-09-10 05:05:30

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

> akokskis wrote:

Do you basically mean that it will only display the conditional message the first time a user visits the site? (ie: set some sort of cookie, etc).

Yep! That’s exactly what I meant!


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#6 2005-09-10 05:09:41

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

Ok then, I’ll look into it in the coming days and I’ll try to get back to you (and everyone else) asap.


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#7 2005-09-10 05:17:13

Vitruvius
Plugin Author
Registered: 2004-09-21
Posts: 125

Re: [plugin] [ORPHAN] ako_ifBrowser

Have tested this and it works as you say in the help file – most of the time. For some reason it was not detecting Opera 6.03 on the Mac – but that’s no big deal.

I don’t really support CreativeSplash’s idea to ‘remove the message’ after the first visit – which would involve setting a cookie. I think this plugin can be used for significantly more than delivering a browser message.

My feature suggestions:

  • A way to specify a browser version and above or and below. eg ie6+ or ie5.5- This way when ie8 comes out I don’t have to go back and fiddle. Looking at the php – I suspect this would not be easy to implement.
  • A code for ‘unrecognised browser’
  • I noticed there was no ie4 support – still I hope no one is viewing my sites with ie4 !
  • A <code><txp:ako_elseifBrowser></code> which would be used after the standard ifbrowser and returned if the first condition was not met
  • As a different tag within the same plugin, a tag to return the UA(user agent) for display

Just my quick thoughts.

I think I can implement this plugin for loading different CSS files like this:

  1. In the <code><head></code> section, have a generic CSS file statement to load the most modern CSS file
  2. Then put the ako_ifBrowser tag after this and load specific CSS for some older browsers which should over-ride the above CSS for all elements defined.

Thanks again for your endeavours!

Offline

#8 2005-09-10 06:46:27

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

@Vitruvius- Sorry, but there’s been a slight misunderstanding. What I meant was an attribute (e.g cookie=“1”) which when used will remove the message after the first visit. Those who want it on a permanent basis should be able to do it without modyfing the existing tags (without providing any extra attributes).

I hope I’vem made it more clear this time.

Regards,
Vasanth


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#9 2005-09-10 07:02:09

jonhicks
Member
From: Oxfordshire UK
Registered: 2004-03-22
Posts: 256
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

> Vitruvius wrote:

> I think I can implement this plugin for loading different CSS files like this:

> # In the <code><head></code> section, have a generic CSS file statement to load the most modern CSS file
> # Then put the ako_ifBrowser tag after this and load specific CSS for some older browsers which should over-ride the above CSS for all elements defined.

Please don’t use browser sniffing to do that, it can easily mean that capable modern browsers miss out. Does everyone remember to include Shiira, Omniweb, Camino in their sniffing? There are too many webkit based browsers to keep up with, and thats just Mac browsers. Also, don’t forget that Opera identifies itself as IE by default, but is a very capable CSS browser. I know thats kind of its own fault for being so silly in the first place, but still, we shouldn’t discriminate.

Then there’s the problem of new browsers that come out, and having to update the sniffing every time.

Its best to use CSS filters to aim at browsers. For instance, using import naturally excludes all browsers earlier than 5. There's a great "list of all filters, and what browser they target here":http://www.dithered.com/css_filters/css_only/index.php. Personally, I only use import, with one that targets IE 5. When I need to target IE 5.5 or 6 specifically, I use conditional comments and a separate CSS file, keeping hacks out of the main css file if possible.


Cheers,
Jon VC#9

Offline

#10 2005-09-10 10:59:37

skoggy
Member
From: Westcoast of Sweden
Registered: 2005-03-27
Posts: 209
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

download link seems broken…

Offline

#11 2005-09-10 15:29:27

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: [plugin] [ORPHAN] ako_ifBrowser

skoggy, I don’t think so(?). Here’s the link again.


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#12 2005-09-10 15:40:35

Vitruvius
Plugin Author
Registered: 2004-09-21
Posts: 125

Re: [plugin] [ORPHAN] ako_ifBrowser

jonhicks wrote:
Please don’t use browser sniffing to do that, it can easily mean that capable modern browsers miss out.

The way I had proposed would not exclude any browser. As I said in my post: I put a generic load CSS statement (with no ‘ifBrowser’) for all modern browsers at the top, then simply use this plugin after that to neatly (without using hacks like @import or other filters) load in some extra CSS for specific older browsers – notably IE 5.x, IE 5.2mac etc.

I’ve not tried it – but it sounds like it would work well..??

Offline

Board footer

Powered by FluxBB