Author Topic: Problem with global variables (!?!?)  (Read 7255 times)

0 Members and 1 Guest are viewing this topic.

Arjarn

  • Full Member
  • ***
  • Posts: 7
Problem with global variables (!?!?)
« on: February 13, 2015, 01:44:22 PM »
Hi all,

I attempt to install last Mibew 1.6 with Drupal site.

All files copied, Mysql DB done and install script OK (table created).

When I modify params with application (logo or options), there 's no update in database.

I write cookies with PHP instruction "setcookie" for variables in Config.php ($mysqlhost... etc...) and cookie haven't values !

If I modify Config.php and write :

global $mysqlhost;
$mysqlhost = 'xxxxxxxxxxx';

All seems ok...

If anybody have idea about this strange problem. I wonder me if problem is Drupal, PHP config or another thing  ???  :o

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Problem with global variables (!?!?)
« Reply #1 on: February 13, 2015, 03:49:51 PM »
To begin with, what's in your error log? Enable verbose errors reporting and provide the output.

Arjarn

  • Full Member
  • ***
  • Posts: 7
Re: Problem with global variables (!?!?)
« Reply #2 on: February 16, 2015, 12:58:48 PM »
OK, I've only error message like :

Could not connect: Access denied for user 'xxxxxxxxxxxxxx'@'localhost' (using password: NO)

So I trace variables used for connexion :

  - making setcookie on config.PHP with PHP variables (user, pass and server), it's OK. Cookie writen with good values.
  - making setcookie on other PHP page : values are NULL (!?!?)

I've proc on my page to know if op is online, if I insert setcookie after las require_once, valeu are NULL too :


require_once('./mibew/libs/common.php');
require_once('./mibew/libs/chat.php');
require_once('./mibew/libs/operator.php');
require_once('./mibew/libs/groups.php');

function util_has_online_operators($util_groupid = "")
{

   $groupid = verifyparam( $util_groupid, "/^\d{1,10}$/", "");

   if($groupid)
   {
      loadsettings();
      if($settings['enablegroups'] == '1')
      {
         $group = group_by_id($groupid);
         if(!$group) { $groupid = ""; }
      }
      else { $groupid = ""; }
   }
   
   $le_retour = has_online_operators($groupid) ? "1" : "0";
   
   return $le_retour;
}

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Problem with global variables (!?!?)
« Reply #3 on: February 17, 2015, 10:04:49 AM »
I don't get it at all.  :-\

Are you trying to make some custom solution with Mibew?

Arjarn

  • Full Member
  • ***
  • Posts: 7
Re: Problem with global variables (!?!?)
« Reply #4 on: February 17, 2015, 01:08:13 PM »
I attempt to install Mibew with DRUPAL site.

I made custom function to activate custom popup if operator is available :

   - use PHPLIVEX to call every X seconds function
   - this function call util_has_online_operators() and if operator is ok then return javascript code to show popup (with noty framework)

All custom are OUT of Mibew, I can see with cookies than problem appears too in Mibew page. So I'm supposing problem is about install, Drupal or PHP option  :o

I read people install Mibew with Drupal 6 site but don't know if it can't be bad params or someone else...

« Last Edit: February 17, 2015, 01:11:14 PM by Arjarn »

faf

  • Mibew Staff Member
  • Native
  • *****
  • Posts: 951
    • Mibew Messenger
Re: Problem with global variables (!?!?)
« Reply #5 on: February 17, 2015, 02:03:22 PM »
The installation of Mibew Messenger on a site means that one is running installer, then generating a button as a javascript code, and then inserting the given code into the markup of the site. That's all.

If you can log into Mibew Messenger administrative interface and generate the javascript code, the installation is fine.

And there should be no interaction between Mibew Messenger and any other software (be it Drupal, or Joomla, or Wordpress, or anything else).

As far as I can understand, you're trying to somehow make use of the internal libraries of Mibew Messenger. They are not supposed to be used that way. BTW, one of the basic reasons for the creation of Mibew Messenger 2 was an aspiration to make it possible to create agile third-party solutions based upon Mibew.

To sum it up.  :-\

1. Stop calling your actions an installation. You're confusing everyone including yourself. The process you're into should be called integration.

2. I really doubt that someone will try to recreate the errors and to find a solution for your troubles caused by mixing the code of almost outdated Mibew Messenger 1.6.x and Drupal (BTW, Drupal 6 that you've mentioned is almost outdated too). Good luck with that.

3. You'd better take a look at Mibew Messenger 2.0 and try to somehow make use of its new abilities. Though even in that case you'd better ask a concrete questions. Sometimes one explores the troubles and writes a code for other people just for fun, but there are not too much third party developers of that kind in the Mibew Messenger community...

Arjarn

  • Full Member
  • ***
  • Posts: 7
Re: Problem with global variables (!?!?)
« Reply #6 on: February 18, 2015, 10:00:58 AM »
Base functionnalities of Mibew are OK : I can modify params, inserting button.

I'm needing stable version of Mibew : we use it for "professional site".
Mibew is great : simplicity, easy css customing and very interesting features.
You do excellent job.

Unfortunately, I'm needing some features not in 1.6 like popup show after X second only if operator is online.

So after looking for in this forum, I'm finding posted source code to do that.

I'm adding little code in the site : just several PHP functions and few JS lines (all is OFF Mibew source).

2.0 seems very promising and - as said in other post - I'm waiting stable version with exciting !

Thanx for time you take to assist me.
I throught to find here, third party developper or people who integrated MIBEW in (old) Drupal  environment : not my intend to denigrate MIBEW or to loose your time with specific problem. Just a message bottle with hopping somebody have similar problem  ;)

Sorry for my bad english and thanx for all.

For now, keeping global instruction for variables in config.php and waiting 2.0.