Page 1 of 1

[SOLVED]User Defined Tags

Posted: Thu Nov 03, 2011 9:24 pm
by sugna
I had some custom work done to CMSMS to allow for functions not available with the the base install.

The developer is using User Defined Tags to reference a script page.


My question. Is their a better way to reference the script page without pointing to the page like below.

require_once("/serverpath/domains/domain.com/html/scripts/functions.php");
$address = getAddress();

echo $address;

Thanks for the help

Re: User Defined Tags

Posted: Thu Nov 03, 2011 9:55 pm
by Wishbone
Not sure what you're asking. If you want to run PHP code located in a file, that's the way to do it. You have to 'include' it or it won't know what to do.

An alternative is to copy the code from that file into the UDT. The file will no longer be needed.

Another alternative is to make it a plugin. Look at the scripts in the plugins/ directory to see how it's done.. That function will be available to call from anywhere in CMSMS that takes Smarty code.

Re: User Defined Tags

Posted: Thu Nov 03, 2011 10:23 pm
by sugna
Answer:
"An alternative is to copy the code from that file into the UDT. The file will no longer be needed."

Thanks Wishbone!