May 23 2012 02:45:45
Languages
Navigation
Friends & Affiliates
Roadmap
[N] User Profile Wall
[N] Error log like in P...
[N] Submit photo - Subc...
[N] Warnings - who can ...
[N] [edit profile]Save ...
[N] Moving panels with ...
[N] Forum thread deform...
[N] Thumbnails in downl...
[N] [Locale German] New...
[N] Warnings only for a...
Users Online
· Guests Online: 2

· Members Online: 0

· Total Members: 495
· Newest Member: chronsk
Last Seen Users
· chronsk15:54:59
· budisantoso 1 day
· lidaer 1 day
· Yodix 2 days
· mr-casino 2 days
· dos5 4 days
· Machello93 4 days
· Leonardo_master 4 days
· ezgi 4 days
· xxyy 5 days

Login
 Username  Password  
View Thread: flash chat integration
Pimped Fusion - Content Management System » Pimped-Fusion Support & Development » Feature Requests
Who is here? 1 Guest
 Print Thread
flash chat integration
uygarozan
I'm trying to install FlashChat_v4711 tp my pimpedsite.
I installed it before to phpfusion 7.1x. It works. But it doesn't work with pimped fusion. I get blank screen. Can anybody help me?
Thanks...

Here is de integration file:


<?php

if ( !defined( 'INC_DIR' ) ) {
die( 'hacking attempt' );
}

$fusion_root_path = realpath(dirname(__FILE__) . '/../../../') . '/';
include($fusion_root_path . 'config.php');
class FusionCMS {

var $userid;
var $loginStmt;
var $getUserStmt;
var $getUsersStmt;

function FusionCMS() {

$this->loginStmt = new Statement("SELECT user_id AS id, user_name AS login, user_password, user_level FROM ".DB_PREFIX."users WHERE user_name=? AND user_password=? LIMIT 1");
$this->getUserStmt = new Statement("SELECT user_id AS id, user_name AS login, user_level FROM ".DB_PREFIX."users WHERE user_id=? LIMIT 1");
$this->getUsersStmt = new Statement("SELECT user_id AS id, user_name as login FROM ".DB_PREFIX."users");

$this->userid = NULL;

if (isset($_COOKIE['fusion_user'])) {
$cookie_vars = explode(".", $_COOKIE['fusion_user']);
$cookie_1 = is_numeric($cookie_vars['0']) ? $cookie_vars['0'] : NULL;
$cookie_2 = (preg_match("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "");

$this->userid = $cookie_1;
}

}


function isLoggedIn() {
return $this->userid;
}

function getRoles($group) {
$rv = ROLE_USER;

if ($group == 101)
{
$rv = ROLE_USER;
}

if ($GLOBALS['fc_config']['liveSupportMode'] && $group == 101)
{
$rv = ROLE_CUSTOMER;
}

if ($group == 102)
{
$rv = ROLE_MODERATOR;
}

if ($group == 103)
{
$rv = ROLE_ADMIN;
}

return $rv;

}

function getUserProfile($userid) {

if ($userid == SPY_USERID) $rv = NULL;

elseif ($user = $this->getUser($userid)) {

$rv = ($id = $this->isLoggedIn() && ($id == $userid)) ? "../edit_profile.php" : "../profile.php?lookup=" . $userid;

return $rv;
}
}


function getUser($userid) {

// if ($userid == SPY_USERID) return NULL;

$rv = NULL;

if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['user_level']);
$rv = $rec;
}
return $rv;
}

function login($login, $password) {

if (($rs = $this->loginStmt->process($login, md5($password))) && ($rec = $rs->next())) {

if ($rec['user_ban']) return NULL; /* user is banned from the site */

$cookie_value = $rec['id'] . "." . md5($password);
setcookie("fusion_user", $cookie_value, time() + 3600*3, "/", "", "0");

return $rec['id'];

}

}

function userInRole($userid, $role) {
if($user = $this->getUser($userid)) {
return ($user['roles'] == $role);
}
return false;
}

function logout() {

}

function getUsers() {

$rv = $this->getUsersStmt->process();
return $rv;

}

function getGender($userid) {
// 'M' for Male, 'F' for Female, NULL for undefined
return NULL;
}
}

$GLOBALS['fc_config']['db'] = array(
'host' => $GLOBALS['db_host'],
'user' => $GLOBALS['db_user'],
'pass' => $GLOBALS['db_pass'],
'base' => $GLOBALS['db_name'],
'pref' => DB_PREFIX . "fc_"
);

$GLOBALS['fc_config']['cms'] = new FusionCMS();


foreach($GLOBALS['fc_config']['languages'] as $k => $v) {
$GLOBALS['fc_config']['languages'][$k]['dialog']['login']['moderator'] = '';
}

?>
Edited by uygarozan on 19-02-2011 03:26
 
http://www.turkishlanguagelessons.com
uygarozan
I'm still busy to integrate flash chat to pimped fusion.

I can't log in, that is problem. There are no connect with database.

Here are the differences with php- fusion. (Flash chat works with php-fusion 7.1)

phpfusion has in config.php this:

