<?php
if(osc_is_web_user_logged_in())
{
$ses = osc_logged_user_id() ; //tell freichat the userid of the current user
setcookie("freichat_user", "LOGGED_IN", time() 3600, "/"); // *do not change -> freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest
setcookie("freichat_user", null, time() 3600, "/"); // *do not change -> freichat code
}
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/home/www/YOURDOMAINNAME.COM/freichat/hardcode.php")){
require "/home/www/YOURDOMAINNAME.COM/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not found!');</script>";
}
return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://www.YOURDOMAINNAME.com/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
<link rel="stylesheet" href="http://www.YOURDOMAINNAME.com/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<div class="onlineuser">
<?php $user = User::newInstance()->findByPrimaryKey(osc_item_user_id()); ?>
<?php if(useronline_show_user_status() == 1) { ?>
<a class="chat_online_inline" id="onlineuser" href="javascript:void(0)" onClick="FreiChat.create_chat_window(<?php echo "'".$user['s_name']."'" ; ?>, <?php echo osc_item_user_id(); ?>)"></a>
<?php } else { ?>
<a class="chat_offline_inline" href="javascript:void(0)"></a>
<?php } ?>
</div>
.chat_online_inline{background:url(images/online.png) no-repeat;}
.chat_offline_inline{background:url(images/offline.png) no-repeat;}
.chat_online_inline,.chat_offline_inline{float:right; display: block; cursor:pointer;}
thanks for tutorial :)
this safe from SPAM or hacker?
#freichat {
position: fixed;
right: 0px;
bottom: 0px;
margin-right: 5px;
font-family: helvetica, arial, sans-serif;
font-size: 13px;
visibility: hidden;
}
.freichat {
position: relative;
padding: 0px;
background-color: none;
color: #000000;
text-align: justify;
font-size: 14px;
width: 200px;
background-image: none;
border: none;
line-height: 1.4em;
margin: 0px;
visibility: hidden;
}
whre wp-config ?
<?php
if(osc_is_web_user_logged_in())
{
$ses = osc_logged_user_id() ; //tell freichat the userid of the current user
setcookie("freichat_user", "LOGGED_IN", time() 3600, "/"); // *do not change -> freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest
setcookie("freichat_user", null, time() 3600, "/"); // *do not change -> freichat code
}
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/home/www/YOURDOMAINNAME.COM/freichat/hardcode.php")){
require "/home/www/YOURDOMAINNAME.COM/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not found!');</script>";
}
return 0;
}
}
?>
i got this error when i enter this code
Parse error: syntax error, unexpected '3600' (T_LNUMBER) inCode: [Select]<?php
if(osc_is_web_user_logged_in())
{
$ses = osc_logged_user_id() ; //tell freichat the userid of the current user
setcookie("freichat_user", "LOGGED_IN", time() 3600, "/"); // *do not change -> freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest
setcookie("freichat_user", null, time() 3600, "/"); // *do not change -> freichat code
}
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file("/home/www/YOURDOMAINNAME.COM/freichat/hardcode.php")){
require "/home/www/YOURDOMAINNAME.COM/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not found!');</script>";
}
return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="http://www.YOURDOMAINNAME.com/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
<link rel="stylesheet" href="http://www.YOURDOMAINNAME.com/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<!--===========================FreiChat=======START=========================-->
<!-- For uninstalling ME , first remove/comment all FreiChat related code i.e below code
Then remove FreiChat tables frei_session & frei_chat if necessary
The best/recommended way is using the module for installation -->
<?php
if(USER_IS_LOGGED_IN)
{
$ses = osc_logged_user_id() ; //tell freichat the userid of the current user
setcookie("freichat_user", "LOGGED_IN", time() 3600, "/"); // *do not change -> freichat code
}
else {
$ses = null; //tell freichat that the current user is a guest
setcookie("freichat_user", null, time() 3600, "/"); // *do not change -> freichat code
}
if(!function_exists("freichatx_get_hash")){
function freichatx_get_hash($ses){
if(is_file(osc_base_path()."/freichat/hardcode.php")){
require osc_base_path()."/freichat/hardcode.php";
$temp_id = $ses . $uid;
return md5($temp_id);
}
else
{
echo "<script>alert('module freichatx says: hardcode.php file not
found!');</script>";
}
return 0;
}
}
?>
<script type="text/javascript" language="javascipt" src="<?php echo osc_base_url() ; ?>freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script>
<link rel="stylesheet" href="<?php echo osc_base_url() ; ?>freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
<!--===========================FreiChatX=======END=========================-->
<?php if(function_exists('useronline_show_chat')) {useronline_show_chat();} ?>
Sorry. i don't think is possible