JordanD Posted December 26, 2011 Share Posted December 26, 2011 I already posted this on the official ezrpg forums, but I decided to post it here as well so that more people have access to it. It's not a real mod written from ground up, but basically a tutorial on how to integrate the phpFreeChat script into your ezrpg game. Step 1: Download phpFreeChat from their website: http://www.phpfreechat.net Step 2: Upload it to your host. My script assumes that you uploaded it to the folder at /phpfreechat-1.3/ so if you have it in a folder called something else or have it inside a few folders, then you will have to change the "require_once" line of code. Step 3: Go to your modules folder and create a new folder in it called Chat and inside it create a php file called index.php. Then copy and paste the following code into that file: <?php defined('IN_EZRPG') or exit; class Module_Chat extends Base_Module { public function start() { requireLogin(); require_once ($_SERVER['DOCUMENT_ROOT']). "/phpfreechat-1.3/src/phpfreechat.class.php"; $params = array(); $params["title"] = "Chat"; $params["nick"] = $this->player->username; $params['firstisadmin'] = false; $params["serverid"] = md5(__FILE__); $params["debug"] = false; $chat = new phpFreeChat( $params ); $this->tpl->display('header.tpl'); $chat->printChat(); $this->tpl->display('footer.tpl'); } } ?> Step 4: Customize the script and add parameters as you see fit. I recommend adding the line $params["frozen_nick"] = true; after the last $params line so that your players can't change their chat nickname to something other than their username in the game. There are lot of other parameters, features, and ways to customize it so check out the phpFreeChat site for more info on this. Step 5: Put a link somewhere in your header.tpl file or anywhere else that links to index.php?mod=Chat If anyone has any questions or comments, please post them and I'll try to answer them. Enjoy! Quote Link to comment Share on other sites More sharing options...
boots Posted January 11, 2012 Share Posted January 11, 2012 cant even find a modules folder ?? Quote Link to comment Share on other sites More sharing options...
JordanD Posted January 13, 2012 Author Share Posted January 13, 2012 Are you using the ezrpg engine? If so, there should be a modules folder if you have installed it correctly. Quote Link to comment Share on other sites More sharing options...
djpredator69 Posted August 9, 2012 Share Posted August 9, 2012 i have a problem i see on my site only loading nothing more if i use iframe it works why? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.