0
votes

I am trying to include a codeigniter comments section within certain pages of an existing site. I am using the following to include the codeigniter snippit:

echo $directoryLevelPrefix . "staff/codeigniter/index.php";
                        $_SERVER["REQUEST_URI"] = "comment/index2/".$page;
                        require_once($directoryLevelPrefix . "staff/codeigniter/index.php"); 

This works fine normally, but when I put the code in a function and call it I get the following error:

Fatal error: Call to a member function item() on a non-object in \codeigniter\system\core\Utf8.php on line 47

I guess codeigniter must be taking some details from the calling page which are out of scope in the calling function. Any ideas how to do this?

1
It sounds like you're trying to fit a square peg into a round hole. - Aren

1 Answers

0
votes

Is the existing site already using codeigniter? Or are you trying to use codeigniter just for the commenting system?

Adding codeigniter to an existing site for a single piece of functionality is overkill.

If you're just trying to add commenting, take a look at http://disqus.com/ it's a much easier way to do commenting and it handles the spambot blocking, moderation, etc. It took me about 10 minutes to setup.