2013-03-07, 02:05 PM
I have been chipping away at this problem for a while and have finally got it to work - I have no idea how to create a plugin for it or indeed whether it is the best way to do it.
For what it is worth this is how I did it:
First download and install this mod (make sure you are happy with the idea / risk of using php in templates! )
http://mybbhacks.zingaburga.com/xthreads...tpl-2.0.7z
Visit the Envolve site - https://www.envolve.com/ - and set up an account.
Download the PHP API library and FTP it to your forum root.
Use a text editor to create the following file, replacing API key with your key from the Envolve website, - name it envolve_login.php and FTP it to your forum root -
<?php
define("IN_MYBB",1);
require_once('./envolve_api_client.php');
if($mybb->usergroup['issupermod'])
{
$envolve_code = envapi_get_html_for_reg_user('API key', $mybb->user['username'], NULL, $mybb->user['avatar'], true, $mybb->user['usertitle']);
}
else
{
$envolve_code = envapi_get_html_for_reg_user('API key', $mybb->user['username'], NULL, $mybb->user['avatar'], false, $mybb->user['usertitle']);
}
?>
Finally, go to the templates in the Admin CP and insert the following code at the end of the footer template -
<?php
define("IN_MYBB",1);
require_once"envolve_login.php";
echo $envolve_code;
?>
That's it - you will now have envolve chat with single login on your forum and users will show up with the correct username, their avatar (if set) and their user title. Board admins will show up in the right colour and have mod rights.
The only reason I used the PHP plugin is because I have no idea how to pass variables from the .php files into the templates - if you can do this then there is no need for the PHP plugin.
For what it is worth this is how I did it:
First download and install this mod (make sure you are happy with the idea / risk of using php in templates! )
http://mybbhacks.zingaburga.com/xthreads...tpl-2.0.7z
Visit the Envolve site - https://www.envolve.com/ - and set up an account.
Download the PHP API library and FTP it to your forum root.
Use a text editor to create the following file, replacing API key with your key from the Envolve website, - name it envolve_login.php and FTP it to your forum root -
<?php
define("IN_MYBB",1);
require_once('./envolve_api_client.php');
if($mybb->usergroup['issupermod'])
{
$envolve_code = envapi_get_html_for_reg_user('API key', $mybb->user['username'], NULL, $mybb->user['avatar'], true, $mybb->user['usertitle']);
}
else
{
$envolve_code = envapi_get_html_for_reg_user('API key', $mybb->user['username'], NULL, $mybb->user['avatar'], false, $mybb->user['usertitle']);
}
?>
Finally, go to the templates in the Admin CP and insert the following code at the end of the footer template -
<?php
define("IN_MYBB",1);
require_once"envolve_login.php";
echo $envolve_code;
?>
That's it - you will now have envolve chat with single login on your forum and users will show up with the correct username, their avatar (if set) and their user title. Board admins will show up in the right colour and have mod rights.
The only reason I used the PHP plugin is because I have no idea how to pass variables from the .php files into the templates - if you can do this then there is no need for the PHP plugin.