A list of functions
A list of functions
It would be nice to have somewhere in one place a list of available functions for CMSimpl_XH-1.7.0.
RIght now I can't find the right usage for sitemap.
RIght now I can't find the right usage for sitemap.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: A list of functions
See http://www.cmsimple-xh.org/dev-doc/php/ ... _8php.html. Note the search box!Tata wrote:It would be nice to have somewhere in one place a list of available functions for CMSimpl_XH-1.7.0.
RIght now I can't find the right usage for sitemap.
Christoph M. Becker – Plugins for CMSimple_XH
Re: A list of functions
Thanks, I didn't know about this one. I have not found how to call the sitemap on a page.
E.g. here: http://cmsimple.sk/?Mapa-stranky
E.g. here: http://cmsimple.sk/?Mapa-stranky
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: A list of functions
There is no dedicated function, but you can use:Tata wrote: I have not found how to call the sitemap on a page.
Code: Select all
<?php echo $_XH_controller->handleSitemap()?>
Christoph M. Becker – Plugins for CMSimple_XH
Re: A list of functions
Thanks, Chris. It works in a template. But I thought about replacement for a function used on a page. E.g.
Maybe this would work with userfunction?
Code: Select all
<h1>Site Map</h1>
{{{shosSitemap();}}}
Code: Select all
function showSitemap()
{
global $pth, $h;
echo $_XH_controller->handleSitemap();
}
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: A list of functions
Yes, but you have to declare $_XH_controller as global:Tata wrote:Maybe this would work with userfunction?
Code: Select all
function showSitemap()
{
global $_XH_controller;
echo $_XH_controller->handleSitemap();
}
Christoph M. Becker – Plugins for CMSimple_XH
Re: A list of functions
Super!!! It works excellent. Shouldn't it go in core functions.php? And maybe also other unique functions modified under older version? E.g. iconized print/printlink, sitemap/sitemaplink, mailform/mailformlink,loginlink etc. With eventual options in configuration.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: A list of functions
I'm not generally against adding such functions, but I don't think adding lots of unprefixed functions in the global namespace is a good idea in the long run, since the risk of nameclashes increases. Consider a user has already a function sitemap in userfuncs.php (or maybe in a plugin), perhaps doing something different. If we add sitemap() to the core, there would be a fatal PHP error.Tata wrote:Shouldn't it go in core functions.php? And maybe also other unique functions modified under older version? E.g. iconized print/printlink, sitemap/sitemaplink, mailform/mailformlink,loginlink etc. With eventual options in configuration.
I also don't like adding prefixes like XH_ (i.e. to name the function XH_sitemap()). This is a relict of the past, but as of PHP 5.3.0 there are namespaces, so Xh\sitemap() would be preferable[1]. Currently, the plugin call doesn't support namespaced functions, but this could easily be fixed.
[1] Note that this is not about that Xh\sitemap() is easier to write or read than XH_sitemap(), but rather that internally the namespace can be omitted what leads to better readable code.
Christoph M. Becker – Plugins for CMSimple_XH
Re: A list of functions
How would it then be with a "patch" file with such prefixed functions and a help file with explanation how to use them instead of standard core functions?
in this case there could be used either e.g.
- sitemap(); or XH_sitemap();
- previouspage(); or XH_previouspage
- toplink(); or XH_toplink();
etc.
Such file could then be continuosly actualized and put downloadable somewhere.
in this case there could be used either e.g.
- sitemap(); or XH_sitemap();
- previouspage(); or XH_previouspage
- toplink(); or XH_toplink();
etc.
Such file could then be continuosly actualized and put downloadable somewhere.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: A list of functions
Well, this could be done by a small plugin, which would need only index.php and help.htm, but version.nfo (and maybe more) would be nice. In this case I would suggest to use the plugin name (or perhaps an abbreviation) as prefix, maybe tplx_sitemap() etc. (where tplx would mean "template extensions"). Having such a plugin (or perhaps multiple plugins) might be interesting; if many users would be interested in this plugin or at some of its functionality, we could consider moving the respective parts into the core later.Tata wrote:How would it then be with a "patch" file with such prefixed functions and a help file with explanation how to use them instead of standard core functions?
Christoph M. Becker – Plugins for CMSimple_XH