Forums / Cotonti / Extensions / Php require

marshall700
#1 2009-07-27 07:51
Im having problems creating a plugin for Cotonti.... its a piece of code used to admin game servers and i want to encorporate it using a plugin! Ive got the code.... but in the code it uses the Php require tag... ive never encountered it before this is the code:

require ('init.inc.php');

ive been able to sucessfully use it out of the plugin but i cant get cotoniti to use it. It doesnt find the file. Anyone got any ideas?
Also when i install the plugin i get alot of "Warning: No tags found in..." i dont know what this means anyone?

Here is the error i keep getting:
Warning: require(init.php) [function.require]: failed to open stream: No such file or directory in /home/marshall/public_html/cms/plugins/rcon/rcon.admin.php on line 28
Warning: require(init.php) [function.require]: failed to open stream: No such file or directory in /home/marshall/public_html/cms/plugins/rcon/rcon.admin.php on line 28

Fatal error: require() [function.require]: Failed opening required 'init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/marshall/public_html/cms/plugins/rcon/rcon.admin.php on line 28
Thanks Marshall
This post was edited by marshall700 (2009-07-27 07:58, 15 years ago)
Kilandor
#2 2009-07-27 14:26
require or includes you have to specify the path to the file. The above would mean a local file form where the script was executed (root), But we don't want that.

So you need to change the path to require($cfg['plugins_dir'].'/your_plugin_name/inc/init.inc.php');

just replace the your_plugin_name with the plugin "code" name

The problem with tags not found is it means, its opening the file looking for the data to load the file as a plugin, such as a hook or standalone or setup. Specificaly its looking for the "[BEGIN_SED_EXTPLUGIN]" block in the file.

If you notice my path above I gave you I included /inc/ if you place the extra files, the non plugin files in it then you won't see those errors. So any files without that block should go in there.
Dave
#3 2009-07-27 14:41
ot: just wondering, what kind of plugin?
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
marshall700
#4 2009-08-07 16:16
im converting an opensource piece of PHP written to control Game Servers! (rcon) and im creating it into a plugin so that it intergrates within Cotonti!

Also thanks kilandorit worked a treat!
Dave
#5 2009-08-09 16:55
does ti will work with specific game server or any?
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl