Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [SMARTY] including a browser sniffer's output into my templates
Have you considered using a link element to include the css for you?

like <link type="text/css" rel="stylesheet"
href="/path/to/specific/stylesheet.css" />

-bok

On Thu, 29 Jul 2004 11:47:05 +0200, Thorsten <shockie@gmx.net> wrote:
> hi,
>
> NB: this may be indirectly related to an earlier question of mine
> regarding inserting an obfuscated mailto-link into pages. if it resolves
> to the same solution (use "fetch"), i was unable to get the other thing
> working thusfar.
>
> i'd like to include a browser sniffer into my pages which is written in
> php, so i can put the correct, browser-specific css path into my pages.
>
> i cannot get this to work at all as of yet, because i can't figure out
> how to place the sniffer code into my template/php file. the sniffer
> requires me to include a php file (which does the work and finally echos
> the respective css path) into my xhtml, but whatever i've tried so far,
> the include statement is only literally printed into my xhtml output.
>
> is there a way to "catch" the include's output and insert it? i tried
> the fetch method, but to no avail here.
>
> help is appreciated,
>
> - Thorsten
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Robert Amos
07-29-04 01:57 PM


Re: [SMARTY] including a browser sniffer's output into my templates
hi Robert,

> Have you considered using a link element to include the css for you?
> like <link type="text/css" rel="stylesheet"
> href="/path/to/specific/stylesheet.css" />
yes, that's exactly what is supposed to be inserted, i just can't figure
out how to use the php-driven sniffer's output and put it into my templates.

<link type="text/css" rel="stylesheet" href="{$css}" /> is what i had so
far. having the {$css} variable hard-coded into my php file is no
problem at all, but as soon as i've got to catch some output of the
sniffer (or any other code, for that matter), using
smarty->assign('css','$foobar'); prints $foobar into my xhtml output.

if fetch() is the solution, would somebody please post an example?

- Thorsten

Report this thread to moderator Post Follow-up to this message
Old Post
Thorsten
07-29-04 01:57 PM


Re: [SMARTY] including a browser sniffer's output into my templates
See the PHP Manual for the difference between single and double quotes.

A single quoted string like you're assigning doesnt expand variables,
so its assigning '$foobar' literally. You need to either use double
quotes "$foobar" or better yet, if you're assigning a variable, dont
use quotes as all.

$smarty->assign('css', $foobar);

See: http://php.net/manual/en/language.types.string.php

-bok

On Thu, 29 Jul 2004 12:35:01 +0200, Thorsten <shockie@gmx.net> wrote:
> hi Robert,
> 
> yes, that's exactly what is supposed to be inserted, i just can't figure
> out how to use the php-driven sniffer's output and put it into my template
s.
>
> <link type="text/css" rel="stylesheet" href="{$css}" /> is what i had so
> far. having the {$css} variable hard-coded into my php file is no
> problem at all, but as soon as i've got to catch some output of the
> sniffer (or any other code, for that matter), using
> smarty->assign('css','$foobar'); prints $foobar into my xhtml output.
>
> if fetch() is the solution, would somebody please post an example?
>
>
>
> - Thorsten
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Robert Amos
07-29-04 01:57 PM


Re: [SMARTY] including a browser sniffer's output into my templates
hi Robert,

> A single quoted string like you're assigning doesnt expand variables,
> so its assigning '$foobar' literally. You need to either use double
> quotes "$foobar" or better yet, if you're assigning a variable, dont
> use quotes as all.
that did the trick, thanks a lot!

- Thorsten

Report this thread to moderator Post Follow-up to this message
Old Post
Thorsten
07-30-04 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:26 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.