[SOLVED] "Mail this page"

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

[SOLVED] "Mail this page"

Post by RonnyK »

Next to the "print this page" on every page in the standard templates, I'd want to have a "mail this page"-option. I've seen it on a lot of pages, but not in CMSMS. Does anyone know how to insert this.

The "Print This Page" is done by calling a standard "TAG", but the similar "MAIL"-tag is missing.
Last edited by RonnyK on Wed Jan 10, 2007 10:37 am, edited 1 time in total.
cyberman

Re: "Mail this page"

Post by cyberman »

RonnyK wrote: Does anyone know how to insert this.
Have you read this  ;)

http://forum.cmsmadesimple.org/index.ph ... 827.0.html
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: "Mail this page"

Post by RonnyK »

I created the following code in a UDT called "rk-mail":
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}

echo '';
and called it in a page using

Code: Select all

{rk-mail}
this lead to the following error.
string(123) "Smarty error: [in content:content_en line 1]: syntax error: unrecognized tag: rk-mail (Smarty_Compiler.class.php, line 439)" string(117) "Smarty error: [in content:content_en line 1]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 583)"
Someone any ideas??
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: "Mail this page"

Post by Dee »

Rename the tag to rk_mail and it should work...

Regards,
D
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: "Mail this page"

Post by RonnyK »

Thanks D,

taht did the trick. One question, why does it work using a "underscore" and not work using the "minus" in the name of the UDT. I often use my initials as a prefix before a code, in this case before mail, because if the tag "mail" is introduced in the core, my own UDT isn't in the way.

Ronny
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: [SOLVED] "Mail this page"

Post by Dee »

RonnyK wrote: why does it work using a "underscore" and not work using the "minus" in the name of the UDT
It can only contain letters, numbers and underscores.

http://smarty.php.net/manual/en/plugins ... ntions.php
http://www.php.net/language.variables

[edit]
Updated wiki.
[/edit]
Last edited by Anonymous on Tue Jan 09, 2007 8:54 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”