1
domecc
How to use smarty plugin "xoAppUrl" and "xoImgUrl"?
  • 2007/8/9 3:09

  • domecc

  • Just popping in

  • Posts: 71

  • Since: 2005/10/30


I've learned Mor.pho.GEN.e.sis, but confused by the usage of "xoAppUrl" and "xoImgUrl".

Sometime <{xoAppUrl}>, but sometime <{xoAppUrl /}>.
Sometime <{xoAppUrl viewpmsg.php}>, but sometime <{xoAppUrl /search.php}>.
Sometime <{xoImgUrl style.css}>, but sometime <{xoImgUrl /style.css}>

Should I use "/" after "xoAppUrl" and "xoImgUrl"?
XoopsChina Webmaster

2
script_fu
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?

Quote:

domecc wrote:
Sometime <{xoImgUrl style.css}>, but sometime <{xoImgUrl /style.css}>


Off topic:

Be careful with this one. Think about it...

Why would you use an img url to pull a style sheet?

I can tell you first hand that IE did pull the sheet.
Firefox is a whole other issue. FF does not know what the code is. It took me three days to figure out that code above was incorrect.

Sorry for going off topic on you. Maybe one of the devs can shed some light on your questions

3
snow77
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?
  • 2007/8/9 6:34

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


Quote:
It took me three days to figure out that code above was incorrect.


Where, when and what is the code that is working wrong?

xoImgUrl and xoAppUrl have been working fine for me with or without slash.

If there is a rule of when to use the slash and when not. The developers of XOOPS should know about the "architecture" to give a better response. But I'm not sure where you'll get a response of the architecture... probably at the sourceforge forums.

4
kris_fr
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?
  • 2007/8/9 7:34

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


Hello,

These two smarty work very well, for an explanation concerning those, I invite you to read the annotations and comments in the files root/class/smarty/xoops_plugins/compiler.xoImgUrl.php and compiler.xoAppUrl.php

I a long time now use them in my topics since good, and I did not encounter any difficulty. It should be known that henceforth it is these smartys which it will be necessary for us to use in the themes and templates as well as the modules

The use of “/” does not obstruct the operation of the link, you can put it or not, on the other hand if you do not have a filename behind you must put it. If not right the name of the directory/filename

@++

5
script_fu
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?

Quote:

snow77 wrote:
Where, when and what is the code that is working wrong?



xpro_042_gamingV2
<link rel="stylesheet" type="text/css" media="all" title="Blue" href="<{xoImgUrl /style.css}>" />


xpro_043_gamingV3
<link rel="stylesheet" type="text/css" media="all" title="Blue" href="<{xoImgUrl /style.css}>" />


FireFox has no idea what this code is and will always load style.css

I can not get styleNN.css to load with the XD examples above.

--------------

I changed the code in the XD theme.html's to...

<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_themecss}>" />


Then my styleNN.css loads and takes effect.

6
script_fu
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?

This page cannot be displayed due to an internal error.

You can provide the following information to the administrators of this site to help them solve the problem:

Error: Smarty error: [in /themes/XGv3_Blue/theme.html line 16]: syntax error: unrecognized tag: xoImgUrl/style.css (Smarty_Compiler.class.php, line 436)

----------
xoImgUrl/style.css = Smarty Errors
---
xoImgUrl /style.css = Nothing but style.css in FireFox
----------

I thought maybe it was the white space so I closed it. lol

Nope...

I will just keep this for now.

<link rel="stylesheet" type="text/css" media="screen" href="<{$xoops_themecss}>" />

7
kris_fr
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?
  • 2007/8/9 17:46

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


hi,

just delete files in templates_c, may be

@++

8
script_fu
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?

Wonderful...

I did mention above that the styleNN.css works fine in firefox with the old style sheet code from the XOOPS default theme.

Also that it does not work with the xoImgUrl

So in order to get this far! It means we already know how to delete templates_c, cache & hit the reload button.

Maybe I should state.
Php 5
MySql 5
FireFox 2.0.0.6

Maybe this is the reason it does not work.

9
kris_fr
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?
  • 2007/8/9 19:12

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


Why you want a leaf styleNN.css, just style.css is enough
If your Css is in conformity you will not have any concern some is the navigator

10
skenow
Re: How to use smarty plugin "xoAppUrl" and "xoImgUrl"?
  • 2007/8/20 17:44

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


A little digging turned this up -

function xoops_getcss($theme '')
{
    if (
$theme == '') {
        
$theme $GLOBALS['xoopsConfig']['theme_set'];
    }
    
$uagent xoops_getenv('HTTP_USER_AGENT');
    if (
stristr($uagent'mac')) {
        
$str_css 'styleMAC.css';
    } elseif (
preg_match("/MSIE ([0-9].[0-9]{1,2})/i"$uagent)) {
        
$str_css 'style.css';
    } else {
        
$str_css 'styleNN.css';
    }
    if (
is_dir(XOOPS_THEME_PATH.'/'.$theme)) {
        if (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/'.$str_css)) {
            return 
XOOPS_THEME_URL.'/'.$theme.'/'.$str_css;
        } elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/style.css')) {
            return 
XOOPS_THEME_URL.'/'.$theme.'/style.css';
        }
    }
    if (
is_dir(XOOPS_THEME_PATH.'/'.$theme '/css')) {
        if (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/css/'.$str_css)) {
            return 
XOOPS_THEME_URL.'/'.$theme.'/css/'.$str_css;
        } elseif (
file_exists(XOOPS_THEME_PATH.'/'.$theme.'/css/style.css')) {
            return 
XOOPS_THEME_URL.'/'.$theme.'/css/style.css';
        }
    }
    return 
'';
}


In a nutshell - $xoops_themecss gets its value from this function and this function uses the browser agent to determine which stylesheet to use - styleMAC, styleNN, or style.

The Smarty variables are documented in the wiki

Login

Who's Online

349 user(s) are online (219 user(s) are browsing Support Forums)


Members: 0


Guests: 349


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits