> You can call the info var directly in the php using this function from
> library.php
> BOLTgetTextVar($var, $default, $page, $pattern='', $auth=false) ...
Thanks. I need to use the variable to call [(mybreadcrumbs)], so I
added this to my config.php:
$BOLTvar['$defaultPage'] = BOLTgetTextVar('defaultPage', 'main',
'site.config', '', 'false') ;
Then in the zone page I tested it:
------
debug: straight info var: **{site.config::defaultPage}**; by system
var: **{defaultPage}**.
[(mybreadcrumb separator=" > " startpage="{defaultPage}"
startlabel="Inicio")]
------
But {defaultPage} returns nothing, no matter 'false' or 'true' in the
fifth parameter. What I'm doing wrong?
> I'm guessing you set $auth to true to bypass the auth checking, but
> I'm not 100% sure... Seems it would have been the other way around.
That's what code comments are for :-) Many times I miss that, e.g.:
// var = name of the info varible to retrieve
// default = default value to be returned if the variable is not found
// page = page where to search the variable
// pattern = ...
// auth = ...
I know many times it's not needed because the function and parameters'
names are evident, but it makes life easier anyway, also for the main
developer. At least, it's a good idea to explain the non-evident
parameters.
> Now that text vars are called info vars I probably should update the
> function name and all references to it. But that would affect several
> plugins I'm sure. Not a pleasant sounding idea.
Why not change the function name and create another one with the old
name, just to call the new one?
function BOLTgetTextVar($var, $default, $page, $pattern='',
$auth=false) {
return BOLTgetInfoVar($var, $default, $page, $pattern, $auth)
;
The old code would be a bit slower... a good reason to update it :)
Cheers,
Marcos
--
http://alinome.net
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---