コード例 #1
0
 *    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))));
    }
}
$tpl->addVar('main', 'nickname', $nickname->coloredToHTML($current_nickname));
$tpl->addVar('main', 'room_name', htmlspecialchars($current_room_name));
コード例 #2
0
$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);
    $invitation_text = str_replace('[USER]', '<b>' . $nickname->coloredToHTML($invitation_data['author_nickname']) . '</b>', htmlspecialchars($invitation_text));
    $tpl->addVar('main', 'invitation_text', nl2br($invitation_text));
    $tpl->addGlobalVar('user_id', htmlspecialchars($invitation_data['author_id']));
    $tpl->addGlobalVar('room_id', htmlspecialchars($invitation_data['room_id']));
    $tpl->addGlobalVar('mute_user_locally', htmlspecialchars(str_replace('[USER]', $nickname->coloredToPlain($invitation_data['author_nickname'], false), $l->g('mute_user_locally'))));
}
$_window_title .= ' ' . PCPIN_WINDOW_TITLE_SEPARATOR . ' ' . $l->g('invitation');
コード例 #3
0
// Initialize vars
$_pcpin_online_users_count = 0;
$_pcpin_online_users = array();
$_pcpin_online_users_colored = array();
$_pcpin_registered_users_count = 0;
$_pcpin_registered_users = array();
$_pcpin_registered_users_colored = array();
$_pcpin_rooms_count = 0;
$_pcpin_rooms = array();
// Get full memberlist
$_pcpin_memberlist = $_pcpin_user->getMemberlist(false, 0, 0, 1, 0);
foreach ($_pcpin_memberlist as $_pcpin_data) {
    if ($_pcpin_data['online_status'] > 0) {
        $_pcpin_online_users_count++;
        $_pcpin_online_users[] = htmlspecialchars($_pcpin_data['nickname_plain']);
        $_pcpin_online_users_colored[] = $_pcpin_nickname->coloredToHTML($_pcpin_data['nickname']);
    }
    if (empty($_pcpin_data['is_guest'])) {
        $_pcpin_registered_users_count++;
        $_pcpin_registered_users[] = htmlspecialchars($_pcpin_data['nickname_plain']);
        $_pcpin_registered_users_colored[] = $_pcpin_nickname->coloredToHTML($_pcpin_data['nickname']);
    }
}
unset($_pcpin_memberlist);
unset($_pcpin_user);
unset($_pcpin_nickname);
// Get rooms
$_pcpin_rooms_count = $_pcpin_room->_db_getList('name', 'name ASC');
foreach ($_pcpin_room->_db_list as $_pcpin_data) {
    $_pcpin_rooms[] = htmlspecialchars($_pcpin_data['name']);
}