<?php
// database settings
$db_host = "localhost";
$db_user = "user";
$db_pass = "pass";
$db_name = "db_name";
$db_prefix = "pre_";
define("DB_PREFIX", "pre_");
?>


pimped fusion has this:


<?php
// Pimped-Fusion
// database settings
$db_host = "localhost";
$db_user = "user";
$db_pass = "pass";
$db_name = "db_name";
$db_prefix = "pre_";
define("DB_PREFIX", $db_prefix);
define("COOKIE_PREFIX", "pre_");
// Unique Salt
define("PIF_SALT", "QRByXXXXX");
// DO NEVER CHANGE THIS SALT! OTHERWISE YOUR USERS CAN'T LOGIN ANYMORE
// IF YOU MOVE YOUR WEBSITE TO A NEW SERVER, YOU NEED TO ADD THIS SALT IN CONFIG
?>


I think, it must be fixed this part in integration file of flash chat:


<?php

if ( !defined( 'INC_DIR' ) ) {
die( 'hacking attempt' );
}

$fusion_root_path = realpath(dirname(__FILE__) . '/../../../') . '/';
include($fusion_root_path . 'config.php');
class FusionCMS {

var $userid;
var $loginStmt;
var $getUserStmt;
var $getUsersStmt;

function FusionCMS() {

$this->loginStmt = new Statement("SELECT user_id AS id, user_name AS login, user_password, user_level FROM ".DB_PREFIX."users WHERE user_name=? AND user_password=? LIMIT 1");
$this->getUserStmt = new Statement("SELECT user_id AS id, user_name AS login, user_level FROM ".DB_PREFIX."users WHERE user_id=? LIMIT 1");
$this->getUsersStmt = new Statement("SELECT user_id AS id, user_name as login FROM ".DB_PREFIX."users");

$this->userid = NULL;

if (isset($_COOKIE['fusion_user'])) {
$cookie_vars = explode(".", $_COOKIE['fusion_user']);
$cookie_1 = is_numeric($cookie_vars['0']) ? $cookie_vars['0'] : NULL;
$cookie_2 = (preg_match("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "");

$this->userid = $cookie_1;
}

}


function isLoggedIn() {
return $this->userid;
}

function getRoles($group) {
$rv = ROLE_USER;

if ($group == 101)
{
$rv = ROLE_USER;
}

if ($GLOBALS['fc_config']['liveSupportMode'] && $group == 101)
{
$rv = ROLE_CUSTOMER;
}

if ($group == 102)
{
$rv = ROLE_MODERATOR;
}

if ($group == 103)
{
$rv = ROLE_ADMIN;
}

return $rv;

}

function getUserProfile($userid) {

if ($userid == SPY_USERID) $rv = NULL;

elseif ($user = $this->getUser($userid)) {

$rv = ($id = $this->isLoggedIn() && ($id == $userid)) ? "../edit_profile.php" : "../profile.php?lookup=" . $userid;

return $rv;
}
}


function getUser($userid) {

// if ($userid == SPY_USERID) return NULL;

$rv = NULL;

if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['user_level']);
$rv = $rec;
}
return $rv;
}

function login($login, $password) {

if (($rs = $this->loginStmt->process($login, md5($password))) && ($rec = $rs->next())) {

if ($rec['user_ban']) return NULL; /* user is banned from the site */

$cookie_value = $rec['id'] . "." . md5($password);
setcookie("fusion_user", $cookie_value, time() + 3600*3, "/", "", "0");

return $rec['id'];

}

}

function userInRole($userid, $role) {
if($user = $this->getUser($userid)) {
return ($user['roles'] == $role);
}
return false;
}

function logout() {

}

function getUsers() {

$rv = $this->getUsersStmt->process();
return $rv;

}

function getGender($userid) {
// 'M' for Male, 'F' for Female, NULL for undefined
return NULL;
}
}

$GLOBALS['fc_config']['db'] = array(
'host' => $GLOBALS['db_host'],
'user' => $GLOBALS['db_user'],
'pass' => $GLOBALS['db_pass'],
'base' => $GLOBALS['db_name'],
'pref' => DB_PREFIX . "fc_"
);


$GLOBALS['fc_config']['cms'] = new FusionCMS();


foreach($GLOBALS['fc_config']['languages'] as $k => $v) {
$GLOBALS['fc_config']['languages'][$k]['dialog']['login']['moderator'] = '';
}

?>



What are the differences between php fusion and pimped fusion to connect to database? How can I fix line as:

define("COOKIE_PREFIX", "pre_");

in the integration file?

Any idea, suggestion?

Thanks...
 
http://www.turkishlanguagelessons.com
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
Integration with phpBB3/MyBB? General Questions 5 29-02-2012 04:07
chat General Questions 1 28-02-2012 04:24
Flash in wysiwig editor General Questions 1 27-02-2012 05:22
AJax Chat kombiniert mit PF-Foren Allgemeine Fragen 1 08-11-2011 13:07
tufat flash chat und pimped fusion Allgemeine Fragen 5 15-02-2010 21:12
Share this thread
URL:
BB-Code:
HTML:
AddThis:
Share |
Render time: 0.12 seconds - 87 Queries 995,827 unique visits