[SOLVED]User Defined Tags

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
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm

[SOLVED]User Defined Tags

Post 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
Last edited by sugna on Thu Nov 03, 2011 10:24 pm, edited 1 time in total.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: User Defined Tags

Post 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.
User avatar
sugna
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 10, 2007 3:04 pm

Re: User Defined Tags

Post 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!
Post Reply

Return to “CMSMS Core”