Created
July 27, 2012 03:02
-
-
Save pd51189/3185963 to your computer and use it in GitHub Desktop.
LiveStream Dolphin 7.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*************************************************************************** | |
* Dolphin Smart Community Builder | |
* ------------------- | |
* begin : Mon Mar 23 2006 | |
* copyright : (C) 2007 BoonEx Group | |
* website : http://www.boonex.com | |
* This file is part of Dolphin - Smart Community Builder | |
* | |
* Dolphin is free software; you can redistribute it and/or modify it under | |
* the terms of the GNU General Public License as published by the | |
* Free Software Foundation; either version 2 of the | |
* License, or any later version. | |
* | |
* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | |
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
* See the GNU General Public License for more details. | |
* You should have received a copy of the GNU General Public License along with Dolphin, | |
* see license.txt file; if not, write to marketing@boonex.com | |
***************************************************************************/ | |
# | |
#Developed By GK | |
# Mail ID: cobrasofttoday@gmail.com | |
#Company www.cogzidel.com | |
bx_import ( 'BxDolModule' ); | |
bx_import ( 'BxDolPaginate'); | |
define('LIVESTREAM_IMAGES_PATH', getcwd(). "/boonex/livestream/files/"); | |
// Added Poll Module | |
// include('/home/dicove/public_html/production/tony/dolphin/modules/boonex/poll/classes/BxPollModule.php'); | |
class LivestreamModule extends BxDolModule { | |
function LivestreamModule(&$aModule) { | |
parent::BxDolModule ( $aModule ); | |
$this->aForm = array( | |
'form_attrs' => array( | |
'name' => 'form_addroom', | |
'action' => '', | |
'method' => 'post', | |
'enctype' => 'multipart/form-data', | |
), | |
'params' => array ( | |
'db' => array( | |
'table' => 'ls_rooms', | |
'key' => 'id', | |
'submit_name' => 'submit_form', | |
), | |
), | |
'inputs' => array( | |
'name' => array( | |
'type' => 'text', | |
'name' => 'name', | |
'caption' => _t('Room Name'), | |
'required' => true, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(3,50), | |
'error' => _t ('Please Give the Room Name'), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'desc' => array( | |
'type' => 'text', | |
'name' => 'desc', | |
'caption' => _t('Description'), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,200), | |
'error' => _t ('Please Give the Description'), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'file' => array( | |
'type' => 'file', | |
'name' => 'file', | |
'caption' => _t('Image'), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'AdPhotos', | |
'params' => '', | |
'error' => _t ('Please Give Image'), | |
), | |
'db' => array ( | |
'pass' => 'XssHtml', | |
), | |
), | |
'tags' => array( | |
'type' => 'text', | |
'name' => 'tags', | |
'caption' => _t('Tags<br>(Give Tags Seperated by "," Comma)'), | |
'required' => true, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(3,255), | |
'error' => _t ('Please Give a Tags More Than 3 Character'), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'access' => array( | |
'type' => 'select', | |
'name' => 'access', | |
'caption' => _t('Access Type'), | |
'values' => array( | |
'Everybody' => _t('Everybody'), | |
'Members' => _t('Members'), | |
'Selected' => _t(' List of Members'), | |
), | |
'required' => false, | |
), | |
'access_list' => array( | |
'type' => 'text', | |
'name' => 'access_list', | |
'value' => getNickName ( $_COOKIE ['memberID'] ), | |
'caption' => _t('List of Members<br>(Give User Names Seperated by "," Comma)'), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,5000), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'memb_list' => array( | |
'type' => 'text', | |
'name' => 'memb_list', | |
'value' => getNickName ( $_COOKIE ['memberID'] ), | |
'caption' => _t('List of Moderators<br>(Give User Names Seperated by "," Comma)'), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,5000), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'welcome_html' => array( | |
'type' => 'textarea', | |
'name' => 'welcome_html', | |
'caption' => _t('Welcome Message'), | |
'value' => 'Welcome!', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,5000), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'XssHtml', | |
), | |
), | |
'layoutcode' => array( | |
'type' => 'textarea', | |
'name' => 'layoutcode', | |
'caption' => _t('Layout Code'), | |
'value' => '', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,5000), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'fillwindow' => array( | |
'type' => 'select', | |
'name' => 'fillwindow', | |
'caption' => _t('Fill Window'), | |
'values'=> array( | |
'0' => _t('No'), | |
'1' => _t('Yes'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'filter_regex' => array( | |
'type' => 'text', | |
'name' => 'filter_regex', | |
'caption' => _t('Filter Regex'), | |
'value' => '(?i)(fuck|cunt)(?-i)', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'filter_replace' => array( | |
'type' => 'text', | |
'name' => 'filter_replace', | |
'caption' => _t('Filter Replace'), | |
'value' => '**', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'camwidth' => array( | |
'type' => 'text', | |
'name' => 'camwidth', | |
'caption' => _t('Camera Width'), | |
'value' => '320', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'camheight' => array( | |
'type' => 'text', | |
'name' => 'camheight', | |
'caption' => _t('Camera Height'), | |
'value' => '240', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'camfps' => array( | |
'type' => 'text', | |
'name' => 'camfps', | |
'caption' => _t('Camera FPS'), | |
'value' => '15', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'micrate' => array( | |
'type' => 'text', | |
'name' => 'micrate', | |
'caption' => _t('MIC Rate'), | |
'value' => '11', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'micrate' => array( | |
'type' => 'text', | |
'name' => 'micrate', | |
'caption' => _t('Mic Rate'), | |
'value' => '11', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'cambandwidth' => array( | |
'type' => 'text', | |
'name' => 'cambandwidth', | |
'caption' => _t('Camera Minimum Bandwidth'), | |
'value' => '40960', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'cammaxbandwidth' => array( | |
'type' => 'text', | |
'name' => 'cammaxbandwidth', | |
'caption' => _t('Camera Maximum Bandwidth'), | |
'value'=> '81920', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'labelcolor' => array( | |
'type' => 'text', | |
'name' => 'labelcolor', | |
'caption' => _t('Label Color'), | |
'value'=> 'FFFFFF', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'floodprotection' => array( | |
'type' => 'text', | |
'name' => 'floodprotection', | |
'caption' => _t('Flood Protection(In Seconds)'), | |
'value'=> '1', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'room_open' => array( | |
'type' => 'select', | |
'name' => 'room_open', | |
'caption' => _t('Is Room Open?'), | |
'values'=> array( | |
'Yes' => _t('Yes'), | |
'No' => _t('No'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'administrator' => array( | |
'type' => 'select', | |
'name' => 'administrator', | |
'caption' => _t('Who can Administrate this Room?'), | |
'values'=> array( | |
'2' => _t('Moderators'), | |
'1' => _t('Everybody'), | |
'0' => _t('Disabled'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'showtimer' => array( | |
'type' => 'select', | |
'name' => 'showtimer', | |
'caption' => _t('Show Timer'), | |
'values'=> array( | |
'1' => _t('Everybody'), | |
'2' => _t('Moderators'), | |
'0' => _t('Disabled'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'writetext' => array( | |
'type' => 'select', | |
'name' => 'writetext', | |
'caption' => _t('Watch Video Write Text'), | |
'values'=> array( | |
'1' => _t('Everybody'), | |
'2' => _t('Moderators'), | |
'0' => _t('Disabled'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'showcamsettings' => array( | |
'type' => 'select', | |
'name' => 'showcamsettings', | |
'caption' => _t('Show Camera Settings'), | |
'values'=> array( | |
'1' => _t('Everybody'), | |
'2' => _t('Moderators'), | |
'0' => _t('Disabled'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'advancedcamsettings' => array( | |
'type' => 'select', | |
'name' => 'advancedcamsettings', | |
'caption' => _t('Advanced Camera Settings'), | |
'values'=> array( | |
'1' => _t('Everybody'), | |
'2' => _t('Moderators'), | |
'0' => _t('Disabled'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'configuresource' => array( | |
'type' => 'select', | |
'name' => 'configuresource', | |
'caption' => _t('Configure Source'), | |
'values'=> array( | |
'1' => _t('Everybody'), | |
'2' => _t('Moderators'), | |
'0' => _t('Disabled'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'onlyvideo' => array( | |
'type' => 'select', | |
'name' => 'onlyvideo', | |
'caption' => _t('Shows Only Video Panel'), | |
'values'=> array( | |
'0' => _t('No'), | |
'1' => _t('Yes'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'noembeds' => array( | |
'type' => 'select', | |
'name' => 'noembeds', | |
'caption' => _t('Hide Embed Codes'), | |
'values'=> array( | |
'0' => _t('No'), | |
'1' => _t('Yes'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_welcome' => array( | |
'type' => 'textarea', | |
'name' => 'w_welcome', | |
'caption' => _t('Watch Video Welcome Message'), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,5000), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_offmsg' => array( | |
'type' => 'text', | |
'name' => 'w_offmsg', | |
'value' => 'Channel+Offline (for watch + just video interface)', | |
'caption' => _t('Watch Video Offline Message'), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_layoutcode' => array( | |
'type' => 'textarea', | |
'name' => 'w_layoutcode', | |
'caption' => _t('Watch Video Layout Code'), | |
'value' => '', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,5000), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_fillwindow' => array( | |
'type' => 'select', | |
'name' => 'w_fillwindow', | |
'caption' => _t('Watch Video Fill Window'), | |
'values'=> array( | |
'0' => _t('No'), | |
'1' => _t('Yes'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_floodprotection' => array( | |
'type' => 'text', | |
'name' => 'w_floodprotection', | |
'caption' => _t('Watch Video Flood Protection(In Seconds)'), | |
'value'=> '1', | |
'required' => false, | |
'checker' => array ( | |
'func' => 'length', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_writetext' => array( | |
'type' => 'select', | |
'name' => 'w_writetext', | |
'caption' => _t('Watch Video Write Text'), | |
'values'=> array( | |
'1' => _t('Everybody'), | |
'2' => _t('Moderators'), | |
'0' => _t('Disabled'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_disablevideo' => array( | |
'type' => 'select', | |
'name' => 'w_disablevideo', | |
'caption' => _t('Disable Video'), | |
'values'=> array( | |
'0' => _t('Disabled'), | |
'1' => _t('Everybody'), | |
'2' => _t('Except Moderators'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_disablechat' => array( | |
'type' => 'select', | |
'name' => 'w_disablechat', | |
'caption' => _t('Watch Video Disable Chat'), | |
'values'=> array( | |
'0' => _t('Disabled'), | |
'1' => _t('Everybody'), | |
'2' => _t('Except Moderators'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'w_disableusers' => array( | |
'type' => 'select', | |
'name' => 'w_disableusers', | |
'caption' => _t('Watch Video Disable Users'), | |
'values'=> array( | |
'0' => _t('Disabled'), | |
'1' => _t('Everybody'), | |
'2' => _t('Except Moderators'), | |
), | |
'required' => false, | |
'checker' => array ( | |
'func' => 'avail', | |
'params' => array(0,255), | |
'error' => _t (''), | |
), | |
'db' => array ( | |
'pass' => 'Xss', | |
), | |
), | |
'submit' => array ( | |
'type' => 'submit', | |
'name' => 'submit_form', | |
'value' => _t('_Submit'), | |
'align' => 'centre', | |
'colspan' => true, | |
), | |
), | |
); | |
} | |
function actionRoom($room_id = '', $watch = '') { | |
$this->_oTemplate->pageStart (); | |
//Access Type Control | |
$room_data = $this->_oDb->getEntryById ( $room_id ); | |
switch ($room_data ['access']) { | |
case 'Everybody' : | |
break; | |
case 'Members' : | |
if ((! $GLOBALS ['logged'] ['member'] && ! $GLOBALS ['logged'] ['admin'])) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
case 'Selected' : | |
$str = $room_data ['access_list']; | |
$yes = 0; //Default Not Found User | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName ( $_COOKIE ['memberID'] )) { | |
$yes = 1; | |
} | |
} //End Find | |
} | |
//Always Access to Room Owner | |
if ($room_data ['owner'] == $_COOKIE ['memberID']) { | |
$yes = 1; | |
} | |
if (($yes == 0 && ! $GLOBALS ['logged'] ['admin'])) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
} | |
//End Access Type Control | |
if ($room_id != NULL) { | |
$room_data = $this->_oDb->getEntryById ( $room_id ); | |
} else { | |
$this->_oTemplate->displayPageNotFound (); | |
return; | |
} | |
if ($room_data ['room_open'] != 'Yes') { | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
/* //Expire Check | |
$expire = strtotime($room_data['expire']); | |
$curr_date = strtotime(date("Y-m-d")); | |
if($expire < $curr_date){ | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
//End Expire*/ | |
//Check Room is Private or Not | |
if ($_COOKIE ['memberID'] == $room_data ['owner']) { | |
$private = 1; | |
} else { | |
$private = 0; | |
} | |
if (! $_COOKIE ['memberID']) { | |
$room_usr ['name'] = 'Guest'; | |
} else { | |
$room_usr = $this->_oDb->roomMgr ( $_COOKIE ['memberID'], $room_data, $private ); | |
} | |
$room_name = str_replace ( " ", "-", $room_data ['name'] ); | |
//Loging Online Status | |
$this->_oDb->onlineUsers ( $room_id, $_COOKIE ['memberID'] ); | |
############################################################################################################################ | |
//Controling vc_Login.php | |
############################################################################################################################ | |
$settings = $this->_oDb->getAdminSettings (); // Call Admin Panel Settings | |
//echo 'Admin<pre>'; print_r($settings); echo '<pre>'; | |
//echo 'Room<pre>'; print_r($room_data); echo '<pre>'; | |
function permission($set, $str) { | |
if ($set == 2) { | |
$yes = 0; //Default Not Found User | |
//print_r($str); | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName ( $_COOKIE ['memberID'] )) { | |
$yes = 1; | |
} | |
} //End Find | |
} | |
} elseif ($set == 1) { | |
$yes = 1; | |
} elseif ($set == 0) { | |
$yes = 0; | |
} | |
return $yes; | |
} | |
# Except Mod Settings | |
function except_permission($set, $str) { | |
if ($set == 2) { | |
$yes = 1; //Default Not Found User | |
//print_r($str); | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName ( $_COOKIE ['memberID'] )) { | |
$yes = 0; | |
} | |
} //End Find | |
} | |
} elseif ($set == 1) { | |
$yes = 1; | |
} elseif ($set == 0) { | |
$yes = 0; | |
} | |
return $yes; | |
} | |
$memb_list = $room_data ['memb_list']; //Get Member List from Modrator | |
$room_data ['showtimer'] = permission ( $room_data ['showtimer'], $memb_list ); | |
$room_data ['showcamsettings'] = permission ( $room_data ['showcamsettings'], $memb_list ); | |
$room_data ['advancedcamsettings'] = permission ( $room_data ['advancedcamsettings'], $memb_list ); | |
$room_data ['configuresource'] = permission ( $room_data ['configuresource'], $memb_list ); | |
$room_data ['writetext'] = permission ( $room_data ['writetext'], $memb_list ); | |
$room_data ['w_writetext'] = permission ( $room_data ['w_writetext'], $memb_list ); | |
$room_data ['w_disablevideo'] = except_permission ( $room_data ['disablevideo'], $memb_list ); | |
$room_data ['w_disablechat'] = except_permission ( $room_data ['w_disablechat'], $memb_list ); | |
$room_data ['w_disableusers'] = except_permission ( $room_data ['w_disableusers'], $memb_list ); | |
$profile = getProfileInfo ( $_COOKIE ['memberID'] ); | |
//Profile Type | |
if ($profile ['Sex'] == 'male') { | |
$userType = 1; | |
$admin = 0; | |
} elseif ($profile ['Sex'] == 'female') { | |
$userType = 2; | |
$admin = 0; | |
} elseif ($GLOBALS ['logged'] ['admin']) { | |
$userType = 3; | |
$admin = 1; | |
} else { | |
$userType = 0; | |
$admin = 0; | |
} | |
//User Picture | |
$userPicture = BX_DOL_URL_ROOT . 'modules/boonex/avatar/data/images/' . $_COOKIE ['memberID'] . '.jpg'; | |
$file_headers = @get_headers ( $userPicture ); | |
if ($file_headers [0] == 'HTTP/1.1 404 Not Found') { | |
$userPicture = 'defaultpicture.png'; | |
} | |
//LoggedIn Check | |
if (($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin'])) { // check access to the page | |
$loggedin = 1; | |
}else { | |
$loggedin = 0; | |
} | |
//User Link | |
$path = BX_DOL_URL_ROOT . getNickName ( $_COOKIE ['memberID'] ); | |
$myFile = getcwd () . '/boonex/livestream/classes/livestream/vc_login.php'; | |
$fh = fopen ( $myFile, 'w' ) or die ( "can't open file" ); | |
#Content | |
$bit = "'"; | |
$stringData= '<?php | |
//This script controls login and parameters to broadcasting inteface (is called by live_broadcast.swf) | |
$rtmp_server = "rtmp://174.37.45.156/devvideo-archive"; | |
$rtmp_amf = "AMF3"; | |
// AMF3 : Red5, Wowza, FMIS3, FMIS3.5 | |
// AMF0 : FCS1.5, FMS2 | |
// blank for flash default | |
$rtmfp_server="rtmfp://stratus.adobe.com/f1533cc06e4de4b56399b10d-1a624022ff71/"; | |
// RTMFP server for negotiangin P2P connections where possible | |
// Get your own independent developer key/address from: https://www.adobe.com/cfusion/entitlement/index.cfm?e=stratus | |
$tokenKey = "VideoWhisper"; | |
// This can be used to secure access as configured in RTMP server settings (secureTokenSharedSecret). | |
$ban_names=Array("ban_name1", "ban_name2"); | |
//ban channel or user names | |
function append_log($text) | |
{ | |
$dfile = fopen("vwlog.txt","a"); | |
fputs($dfile,$text); | |
fclose($dfile); | |
} | |
$username=$_GET['.$bit.'room_name'.$bit.']; | |
$username=preg_replace("/[^0-9a-zA-Z_]/","-",$username); | |
$msg=""; | |
$loggedin=1; | |
if (in_array($username,$ban_names)) | |
{ | |
$loggedin=0; | |
$msg=urlencode("<a href=\"http://www.videowhisper.com\">You are not allowed to broadcast. Contact for details.</a>"); | |
} | |
function baseURL() { | |
$pageURL = '.$bit.'http'.$bit.'; | |
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} | |
$pageURL .= "://"; | |
if ($_SERVER["SERVER_PORT"] != "80") { | |
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; | |
} else { | |
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; | |
} | |
return substr($pageURL,0,strrpos($pageURL,"/"))."/"; | |
} | |
$base=baseURL(); | |
$linkcode=$base."channel.php?n=".urlencode($username); | |
$imagecode=$base."snapshots/".urlencode($username).".jpg"; | |
$swfurl=$base."live_watch.swf?n=".urlencode($username); | |
$swfurl2=$base."live_video.swf?n=".urlencode($username); | |
$embedcode =<<<EMBEDEND | |
<object width="640" height="350"><param name="movie" value="$swfurl" /><param name="base" value="$base" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="scale" value="noscale" /><param name="salign" value="lt" /><embed src="$swfurl" base="$base" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="350" scale="noscale" salign="lt"></embed></object> | |
EMBEDEND; | |
$embedvcode =<<<EMBEDEND2 | |
<object width="320" height="240"><param name="movie" value="$swfurl2" /><param name="base" value="$base" /><param name="scale" value="exactfit"/><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="$swfurl2" base="$base" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="240" scale="exactfit"></embed></object> | |
EMBEDEND2; | |
//replace bad words or expression | |
$filterRegex=urlencode("'.$room_data['filter_regex'].'"); | |
$filterReplace=urlencode("'.$room_data['filter_replace'].'"); | |
//layout obtained by sending in public chat box "/videowhisper layout"; fill in new line between layoutEND markers | |
$layoutCode=<<<layoutEND | |
'.$room_data['layoutcode'].' | |
layoutEND; | |
?>server=' . $settings [0] ['VALUE'] . '&serverAMF=' . $settings [3] ['VALUE'] . '&tokenKey=' . $settings [16] ['VALUE'] . '&serverRTMFP=' . $settings [1] ['VALUE'] . '&p2pGroup=' . $settings [4] ['VALUE'] . '&supportRTMP=' . $settings [5] ['VALUE'] . '&supportP2P=' . $settings [6] ['VALUE'] . '&alwaysRTMP=' . $settings [7] ['VALUE'] . '&alwaysP2P=' . $settings [8] ['VALUE'] . '&room=<?=$username?>&welcome='.$room_data['welcome_html'].'&username=<?=$username?>&userType='.$userType.'&webserver=&msg=<?=$msg?>&loggedin='.$loggedin.'&linkcode=<?=urlencode($linkcode)?>&embedcode=<?=urlencode($embedcode)?>&embedvcode=<?=urlencode($embedvcode)?>&imagecode=<?=urlencode($imagecode)?>&room_limit='.$settings [21] ['VALUE'].'&showTimer=' . $room_data ['showtimer'] . '&showCredit=1&disconnectOnTimeout=1&camWidth=' . $room_data ['camwidth'] . '&camHeight=' . $room_data ['camheight'] . '&camFPS=' . $room_data ['camfps'] . '&micRate='.$room_data['micrate'].'&camBandwidth=' . $room_data ['cambandwidth'] . '&bufferLive=' . $settings [9] ['VALUE'] . '&bufferFull=' . $settings [10] ['VALUE'] . '&showCamSettings=' . $room_data ['showcamsettings'] . '&advancedCamSettings=' . $room_data ['advancedcamsettings'] . '&camMaxBandwidth=' . $room_data ['cammaxbandwidth'] . '&disableBandwidthDetection=' . $settings [11] ['VALUE'] . '&limitByBandwidth=' . $settings [12] ['VALUE'] . '&configureSource=' . $room_data ['configuresource'] . '&generateSnapshots='.$settings[17]['VALUE'].'&snapshotsTime='.$settings[18]['VALUE'].'&onlyVideo='.$room_data['onlyvideo'].'&noVideo=0&noEmbeds='.$room_data['noembeds'].'&labelColor='.$room_data['labelcolor'].'&writeText='.$room_data['writetext'].'&floodProtection='.$room_data['floodprotection'].'&privateTextchat=1&filterRegex=<?=$filterRegex?>&filterReplace=<?=$filterReplace?>&externalInterval=5000&layoutCode=<?=urlencode($layoutCode)?>&fillWindow=' . $room_data ['fillwindow'] . '&verboseLevel=2&loadstatus=1 | |
'; | |
fwrite ( $fh, $stringData ); | |
fclose ( $fh ); | |
//End Controling ls_Login.php | |
############################################################################################################################ | |
$this->_oTemplate->pageStart (); | |
#Updating Last Used Time For Room | |
$this->_oDb->updateRoomUsed ( $room_id, time () ); | |
if($watch == ''){ | |
#Controling Live_broadcast.php | |
$myFile4 = getcwd () . '/boonex/livestream/classes/livestream/live_broadcast.php'; | |
$fh4 = fopen ( $myFile4, 'w' ) or die ( "can't open file" ); | |
$stringData4 = '<?php | |
$_POST ["username"] = "'.$room_data['name'].'"; | |
if (! $_POST ["username"] || $_POST ["username"] == "Studio") { | |
//$username = "Studio" . rand ( 100, 999 ); | |
echo "<div align=center><h3>Warning: You Must Login to Use this Service.</h3></div>"; | |
exit(); | |
} else { | |
$username = "'.$room_data['name'].'"; | |
} | |
$username = preg_replace ( "/[^0-9a-zA-Z]/", "-", $username ); | |
$path = "'.BX_DOL_URL_ROOT.'"; | |
$room_id = '.$room_id.'; | |
$user_id = '.$_COOKIE ['memberID'].'; | |
if(file_exists("templates/live/buzz.mp3.bak")){ | |
rename("templates/live/buzz.mp3.bak","templates/live/buzz.mp3"); | |
} | |
if(file_exists("templates/live/message.mp3.bak")){ | |
rename("templates/live/message.mp3.bak","templates/live/message.mp3"); | |
} | |
?> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> | |
<script type="text/javascript"> | |
function updater(){ | |
jQuery.ajax({ | |
type: "POST", | |
url: "<?php | |
echo $path; | |
?>m/livestream/onlineupdate/<?php | |
echo $room_id?>/<?php | |
echo $user_id?>/", | |
cache: false | |
}); | |
} | |
setInterval("updater()",10000); | |
</script> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<style type="text/css"> | |
<!-- | |
body { | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 15px; | |
color: #EEE; | |
} | |
a { | |
color: #CC5577; | |
font-weight: normal; | |
text-decoration: none; | |
} | |
--> | |
</style> | |
<title>VideoWhisper Live Broadcast</title> | |
</head> | |
<body bgcolor="#333333"> | |
<?php | |
$swfurl = "live_broadcast.swf?room=" . $username; | |
$bgcolor = "#333333"; | |
?> | |
<object width="100%" height="500"> | |
<param name="movie" value="<?=$swfurl?>"> | |
</param> | |
<param bgcolor="<?=$bgcolor?>"> | |
<param name="scale" value="noscale" /> | |
</param> | |
<param name="salign" value="lt"> | |
</param> | |
<param name="allowFullScreen" value="true"> | |
</param> | |
<param name="allowscriptaccess" value="always"> | |
</param> | |
<embed width="100%" height="500" scale="noscale" salign="lt" | |
src="<?=$swfurl?>" type="application/x-shockwave-flash" | |
allowscriptaccess="always" allowfullscreen="true" | |
bgcolor="<?=$bgcolor?>"></embed> | |
</object> | |
</td> | |
</body> | |
</html> | |
'; | |
fwrite ( $fh4, $stringData4 ); | |
fclose ( $fh4 ); | |
# Redirect To Conference | |
echo MsgBox ( _t ( 'Entering to Live Streaming' ) ); | |
$sRedirectUrl = BX_DOL_URL_ROOT . 'modules/boonex/livestream/classes/livestream/live_broadcast.php'; | |
sleep(1); | |
header ( 'Location:' . $sRedirectUrl ); // redirect to created post view page | |
} | |
elseif($watch == 'watch'){ | |
#Watch Video Settings | |
$myFile2 = getcwd () . '/boonex/livestream/classes/livestream/vv_login.php'; | |
$fh2 = fopen ( $myFile2, 'w' ) or die ( "can't open file" ); | |
#Content | |
$stringData2 = '<?php | |
$rtmp_server = "rtmp://174.37.45.156/devvideo"; | |
// rtmp://your-server-ip-or-domain/application | |
$rtmp_amf = "AMF3"; | |
// AMF3 : Red5, Wowza, FMIS3, FMIS3.5 | |
// AMF0 : FCS1.5, FMS2 | |
// blank for flash default | |
$rtmfp_server="rtmfp://stratus.adobe.com/f1533cc06e4de4b56399b10d-1a624022ff71/"; | |
// RTMFP server for negotiangin P2P connections where possible | |
// Get your own independent developer key/address from: https://www.adobe.com/cfusion/entitlement/index.cfm?e=stratus | |
$tokenKey = "VideoWhisper"; | |
// This can be used to secure access as configured in RTMP server settings (secureTokenSharedSecret). | |
$ban_names=Array("ban_name1", "ban_name2"); | |
//ban channel or user names | |
function append_log($text) | |
{ | |
$dfile = fopen("vwlog.txt","a"); | |
fputs($dfile,$text); | |
fclose($dfile); | |
} | |
$username="VV".base_convert((time()-1224350000).rand(0,10),10,36); | |
$room=$_GET['.$bit.'room_name'.$bit.']; | |
$msg=""; | |
$loggedin=1; | |
if (in_array($username,$ban_names)) | |
{ | |
$loggedin=0; | |
$msg=urlencode("<a href=\"http://www.videowhisper.com\">You are not allowed to watch. Contact for details.</a>"); | |
} | |
?>server=' . $settings [0] ['VALUE'] . '&serverAMF=' . $settings [3] ['VALUE'] . '&tokenKey=' . $settings [16] ['VALUE'] . '&serverRTMFP=' . $settings [1] ['VALUE'] . '&p2pGroup=' . $settings [4] ['VALUE'] . '&bufferLive=' . $settings [19] ['VALUE'] . '&bufferFull=' . $settings [20] ['VALUE'] . '&welcome='.$room_data['w_welcome'].'&username=<?=$username?>&userType='.$userType.'&msg=<?=$msg?>&visitor=1&loggedin=<?=$loggedin?>&showCredit=1&disconnectOnTimeout=1&offlineMessage='.$room_data['w_offmsg'].'&loadstatus=1 | |
'; | |
fwrite ( $fh2, $stringData2 ); | |
fclose ( $fh2 ); | |
#Show Settings | |
$myFile3 = getcwd () . '/boonex/livestream/classes/livestream/vs_login.php'; | |
$fh3 = fopen ( $myFile3, 'w' ) or die ( "can't open file" ); | |
#Content | |
$stringData3 = '<?php | |
//vs_login.php controls watch interface (video & chat & user list) login called by live_watch.swf | |
$rtmp_server = "rtmp://174.37.45.156/devvideo"; | |
// rtmp://your-server-ip-or-domain/application | |
$rtmp_amf = "AMF3"; | |
// AMF3 : Red5, Wowza, FMIS3, FMIS3.5 | |
// AMF0 : FCS1.5, FMS2 | |
// blank for flash default | |
$rtmfp_server="rtmfp://stratus.adobe.com/f1533cc06e4de4b56399b10d-1a624022ff71/"; | |
// RTMFP server for negotiangin P2P connections where possible | |
// Get your own independent developer key/address from: https://www.adobe.com/cfusion/entitlement/index.cfm?e=stratus | |
$tokenKey = "VideoWhisper"; | |
// This can be used to secure access as configured in RTMP server settings (secureTokenSharedSecret). | |
$ban_names=Array("ban_name1", "ban_name2"); | |
//ban channel or user names | |
function append_log($text) | |
{ | |
$dfile = fopen("vwlog.txt","a"); | |
fputs($dfile,$text); | |
fclose($dfile); | |
} | |
$username="VW".base_convert((time()-1224350000).rand(0,10),10,36); | |
$userType=0; | |
$visitor=1; //ask for username | |
$room=$_GET['.$bit.'room_name'.$bit.']; | |
$msg=""; | |
$loggedin=1; | |
if (in_array($username,$ban_names)) | |
{ | |
$loggedin=0; | |
$msg=urlencode("<a href=\"http://www.videowhisper.com\">You are not allowed to watch Contact for details.</a>"); | |
} | |
if (in_array($room,$ban_names)) | |
{ | |
$loggedin=0; | |
$msg=urlencode("<a href=\"http://www.videowhisper.com\">This channel was disabled. Contact for details.</a>"); | |
} | |
//replace bad words or expressions | |
$filterRegex=urlencode("'.$room_data['filter_regex'].'"); | |
$filterReplace=urlencode(" '.$room_data['filter_replace'].' "); | |
//layout obtained by sending in public chat box "/videowhisper layout"; fill in new line between layoutEND markers | |
$layoutCode=<<<layoutEND | |
'.$room_data['w_layoutcode'].'layoutEND; | |
if (!$welcome) $welcome="Welcome on <B>$room</B> live streaming channel!"; | |
?>server=' . $settings [0] ['VALUE'] . '&serverAMF=' . $settings [3] ['VALUE'] . '&tokenKey=' . $settings [16] ['VALUE'] . '&serverRTMFP=' . $settings [1] ['VALUE'] . '&p2pGroup=' . $settings [4] ['VALUE'] . '&bufferLive=' . $settings [19] ['VALUE'] . '&bufferFull=' . $settings [20] ['VALUE'] . '&welcome='.$room_data['w_welcome'].'&username=<?=$username?>&userType='.$userType.'&msg=<?=$msg?>&visitor=1&loggedin=1&showCredit=1&disconnectOnTimeout=1&offlineMessage='.$room_data['w_offmsg'].'&disableVideo='.$room_data['w_disablevideo'].'&disableChat='.$room_data['w_disablechat'].'&disableUsers='.$room_data['w_disableusers'].'&layoutCode=<?=urlencode($layoutCode)?>&fillWindow=' . $room_data ['w_fillwindow'] . '&filterRegex=<?=$filterRegex?>&filterReplace=<?=$filterReplace?>&writeText='.$room_data['w_writetext'].'&floodProtection='.$room_data['w_floodprotection'].'&privateTextchat=1&externalInterval=6000&ws_ads=<?=urlencode("ads.php")?>&adsTimeout=15000&adsInterval=240000&statusInterval=10000&verboseLevel=2&loadstatus=1 | |
'; | |
fwrite ( $fh3, $stringData3 ); | |
fclose ( $fh3 ); | |
# Redirect To Conference | |
echo MsgBox ( _t ( 'Entering to Live Streaming' ) ); | |
$sRedirectUrl = BX_DOL_URL_ROOT . 'modules/boonex/livestream/classes/livestream/channel.php?n='.$room_name; | |
sleep(1); | |
header ( 'Location:' . $sRedirectUrl ); // redirect to created post view page | |
} | |
$this->_oTemplate->pageCode ( _t ( '_vfellow_livestream' ), true ); | |
} | |
function actionRoomDashboard($room_id = '') { | |
if ($room_id == NULL) { | |
$this->_oTemplate->displayPageNotFound (); | |
return; | |
} | |
//Access Type Control | |
$room_data = $this->_oDb->getEntryById ( $room_id ); | |
switch ($room_data ['access']) { | |
case 'Everybody' : | |
$access = 'Everybody'; | |
break; | |
case 'Members' : | |
$access = 'Only For Members'; | |
if ((! $GLOBALS ['logged'] ['member'] && ! $GLOBALS ['logged'] ['admin'])) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
case 'Selected' : | |
$access = 'Only For Selected Members & Room Owner'; | |
$str = $room_data ['memb_list']; | |
$yes = 0; //Default Not Found User | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName ( $_COOKIE ['memberID'] )) { | |
$yes = 1; | |
} | |
} //End Find | |
} | |
//Always Access to Room Owner | |
if ($room_data ['owner'] == $_COOKIE ['memberID']) { | |
$yes = 1; | |
} | |
if (($yes == 0 && ! $GLOBALS ['logged'] ['admin'])) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
} | |
//End Access Type Control | |
$this->_oTemplate->pageStart (); | |
if (! $_COOKIE ['memberID']) { | |
//$this->_oTemplate->displayPageNotFound (); | |
// return; | |
} | |
$room_usr = $this->_oDb->roomDash ( $_COOKIE ['memberID'] ); | |
/*echo '<pre>'; | |
print_r($room_usr); | |
print_r($room_data); | |
echo '</pre>';*/ | |
$room_name = str_replace ( " ", "-", $room_data ['name'] ); | |
//Log Read | |
$myFile = getcwd () . '/boonex/livestream/classes/livestream/uploads/'; | |
$myFile .= $room_name . '/Log'; | |
$myFile .= date ( "y-M-j", time () ) . '.html'; | |
if (file_exists ( $myFile )) { | |
$fh = fopen ( $myFile, 'r' ); | |
$theData = fgets ( $fh ); | |
fclose ( $fh ); | |
} else { | |
$theData = '<div style="color:blue;">No Logs Found!</div>'; | |
} | |
//Log Read End | |
//Online Users List | |
$online = ''; | |
$members = ''; | |
$str = explode ( ",", $room_data ['online'] ); | |
$len = count ( $str ); | |
if ($str [0] != NULL) { | |
for($i = 0; $i < $len; $i ++) { | |
//current Time | |
$info = $this->_oDb->getOnlineRoom ( $room_id, $str [$i] ); | |
$last_used = $info ['used']; | |
$members .= '<li>' . get_member_thumbnail ( $str [$i], 'none', true ) . '</li>'; | |
$min = round ( (time () - $last_used) / 60 ); | |
echo '<br>'; | |
if ($min <= 1) { | |
//echo ' User '.$str[$i].' is Online';echo '<br>'; | |
$online .= '<li>' . get_member_thumbnail ( $str [$i], 'none', true ) . '</li>'; | |
} else { | |
$this->_oDb->deleteOnlineRoom ( $room_id, $str [$i] ); | |
} | |
} | |
} else { | |
$members = $online = '<li>There is no Members</li>'; | |
} | |
//End Online Users | |
//Check Room Open Or Closed | |
if ($room_data ['room_open'] == 'Yes') { | |
$status = 'Open'; | |
$enter = BX_DOL_URL_ROOT . 'm/livestream/room/' . $room_id; | |
$str = $room_data ['memb_list']; | |
$yes = 0; //Default Not Found User | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName ( $_COOKIE ['memberID'] )) { | |
$yes = 1; | |
} | |
} //End Find | |
} | |
if(($room_data ['owner'] == $_COOKIE ['memberID']) || ($yes == 1) || $GLOBALS ['logged'] ['admin']){ | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper'><input type=button name=login id='enter' value='Broadcast' class='form_input_submit bigLoginButton submit' style='min-width: 110px;'><div class='button_wrapper_close'> </div></div> <div class=button_wrapper><input type=button class='form_input_submit bigLoginButton submit' value=Show id='show' name='show'><div class=button_wrapper_close> </div></div> <div class='button_wrapper'><input type=button name=edit id='edit' value='Edit' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#enter').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/room/" . $room_id?>','_self'); | |
}); | |
$('#show').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/room/" . $room_id.'/watch/'; ?>','_self'); | |
}); | |
$('#edit').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom/" . $room_id?>','_self'); | |
}); | |
</script> | |
<?php | |
}else{ | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper'><input type=button name=login id='enter' value='Watch' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#enter').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/room/" . $room_id.'/watch/'; ?>','_self'); | |
}); | |
$('#recorder').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/recorder/" . $room_id?>','_self'); | |
}); | |
$('#recorder').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/recorder/recorder/" . $room_id?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
} else { | |
$status = 'Closed'; | |
$enter = '#'; | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper'><input type=button name=login id='enter' value='Closed' class='form_input_submit bigJoinButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
</script> | |
<?php | |
} | |
$owner_thumb = '<li>' . get_member_thumbnail ( $room_data ['owner'], 'none', true ) . '</li>'; | |
$channel = str_replace ( " ", "-", $room_data ['name'] ); | |
$aVars = array ( | |
'id' => $room_id, | |
'rootpath' => BX_DOL_URL_ROOT, | |
'csspath' => BX_DOL_URL_ROOT.'modules/boonex/livestream/templates/base/css/', | |
'room_enter_url' => $enter, | |
'owner' => $room_usr['name'], | |
'owner_thumb' => $owner_thumb, | |
'name' => $room_data['name'], | |
'channel' => $channel, | |
'desc' => $room_data['desc'], | |
'tags' => $room_data['tags'], | |
'log' => $theData, | |
'access' => $access, | |
'file' => BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$room_data['file'].'&h=500&w=638&zc=1', | |
'owner' => getNickName($room_data['owner']), | |
'added' => defineTimeInterval($room_data['added']), | |
'edit_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'room', | |
'bx_if:edit' => array( | |
'condition' => ($GLOBALS['logged']['member'] || $GLOBALS['logged']['admin']) && $room_data['owner'] == $_COOKIE['memberID'], | |
'content' => array( | |
'edit_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'editroom/' . $room_data['id'], | |
), | |
), | |
'online' => $online, | |
'members' => $members, | |
'status' => $status, | |
); | |
echo $this->_oTemplate->parseHtmlByName ( 'room_dashboard', $aVars ); // display post | |
$this->_oTemplate->pageCode ( $room_data ['title'], true ); | |
} | |
function actionAdministration() { | |
if (! $GLOBALS ['logged'] ['admin']) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the admin design | |
$iId = $this->_oDb->getSettingsCategory (); // get our setting category id | |
if (empty ( $iId )) { // if category is not found display page not found | |
echo MsgBox ( _t ( '_sys_request_page_not_found_cpt' ) ); | |
$this->_oTemplate->pageCodeAdmin ( _t ( '_vfellow_livestream' ) ); | |
return; | |
} | |
bx_import ( 'BxDolAdminSettings' ); // import class | |
$mixedResult = ''; | |
if (isset ( $_POST ['save'] ) && isset ( $_POST ['cat'] )) { // save settings | |
$oSettings = new BxDolAdminSettings ( $iId ); | |
$mixedResult = $oSettings->saveChanges ( $_POST ); | |
} | |
$oSettings = new BxDolAdminSettings ( $iId ); // get display form code | |
$sResult = $oSettings->getForm (); | |
if ($mixedResult !== true && ! empty ( $mixedResult )) // attach any resulted messages at the form beginning | |
$sResult = $mixedResult . $sResult; | |
echo DesignBoxAdmin ( _t ( '_vfellow_livestream' ), $sResult ); // dsiplay box | |
$this->_oTemplate->pageCodeAdmin ( _t ( '_vfellow_livestream' ) ); // output is completed, admin page will be displaed here | |
} | |
function actionAddroom() { | |
//Controling Who to Add a Room | |
$settings = $this->_oDb->getAdminSettings (); // Call Admin Panel Settings | |
switch ($settings [2] ['VALUE']) { | |
case 'Everyone' : | |
break; | |
case 'All Members' : | |
if (! $GLOBALS ['logged'] ['member'] && ! $GLOBALS ['logged'] ['admin']) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
case 'List of Members' : | |
#Filter By Moderator List | |
$str = $settings [14] ['VALUE']; | |
$yes = 0; //Default Not Found User | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName ( $_COOKIE ['memberID'] )) { | |
$yes = 1; | |
} | |
} //End Find | |
} | |
//Always Access to Admin Owner | |
if ($GLOBALS ['logged'] ['admin']) { | |
$yes = 1; | |
} | |
if ($yes == 0) { | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
} | |
//End Controling Who to Add a Room | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
bx_import ( 'BxTemplFormView' ); // import forms class | |
$oForm = new BxTemplFormView ( $this->aForm ); // create foprms class | |
$oForm->initChecker (); // init form checker | |
if ($_FILES ["file"] ["name"] != '') { | |
if ((($_FILES ["file"] ["type"] == "image/gif") || ($_FILES ["file"] ["type"] == "image/jpeg") || ($_FILES ["file"] ["type"] == "image/jpg") || ($_FILES ["file"] ["type"] == "image/png") || ($_FILES ["file"] ["type"] == "image/pjpeg")) && ($_FILES ["file"] ["size"] < 2000000000000000)) { | |
if ($_FILES ["file"] ["error"] > 0) { | |
echo "Return Code: " . $_FILES ["file"] ["error"] . "<br />"; | |
} else { | |
/* echo "Upload: " . $_FILES["file"]["name"] . "<br />"; | |
echo "Type: " . $_FILES["file"]["type"] . "<br />"; | |
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; | |
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";*/ | |
//chmod(BX_DOL_URL_ROOT . $_FILES["file"]["name"], 0644); | |
$file_name = md5 ( uniqid ( time () ) ) . '_' . $_FILES ["file"] ["name"]; | |
move_uploaded_file ( $_FILES ["file"] ["tmp_name"], LIVESTREAM_IMAGES_PATH . $file_name ); | |
@unlink ( $_FILES ['file'] ['tmp_name'] ); | |
} | |
} else { | |
echo $msg = '<div style="color:blue;"><b><center>ERROR: Give JPG, JPEG,PNG, GIF Files (OR) Invalid File<center></b></div><br>'; | |
} | |
}else{ | |
$file_name = 'thumbnail.png'; | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
// Added 7-25-2012: For Automated Poll Creation | |
// When Add room form is submitted | |
if (isset($_POST['submit_form'])) { | |
$name = $this->_oDb->getAllRooms(); | |
$name_tot = count($name); | |
$found = 0; | |
for($i=0; $i < $name_tot; $i++){ | |
// If room name already exists set found == 1 | |
if($name [$i]['name'] == $_POST ['name']){ | |
$found = 1; | |
} | |
} | |
// If found is equal to 1, notify user | |
if($found == 1){ | |
echo "<script>alert('Lets try this again!');</script>"; | |
$filename = '/home/dicove/public_html/production/tony/dolphin/modules/boonex/poll/classes/BxPollModule.php'; | |
if (file_exists($filename)) { | |
echo "<script>alert('The file $filename exists');</script>"; | |
} else { | |
echo "<script>alert('The file $filename doesnt exist');</script>"; | |
} | |
// ... Else run create poll function | |
} else { | |
$filename = '/home/dicove/public_html/production/tony/dolphin/modules/boonex/poll/classes/BxPollModule.php'; | |
if (file_exists($filename)) { | |
echo "The file $filename exists"; | |
} else { | |
echo "The file $filename does not exist"; | |
} | |
// Added Poll Module | |
include('/home/dicove/public_html/production/tony/dolphin/modules/boonex/poll/classes/BxPollModule.php'); | |
// autocreatePoll($sPollQuestion, $sPollAnswers,/* $sPollResults, $sTags, */ $iCommentGroupValue, $iVoteGroupValue, $sCategory, $iViewGroupValue); | |
echo "<script>alert('Lets try this again 2!');</script>"; | |
} | |
} | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$name = $this->_oDb->getAllRooms(); | |
$name_tot = count($name); | |
$found = 0; | |
for($i=0; $i < $name_tot; $i++){ | |
if($name [$i]['name'] == $_POST ['name']){ | |
$found = 1; | |
} | |
} | |
if($found == 1){ | |
echo $msg = '<div style="color:blue;"><b><center>Room Name Already Found!<center></b></div>'; | |
} | |
if ($_POST ['name'] != '' && $found == 0 && $_POST['tags'] != '') { // if form is submitted and not form errors were found, save form data | |
$_POST ['added'] = time (); | |
$_POST ['owner'] = $_COOKIE ['memberID']; | |
$_POST ['file'] = $file_name; | |
//$iEntryId = $oForm->insert ( $aValsAdd ); // insert data to database | |
//print_r($_POST); | |
$iEntry = $this->_oDb->addRoomPhoto ( $_POST ); | |
if ($iEntry[0]) { // if post was successfully added | |
//$sRedirectUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri () . 'view/' . $iEntryId; | |
//header ( 'Location:' . $sRedirectUrl ); // redirect to created post view page | |
//exit (); | |
$last_url = BX_DOL_URL_ROOT . "m/livestream/roomdashboard/".$iEntry[1]; | |
echo $msg = "<div style='color:green;'><b><center>Room ".$_POST ['name']." was successfully created.<br><br> | |
Click this link to access it: <a href=".$last_url." >Goto ".$_POST ['name']."</a><center></b></div>"; | |
} else { | |
MsgBox ( _t ( '_Error Occured' ) ); // if error occured display erroro message | |
} | |
} else { | |
echo $oForm->getCode (); // display form, if the form is not submiyyed or data is invalid | |
} | |
$this->_oTemplate->pageCode ( _t ( 'Add Room' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
function actionEditroom($iEntryId = '') { | |
if ($iEntryId == '') { | |
if (! $GLOBALS ['logged'] ['member'] && ! $GLOBALS ['logged'] ['admin']) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
$this->_oTemplate->pageStart (); | |
//Pagination Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
echo $this->get_pagination_edit (); | |
$dat = $this->get_pagination_edit (); | |
if($dat == NULL){ | |
echo MsgBox ( _t ( 'No Rooms Found' ) ); | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$this->_oTemplate->pageCode ( _t ( 'Chat Room Edit' ), true ); | |
} else { | |
$aEntry = $this->_oDb->getEntryById ( ( int ) $iEntryId ); | |
if (! $aEntry) { // check if entry exists | |
$this->_oTemplate->displayPageNotFound (); | |
return; | |
} | |
//Access Type Control | |
$room_data = $this->_oDb->getEntryById ( $iEntryId ); | |
switch ($room_data ['administrator']) { | |
case 1 : | |
break; | |
case 0 : | |
if ((! $GLOBALS ['logged'] ['member'] && ! $GLOBALS ['logged'] ['admin'])) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
case 2 : | |
$str = $room_data ['memb_list']; | |
$yes = 0; //Default Not Found User | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName ( $_COOKIE ['memberID'] )) { | |
$yes = 1; | |
} | |
} //End Find | |
} | |
if (($yes == 0 && ! $GLOBALS ['logged'] ['admin']) && ($_COOKIE ['memberID'] != $room_data['owner'])) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} | |
break; | |
} | |
//End Access Type Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
bx_import ( 'BxTemplFormView' ); // import forms class | |
$oForm = new BxTemplFormView ( $this->aForm ); // create forms class | |
$oForm->initChecker ( $aEntry ); // init form checker | |
if ($_FILES) { | |
if ((($_FILES ["file"] ["type"] == "image/gif") || ($_FILES ["file"] ["type"] == "image/jpeg") || ($_FILES ["file"] ["type"] == "image/jpg") || ($_FILES ["file"] ["type"] == "image/png") || ($_FILES ["file"] ["type"] == "image/pjpeg")) && ($_FILES ["file"] ["size"] < 2000000000000000)) { | |
if ($_FILES ["file"] ["error"] > 0) { | |
echo "Return Code: " . $_FILES ["file"] ["error"] . "<br />"; | |
} else { | |
//chmod(BX_DOL_URL_ROOT . $_FILES["file"]["name"], 0644); | |
$file_name = md5 ( uniqid ( time () ) ) . '_' . $_FILES ["file"] ["name"]; | |
move_uploaded_file ( $_FILES ["file"] ["tmp_name"], LIVESTREAM_IMAGES_PATH . $file_name ); | |
@unlink ( $_FILES ['file'] ['tmp_name'] ); | |
$room_data = $this->_oDb->getEntryById ( $iEntryId ); | |
if($room_data ['file'] != 'thumbnail.png'){ | |
@unlink ( LIVESTREAM_IMAGES_PATH . $room_data ['file'] ); | |
} | |
} | |
} else { | |
} | |
} | |
$_POST ['added'] = time (); | |
$_POST ['owner'] = $_COOKIE ['memberID']; | |
$_POST ['file'] = $file_name; | |
if ($_POST ['name'] != '' && $_POST['tags'] != '') { // if form is submitted and there is no form errors were found, save form data | |
if ($file_name == NULL) { | |
$iRes = $this->_oDb->editRoomPhotoNofile ( $iEntryId, $_POST ); | |
} else { | |
$iRes = $this->_oDb->editRoomPhoto ( $iEntryId, $_POST ); | |
} | |
if ($iRes) { // if post was successfully added | |
echo $msg = '<div style="color:green;"><b><center>Room have been successfully Updated.<center></b></div>'; | |
} else { | |
MsgBox ( _t ( '_Error Occured' ) ); // if error occured display error message | |
} | |
} else { | |
echo $oForm->getCode (); // display form, if the form is not submitted or data is invalid | |
} | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
$this->_oTemplate->pageCode ( _t ( 'Chat Room Edit' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
} | |
function actiondeleteroom($iEntryId = '') { | |
if ($iEntryId == NULL) { | |
$this->_oTemplate->displayPageNotFound (); | |
return; | |
} else { | |
$aEntry = $this->_oDb->getEntryById ( ( int ) $iEntryId ); | |
if (! $aEntry) { // check if entry exists | |
$this->_oTemplate->displayPageNotFound (); | |
return; | |
} | |
if ((! $GLOBALS ['logged'] ['member'] && ! $GLOBALS ['logged'] ['admin']) || $aEntry ['owner'] != $_COOKIE ['memberID']) { // check access to the page | |
$this->_oTemplate->displayAccessDenied (); | |
return; | |
} else { | |
//rm File | |
$room_data = $this->_oDb->getEntryById ( $iEntryId ); | |
if($room_data ['file'] != 'thumbnail.png'){ | |
@unlink ( LIVESTREAM_IMAGES_PATH . $room_data ['file'] ); | |
} | |
// Del Record | |
$state = $this->_oDb->deleteRoom ( $iEntryId ); | |
if ($state) { | |
$this->_oTemplate->pageStart (); | |
echo $msg = '<div style="color:blue;"><b><center>Room have been Deleted<center></b></div>'; | |
$this->_oTemplate->pageCode ( _t ( 'Chat Room Delete' ), true ); | |
} | |
} | |
} | |
} | |
function actionHome($page = '') { | |
#Add Button Via TEMPLATE HTML | |
$myFile = str_replace ( "modules", "", getcwd () ); | |
$myFile .= 'templates/base/navigation_menu_sub_header.html'; | |
$fh = fopen ( $myFile, 'w' ) or die ( "can't open file" ); | |
$stringData = ' | |
<div class="subMenu" id="subMenu___submenu_id__" style="display:__display_value__"> | |
<div class="subMenuOvr"> | |
<table class="subMenuInfoKeeper" cellspacing="0" cellpadding="0"> | |
<tr> | |
<td> | |
__picture__ | |
</td> | |
<td class="sys_page_header"> | |
__sub_caption__ | |
</td> | |
<td style="width:90%;"> | |
<div class="sys_tm_title_addon" id="sys_tm_title_addon"> | |
__profile_status__ | |
__login_section__ | |
<div class="clear_both"></div> | |
</div> | |
</td> | |
<td style="width:10px;"></td> | |
</tr> | |
</table> | |
__profile_actions__ | |
<bx_injection:injection_title_zone /> | |
<div class="clear_both"></div> | |
'; | |
fwrite ( $fh, $stringData ); | |
fclose ( $fh ); | |
#Add Button Via TEMPLATE HTML | |
//Pagination Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
echo $this->all (); | |
$dat = $this->all (); | |
if($dat == NULL){ | |
echo MsgBox ( _t ( 'No Rooms Found' ) ); | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$this->_oTemplate->pageCode ( _t ( 'Chat Rooms View' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
function actionOnlineupdate($room_id = '', $user_id = '') { | |
if ($room_id != NULL && $user_id != NULL) { | |
$this->_oDb->setOnlineRoom ( $room_id, $user_id ); | |
}elseif ($room_id != NULL && $user_id == NULL){ | |
$user_id = 0; | |
$this->_oDb->setOnlineRoom ( $room_id, $user_id ); | |
} | |
} | |
function get_pagination() { | |
$settings = $this->_oDb->getAdminSettings(); | |
$iLimit = $settings[15]['VALUE']; | |
$owner = $_COOKIE['memberID']; | |
$settings = $this->_oDb->getAdminSettings(); | |
$exp_days = $settings[13]['VALUE']; | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms`"); | |
$aResult="SELECT * FROM `ls_rooms` ORDER BY `id` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
foreach ($rData as $aData) { | |
//Remove If Date Expire | |
if($exp_days != 0){ | |
$expire = strtotime(date("Y-m-d", $aData['last_used']) . " +".$exp_days." days"); | |
if($aData['last_used'] > $expire){ | |
@unlink(LIVESTREAM_IMAGES_PATH . $aData['file'] ); | |
$this->_oDb->deleteRoom($aData['id']); | |
continue; | |
} | |
} | |
//End Remove If Date Expire | |
$sCode .= ' | |
<div id="unit_6" class="sys_file_search_unit bx_photos_search_unit"> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'"> | |
<div style="background-image: url('.BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$aData['file'].'&h=100&w=135&zc=1 );" class="sys_file_search_pic bx_photos_file_search_pic"> | |
</div> | |
</a> | |
<div class="sys_file_search_header"> | |
<!-- <div class="sys_file_search_rate"><div id="bx_photossmall" class="votes_small"><div style="width:55px;" class="votes_gray_small"><div style="width:0px;" class="votes_active_small" id="bx_photossmallSlider"></div></div><div class="clear_both"></div></div></div> --> | |
<div class="clear_both"></div> | |
</div> | |
<div class="sys_file_search_title"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'">'.$aData['name'].'</a></div> | |
<div class="sys_file_search_when">'.$aData['desc'].'</div> | |
<!-- <div class="sys_file_search_when">0 Views</div> --> | |
</div> | |
'; | |
} | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/livestream/home/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
//'page_reloader' => true, | |
//'on_change_page' => 'return !loadDynamicBlock('.$iBlockid.', \'index.php?'.$sBlockName.'Mode='.$sMode.'&page={page}&per_page={per_page}\');', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
function get_pagination_edit() { | |
$settings = $this->_oDb->getAdminSettings(); | |
$iLimit = $settings[15]['VALUE']; | |
$owner = $_COOKIE['memberID']; | |
$settings = $this->_oDb->getAdminSettings(); | |
$exp_days = $settings[13]['VALUE']; | |
//$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms` WHERE `owner`='".$owner."'"); | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms`"); | |
//$aResult="SELECT * FROM `ls_rooms` WHERE `owner`='".$owner."' ORDER BY `id` DESC"; | |
$aResult="SELECT * FROM `ls_rooms` ORDER BY `id` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
foreach ($rData as $aData) { | |
#Remove If Date Expire | |
if($exp_days != 0){ | |
$expire = strtotime(date("Y-m-d", $aData['last_used']) . " +".$exp_days." days"); | |
if($aData['last_used'] > $expire){ | |
@unlink(LIVESTREAM_IMAGES_PATH . $aData['file'] ); | |
$this->_oDb->deleteRoom($aData['id']); | |
continue; | |
} | |
} | |
//End Remove If Date Expire | |
#Filter By Moderator List | |
$str = $aData ['memb_list']; | |
$yes = 0; //Default Not Found User | |
if ($str != '') { | |
$str = explode ( ",", $str ); | |
$str_size = count ( $str ); | |
//Find The User is Already Present | |
for($i = 0; $i < $str_size; $i ++) { | |
if ($str [$i] == getNickName($_COOKIE ['memberID'])) { | |
$yes = 1; | |
} | |
} //End Find | |
} | |
//Always Access to Admin Owner | |
if($GLOBALS ['logged'] ['admin']){ | |
$yes = 1; | |
} | |
if($aData['owner']== $_COOKIE['memberID'] || $yes == 1){ | |
$sCode .= ' | |
<div id="unit_6" class="sys_file_search_unit bx_photos_search_unit"> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/editroom/'.$aData['id'].'"> | |
<div style="background-image: url('.BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$aData['file'].'&h=100&w=135&zc=1 );" class="sys_file_search_pic bx_photos_file_search_pic"> | |
</div> | |
</a> | |
<div class="sys_file_search_header"> | |
<!-- <div class="sys_file_search_rate"><div id="bx_photossmall" class="votes_small"><div style="width:55px;" class="votes_gray_small"><div style="width:0px;" class="votes_active_small" id="bx_photossmallSlider"></div></div><div class="clear_both"></div></div></div> --> | |
<div class="clear_both"></div> | |
</div> | |
<div class="sys_file_search_title"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/editroom/'.$aData['id'].'">'.$aData['name'].'</a></div> | |
<div> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/editroom/'.$aData['id'].'">Edit</a> | |
| |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/deleteroom/'.$aData['id'].'">Delete</a> | |
</div> | |
<!-- <div class="sys_file_search_when">0 Views</div> --> | |
</div> | |
'; | |
} | |
} | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/livestream/editroom/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
//'page_reloader' => true, | |
//'on_change_page' => 'return !loadDynamicBlock('.$iBlockid.', \'index.php?'.$sBlockName.'Mode='.$sMode.'&page={page}&per_page={per_page}\');', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
#Service List | |
function get_pagination_index() { | |
$iLimit = 4; | |
$settings = $this->_oDb->getAdminSettings(); | |
$exp_days = $settings[13]['VALUE']; | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms`"); | |
$aResult="SELECT * FROM `ls_rooms` ORDER BY `id` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
foreach ($rData as $aData) { | |
//Remove If Date Expire | |
if($exp_days != 0){ | |
$expire = strtotime(date("Y-m-d", $aData['last_used']) . " +".$exp_days." days"); | |
if($aData['last_used'] > $expire){ | |
@unlink(LIVESTREAM_IMAGES_PATH . $aData['file'] ); | |
$this->_oDb->deleteRoom($aData['id']); | |
continue; | |
} | |
} | |
//End Remove If Date Expire | |
$sCode .= ' | |
<div id="unit_6" class="sys_file_search_unit bx_photos_search_unit"> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'"> | |
<div style="background-image: url('.BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$aData['file'].'&h=100&w=135&zc=1 );" class="sys_file_search_pic bx_photos_file_search_pic"> | |
</div> | |
</a> | |
<div class="sys_file_search_header"> | |
<!-- <div class="sys_file_search_rate"><div id="bx_photossmall" class="votes_small"><div style="width:55px;" class="votes_gray_small"><div style="width:0px;" class="votes_active_small" id="bx_photossmallSlider"></div></div><div class="clear_both"></div></div></div> --> | |
<div class="clear_both"></div> | |
</div> | |
<div class="sys_file_search_title"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'">'.$aData['name'].'</a></div> | |
<div class="sys_file_search_when">'.$aData['desc'].'</div> | |
<!-- <div class="sys_file_search_when">0 Views</div> --> | |
</div> | |
'; | |
} | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/livestream/home/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
//'page_reloader' => true, | |
//'on_change_page' => 'return !loadDynamicBlock('.$iBlockid.', \'index.php?'.$sBlockName.'Mode='.$sMode.'&page={page}&per_page={per_page}\');', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
function serviceMainPage() { | |
echo $this->get_pagination_index (); | |
} | |
#============================================================================================ | |
# Search Filters | |
function actionAll(){ | |
//Pagination Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
echo $this->all (); | |
$dat = $this->all (); | |
if($dat == NULL){ | |
echo MsgBox ( _t ( 'No Rooms Found' ) ); | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$this->_oTemplate->pageCode ( _t ( 'All' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
function all() { | |
$settings = $this->_oDb->getAdminSettings(); | |
$iLimit = $settings[15]['VALUE']; | |
$owner = $_COOKIE['memberID']; | |
$settings = $this->_oDb->getAdminSettings(); | |
$exp_days = $settings[16]['VALUE']; | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms`"); | |
$aResult="SELECT * FROM `ls_rooms` ORDER BY `id` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
foreach ($rData as $aData) { | |
//Remove If Date Expire | |
if($exp_days != 0){ | |
$expire = strtotime(date("Y-m-d", $aData['last_used']) . " +".$exp_days." days"); | |
if($aData['last_used'] > $expire){ | |
@unlink(LIVESTREAM_IMAGES_PATH . $aData['file'] ); | |
$this->_oDb->deleteRoom($aData['id']); | |
continue; | |
} | |
} | |
//End Remove If Date Expire | |
$sCode .= ' | |
<div id="unit_6" class="sys_file_search_unit bx_photos_search_unit"> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'"> | |
<div style="background-image: url('.BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$aData['file'].'&h=100&w=135&zc=1 );" class="sys_file_search_pic bx_photos_file_search_pic"> | |
</div> | |
</a> | |
<div class="sys_file_search_header"> | |
<!-- <div class="sys_file_search_rate"><div id="bx_photossmall" class="votes_small"><div style="width:55px;" class="votes_gray_small"><div style="width:0px;" class="votes_active_small" id="bx_photossmallSlider"></div></div><div class="clear_both"></div></div></div> --> | |
<div class="clear_both"></div> | |
</div> | |
<div class="sys_file_search_title"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'">'.$aData['name'].'</a></div> | |
Room No. '.$aData['id'].' | |
<div class="sys_file_search_when">'.$aData['desc'].'</div> | |
<!-- <div class="sys_file_search_when">0 Views</div> --> | |
</div> | |
'; | |
} | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/livestream/all/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
'page_reloader' => false, | |
'on_change_page' => 'return !loadDynamicBlock("", "&page={page}&per_page={per_page}"0 );', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
function online(){ | |
//Online Users List | |
$room = $this->_oDb->getAllRooms(); | |
$tot_room = count($room); | |
//echo '<pre>';print_r($room);echo '</pre>'; | |
$online = ''; | |
for($k=0; $k< $tot_room; $k ++){ | |
$str = explode ( ",", $room[$k] ['online'] ); | |
$len = count ( $str ); | |
if ($str [0] != NULL) { | |
for($i = 0; $i < $len; $i ++) { | |
//current Time | |
$info = $this->_oDb->getOnlineRoom ( $room[$k] ['id'], $str [$i] ); | |
$last_used = $info ['used']; | |
$min = round ( (time () - $last_used) / 60 ); | |
if ($min <= 1) { | |
//echo ' User '.$str[$i].' is Online';echo '<br>'; | |
$online .= '<li>' . get_member_thumbnail ( $str [$i], 'none', true ) . '</li>'; | |
} else { | |
$this->_oDb->deleteOnlineRoom ( $room[$k] ['id'], $str [$i] ); | |
} | |
} | |
} | |
} | |
//End Online Users | |
//Pagination Function | |
$settings = $this->_oDb->getAdminSettings(); | |
$iLimit = $settings[15]['VALUE']; | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_online`"); | |
$list = $this->_oDb->getAllOnlineLocal(); | |
$tot_list = count($list); | |
$tot_pre_list = count($list); | |
$tot_pre_list --; | |
$list_data = ''; | |
for($m = 0; $m < $tot_list; $m ++){ | |
$list_data .= $list [$m] ['room_id']; | |
if($tot_pre_list != $m){ | |
$list_data .= ','; | |
} | |
} | |
$aResult="SELECT * FROM `ls_rooms` WHERE `id` IN ($list_data) ORDER BY `id` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
foreach ($rData as $aData) { | |
$sCode .= ' | |
<div id="unit_6" class="sys_file_search_unit bx_photos_search_unit"> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'"> | |
<div style="background-image: url('.BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$aData['file'].'&h=100&w=135&zc=1 );" class="sys_file_search_pic bx_photos_file_search_pic"> | |
</div> | |
</a> | |
<div class="sys_file_search_header"> | |
<!-- <div class="sys_file_search_rate"><div id="bx_photossmall" class="votes_small"><div style="width:55px;" class="votes_gray_small"><div style="width:0px;" class="votes_active_small" id="bx_photossmallSlider"></div></div><div class="clear_both"></div></div></div> --> | |
<div class="clear_both"></div> | |
</div> | |
<div class="sys_file_search_title"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'">'.$aData['name'].'</a></div> | |
Room No. '.$aData['id'].' | |
<div class="sys_file_search_when">'.$aData['desc'].'</div> | |
<!-- <div class="sys_file_search_when">0 Views</div> --> | |
</div> | |
'; | |
} | |
if($sCode == ''){ | |
$sCode .= '<div style="color:blue;"><b><center>There is No Users Online Now<center></b></div>'; | |
} | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/videocon/online/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
//'page_reloader' => true, | |
//'on_change_page' => 'return !loadDynamicBlock('.$iBlockid.', \'index.php?'.$sBlockName.'Mode='.$sMode.'&page={page}&per_page={per_page}\');', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
function actionOnline(){ | |
//Pagination Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
echo $this->online (); | |
$dat = $this->online (); | |
if($dat == NULL){ | |
echo MsgBox ( _t ( 'No Rooms Found' ) ); | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$this->_oTemplate->pageCode ( _t ( 'Online' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
function top(){ | |
//Pagination Function | |
$settings = $this->_oDb->getAdminSettings(); | |
$iLimit = $settings[15]['VALUE']; | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms`"); | |
$aResult="SELECT * FROM `ls_rooms` ORDER BY `total_users` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
foreach ($rData as $aData) { | |
$sCode .= ' | |
<div id="unit_6" class="sys_file_search_unit bx_photos_search_unit"> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'"> | |
<div style="background-image: url('.BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$aData['file'].'&h=100&w=135&zc=1 );" class="sys_file_search_pic bx_photos_file_search_pic"> | |
</div> | |
</a> | |
<div class="sys_file_search_header"> | |
<!-- <div class="sys_file_search_rate"><div id="bx_photossmall" class="votes_small"><div style="width:55px;" class="votes_gray_small"><div style="width:0px;" class="votes_active_small" id="bx_photossmallSlider"></div></div><div class="clear_both"></div></div></div> --> | |
<div class="clear_both"></div> | |
</div> | |
<div class="sys_file_search_title"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'">'.$aData['name'].'</a></div> | |
Room No. '.$aData['id'].' | |
<div class="sys_file_search_when">'.$aData['desc'].'</div> | |
<div class="sys_file_search_when">'.$aData['total_users'].' Users</div> | |
</div> | |
'; | |
} | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/livestream/top/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
//'page_reloader' => true, | |
//'on_change_page' => 'return !loadDynamicBlock('.$iBlockid.', \'index.php?'.$sBlockName.'Mode='.$sMode.'&page={page}&per_page={per_page}\');', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
function actionTop(){ | |
//Pagination Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
echo $this->top (); | |
$dat = $this->top (); | |
if($dat == NULL){ | |
echo MsgBox ( _t ( 'No Rooms Found' ) ); | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$this->_oTemplate->pageCode ( _t ( 'Top' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
function popular(){ | |
//Pagination Function | |
$settings = $this->_oDb->getAdminSettings(); | |
$iLimit = $settings[15]['VALUE']; | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms`"); | |
$aResult="SELECT * FROM `ls_rooms` ORDER BY `top_always` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
foreach ($rData as $aData) { | |
$sCode .= ' | |
<div id="unit_6" class="sys_file_search_unit bx_photos_search_unit"> | |
<a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'"> | |
<div style="background-image: url('.BX_DOL_URL_ROOT. 'modules/boonex/livestream/files/timdhumb.php?src='.$aData['file'].'&h=100&w=135&zc=1 );" class="sys_file_search_pic bx_photos_file_search_pic"> | |
</div> | |
</a> | |
<div class="sys_file_search_header"> | |
<!-- <div class="sys_file_search_rate"><div id="bx_photossmall" class="votes_small"><div style="width:55px;" class="votes_gray_small"><div style="width:0px;" class="votes_active_small" id="bx_photossmallSlider"></div></div><div class="clear_both"></div></div></div> --> | |
<div class="clear_both"></div> | |
</div> | |
<div class="sys_file_search_title"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'">'.$aData['name'].'</a></div> | |
<div class="sys_file_search_when">'.$aData['desc'].'</div> | |
<div class="sys_file_search_when">'.$aData['top_always'].' Views</div> | |
</div> | |
'; | |
} | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/livestream/popular/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
//'page_reloader' => true, | |
//'on_change_page' => 'return !loadDynamicBlock('.$iBlockid.', \'index.php?'.$sBlockName.'Mode='.$sMode.'&page={page}&per_page={per_page}\');', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
function actionPopular(){ | |
//Pagination Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
echo $this->popular (); | |
$dat = $this->popular (); | |
if($dat == NULL){ | |
echo MsgBox ( _t ( 'No Rooms Found' ) ); | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$this->_oTemplate->pageCode ( _t ( 'Popular' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
function tags(){ | |
$iLimit = 100; | |
$owner = $_COOKIE['memberID']; | |
$exp_days = $settings[16]['VALUE']; | |
$iCount = db_value("SELECT COUNT(id) FROM `ls_rooms`"); | |
$aResult="SELECT * FROM `ls_rooms` ORDER BY `id` DESC"; | |
if ($iCount) { | |
$iPages = ceil($iCount/ $iLimit); | |
$iPage = (int)$_GET['page']; | |
if ($iPage < 1) | |
$iPage = 1; | |
if ($iPage > $iPages) | |
$iPage = $iPages; | |
//echo $iPages; | |
$sqlFrom = ($iPage - 1) * $iLimit; | |
$sqlLimit = " LIMIT $sqlFrom, $iLimit"; | |
$sqlQuery = $aResult.$sqlLimit; | |
$rData = db_res_assoc_arr($sqlQuery); | |
$sCode = '<div class="tags_wrapper">'; | |
foreach ($rData as $aData) { | |
//Remove If Date Expire | |
if($exp_days != 0){ | |
$expire = strtotime(date("Y-m-d", $aData['last_used']) . " +".$exp_days." days"); | |
if($aData['last_used'] > $expire){ | |
@unlink(VIDEOCON_IMAGES_PATH . $aData['file'] ); | |
$this->_oDb->deleteRoom($aData['id']); | |
continue; | |
} | |
} | |
//End Remove If Date Expire | |
if($aData['top_always'] >= 0 && $aData['top_always'] <= 100){ | |
$size = 10; | |
}elseif ($aData['top_always'] > 101 && $aData['top_always'] <= 250){ | |
$size = round($aData['top_always'] / 10); | |
}else{ | |
$size = 28; | |
} | |
if($aData['tags'] != NULL){ | |
$str = explode ( ",", $aData['tags'] ); | |
$str_size = count ( $str ); | |
for($i = 0; $i < $str_size; $i ++) { | |
$sCode .= '<span style="font-size:'.$size.'px;" class="one_tag"><a title="'.$aData['name'].'" href="'.BX_DOL_URL_ROOT. 'm/livestream/roomdashboard/'.$aData['id'].'">'.$str[$i].'</a></span>'; | |
} | |
} | |
} | |
$sCode .= ' </div>'; | |
$iCurrCount = count($rData); | |
//$iCount; | |
//$sCode = $GLOBALS['oFunctions']->centerContent($sCode, '.featured_block_1'); | |
if ($iPages >= 1) { | |
$oPaginate = new BxDolPaginate(array( | |
'page_url' => BX_DOL_URL_ROOT . 'm/livestream/tags/&page={page}&per_page={per_page}' , | |
'count' => $iCount, | |
'per_page' => $iLimit, | |
'page' => $iPage, | |
'per_page_changer' => false, | |
'page_reloader' => false, | |
'on_change_page' => 'return !loadDynamicBlock("", "&page={page}&per_page={per_page}"0 );', | |
'on_change_per_page' => '' | |
)); | |
return $sPaginate = $sCode . $oPaginate->getPaginate(); | |
} | |
} | |
} | |
function actionTags(){ | |
//Pagination Control | |
$this->_oTemplate->pageStart (); // all the code below will be wrapped by the user design | |
echo $this->tags (); | |
$dat = $this->tags (); | |
if($dat == NULL){ | |
echo MsgBox ( _t ( 'No Rooms Found' ) ); | |
} | |
if ($GLOBALS ['logged'] ['member'] || $GLOBALS ['logged'] ['admin']) { | |
?> | |
<script type="text/javascript"> | |
document.getElementById('sys_tm_title_addon').innerHTML = "<div class='sys_tm_actions'><div class='input_wrapper input_wrapper_input_set'><div class='button_wrapper' style='margin:0 15px 0 0'><input type=button name=add id='add' value=Add class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div><div class='button_wrapper'><input type=button name=login id='manage' value='Manage' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div> <div class='button_wrapper'><input type=button name=view id='view' value='View' class='form_input_submit bigLoginButton submit'><div class='button_wrapper_close'> </div></div></div></div>"; | |
$('#add').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/addroom"?>','_self'); | |
}); | |
$('#manage').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/editroom"?>','_self'); | |
}); | |
$('#view').click(function() { | |
window.open('<?php | |
echo BX_DOL_URL_ROOT . "m/livestream/"?>','_self'); | |
}); | |
</script> | |
<?php | |
} | |
$this->_oTemplate->pageCode ( _t ( 'Tags' ), true ); // output is completed, display all output above data wrapped by user design | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment