Page 1 of 1

Installing on codeigniter

PostPosted: 29 Sep 2015, 10:42
by Kode
Hi, according to http://www.arrowchat.com/requirements/ CodeIgniter is a supported integration, which, lets be honest, appears to be a lie ( once I upgraded my license, then realised that didn't allow you to download the latest version, so had to purchase that as well ), as it's not on the list when you go to /arrowchat/install/ so I had to go the custom route.

So what I did was set it to only members can chat, that didn't work, I checked the debug (which isn't in the location the documentation says it is), and that said it wasn't getting the user id, so I copied the codeigniter index file into the includes folder and named it external2.php, set the application and system path to ../../../ (trial and error to get the correct one, but it made sense when it worked), then in integration.php after the commented out //session_start(); (I tried uncommenting the session_start and changing cookie to session but that didn't work). I added:

Code: Select all
ob_start();
include('external2.php');
ob_end_clean();
$CI =& get_instance();
$CI->load->library('session');


and the get_user_id looks like:

Code: Select all
   function get_user_id() 
   {
      $userid = NULL;
      
      if (isset($_SESSION['user_id']))
      {
         $userid = $_SESSION['user_id'];
      }

      return $userid;
   }


after that debug showed that the user id was working but it was saying that there was a problem with a foreach in functions_common.php so I changed the affected function to:

Code: Select all
   function check_array_for_match($needle, $haystack)
   {
      if(!is_array($needle)) return false;
      foreach ($needle as $value)
      {
         if (in_array($value, $haystack))
         {
            return true;
         }
      }
      
      return false;
   }

As in I checked it was an array first and returned false if it wasnt.

Still no joy on the front end though, so I went into the admin and changed it to guests could chat, now the bar finally shows up, but it's showing me as a guest!

Any ideas?

Re: Installing on codeigniter

PostPosted: 29 Sep 2015, 10:59
by Kode
Ok, I might have been a bit premature on that, apparently I show up as a logged in user, but guests are messed up, thats not a big issue though as I dont want them chatting anyway

Re: Installing on codeigniter

PostPosted: 12 Nov 2015, 14:37
by ayahinia
Kode wrote:Ok, I might have been a bit premature on that, apparently I show up as a logged in user, but guests are messed up, thats not a big issue though as I dont want them chatting anyway

Just curious but which version of CodeIgniter were you using?

Our current version is 2.1.0 and we've come to an impasse. After replicating your changes and changing a few other things on our side we've come to the point logs indicate a pathing issue in system/Core attempting to open /config/constants.php. And obviously, we can't modify that without affecting the entire rest of the site.

Re: Installing on codeigniter

PostPosted: 12 Nov 2015, 15:14
by Jason
CodeIgniter is just a framework. Every site will have a different integration file when using CI.

Re: Installing on codeigniter

PostPosted: 14 Jun 2019, 03:52
by sholleyonline
CodeIgniter is just a framework. Every site will have a different integration file when using CI.
How are we going to integrate it with Codeigniter? Because is not working yet.