Installing on codeigniter
PostPosted: 29 Sep 2015, 10: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:
and the get_user_id looks like:
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:
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?
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?