External php file

General questions about CMSimple
Post Reply
maeg
Posts: 525
Joined: Fri Feb 20, 2009 2:27 pm
Location: Agerbæk, Denmark
Contact:

External php file

Post by maeg » Tue Jun 04, 2013 1:45 pm

Hi

I remember log time ago, there was a small trick with the userfuncs.php, so use an external php file.

But i don't remember how - can any one tell me how

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: External php file

Post by cmb » Tue Jun 04, 2013 2:01 pm

What exactly do you want to do with the external PHP file?
  1. include it, so you can use its functions
  2. display its output on a page
  3. something else
PS: What exactly do you mean with external file? A file not being part of CMSimple or a file hosted on another server?
Last edited by cmb on Tue Jun 04, 2013 2:02 pm, edited 1 time in total.
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH

bjorn
Posts: 75
Joined: Thu Apr 28, 2011 3:13 pm

Re: External php file

Post by bjorn » Mon Jun 10, 2013 2:18 pm

Hi maeg

You can include a php file from functions.php if you add this line:
if (file_exists ($pth['folder']['cmsimple'].'userfuncs.php')) { include($pth['folder']['cmsimple'].'userfuncs.php');

userfunc.php can be any name you want

best regards
Bjorn

Post Reply