示例#1
0
$_body_onload = array('setSid(\'' . $session->_s_id . '\')', 'setIP(\'' . PCPIN_CLIENT_IP . '\')', 'setFormLink(\'' . PCPIN_FORMLINK . '\')', 'setAdminFormLink(\'' . PCPIN_ADMIN_FORMLINK . '\')', 'setMainFormLink(\'' . PCPIN_FORMLINK . '\')', 'setExitURL(\'' . htmlspecialchars($session->_conf_all['exit_url']) . '\')', 'setUserId(' . $session->_s_user_id . ')', 'setImgResizeFlag(' . ('2' == PCPIN_GD_VERSION ? 'true' : 'false') . ')', 'window.appName_=\'pcpin_chat\'', 'setDateFormat(\'' . str_replace('\'', '\\\'', $current_user->date_format != '' ? $current_user->date_format : $session->_conf_all['date_format']) . '\')', 'setAdminFlag(' . ($current_user->is_admin === 'y' ? 'true' : 'false') . ')', 'startMousePosCapture()', 'setSlaveMode(' . (PCPIN_SLAVE_MODE ? 'true' : 'false') . ')', 'setCurrentRoomID(' . $session->_s_room_id . ')');
// JavaScript files
$_js_files = array('./js/base/screen.js', './js/base/strings.js', './js/base/time.js', './js/base/xmlhttprequest.js', './js/base/connectionstatus.js', './js/base/global.js', './js/base/main.js', './js/base/alertbox.js', './js/base/confirmbox.js', './js/base/promptbox.js');
// Add mp3 player javascript code
if (!empty($session->_conf_all['allow_sounds'])) {
    $_js_files[] = './js/base/mp3_player.js';
}
// JavaScript language expressions
$_js_lng = array('password', 'ok', 'cancel');
// CSS files
$_css_files = array('./main.css');
// Global template variables
$global_tpl_vars = array('s_id' => $session->_s_id, 'formlink' => PCPIN_FORMLINK);
// Init main template handler
_pcpin_loadClass('pcpintpl');
$template = new PcpinTpl();
$template->setBasedir('./tpl');
$template->readTemplatesFromFile('./main.tpl');
// Add language data to main template
$template->addVar('main', 'iso_lng', $l->iso_name);
// Default inc
if (!isset($inc)) {
    $inc = '';
}
// Specify the page to load
if (empty($session->_s_user_id)) {
    if (!empty($activation_code)) {
        // Something to activate...
        require_once './inc/activation.inc.php';
    } else {
        // Login page
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (empty($current_user->id) || $current_user->is_admin !== 'y') {
    header('Location: ' . PCPIN_FORMLINK . '?' . md5(microtime()));
    die;
}
// JS files
$_js_files[] = './js/admin/word_blacklist.js';
// JS language expressions
$_js_lng[] = 'delete';
$_js_lng[] = 'word_empty_error';
$_js_lng[] = 'confirm_delete_word';
$_body_onload[] = 'initWordBlacklistForm()';
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/word_blacklist.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
    case 'design':
        $title = $l->g('design');
        break;
    case 'security':
        $title = $l->g('security');
        break;
    case 'server':
        $title = $l->g('server');
        break;
    case 'slave':
        $title = $l->g('slave_mode');
        break;
}
$_body_onload[] = 'initSettingsForm(\'' . htmlspecialchars($group) . '\')';
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/settings.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
$tpl->addVar('main', 'title', $title);
    die;
}
$_js_files[] = './js/invitation.js';
_pcpin_loadClass('invitation');
$invitation = new PCPIN_Invitation($session);
_pcpin_loadClass('nickname');
$nickname = new PCPIN_Nickname($session);
$invitations = $invitation->getNewInvitations($current_user->id, false, $invitation_id);
if (empty($invitations)) {
    $_body_onload[] = 'window.close()';
    $_body_onload[] = 'return false';
} else {
    $invitation_data = reset($invitations);
    // Init template
    _pcpin_loadClass('pcpintpl');
    $tpl = new PcpinTpl();
    $tpl->setBasedir('./tpl');
    $tpl->readTemplatesFromFile('./invitation.tpl');
    // Add language expressions to template
    foreach ($tpl->tpl_vars_plain as $var) {
        if (0 === strpos($var, 'LNG_')) {
            $var = strtolower($var);
            $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
        }
    }
    // Add global vars to template
    foreach ($global_tpl_vars as $key => $val) {
        $tpl->addGlobalVar($key, htmlspecialchars($val));
    }
    $invitation_text = $l->g('user_invited_you');
    $invitation_text = str_replace('[ROOM]', $invitation_data['room_name'], $invitation_text);
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (empty($current_user->id) || $current_user->is_admin !== 'y') {
    header('Location: ' . PCPIN_FORMLINK . '?' . md5(microtime()));
    die;
}
// JS files
$_js_files[] = './js/admin/avatar_gallery.js';
// JS language expressions
$_js_lng[] = 'delete_avatar';
$_js_lng[] = 'avatar_image_empty_error';
$_js_lng[] = 'confirm_delete_avatar';
$_js_lng[] = 'primary';
$_body_onload[] = 'initAvatarsForm()';
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/avatar_gallery.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
    // Default room specified and exists
    $room->_db_freeList();
    if ($room->putUser($current_user->id, $session->_conf_all['default_room'])) {
        header('Location: ' . PCPIN_FORMLINK . '?s_id=' . $session->_s_id . '&inc=chat_room&ts=' . time());
        die;
    }
}
if (!empty($session->_s_room_id)) {
    // User was in chat room. Push him out.
    $room->putUser($current_user->id, 0, $session->_s_stealth_mode == 'y', 'n');
}
$_body_onload[1000000] = 'initRoomSelection(' . $session->_conf_all['updater_interval'] . ',' . '\'' . $current_user->room_selection_view . '\',' . (!empty($session->_conf_all['userlist_avatar_thumb']) && 2 == PCPIN_GD_VERSION ? 'true' : 'false') . ',' . (!empty($session->_conf_all['userlist_privileged_flags']) && 2 == PCPIN_GD_VERSION ? 'true' : 'false') . ',' . (!empty($session->_conf_all['userlist_gender_icon']) ? 'true' : 'false') . ')';
$_load_cm_user_options = true;
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./room_selection.tpl');
// JS files
$_js_files[] = './js/room_selection.js';
$_js_files[] = './js/room_structure.js';
$_js_files[] = './js/user.js';
// JS language expressions
$_js_lng[] = 'user_invited_you';
$_js_lng[] = 'select_room';
$_js_lng[] = 'room_password';
$_js_lng[] = 'online_status_0';
$_js_lng[] = 'online_status_1';
$_js_lng[] = 'online_status_2';
$_js_lng[] = 'online_status_3';
$_js_lng[] = 'users_profile';
 *
 *    "PCPIN Chat 6" 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (empty($current_user->id)) {
    $_body_onload[] = 'window.close()';
} else {
    $_body_onload[] = 'executeLogOut(' . (!empty($session->_conf_all['exit_close']) ? 'true' : 'false') . ')';
}
$_js_files[] = './js/do_logout.js';
$_window_title .= ' ' . PCPIN_WINDOW_TITLE_SEPARATOR . ' ' . $l->g('log_out');
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./do_logout.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
            } while (!feof($h));
            if ($query != '') {
                execQuery($query);
            }
            fclose($h);
            $statustext[] = str_replace('[COUNT]', $queries_count, $l->g('count_queries_executed'));
        } else {
            $errortext[] = $l->g('failed_opening_uploaded_file');
        }
    } else {
        $errortext[] = $l->g('file_upload_error');
    }
}
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/db_restore.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
// Display errors
if (!empty($errortext)) {
示例#9
0
$_load_colorbox = false;
// onLoad event handlers for BODY element
$_body_onload = array('window.focus()', 'setSid(\'' . $session->_s_id . '\')', 'setIP(\'' . PCPIN_CLIENT_IP . '\')', 'setFormLink(\'' . PCPIN_ADMIN_FORMLINK . '\')', 'setAdminFormLink(\'' . PCPIN_ADMIN_FORMLINK . '\')', 'setMainFormLink(\'' . PCPIN_FORMLINK . '\')', 'setExitURL(\'' . htmlspecialchars($session->_conf_all['exit_url']) . '\')', 'setUserId(' . $session->_s_user_id . ')', 'setImgResizeFlag(' . ('2' == PCPIN_GD_VERSION ? 'true' : 'false') . ')', 'window.appName_=\'pcpin_chat\'', 'window.adminArea_=true', 'setDateFormat(\'' . str_replace('\'', '\\\'', $current_user->date_format != '' ? $current_user->date_format : $session->_conf_all['date_format']) . '\')', 'setAdminFlag(' . ($current_user->is_admin === 'y' ? 'true' : 'false') . ')', 'setSlaveMode(' . (PCPIN_SLAVE_MODE ? 'true' : 'false') . ')', 'setCurrentRoomID(' . $session->_s_room_id . ')');
// onLoad event handlers for main FRAMESET element
$_frameset_onload = array('setMainFormLink(\'' . PCPIN_FORMLINK . '\')', 'setSid(\'' . $session->_s_id . '\')');
// JavaScript files
$_js_files = array('./js/base/screen.js', './js/base/strings.js', './js/base/time.js', './js/base/xmlhttprequest.js', './js/base/connectionstatus.js', './js/base/global.js', './js/base/main.js', './js/admin/frames.js', './js/base/alertbox.js', './js/base/confirmbox.js', './js/base/promptbox.js');
// JavaScript language expressions
$_js_lng = array();
// CSS files
$_css_files = array('./main.css');
// Global template variables
$global_tpl_vars = array('s_id' => htmlspecialchars($session->_s_id), 'formlink' => PCPIN_ADMIN_FORMLINK, 'main_formlink' => PCPIN_FORMLINK, 'ainc' => htmlspecialchars(isset($ainc) ? $ainc : ''));
// Init main template handler
_pcpin_loadClass('pcpintpl');
$template = new PcpinTpl();
$template->setBasedir('./tpl');
if (isset($inc) && $inc == 'do_logout') {
    $ainc = 'do_logout';
}
if (isset($inc) && $inc == 'upload') {
    $ainc = 'upload';
}
if (!isset($ainc) && !empty($session->_s_user_id)) {
    // Load frameset
    $frameset_loaded = true;
    $template->readTemplatesFromFile('./admin/frames.tpl');
    $_frameset_onload[] = 'initAdminFames()';
} else {
    // Load main template
    $frameset_loaded = false;
$_js_lng[] = 'edit_category';
$_js_lng[] = 'category_name_empty';
$_js_lng[] = 'edit_room';
$_js_lng[] = 'room_name_empty';
$_js_lng[] = 'passwords_not_ident';
$_js_lng[] = 'password_too_short';
$_js_lng[] = 'background_image';
$_js_lng[] = 'confirm_delete_category';
$_js_lng[] = 'confirm_delete_room';
$_js_lng[] = 'online_status_0';
$_js_lng[] = 'online_status_1';
$_js_lng[] = 'online_status_2';
$_js_lng[] = 'online_status_3';
$_body_onload[] = 'initRoomsForm()';
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/rooms.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
$tpl->addVar('main', 'default_message_color', $session->_conf_all['default_message_color']);
$show_avatar_gallery_link = false;
if (!empty($session->_conf_all['avatar_gallery'])) {
    _pcpin_loadClass('avatar');
    $avatar = new PCPIN_Avatar($session);
    if ($avatar->_db_getList('COUNT', 'user_id = 0')) {
        if ($avatar->_db_list_count > 1) {
            // There are more that one default avatar
            $show_avatar_gallery_link = true;
        }
        $avatar->_db_freeList();
    }
}
$_body_onload[1000000] = 'initProfile(' . $session->_conf_all['nickname_length_min'] . ',' . $session->_conf_all['nickname_length_max'] . ',' . '\'' . $session->_conf_all['default_nickname_color'] . '\',' . $session->_conf_all['avatars_max_count'] . ',' . $session->_conf_all['nicknames_max_count'] . ',' . $profile_user_id . ',' . ($show_avatar_gallery_link ? 'true' : 'false') . ',' . ($session->_conf_all['allow_language_selection'] ? 'true' : 'false') . ',' . ($session->_conf_all['allow_account_unsubscribe'] && $profile_user_id == $current_user->id ? 'true' : 'false') . ')';
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./profile_main.tpl');
// JS files
$_js_files[] = './js/profile.js';
$_js_files[] = './js/context_menu_user_options.js';
// JS language expressions
$_js_lng[] = 'users_profile';
$_js_lng[] = 'days';
$_js_lng[] = 'hours';
$_js_lng[] = 'minutes';
$_js_lng[] = 'seconds';
$_js_lng[] = 'enter_new_password';
$_js_lng[] = 'confirm_password';
$_js_lng[] = 'email_invalid';
$_js_lng[] = 'passwords_not_ident';
 *
 *    "PCPIN Chat 6" 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (empty($current_user->id) || $current_user->is_admin !== 'y') {
    header('Location: ' . PCPIN_FORMLINK . '?' . md5(microtime()));
    die;
}
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/navigation.tpl');
// JS files
$_js_files[] = './js/admin/navigation.js';
$_body_onload[] = 'initNavigationWindow()';
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
 *    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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (empty($current_user->id) || $current_user->is_admin !== 'y') {
    header('Location: ' . PCPIN_FORMLINK . '?' . md5(microtime()));
    die;
}
$_force_buggy_doctype = true;
// Do not hide <!DOCTYPE> declaration for IE6
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/header.tpl');
// JS files
$_js_files[] = './js/admin/header.js';
// JS language expressions
//$_js_lng[]='avatar';
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
$_js_lng[] = 'all_members';
$_js_lng[] = 'edit_profile';
$_js_lng[] = 'edit_moderator';
$_js_lng[] = 'moderators_only';
$_js_lng[] = 'admins_only';
$_js_lng[] = 'never';
$_js_lng[] = 'not_activated_accounts';
$_js_lng[] = 'guest';
$_js_lng[] = 'delete_user';
$_js_lng[] = 'sure_delete_user';
$_js_lng[] = 'really_sure';
$_body_onload[] = 'initMemberlist(' . (!empty($session->_conf_all['userlist_gender_icon']) ? 'true' : 'false') . ',' . (!empty($session->_conf_all['userlist_avatar_thumb']) && 2 == PCPIN_GD_VERSION ? 'true' : 'false') . ',' . (!empty($session->_conf_all['userlist_privileged_flags']) && 2 == PCPIN_GD_VERSION ? 'true' : 'false') . ')';
$_window_title .= ' ' . PCPIN_WINDOW_TITLE_SEPARATOR . ' ' . $l->g('memberlist');
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./memberlist.tpl');
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
$tpl->addVar('admin_filter_options', 'display', $current_user->is_admin === 'y');
if (isset($banned_members)) {
 *    "PCPIN Chat 6" 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
$_body_onload[] = 'initImageWindow()';
// JS file
$_js_files[] = './js/show_image.js';
$_js_lng[] = 'close_window';
if (empty($img_b_id) || !is_scalar($img_b_id) || !pcpin_ctype_digit($img_b_id)) {
    die;
}
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./show_image.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
$tpl->addVar('main', 'b_id', htmlspecialchars($img_b_id));
}
if (empty($profile_user_id) || $current_user->is_admin !== 'y') {
    $profile_user_id = $current_user->id;
}
// Get avatars
_pcpin_loadClass('avatar');
$avatar = new PCPIN_Avatar($session);
$avatars = $avatar->getGalleryAvatars();
// JS files
$_js_files[] = './js/avatar_gallery.js';
$_js_lng[] = 'avatar';
$_body_onload[] = 'initAvatarGallery(' . addslashes(htmlspecialchars($profile_user_id)) . ')';
$_window_title .= ' ' . PCPIN_WINDOW_TITLE_SEPARATOR . ' ' . $l->g('avatar_gallery');
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./avatar_gallery.tpl');
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add avatars
$tpl->addVar('main', 'header_colspan', htmlspecialchars($session->_conf_all['gallery_avatars_per_row']));
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (empty($current_user->id)) {
    header('Location: ' . PCPIN_FORMLINK . '?' . md5(microtime()));
    die;
}
$_js_files[] = './js/call_moderator.js';
$_js_lng[] = 'abuser_nickname_empty';
$_js_lng[] = 'violation_category_not_selected';
_pcpin_loadClass('nickname');
$nickname = new PCPIN_Nickname($session);
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./call_moderator.tpl');
$_body_onload[] = 'initCMBox()';
$_window_title .= ' ' . PCPIN_WINDOW_TITLE_SEPARATOR . ' SOS ' . PCPIN_WINDOW_TITLE_SEPARATOR . ' ' . $l->g('call_moderator');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
$_js_lng[] = 'hide_message_time';
$_js_lng[] = 'delete';
$_js_lng[] = 'attachment';
$_js_lng[] = 'auto_scroll';
$_js_lng[] = 'on';
$_js_lng[] = 'off';
$_js_lng[] = 'said_message';
$_js_lng[] = 'whispered_message';
$_js_lng[] = 'room_password';
// Init smilies after load
$_body_onload[] = 'initSmilieList()';
// Init chat room client
$_body_onload[] = 'initChatRoom(' . $session->_s_room_id . ', ' . $session->_conf_all['updater_interval'] . ', ' . $session->_conf_all['userlist_width'] . ', ' . $session->_conf_all['userlist_position'] . ', ' . $session->_conf_all['controls_height'] . ', ' . $session->_conf_all['message_length_max'] . ', \'' . htmlspecialchars($session->_conf_all['default_font_family']) . '\', \'' . $session->_conf_all['default_font_size'] . '\', ' . ($session->_s_stealth_mode == 'y' ? 'true' : 'false') . ',' . (!empty($session->_conf_all['userlist_gender_icon']) ? 'true' : 'false') . ',' . (!empty($session->_conf_all['userlist_avatar_thumb']) && 2 == PCPIN_GD_VERSION ? 'true' : 'false') . ',' . (!empty($session->_conf_all['userlist_privileged_flags']) && 2 == PCPIN_GD_VERSION ? 'true' : 'false') . ',' . ($current_user->show_message_time == 'y' ? 'true' : 'false') . ',' . ($current_user->allow_sounds == 'y' ? 'true' : 'false') . ',' . '\'' . htmlspecialchars($current_user->outgoing_message_color) . '\', ' . '\'' . htmlspecialchars($session->_conf_all['default_room_background_color']) . '\', ' . $session->_conf_all['msg_attachments_limit'] . ',' . $session->_conf_all['top_banner_height'] . ', ' . $session->_conf_all['bottom_banner_height'] . ', ' . $session->_conf_all['banner_refresh_rate'] . ', ' . $session->_conf_all['popup_banner_period'] . ', ' . $session->_conf_all['msg_banner_period'] . ', ' . $session->_conf_all['smilies_position'] . ', ' . $session->_conf_all['smilies_row_height'] . ', ' . $session->_conf_all['flood_protection_message_delay'] . ')';
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./chat_room.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
// Display fonts
$tpl->addVar('fonts', 'fonts', htmlspecialchars($session->_conf_all['font_families']));
 *
 *    "PCPIN Chat 6" 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (empty($current_user->id) || $current_user->is_admin !== 'y') {
    header('Location: ' . PCPIN_FORMLINK . '?' . md5(microtime()));
    die;
}
// JS files
$_js_files[] = './js/admin/db_optimize.js';
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/db_optimize.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
                    if ($binaryfile->newBinaryFile(file_get_contents($f_data['tmp_name']), $img_data['mime'], $width, $height, '')) {
                        $binaryfile_id = $binaryfile->id;
                        if (!empty($binaryfile->id)) {
                            _pcpin_loadClass('tmpdata');
                            $tmpdata = new PCPIN_TmpData($session);
                            $tmpdata->_db_deleteRowMultiCond(array('user_id' => $current_user->id, 'type' => 2));
                            $tmpdata->addRecord(2, $current_user->id, $binaryfile_id, $filename);
                        }
                    }
                }
                break;
        }
    }
}
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./file_upload.tpl');
// JS files
$_js_files[] = './js/file_upload.js';
if (!empty($upload_status)) {
    $message = str_replace('\'', '\\\'', htmlspecialchars($upload_status['message']));
    $message = str_replace("\n", '\\n', str_replace("\r", '\\r', $message));
    $_body_onload[] = 'parseUploadResponse(' . $upload_status['code'] . ', \'' . $message . '\', ' . $binaryfile_id . ', ' . $width . ', ' . $height . ', \'' . str_replace('\'', '\\\'', $filename) . '\')';
} else {
    $_body_onload[] = 'initUploadForm(\'' . $f_target . '\')';
}
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
$_js_lng[] = 'everybody';
$_js_lng[] = 'registered_users_only';
$_js_lng[] = 'moderators_only';
$_js_lng[] = 'admins_only';
$_js_lng[] = 'profile_owner';
$_js_lng[] = 'yes';
$_js_lng[] = 'no';
$_js_lng[] = 'move_up';
$_js_lng[] = 'move_down';
$_js_lng[] = 'edit';
$_js_lng[] = 'delete';
$_js_lng[] = 'sure_delete_field';
$_js_lng[] = 'name_empty_error';
$_js_lng[] = 'no_options_specified';
$_body_onload[] = 'initCustomFieldsWindow()';
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/custom_profile_fields.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
    header('Location: ' . PCPIN_FORMLINK . '?' . md5(microtime()));
    die;
}
// Load colorbox
$_load_colorbox = true;
// Load smiliebox
$_load_smiliebox = true;
// Default: Do not context menu user options
$_load_cm_user_options = true;
_pcpin_loadClass('nickname');
$nickname = new PCPIN_Nickname($session);
$_js_files[] = './js/user.js';
$_js_files[] = './js/pm_box.js';
$_js_lng[] = 'private_message';
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./pm_box.tpl');
if (empty($target_user_id) || $target_user_id == $current_user->id || !$current_user->_db_getList('id', 'id = ' . $target_user_id, 1)) {
    $_body_onload[] = 'window.close()';
} else {
    $_body_onload[] = 'initSmilieList()';
    $current_user->_db_freeList();
    $target_user_nickname = $nickname->getDefaultNickname($target_user_id);
    $_body_onload[] = 'initPMBox(' . $target_user_id . ', 60)';
    $_window_title = $nickname->coloredToPlain($target_user_nickname, false) . '::' . $l->g('private_message') . ' (' . $session->_conf_all['chat_name'] . ')';
}
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
    $new_version_url = '';
}
$current_version = number_format($current_version, 2, '.', '');
$new_version_available = number_format($new_version_available, 2, '.', '');
if (!empty($do_check)) {
    // Check for new version
    // Generate new security key
    $key = PCPIN_Common::randomString(36, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-()[].,');
    $version->setVersionCheckKey($key);
    $session->_s_updateSession($session->_s_id, true, true, null, null, null, md5($key));
    header('Location: ' . PCPIN_VERSIONCHECKER_URL . '?' . htmlspecialchars($key));
    die;
}
// Initialize template handler
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./admin/versions.tpl');
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
if (empty($do_check)) {
    // Display form
                    $preselect_language = $data['id'];
                    break;
                }
            }
            if (!empty($preselect_language)) {
                break;
            }
        }
    }
    if (empty($preselect_language)) {
        $preselect_language = $session->_conf_all['default_language'];
    }
    $l->setLanguage($preselect_language);
}
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./login.tpl');
$_body_onload[] = 'initLoginForm(' . htmlspecialchars($session->_conf_all['login_length_min']) . ', ' . htmlspecialchars($session->_conf_all['login_length_max']) . ', ' . (!empty($admin_login) ? 'true' : 'false') . ')';
// JS file for login
$_js_files[] = './js/login.js';
// JS language expressions
$_js_lng[] = 'username_empty';
$_js_lng[] = 'email_invalid';
$_js_lng[] = 'username_length_error';
$_js_lng[] = 'password_too_short';
$_js_lng[] = 'passwords_not_ident';
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
    }
}
if (empty($preselect_language)) {
    $preselect_language = $session->_conf_all['default_language'];
}
$l->setLanguage($preselect_language);
$message = $l->g('access_denied');
if (!isset($activation_code) || !is_scalar($activation_code)) {
    $activation_code = '';
}
_pcpin_loadClass('user');
$user = new PCPIN_User($session);
_pcpin_loadClass('message');
$msg = new PCPIN_Message($session);
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./dummy.tpl');
if ($activation_code != '') {
    if (isset($activate_email)) {
        // New email address activation
        if ($user->_db_getList('email_new != ', 'email_new_activation_code = ' . md5($activation_code), 1)) {
            // Requested email address found and activation code is OK
            $user->_db_setObject($user->_db_list[0]);
            $user->email = $user->email_new;
            $user->email_new = '';
            $user->email_new_date = '';
            $user->email_new_activation_code = '';
            $user->_db_updateObj($user->id);
            $message = $l->g('new_email_activated');
            if ($session->_db_getList('_s_room_id', '_s_user_id = ' . $user->id, 1)) {
}
$category_name = $category->_db_list[0]['name'];
$category->_db_freeList();
$title = str_replace('[CATEGORY]', $category_name, $l->g('create_new_room_in_category'));
// JS files
$_js_files[] = './js/create_user_room.js';
$_js_lng[] = 'room_name_empty';
$_js_lng[] = 'passwords_not_ident';
$_js_lng[] = 'password_too_short';
if (!isset($user_id)) {
    $user_id = 0;
}
$_body_onload[] = 'initNewuserRoomForm(' . $category_id . ')';
$_window_title .= ' ' . PCPIN_WINDOW_TITLE_SEPARATOR . ' ' . $title;
// Init template
_pcpin_loadClass('pcpintpl');
$tpl = new PcpinTpl();
$tpl->setBasedir('./tpl');
$tpl->readTemplatesFromFile('./create_user_room.tpl');
// Add language expressions to template
foreach ($tpl->tpl_vars_plain as $var) {
    if (0 === strpos($var, 'LNG_')) {
        $var = strtolower($var);
        $tpl->addGlobalVar($var, htmlspecialchars($l->g(substr($var, 4))));
    }
}
// Add global vars to template
foreach ($global_tpl_vars as $key => $val) {
    $tpl->addGlobalVar($key, htmlspecialchars($val));
}
$tpl->addVars('main', array('title' => htmlspecialchars($title), 'room_name_length_max' => PCPIN_ROOM_NAME_LENGTH_MAX));