Welcome Guest, Not a member yet? Register   Sign In
Making a helper/plugin
#11

[eluser]Maglok[/eluser]
To do what? That points to my CI root which looks like this:

Code:
CI/
CI/forum
CI/system/ <-- normal CI dirs
CI/images
etc

At the moment I tried to create a library. I can autoload it, but I cannot use any of the functions in it, like so:

Code:
&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* Wrapper class for SSI.php to call functions from within CI by loading as a library
*/
class SMF {

    require_once('forum/SSI.php');

    /**
     * Constructor
     */
    function SMF()
    {    
        log_message('debug', "SMF library Initialized");
    }
    
    // --------------------------------------------------------------------

    /**
     * SSI_welcome wrapper
     */    
    function smf_welcome($output_method = 'echo') {
        ssi_welcome($output_method);
     }
    
    // --------------------------------------------------------------------

}

// END SMF library

I can't call it after I autoload the library and then use smf_welcome() though.
#12

[eluser]R. Oerlemans[/eluser]
The includes work or not?


require_once($config['base_url'].'/includes/forum/SSI.php');
#13

[eluser]Maglok[/eluser]
Well isn't there the base_url() function to call that? Easier.

Anyways I don't know where I mentioned a includes dir. SSI.php is in the root of the forum.

I COULD do require_once, but I will need access to that class in EVERY file, thus if I can autoload it, it would be much, much easier. Smile




Theme © iAndrew 2016 - Forum software by © MyBB