Ask questions about how to do or fix things in Arrowchat
User avatar
Kode
Customer
 
Posts: 3
Joined: 15 Aug 2011, 16:55

 

by Kode 29 Sep 2015, 17:42

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?
User avatar
Kode
Customer
 
Posts: 3
Joined: 15 Aug 2011, 16:55

 

by Kode 29 Sep 2015, 17:59

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
User avatar
ayahinia
Customer
 
Posts: 1
Joined: 26 Oct 2015, 19:29

 

by ayahinia 12 Nov 2015, 22:37

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.
User avatar
Jason
ArrowChat Team
 
Posts: 2059
Joined: 13 Dec 2009, 00:06

 

by Jason 12 Nov 2015, 23:14

CodeIgniter is just a framework. Every site will have a different integration file when using CI.
User avatar
sholleyonline
Trial
 
Posts: 1
Joined: 13 Jun 2019, 16:03

 

by sholleyonline 14 Jun 2019, 10:52

Jason wrote: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.