two questions: text? and custom_404
two questions: text? and custom_404
Hi all
I've found inside cmsimple source the possibilty to have a custom_404 in order to redirect 404 error to something.
I have used this piece of code without results:
<?php
function custom_404() {
header('Location: http://www.google.com');
}
Any suggestion?
I have found inside the website configuration text1, text2 text3. But how to use them?
thanks in advance
sareide
I've found inside cmsimple source the possibilty to have a custom_404 in order to redirect 404 error to something.
I have used this piece of code without results:
<?php
function custom_404() {
header('Location: http://www.google.com');
}
Any suggestion?
I have found inside the website configuration text1, text2 text3. But how to use them?
thanks in advance
sareide
Re: two questions: text? and custom_404
However you want, the variables are in the langconfig files (deconfig.php, enconfig.php ... ).sareide wrote:I have found inside the website configuration text1, text2 text3. But how to use them?
For example in a multiligual template:
Code: Select all
<?php echo $txc['template']['text1']; ?>
Code: Select all
function custom_404() {
header('Location: http://www.google.com');
}
Code: Select all
function custom_404() {
header('Location: ?Custom_404_page');
}
Gert
Re: two questions: text? and custom_404
Sorry.
I was not able to install plugin or to have a correct result.
I still continue ho have problems with a blank content.
Before installing the plugin manager I switched to one of base templates.
then I copied cms.php and cmsconfig.php (with its new 3 lines) and copied pluginmanager.
I success in disabling plugins but I realized that the content page was blank.
sareide
I was not able to install plugin or to have a correct result.
I still continue ho have problems with a blank content.
Before installing the plugin manager I switched to one of base templates.
then I copied cms.php and cmsconfig.php (with its new 3 lines) and copied pluginmanager.
I success in disabling plugins but I realized that the content page was blank.
sareide
Re: two questions: text? and custom_404
Hi sareide,
a blank page usually indicates a "fatal" PHP error. To detect this, the XHdebug mode might be helpful. Probably it's best, if you give it a try: http://www.cmsimple-xh.com/wiki/doku.ph ... debug_mode
Christoph
a blank page usually indicates a "fatal" PHP error. To detect this, the XHdebug mode might be helpful. Probably it's best, if you give it a try: http://www.cmsimple-xh.com/wiki/doku.ph ... debug_mode
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: two questions: text? and custom_404
Hi
thanks a lot for you suggestion. I realized that I was using a custom function inside cms.php. Now all is working.
But what about to usesfunctions.php. Is a standard file that, if present, could be loaded? It would be the right place.
sareide
// Code added for pdf_link
function pdflink(){global $f,$search,$file,$sn,$su,$tx;$t=amp().'pdf';if($f=='search')$t.=amp().'function=search'.amp().'search='.$search;else if($f=='file')$t.=amp().'file='.$file;else if($f!=''&&$f!='save')$t.=amp().$f;return '<a href="'.$sn.'?'.$su.$t.'">'.$tx['menu']['pdf'].'</a>';}
// Code added custom
thanks a lot for you suggestion. I realized that I was using a custom function inside cms.php. Now all is working.
But what about to usesfunctions.php. Is a standard file that, if present, could be loaded? It would be the right place.
sareide
// Code added for pdf_link
function pdflink(){global $f,$search,$file,$sn,$su,$tx;$t=amp().'pdf';if($f=='search')$t.=amp().'function=search'.amp().'search='.$search;else if($f=='file')$t.=amp().'file='.$file;else if($f!=''&&$f!='save')$t.=amp().$f;return '<a href="'.$sn.'?'.$su.$t.'">'.$tx['menu']['pdf'].'</a>';}
// Code added custom
Re: two questions: text? and custom_404
Hi sareide,
Regarding pdflink(): do you have a solution for downloading/viewing the current CMSimple page as PDF? Quite a while ago I've made some experiments with mPDF, which worked nicely out of the box, but I was in doubt, if it could handle some fancy CSS and exotic fonts. I'm quite sure such automatic PDF conversion has it's limitations. But anyway, this could be a nice Addon.
Christoph
PS: About the custom_404(): did you manage to get it working?
That's exactly what cmsimple/userfuncs.php is meant for. It will be included, if it exists, but it will not be overwritten by any update of CMSimple_XH.sareide wrote:But what about to usesfunctions.php. Is a standard file that, if present, could be loaded? It would be the right place.
Regarding pdflink(): do you have a solution for downloading/viewing the current CMSimple page as PDF? Quite a while ago I've made some experiments with mPDF, which worked nicely out of the box, but I was in doubt, if it could handle some fancy CSS and exotic fonts. I'm quite sure such automatic PDF conversion has it's limitations. But anyway, this could be a nice Addon.
Christoph
PS: About the custom_404(): did you manage to get it working?
Christoph M. Becker – Plugins for CMSimple_XH
Re: two questions: text? and custom_404
Hi Christoph,cmb wrote:Regarding pdflink(): do you have a solution for downloading/viewing the current CMSimple page as PDF?
I've made a "simple_PDF" - Plugin (not only) for that purpose.
You can test it live here (PDF erzeugen).
I'll release it ASAP.
Holger
Re: two questions: text? and custom_404
Hi Holger,
Christoph
Sounds good!Holger wrote:I've made a "simple_PDF" - Plugin (not only) for that purpose.
You can test it live here (PDF erzeugen).
I'll release it ASAP.
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: two questions: text? and custom_404
Hi.
About custom_404: I managed to get it working. I created a userfunc.php file inside cmsimple.
About PDF: I used an old solution for CMSIMPLE. It seems to work well (without plugin). But Now I've got a new problem. My site is multilanguage, so pdf library has some ploblems handling é, à, etc.
I'm going to find a workaround. If you wish I could share my code.
sareide
About custom_404: I managed to get it working. I created a userfunc.php file inside cmsimple.
About PDF: I used an old solution for CMSIMPLE. It seems to work well (without plugin). But Now I've got a new problem. My site is multilanguage, so pdf library has some ploblems handling é, à, etc.
I'm going to find a workaround. If you wish I could share my code.
sareide
Re: two questions: text? and custom_404
Hi sareide,
Christoph
That might be related to the UTF-8 encoded content. Either this encoding has to be set for the library, or other fonts are required (perhaps both?).sareide wrote:But Now I've got a new problem. My site is multilanguage, so pdf library has some ploblems handling é, à, etc.
That would be nice! Probably others are interested in automatic PDF creation too.sareide wrote:If you wish I could share my code.
Christoph
Christoph M. Becker – Plugins for CMSimple_XH