Example #1
0
 function e_linkwords()
 {
     global $pref, $admin_log;
     /* constructor */
     // Do an auto-update on the variable used to hook parsers - so we should only be called once
     include_lan(e_PLUGIN . "linkwords/languages/" . e_LANGUAGE . ".php");
     $hooks = explode(",", $pref['tohtml_hook']);
     if (($key = array_search('linkwords', $hooks)) !== FALSE) {
         unset($hooks[$key]);
     }
     if (count($hooks) == 0) {
         unset($pref['tohtml_hook']);
     } else {
         $pref['tohtml_hook'] = implode(',', $hooks);
     }
     if (!isset($pref['e_tohtml_list'])) {
         $pref['e_tohtml_list'] = array();
     }
     if (!in_array('linkwords', $pref['e_tohtml_list'])) {
         $pref['e_tohtml_list'][] = 'linkwords';
     }
     save_prefs();
     $admin_log->log_event('LINKWD_05', LWLAN_58 . '[!br!]' . $pref['tohtml_hook'], '');
     // Log that the update was done
     return;
 }
Example #2
0
 function ebattles_configure_save()
 {
     global $gold_obj, $pref, $arcade_obj;
     $pref['eb_gold_userclass'] = $_POST['eb_gold_userclass'];
     $pref['eb_gold_playmatch'] = $_POST['eb_gold_playmatch'];
     save_prefs();
     return EB_GOLD_L3;
 }
Example #3
0
 function e_emotefilter()
 {
     $pref = e107::getPref();
     if (!$pref['emotepack']) {
         $pref['emotepack'] = "default";
         save_prefs();
     }
     $this->emotes = e107::getConfig("emote")->getPref();
     if (!vartrue($this->emotes)) {
         return;
     }
     foreach ($this->emotes as $key => $value) {
         $value = trim($value);
         if ($value) {
             // Only 'activate' emote if there's a substitution string set
             $key = preg_replace("#!(\\w{3,}?)\$#si", ".\\1", $key);
             // Next two probably to sort out legacy issues - may not be required any more
             $key = preg_replace("#_(\\w{3})\$#", ".\\1", $key);
             $key = str_replace("!", "_", $key);
             $filename = e_IMAGE . "emotes/" . $pref['emotepack'] . "/" . $key;
             $fileloc = SITEURLBASE . e_IMAGE_ABS . "emotes/" . $pref['emotepack'] . "/" . $key;
             if (file_exists($filename)) {
                 if (strstr($value, " ")) {
                     $tmp = explode(" ", $value);
                     foreach ($tmp as $code) {
                         $this->search[] = " " . $code;
                         $this->search[] = "\n" . $code;
                         //TODO CSS class?
                         $this->replace[] = " <img src='" . $fileloc . "' alt='' style='vertical-align:middle; border:0' /> ";
                         $this->replace[] = "\n <img src='" . $fileloc . "' alt='' style='vertical-align:middle; border:0' /> ";
                     }
                     unset($tmp);
                 } else {
                     if ($value) {
                         $this->search[] = " " . $value;
                         $this->search[] = "\n" . $value;
                         //TODO CSS class?
                         $this->replace[] = " <img src='" . $filename . "' alt='' style='vertical-align:middle; border:0' /> ";
                         $this->replace[] = "\n <img src='" . $filename . "' alt='' style='vertical-align:middle; border:0' /> ";
                     }
                 }
             }
         } else {
             unset($this->emotes[$key]);
         }
     }
 }
Example #4
0
 function __construct()
 {
     e107::js('core', 'zrssfeed/jquery.zrssfeed.min.js');
     // http://www.zazar.net/developers/jquery/zrssfeed/
     $code = "\n\t\t\n\t\t\n\t\tjQuery(function(\$){\n\t\t \$('#e-adminfeed').rssfeed('" . ADMINFEED . "', {\n    \t\tlimit: 3,\n    \t\theader: false,\n    \t\tlinktarget: '_blank'\n  \t\t\t});\n\t\t});\n";
     global $user_pref;
     // quick fix.
     $pref = e107::getPref();
     e107::js('inline', $code, 'jquery');
     if (isset($_POST['submit-mye107']) || varset($_POST['submit-mymenus'])) {
         $user_pref['core-infopanel-mye107'] = $_POST['e-mye107'];
         save_prefs('user');
         $pref['core-infopanel-menus'] = $_POST['e-mymenus'];
         save_prefs();
     }
     //	$array_functions_assoc = e107::getNav()->adminLinks('assoc');
     //	$this->iconlist = array_merge($array_functions_assoc, e107::getNav()->pluginLinks(E_16_PLUGMANAGER, "array"));
     $this->iconlist = e107::getNav()->adminLinks();
 }
Example #5
0
function logPrefChanges(&$prefList, $logRef)
{
    global $pref, $tp, $admin_log;
    $prefChanges = array();
    foreach ($prefList as $prefName => $process) {
        switch ($process) {
            case 0:
                $temp = varset($_POST[$prefName], '');
                break;
            case 1:
                $temp = intval(varset($_POST[$prefName], 0));
                break;
            case 2:
                $temp = $tp->toDB(varset($_POST[$prefName], ''));
                break;
            case 3:
                // Array of integers - turn into comma-separated string
                $tmp = array();
                foreach ($_POST[$prefName] as $v) {
                    $tmp[] = intval($v);
                }
                $temp = implode(",", $tmp);
                unset($tmp);
                break;
        }
        if (!isset($pref[$prefName]) || $temp != $pref[$prefName]) {
            // Change to process
            $pref[$prefName] = $temp;
            $prefChanges[] = $prefName . ' => ' . $temp;
        }
    }
    if (count($prefChanges)) {
        save_prefs();
        // Do admin logging
        $logString = implode('[!br!]', $prefChanges);
        $admin_log->log_event($logRef, $logString, '');
    }
}
Example #6
0
 function update()
 {
     global $sql, $pref, $tp, $eArrayStorage, $admin_log;
     $this->changeList = array();
     foreach ($_POST['event'] as $key => $value) {
         if ($this->update_event($key)) {
             $active = TRUE;
         }
     }
     if ($active) {
         $pref['notify'] = TRUE;
     } else {
         $pref['notify'] = FALSE;
     }
     save_prefs();
     $s_prefs = $tp->toDB($this->notify_prefs);
     $s_prefs = $eArrayStorage->WriteArray($s_prefs);
     if ($sql->db_Update("core", "e107_value='" . $s_prefs . "' WHERE e107_name='notify_prefs'") !== FALSE) {
         $admin_log->logArrayAll('NOTIFY_01', $this->changeList);
         return TRUE;
     } else {
         return FALSE;
     }
 }
Example #7
0
 function saveSettings()
 {
     global $admin_log, $pref;
     $tp = e107::getParser();
     $temp = array();
     $temp['download_php'] = $_POST['download_php'];
     $temp['download_view'] = $_POST['download_view'];
     $temp['download_sort'] = $_POST['download_sort'];
     $temp['download_order'] = $_POST['download_order'];
     $temp['mirror_order'] = $_POST['mirror_order'];
     $temp['recent_download_days'] = $_POST['recent_download_days'];
     $temp['agree_flag'] = $_POST['agree_flag'];
     $temp['download_email'] = $_POST['download_email'];
     $temp['agree_text'] = $tp->toDB($_POST['agree_text']);
     $temp['download_denied'] = $tp->toDB($_POST['download_denied']);
     $temp['download_reportbroken'] = $_POST['download_reportbroken'];
     if ($_POST['download_subsub']) {
         $temp['download_subsub'] = '1';
     } else {
         $temp['download_subsub'] = '0';
     }
     if ($_POST['download_incinfo']) {
         $temp['download_incinfo'] = '1';
     } else {
         $temp['download_incinfo'] = '0';
     }
     if ($admin_log->logArrayDiffs($temp, $pref, 'DOWNL_01')) {
         save_prefs();
         // e107::getMessage()->add(DOWLAN_65);
     } else {
         // e107::getMessage()->add(DOWLAN_8);
     }
 }
Example #8
0
 function users()
 {
     // Any changed need to be duplicated in /usersettings.php (end of the script)
     $var = array();
     $var['main']['text'] = LAN_USER_LIST;
     $var['main']['link'] = e_ADMIN . 'users.php';
     $var['main']['perm'] = '4|U0|U1';
     $var['create']['text'] = LAN_USER_QUICKADD;
     $var['create']['link'] = e_ADMIN . 'users.php?action=create';
     $var['create']['perm'] = '4|U0|U1';
     $var['prune']['text'] = LAN_USER_PRUNE;
     $var['prune']['link'] = e_ADMIN . 'users.php?action=prune';
     // Will be moved to "Schedule tasks"
     $var['prune']['perm'] = '4';
     $var['options']['text'] = LAN_OPTIONS;
     $var['options']['link'] = e_ADMIN . 'users.php?action=options';
     $var['options']['perm'] = '4|U2';
     $var['ranks']['text'] = LAN_USER_RANKS;
     $var['ranks']['link'] = e_ADMIN . 'users.php?action=ranks';
     $var['ranks']['perm'] = '4|U3';
     // if ($unverified) // No longer needed - done with 'filter'.
     // {
     // $var ['unveri']['text'] = USRLAN_138." ($unverified)";
     // $var ['unveri']['link'] = e_ADMIN.'users.php?unverified';
     // }
     $this->menuOptions = $var;
     global $pref, $user_pref, $sql, $tp;
     if (isset($pref['admin_user_disp'])) {
         $user_pref['admin_users_columns'] = $pref['admin_user_disp'] ? explode("|", $pref['admin_user_disp']) : array('user_status', 'user_name', 'user_class');
         save_prefs('user');
         unset($pref['admin_user_disp']);
         save_prefs();
     }
     //	$this->usersSaveColumnPref();
     $this->fieldpref = !$user_pref['admin_users_columns'] ? array('user_name', 'user_class') : $user_pref['admin_users_columns'];
     /*        if (e_QUERY)
     		{
     		$tmp = explode('.', e_QUERY);
     		$action = $tmp[0];    // main
     		$sub_action = varset($tmp[1],'');
     		$id = varset($tmp[2],0);
     		$from = varset($tmp[3],0);
     		unset($tmp);
     		}*/
     global $sub_action, $id, $from;
     if ($from) {
         $this->sortfield = $sub_action;
         $this->sortorder = $id;
         $this->sortorderrev = $this->sortorder == 'asc' ? 'desc' : 'asc';
         $this->from = $from;
     }
     $this->fields = array('checkboxes' => array('title' => '', 'width' => '3%', 'forced' => true, 'thclass' => 'center first'), 'user_id' => array('title' => 'Id', 'width' => '5%', 'forced' => true), 'user_status' => array('title' => LAN_STATUS, 'width' => 'auto', 'nosort' => TRUE), 'user_name' => array('title' => LAN_USER_01, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), 'user_loginname' => array('title' => LAN_USER_02, 'type' => 'text', 'width' => 'auto'), 'user_login' => array('title' => LAN_USER_03, 'type' => 'text', 'width' => 'auto'), 'user_customtitle' => array('title' => LAN_USER_04, 'type' => 'text', 'width' => 'auto'), 'user_password' => array('title' => LAN_USER_05, 'type' => 'text', 'width' => 'auto'), 'user_sess' => array('title' => LAN_USER_06, 'type' => 'text', 'width' => 'auto'), 'user_image' => array('title' => LAN_USER_07, 'type' => 'text', 'width' => 'auto'), 'user_email' => array('title' => LAN_USER_08, 'type' => 'text', 'width' => 'auto'), 'user_signature' => array('title' => LAN_USER_09, 'type' => 'text', 'width' => 'auto'), 'user_hideemail' => array('title' => LAN_USER_10, 'type' => 'boolean', 'width' => 'auto'), 'user_xup' => array('title' => LAN_USER_11, 'type' => 'text', 'width' => 'auto'), 'user_class' => array('title' => LAN_USER_12, 'type' => 'class'), 'user_join' => array('title' => LAN_USER_14, 'type' => 'date', 'width' => 'auto'), 'user_lastvisit' => array('title' => LAN_USER_15, 'type' => 'date', 'width' => 'auto'), 'user_currentvisit' => array('title' => LAN_USER_16, 'type' => 'date', 'width' => 'auto'), 'user_comments' => array('title' => LAN_USER_17, 'width' => 'auto'), 'user_lastpost' => array('title' => 'Last Post', 'type' => 'date', 'width' => 'auto'), 'user_ip' => array('title' => LAN_USER_18, 'width' => 'auto'), 'user_ban' => array('title' => LAN_USER_19, 'type' => 'boolean', 'width' => 'auto'), 'user_prefs' => array('title' => LAN_USER_20, 'width' => 'auto'), 'user_visits' => array('title' => LAN_USER_21, 'width' => 'auto', 'thclass' => 'right'), 'user_admin' => array('title' => LAN_USER_22, 'type' => 'boolean', 'width' => 'auto', 'thclass' => 'center'), 'user_perms' => array('title' => LAN_USER_23, 'width' => 'auto'), 'user_pwchange' => array('title' => LAN_USER_24, 'width' => 'auto'));
     if ($sql->db_Select('user_extended_struct', 'user_extended_struct_name', "user_extended_struct_type > 0 AND user_extended_struct_text != '_system_' ORDER BY user_extended_struct_parent ASC")) {
         while ($row = $sql->db_Fetch()) {
             $field = "user_" . $row['user_extended_struct_name'];
             $title = ucfirst(str_replace("user_", "", $field));
             $this->fields[$field] = array('title' => $title, 'width' => 'auto');
         }
     }
     $this->fields['options'] = array('title' => LAN_OPTIONS, 'width' => '10%', "thclass" => "center last", 'forced' => true);
     if (!getperms('4|U0')) {
         unset($this->fields['checkboxes']);
         unset($this->fields['options']);
         $this->fieldpref = array('user_name', 'user_loginname', 'user_login', 'user_email', 'user_class', 'user_ban', 'user_admin');
     }
     // print_a($this->fields);
 }
Example #9
0
 function updateSettings()
 {
     global $pref, $admin_log, $tp;
     $mes = e107::getMessage();
     $tmp = array();
     $tmp['image_post'] = intval($_POST['image_post']);
     $tmp['resize_method'] = $tp->toDB($_POST['resize_method']);
     $tmp['im_path'] = trim($tp->toDB($_POST['im_path']));
     $tmp['image_post_class'] = intval($_POST['image_post_class']);
     $tmp['image_post_disabled_method'] = intval($_POST['image_post_disabled_method']);
     $tmp['enable_png_image_fix'] = intval($_POST['enable_png_image_fix']);
     if ($_POST['img_import_resize_w'] && $_POST['img_import_resize_h']) {
         $tmp['img_import_resize'] = intval($_POST['img_import_resize_w']) . "x" . intval($_POST['img_import_resize_h']);
     }
     if ($admin_log->logArrayDiffs($tmp, $pref, 'IMALAN_04')) {
         save_prefs();
         // Only save if changes
         $mes->add(IMALAN_9, E_MESSAGE_SUCCESS);
     } else {
         $mes->add(IMALAN_20, E_MESSAGE_INFO);
     }
 }
Example #10
0
function saveMailPrefs(&$emessage)
{
    global $pref;
    $e107 = e107::getInstance();
    $bounceOpts = array('none' => LAN_MAILOUT_232, 'auto' => LAN_MAILOUT_233, 'mail' => LAN_MAILOUT_234);
    unset($temp);
    if (!in_array($_POST['mailer'], array('smtp', 'sendmail', 'php'))) {
        $_POST['mailer'] = 'php';
    }
    $temp['mailer'] = $_POST['mailer'];
    // Allow qmail as an option as well - works much as sendmail
    if (strpos($_POST['sendmail'], 'sendmail') !== FALSE || strpos($_POST['sendmail'], 'qmail') !== FALSE) {
        $temp['sendmail'] = $e107->tp->toDB($_POST['sendmail']);
    }
    $temp['smtp_server'] = $e107->tp->toDB($_POST['smtp_server']);
    $temp['smtp_username'] = $e107->tp->toDB($_POST['smtp_username']);
    $temp['smtp_password'] = $e107->tp->toDB($_POST['smtp_password']);
    $smtp_opts = array();
    switch (trim($_POST['smtp_options'])) {
        case 'smtp_ssl':
            $smtp_opts[] = 'secure=SSL';
            break;
        case 'smtp_tls':
            $smtp_opts[] = 'secure=TLS';
            break;
        case 'smtp_pop3auth':
            $smtp_opts[] = 'pop3auth';
            break;
    }
    if (varsettrue($_POST['smtp_keepalive'])) {
        $smtp_opts[] = 'keepalive';
    }
    if (varsettrue($_POST['smtp_useVERP'])) {
        $smtp_opts[] = 'useVERP';
    }
    $temp['smtp_options'] = implode(',', $smtp_opts);
    $temp['mail_sendstyle'] = $e107->tp->toDB($_POST['mail_sendstyle']);
    $temp['mail_pause'] = intval($_POST['mail_pause']);
    $temp['mail_pausetime'] = intval($_POST['mail_pausetime']);
    $temp['mail_workpertick'] = intval($_POST['mail_workpertick']);
    $temp['mail_workpertick'] = min($temp['mail_workpertick'], 1000);
    $temp['mail_bounce'] = isset($bounceOpts[$_POST['mail_bounce']]) ? $_POST['mail_bounce'] : 'none';
    $temp['mail_bounce_auto'] = 0;
    // Make sure this is always defined
    switch ($temp['mail_bounce']) {
        case 'none':
            $temp['mail_bounce_email'] = '';
            break;
        case 'auto':
            $temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email2']);
            break;
        case 'mail':
            $temp['mail_bounce_email'] = $e107->tp->toDB($_POST['mail_bounce_email']);
            $temp['mail_bounce_auto'] = intval($_POST['mail_bounce_auto']);
            break;
    }
    $temp['mail_bounce_pop3'] = $e107->tp->toDB($_POST['mail_bounce_pop3']);
    $temp['mail_bounce_user'] = $e107->tp->toDB($_POST['mail_bounce_user']);
    $temp['mail_bounce_pass'] = $e107->tp->toDB($_POST['mail_bounce_pass']);
    $temp['mail_bounce_type'] = $e107->tp->toDB($_POST['mail_bounce_type']);
    $temp['mail_bounce_delete'] = intval(varset($_POST['mail_bounce_delete'], 0));
    $temp['mailout_enabled'] = implode(',', varset($_POST['mail_mailer_enabled'], ''));
    $temp['mail_log_options'] = intval($_POST['mail_log_option']) . ',' . intval($_POST['mail_log_email']);
    if ($e107->admin_log->logArrayDiffs($temp, $pref, 'MAIL_03')) {
        save_prefs();
        // Only save if changes - generates its own message
        //		$emessage->add(LAN_SETSAVED, E_MESSAGE_SUCCESS);
    } else {
        $emessage->add(LAN_NO_CHANGE, E_MESSAGE_INFO);
    }
}
Example #11
0
$one_pack = FALSE;
// Check for pack-related buttons pressed
foreach ($_POST as $key => $value) {
    if (strstr($key, "subPack_")) {
        $subpack = str_replace("subPack_", "", $key);
        $emote->emoteConf($subpack);
        break;
    }
    if (strstr($key, "XMLPack_")) {
        $subpack = str_replace("XMLPack_", "", $key);
        $emote->emoteXML($subpack);
        break;
    }
    if (strstr($key, "defPack_")) {
        $pref['emotepack'] = str_replace("defPack_", "", $key);
        if (save_prefs()) {
            $mes->addSuccess(LAN_UPDATED);
        } else {
            $mes->addInfo(LAN_NO_CHANGE);
        }
        e107::getLog()->add('EMOTE_01', $pref['emotepack'], E_LOG_INFORMATIVE, '');
        break;
    }
    if (strstr($key, "scanPack_")) {
        $one_pack = str_replace("scanPack_", "", $key);
        break;
    }
}
$ns->tablerender($caption, $mes->render() . $text);
$check = TRUE;
//$check = $emote -> installCheck();
Example #12
0
 function saveSettings()
 {
     global $pref, $admin_log, $emessage;
     $temp['listPages'] = $_POST['listPages'];
     $temp['pageCookieExpire'] = $_POST['pageCookieExpire'];
     if ($admin_log->logArrayDiffs($temp, $pref, 'CPAGE_04')) {
         save_prefs();
         // Only save if changes
         $emessage->add(CUSLAN_45, E_MESSAGE_SUCCESS);
     } else {
         $emessage->add(CUSLAN_46);
     }
 }
Example #13
0
 function setAdminTheme()
 {
     global $pref, $e107cache;
     $ns = e107::getRender();
     $mes = e107::getMessage();
     $themeArray = $this->getThemes("id");
     $pref['admintheme'] = $themeArray[$this->id];
     $pref['admincss'] = file_exists(e_THEME . $pref['admintheme'] . '/admin_dark.css') ? 'admin_dark.css' : 'admin_light.css';
     $e107cache->clear_sys();
     if (save_prefs()) {
         // Default Message
         $mes->add(TPVLAN_40 . " <b>'" . $themeArray[$this->id] . "'</b>", E_MESSAGE_SUCCESS);
         $this->theme_adminlog('02', $pref['admintheme'] . ', ' . $pref['admincss']);
     }
     //	$ns->tablerender("Admin Message", "<br /><div style='text-align:center;'>".TPVLAN_40." <b>'".$themeArray[$this -> id]."'</b>.</div><br />");
     //  $this->showThemes('admin');
 }
Example #14
0
 function menuSetConfigList()
 {
     global $sql, $pref;
     $sql->db_Select("menus", "*", "menu_location != 0 ORDER BY menu_path,menu_name");
     while ($row = $sql->db_Fetch()) {
         $link = "";
         extract($row);
         $id = substr($menu_path, 0, -1);
         if (file_exists(e_PLUGIN . "{$menu_path}{$menu_name}_menu_config.php")) {
             $link = "{$menu_path}{$menu_name}_menu_config.php";
         }
         if (file_exists(e_PLUGIN . "{$menu_path}config.php")) {
             $link = "{$menu_path}config.php";
         }
         if ($link) {
             $tmp[$id]['name'] = ucwords(str_replace("_menu", "", $menu_name));
             if ($prev == $id && $tmp[$id]['name'] != $prev_name) {
                 $tmp[$id]['name'] .= ":" . $prev_name;
             }
             $tmp[$id]['link'] = $link;
             $prev = $id;
             $prev_name = $tmp[$id]['name'];
         }
     }
     $pref['menuconfig_list'] = $tmp;
     save_prefs();
 }
Example #15
0
 function menuSetCustomPages($array)
 {
     $pref = e107::getPref();
     $key = key($array);
     $pref['sitetheme_custompages'][$key] = array_filter(explode(" ", $array[$key]));
     save_prefs();
 }
Example #16
0
function poll_list()
{
    $sql = e107::getDb();
    $ns = e107::getRender();
    $tp = e107::getParser();
    $frm = new e_form(true);
    global $user_pref;
    if (isset($_POST['etrigger_ecolumns'])) {
        $user_pref['admin_poll_columns'] = $_POST['e-columns'];
        save_prefs('user');
    }
    $fieldpref = varset($user_pref['admin_poll_columns']) ? $user_pref['admin_poll_columns'] : array("poll_id", "poll_title", "poll_options", "poll_vote_userclass");
    //TODO Add more column options.
    $fields = array('poll_id' => array('title' => ID, 'width' => '5%', 'forced' => TRUE), 'poll_title' => array('title' => POLLAN_3, 'width' => 'auto'), 'poll_options' => array('title' => POLLAN_4, 'type' => 'text', 'width' => 'auto', 'thclass' => 'center'), 'poll_vote_userclass' => array('title' => LAN_USERCLASS, 'type' => 'text', 'width' => 'auto'), 'options' => array('title' => LAN_OPTIONS, 'forced' => TRUE, 'width' => '10%', 'thclass' => 'center last'));
    $text = "<div style='text-align:center'><div>\n\t\t<form action='" . e_SELF . "' method='post' id='del_poll'>";
    if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1")) {
        $text .= "<table class='table adminlist'>";
        $text .= $frm->colGroup($fields, $fieldpref) . $frm->thead($fields, $fieldpref);
        $text .= "<tbody>";
        while ($row = $sql->db_Fetch()) {
            extract($row);
            $text .= "<tr>\n\t\t\t\t<td>{$poll_id}</td>";
            $text .= in_array("poll_title", $fieldpref) ? "<td class='left'>" . $tp->toHTML($poll_title, TRUE, "no_hook, emotes_off, defs") . "</td>" : "";
            $text .= in_array("poll_options", $fieldpref) ? "<td class='left'>" . str_replace(chr(1), "<br />", $poll_options) . "</td>" : "";
            $text .= in_array("poll_comment", $fieldpref) ? "<td>" . ($poll_comment ? LAN_YES : LAN_NO) . "</td>" : "";
            $text .= in_array("poll_vote_userclass", $fieldpref) ? "<td>" . r_userclass_name($poll_vote_userclass) . "</td>" : "";
            $text .= "\n\t\t\t\t<td class='center'>\n\t\t\t\t\t<input type='image' name='edit[{$poll_id}]' value='edit' src='" . ADMIN_EDIT_ICON_PATH . "' alt='" . LAN_EDIT . "' title='" . LAN_EDIT . "' style='border:0px' />\n\t\t\t\t\t<input type='image' name='delete[{$poll_id}]' value='del' onclick=\"return jsconfirm('" . $tp->toJS(LAN_CONFIRMDEL . " [" . $poll_id . "]") . "') \" src='" . ADMIN_DELETE_ICON_PATH . "' alt='" . LAN_DELETE . "' title='" . LAN_DELETE . "' style='border:0px' />\n\t\t\t\t</td>\n\t\t\t\t</tr>";
        }
        $text .= "</tbody></table>";
    } else {
        $text .= "<div style='text-align:center'>" . POLLAN_7 . "</div>";
    }
    $text .= "</form></div></div>";
    $emessage = eMessage::getInstance();
    $ns->tablerender(POLLAN_MENU_CAPTION . " :: " . POLLAN_1, $emessage->render() . $text);
}
Example #17
0
function poll_list()
{
    $sql = e107::getDb();
    $ns = e107::getRender();
    $tp = e107::getParser();
    $frm = e107::getForm();
    $mes = e107::getMessage();
    global $user_pref;
    if (isset($_POST['etrigger_ecolumns'])) {
        $user_pref['admin_poll_columns'] = $_POST['e-columns'];
        save_prefs('user');
    }
    $fieldpref = varset($user_pref['admin_poll_columns']) ? $user_pref['admin_poll_columns'] : array("poll_id", "poll_title", "poll_options", "poll_vote_userclass");
    //TODO Add more column options.
    $fields = array('poll_id' => array('title' => LAN_ID, 'width' => '5%', 'forced' => TRUE), 'poll_title' => array('title' => POLLAN_3, 'width' => 'auto'), 'poll_options' => array('title' => POLLAN_4, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'), 'poll_vote_userclass' => array('title' => LAN_USERCLASS, 'type' => 'text', 'width' => 'auto'), 'options' => array('title' => LAN_OPTIONS, 'forced' => TRUE, 'width' => '10%', 'thclass' => 'center last'));
    $text = "\n\t\t<form action='" . e_SELF . "' method='post' id='del_poll'>";
    if ($poll_total = $sql->select("polls", "*")) {
        $text .= "<table class='table adminlist'>";
        $text .= $frm->colGroup($fields, $fieldpref) . $frm->thead($fields, $fieldpref);
        $text .= "<tbody>";
        while ($row = $sql->fetch()) {
            extract($row);
            // FIXME
            $pollopts = explode(chr(1), $poll_options);
            $pollopts = array_filter($pollopts);
            $text .= "\n\t\t\t<tr>\n\t\t\t\t<td>{$poll_id}</td>";
            $text .= in_array("poll_title", $fieldpref) ? "<td class='left'>" . $tp->toHTML($poll_title, TRUE, "no_hook, emotes_off, defs") . "</td>" : "";
            $text .= in_array("poll_options", $fieldpref) ? "<td class='left'><ul><li>" . implode("</li><li>", $pollopts) . "</li></ul></td>" : "";
            $text .= in_array("poll_comment", $fieldpref) ? "<td>" . ($poll_comment ? LAN_YES : LAN_NO) . "</td>" : "";
            $text .= in_array("poll_vote_userclass", $fieldpref) ? "<td>" . r_userclass_name($poll_vote_userclass) . "</td>" : "";
            $text .= "\n\t\t\t\t<td class='center' style='white-space:nowrap'>\n\t\t\t\t\t<button class='btn btn-large' type='submit' name='edit[{$poll_id}]' value='edit' alt='" . LAN_EDIT . "' title='" . LAN_EDIT . "' >" . ADMIN_EDIT_ICON . "</button>\n\t\t\t\t\t<button class='btn btn-large action delete' type='submit' name='delete[{$poll_id}]' value='del' onclick=\"return jsconfirm('" . $tp->toJS(LAN_CONFIRMDEL . " [" . $poll_id . "]") . "') \" title='" . LAN_DELETE . "' >" . ADMIN_DELETE_ICON . "</button>\n\t\t\t\t</td>\n\t\t\t</tr>";
        }
        $text .= "</tbody></table>";
    } else {
        $mes->addInfo(POLLAN_7);
    }
    $text .= "</form>";
    $ns->tablerender(POLLAN_MENU_CAPTION . SEP . POLLAN_1, $mes->render() . $text);
}
Example #18
0
 function pluginObserver()
 {
     global $user_pref, $admin_log;
     if (isset($_POST['upload'])) {
         $this->pluginProcessUpload();
     }
     if (isset($_POST['etrigger_ecolumns'])) {
         $user_pref['admin_pluginmanager_columns'] = $_POST['e-columns'];
         save_prefs('user');
     }
     $this->fieldpref = vartrue($user_pref['admin_pluginmanager_columns']) ? $user_pref['admin_pluginmanager_columns'] : array("plugin_icon", "plugin_name", "plugin_version", "plugin_description", "plugin_category", "plugin_author", "plugin_website", "plugin_notes");
     if ($this->action == 'avail' || $this->action == 'installed') {
         $this->pluginCheck();
     }
     if ($this->action == "uninstall") {
         $this->pluginUninstall();
     }
     if ($this->action == "install") {
         $this->pluginInstall();
         $this->action = "installed";
     }
     if ($this->action == "upgrade") {
         $this->pluginUpgrade();
         $this->action = "installed";
     }
     if ($this->action == "refresh") {
         $this->pluginRefresh();
     }
     if ($this->action == "upload") {
         $this->pluginUpload();
     }
     if ($this->action == "online") {
         $this->pluginOnline();
         return;
     }
     if (isset($_POST['install-selected'])) {
         foreach ($_POST['plugin_checkbox'] as $val) {
             $this->id = intval($val);
             $this->pluginInstall();
         }
         $this->action = "installed";
     }
     if ($this->action != 'avail' && varset($this->fields['plugin_checkboxes'])) {
         $this->fields['plugin_checkboxes'] = FALSE;
     }
     if ($this->action != 'upload' && $this->action != 'uninstall') {
         $this->pluginRenderList();
     }
 }
Example #19
0
 function setNewVersion()
 {
     global $pref;
     $e107 = e107::getInstance();
     $e107->sql->db_Update('plugin', "plugin_version = '{$this->newVersion}' WHERE plugin_name='Forum'", true);
     $pref['plug_installed']['forum'] = $this->newVersion;
     save_prefs();
     return "Forum Version updated to version: {$this->newVersion} <br />";
 }
Example #20
0
 function setNewVersion()
 {
     $pref = e107::getPref();
     $sql = e107::getDb();
     $sql->update('plugin', "plugin_version = '{$this->newVersion}' WHERE plugin_name='Forum'");
     $pref['plug_installed']['forum'] = $this->newVersion;
     save_prefs();
     return "Forum Version updated to version: {$this->newVersion} <br />";
 }
Example #21
0
 /**
  * Save the column visibility prefs for this mode
  *
  * @param $target - display mode
  * @return none
  */
 public function mailbodySaveColumnPref($target)
 {
     global $user_pref;
     if (!$target) {
         return;
     }
     if (!isset($this->tasks[$target])) {
         echo "Invalid prefs target: {$target}<br />";
         return;
     }
     if (isset($_POST['etrigger_ecolumns'])) {
         $user_pref['admin_mailout_columns'][$target] = $_POST['e-columns'];
         save_prefs('user');
         $this->fieldPref = $user_pref['admin_mailout_columns'][$target];
     }
 }
Example #22
0
 function show_existing_items($action, $sub_action, $id, $from, $amount)
 {
     global $sql, $rs, $ns, $tp, $mySQLdefaultdb, $pref;
     $text = "<div style='text-align:center'><div style='padding : 1px; " . ADMIN_WIDTH . "; margin-left: auto; margin-right: auto;'>";
     $sortorder = $pref['download_order'] ? $pref['download_order'] : "download_datestamp";
     $sortdirection = $pref['download_sort'] ? strtolower($pref['download_sort']) : "desc";
     if ($sortdirection != 'desc') {
         $sortdirection = 'asc';
     }
     if (isset($_POST['searchdisp'])) {
         $pref['admin_download_disp'] = implode("|", $_POST['searchdisp']);
         save_prefs();
     }
     if (!$pref['admin_download_disp']) {
         $search_display = array("download_name", "download_class");
     } else {
         $search_display = explode("|", $pref['admin_download_disp']);
     }
     $query = "SELECT d.*, dc.* FROM `#download` AS d\tLEFT JOIN `#download_category` AS dc ON dc. download_category_id  = d.download_category";
     if (isset($_POST['searchquery']) && $_POST['searchquery'] != "") {
         $query .= " WHERE  download_url REGEXP('" . $_POST['searchquery'] . "') OR download_author REGEXP('" . $_POST['searchquery'] . "') OR download_description  REGEXP('" . $_POST['searchquery'] . "') ";
         foreach ($search_display as $disp) {
             $query .= " OR {$disp} REGEXP('" . $_POST['searchquery'] . "') ";
         }
         $query .= " ORDER BY {$sortorder} {$sortdirection}";
     } else {
         $query .= " ORDER BY " . ($sub_action ? $sub_action : $sortorder) . " " . ($id ? $id : $sortdirection) . "  LIMIT {$from}, {$amount}";
     }
     if ($dl_count = $sql->db_Select_gen($query)) {
         $text .= $rs->form_open("post", e_SELF . "?" . e_QUERY, "myform") . "\n\t\t\t\t<table class='fborder' style='width:99%'>\n\t\t\t\t<tr>\n\t\t\t\t<td style='width:5%' class='fcaption'>ID</td>\n\t\t\t\t";
         // Search Display Column header.----------
         foreach ($search_display as $disp) {
             if ($disp == "download_name") {
                 // Toggle direction
                 $text .= "<td class='fcaption'><a href='" . e_SELF . "?main.download_name." . ($id == "desc" ? "asc" : "desc") . ".{$from}'>" . DOWLAN_27 . "</a></td>";
             } else {
                 $repl = array("download_", "_");
                 $text .= "<td class='fcaption'><a href='" . e_SELF . "?main.{$disp}." . ($id == "desc" ? "asc" : "desc") . ".{$from}'>" . ucwords(str_replace($repl, " ", $disp)) . "</a></td>";
             }
         }
         $text .= "<td style='width:10%' class='fcaption'>" . LAN_OPTIONS . "</td></tr>";
         while ($row = $sql->db_Fetch()) {
             $text .= "<tr><td style='width:5%;vertical-align:top' class='forumheader3'>" . $row['download_id'] . "</td>";
             // Display Chosen options
             foreach ($search_display as $disp) {
                 $text .= "<td class='forumheader3' style='vertical-align:top'>";
                 switch ($disp) {
                     case "download_name":
                         $text .= "<a href='" . e_BASE . "download.php?view." . $row['download_id'] . "'>" . $row['download_name'] . "</a>";
                         break;
                     case "download_category":
                         $text .= $row['download_category_name'] . "&nbsp;";
                         break;
                     case "download_datestamp":
                         $text .= $row[$disp] ? strftime($pref['shortdate'], $row[$disp]) . "&nbsp;" : "&nbsp";
                         break;
                     case "download_class":
                     case "download_visible":
                         $text .= r_userclass_name($row[$disp]) . "&nbsp;";
                         break;
                     case "download_filesize":
                         $text .= $row[$disp] ? round($row[$disp] / 1000) . " Kb&nbsp;" : "&nbsp";
                         break;
                     case "download_thumb":
                         $text .= $row[$disp] ? "<img src='" . e_FILE . "downloadthumbs/" . $row[$disp] . "' alt='' />" : "";
                         break;
                     case "download_image":
                         $text .= "<a rel='external' href='" . e_FILE . "downloadimages/" . $row[$disp] . "' >" . $row[$disp] . "</a>&nbsp;";
                         break;
                     case "download_description":
                         $text .= $tp->toHTML($row[$disp], TRUE) . "&nbsp;";
                         break;
                     case "download_active":
                         if ($row[$disp] == 1) {
                             $text .= "<img src='" . ADMIN_TRUE_ICON_PATH . "' title='" . DOWLAN_123 . "' alt='' style='cursor:help' />\n";
                         } elseif ($row[$disp] == 2) {
                             $text .= "<img src='" . ADMIN_TRUE_ICON_PATH . "' title='" . DOWLAN_124 . "' alt='' style='cursor:help' /><img src='" . ADMIN_TRUE_ICON_PATH . "' title='" . DOWLAN_124 . "' alt='' style='cursor:help' />\n";
                         } else {
                             $text .= "<img src='" . ADMIN_FALSE_ICON_PATH . "' title='" . DOWLAN_122 . "' alt='' style='cursor:help' />\n";
                         }
                         break;
                     case "download_comment":
                         $text .= $row[$disp] ? ADMIN_TRUE_ICON : "&nbsp;";
                         break;
                     default:
                         $text .= $row[$disp] . "&nbsp;";
                 }
                 $text .= "</td>";
             }
             $text .= "\n\t\t\t\t\t<td style='width:20%;vertical-align:top; text-align:center' class='forumheader3'>\n\t\t\t\t\t<a href='" . e_SELF . "?create.edit." . $row['download_id'] . "'>" . ADMIN_EDIT_ICON . "</a>\n\t\t\t\t\t<input type='image' title='" . LAN_DELETE . "' name='delete[main_" . $row['download_id'] . "]' src='" . ADMIN_DELETE_ICON_PATH . "' onclick=\"return jsconfirm('" . $tp->toJS(DOWLAN_33 . " [ID: " . $row['download_id'] . " ]") . "') \" />\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
         }
         $text .= "</table></form>";
     } else {
         // 'No downloads yet'
         $text .= "<div style='text-align:center'>" . DOWLAN_6 . "</div>";
     }
     $text .= "</div>";
     // Next-Previous.
     $downloads = $sql->db_Count("download");
     if ($downloads > $amount && !$_POST['searchquery']) {
         $parms = "{$downloads},{$amount},{$from}," . e_SELF . "?" . (e_QUERY ? "{$action}.{$sub_action}.{$id}." : "main.{$sortorder}.{$sortdirection}.") . "[FROM]";
         $text .= "<br />" . $tp->parseTemplate("{NEXTPREV={$parms}}");
     }
     // Search  & display options etc.
     $text .= "<br /><form method='post' action='" . e_SELF . "'>\n<p>\n<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />\n<input class='button' type='submit' name='searchsubmit' value='" . DOWLAN_51 . "' />\n</p>";
     $text .= "<div style='cursor:pointer' onclick=\"expandit('sdisp')\">" . LAN_DISPLAYOPT . "</div>";
     $text .= "<div id='sdisp' style='padding-top:4px;display:none;text-align:center;margin-left:auto;margin-right:auto'>\n\t\t<table class='forumheader3' style='width:95%'><tr>";
     $fields = mysql_list_fields($mySQLdefaultdb, MPREFIX . "download");
     $columns = mysql_num_fields($fields);
     for ($i = 0; $i < $columns; $i++) {
         $fname[] = mysql_field_name($fields, $i);
     }
     $m = 0;
     $replacechar = array("download_", "_");
     foreach ($fname as $fcol) {
         $checked = in_array($fcol, $search_display) ? "checked='checked'" : "";
         $text .= "<td style='text-align:left; padding:0px'>";
         $text .= "<input type='checkbox' name='searchdisp[]' value='" . $fcol . "' {$checked} />" . str_replace($replacechar, " ", $fcol) . "</td>\n";
         $m++;
         if ($m == 5) {
             $text .= "</tr><tr>";
             $m = 0;
         }
     }
     $text .= "</table></div>\n\t\t</form>\n\n\t\t</div>";
     $ns->tablerender(DOWLAN_7, $text);
 }
Example #23
0
 function pluginObserver()
 {
     global $user_pref, $admin_log;
     if (isset($_POST['upload'])) {
         $this->pluginProcessUpload();
         $this->action = 'avail';
     }
     if (isset($_POST['etrigger_ecolumns'])) {
         $user_pref['admin_pluginmanager_columns'] = $_POST['e-columns'];
         save_prefs('user');
     }
     $user_pref['admin_pluginmanager_columns'] = false;
     $this->fieldpref = vartrue($user_pref['admin_pluginmanager_columns']) ? $user_pref['admin_pluginmanager_columns'] : array("plugin_icon", "plugin_name", "plugin_version", "plugin_date", "plugin_description", "plugin_category", "plugin_compatible", "plugin_author", "plugin_website", "plugin_notes");
     foreach ($this->fields as $key => $val) {
         if (vartrue($val['forced']) && substr($key, 0, 6) == 'plugin') {
             $this->fieldpref[] = $key;
         }
     }
     if ($this->action == 'download') {
         $this->pluginDownload();
         return;
     }
     if ($this->action == 'avail' || $this->action == 'installed') {
         $this->pluginCheck();
     }
     if ($this->action == "uninstall") {
         $this->pluginUninstall();
         $this->pluginCheck(true);
         // forced
     }
     if ($this->action == "refresh") {
         $this->pluginCheck(true);
         // forced
     }
     if ($this->action == "install" || $this->action == "refresh") {
         $this->pluginInstall();
         $this->action = "installed";
     }
     if ($this->action == 'create') {
         $pc = new pluginBuilder();
         return;
     }
     if ($this->action == 'lans') {
         $pc = new pluginLanguage();
         return;
     }
     if ($this->action == "upgrade") {
         $this->pluginUpgrade();
         $this->action = "installed";
     }
     if ($this->action == "refresh") {
         $this->pluginRefresh();
     }
     if ($this->action == "upload") {
         $this->pluginUpload();
     }
     if ($this->action == "online") {
         $this->pluginOnline();
         return;
     }
     //	print_a($_POST);
     if (isset($_POST['install-selected'])) {
         foreach ($_POST['multiselect'] as $val) {
             $this->id = intval($val);
             $this->pluginInstall();
         }
         $this->action = "installed";
     }
     if ($this->action != 'avail' && varset($this->fields['checkboxes'])) {
         unset($this->fields['checkboxes']);
         //  = FALSE;
     }
     if ($this->action != 'upload' && $this->action != 'uninstall') {
         $this->pluginRenderList();
     }
 }
Example #24
0
 function dboptions()
 {
     global $tp, $pref;
     $admin_log = e107::getLog();
     $temp = array();
     $temp['rss_othernews'] = $_POST['rss_othernews'];
     $temp['rss_summarydiz'] = $_POST['rss_summarydiz'];
     $temp['rss_shownewsimage'] = $_POST['rss_shownewsimage'];
     if ($admin_log->logArrayDiffs($temp, $pref, 'RSS_06')) {
         save_prefs();
         // Only save if changes
         return LAN_SAVED;
     } else {
         return RSS_LAN_ADMIN_28;
     }
 }
Example #25
0
function update_70x_to_706($type = '')
{
    global $sql, $ns, $pref, $e107info, $admin_log, $emessage;
    $just_check = $type == 'do' ? FALSE : TRUE;
    if (!$sql->db_Field("plugin", 5)) {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "plugin` ADD `plugin_addons` TEXT NOT NULL ;");
        catch_error($sql);
    }
    //rename plugin_rss field
    if ($sql->db_Field("plugin", 5) == "plugin_rss") {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "plugin` CHANGE `plugin_rss` `plugin_addons` TEXT NOT NULL;");
        catch_error($sql);
    }
    if ($sql->db_Field("dblog", 5) == "dblog_query") {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "dblog` CHANGE `dblog_query` `dblog_title` VARCHAR( 255 ) NOT NULL DEFAULT '';");
        catch_error($sql);
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "dblog` CHANGE `dblog_remarks` `dblog_remarks` TEXT NOT NULL;");
        catch_error($sql);
    }
    if (!$sql->db_Field("plugin", "plugin_path", "UNIQUE")) {
        if ($just_check) {
            return update_needed();
        }
        if (!$sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "plugin` ADD UNIQUE (`plugin_path`);")) {
            $mesg = LAN_UPDATE_12 . " : <a href='" . e_ADMIN . "db.php?plugin'>" . ADLAN_145 . "</a>.";
            //$ns -> tablerender(LAN_ERROR,$mes);
            $emessage->add($mesg, E_MESSAGE_ERROR);
            catch_error($sql);
        }
    }
    if (!$sql->db_Field("online", 6)) {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE " . MPREFIX . "online ADD online_active INT(10) UNSIGNED NOT NULL DEFAULT '0'");
        catch_error($sql);
    }
    if ($sql->db_Query("SHOW INDEX FROM " . MPREFIX . "tmp")) {
        $row = $sql->db_Fetch();
        if (!in_array('tmp_ip', $row)) {
            if ($just_check) {
                return update_needed();
            }
            $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "tmp` ADD INDEX `tmp_ip` (`tmp_ip`);");
            $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "upload` ADD INDEX `upload_active` (`upload_active`);");
            $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "generic` ADD INDEX `gen_type` (`gen_type`);");
        }
    }
    if (!$just_check) {
        // update new fields
        require_once e_HANDLER . "plugin_class.php";
        $ep = new e107plugin();
        $ep->update_plugins_table('update');
        $ep->save_addon_prefs('update');
    }
    if (!isset($pref['displayname_maxlength'])) {
        if ($just_check) {
            return update_needed();
        }
        $pref['displayname_maxlength'] = 15;
        save_prefs();
    }
    // If we get to here, in checking mode no updates are required. In update mode, all done.
    if ($just_check) {
        return TRUE;
    }
    e107::getLog()->add('UPDATE_02', LAN_UPDATE_14 . $e107info['e107_version'], E_LOG_INFORMATIVE, '');
    // Log result of actual update
    return $just_check;
    // TRUE if no updates needed, FALSE if updates needed and completed
}
Example #26
0
    require "./apply_filters.php";
    $UM->mail_disconnect();
    if ($require_update) {
        mail_connect();
        require "./get_message_list.php";
        $UM->mail_disconnect();
    }
}
if (!is_array($headers = $sess["headers"][$folder_key])) {
    redirect("messages.php?folder={$folder}&pag={$pag}&sid={$sid}&tid={$tid}&lid={$lid}\r\n");
}
array_qsort2($headers, $sortby, $sortorder);
$sess["headers"][$folder_key] = $headers;
$SS->Save($sess);
if ($check_first_login && !$prefs["first-login"]) {
    $prefs["first-login"] = 1;
    save_prefs($prefs);
    redirect("preferences.php?sid={$sid}&tid={$tid}&lid={$lid}&folder=" . urlencode($folder));
    exit;
}
if (!isset($pag) || !is_numeric(trim($pag))) {
    $pag = 1;
}
$refreshurl = "messages.php?sid={$sid}&tid={$tid}&lid={$lid}&folder=" . urlencode($folder) . "&pag={$pag}";
if (isset($back_to)) {
    if (count($headers) > $back_to) {
        redirect("readmsg.php?folder=" . urlencode($folder) . "&pag={$pag}&ix={$back_to}&sid={$sid}&tid={$tid}&lid={$lid}");
        exit;
    }
}
redirect($refreshurl);
Example #27
0
 function page()
 {
     global $pref, $user_pref, $admin_log;
     if (isset($_POST['etrigger_ecolumns'])) {
         $user_pref['admin_cpage_columns'] = $_POST['e-columns'];
         save_prefs('user');
     }
     $this->fieldpref = varset($user_pref['admin_cpage_columns']) ? $user_pref['admin_cpage_columns'] : array("page_id", "page_title", "page_theme");
     $this->fields = array('page_id' => array('title' => 'ID', 'width' => '5%', 'forced' => TRUE), 'page_title' => array('title' => LAN_TITLE, 'type' => 'text', 'width' => 'auto'), 'page_theme' => array('title' => CUSLAN_2, 'type' => 'text', 'width' => 'auto', 'nolist' => true), 'page_template' => array('title' => 'Template', 'type' => 'text', 'width' => 'auto'), 'page_author' => array('title' => LAN_AUTHOR, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'), 'page_datestamp' => array('title' => LAN_DATE, 'type' => 'datestamp', 'width' => 'auto'), 'page_class' => array('title' => LAN_USERCLASS, 'type' => 'userclass', 'width' => 'auto', 'filter' => true, 'batch' => true), 'page_rating_flag' => array('title' => LAN_RATING, 'type' => 'boolean', 'width' => '10%', 'thclass' => 'center', 'class' => 'center'), 'page_comment_flag' => array('title' => ADLAN_114, 'type' => 'boolean', 'width' => '10%', 'thclass' => 'center', 'class' => 'center'), 'options' => array('title' => LAN_OPTIONS, 'forced' => TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center'));
     // $this->fieldpref = array("page_id","page_title","page_author","page_class");
 }
Example #28
0
File: db.php Project: notzen/e107
 /**
  * Preferences Editor
  * @return none
  */
 private function scan_override()
 {
     global $pref, $emessage;
     require_once e_HANDLER . 'file_class.php';
     $f = new e_file();
     $scList = '';
     $fList = $f->get_files(e_CORE . 'override/shortcodes', '\\.sc$');
     if (count($fList)) {
         $tmp = array();
         foreach ($fList as $file) {
             $tmp[] = strtoupper(substr($file['fname'], 0, -3));
         }
         $scList = implode(',', $tmp);
         unset($tmp);
     }
     $pref['sc_override'] = $scList;
     save_prefs();
     //	$emessage->add(DBLAN_57.':<br />'.$pref['sc_override'], E_MESSAGE_SUCCESS);
     e107::getRender()->tablerender(DBLAN_56, DBLAN_57 . ':<br />' . $pref['sc_override']);
 }
Example #29
0
/*
 * e107 website system
 *
 * Copyright (C) 2008-2013 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
*/
require_once '../../class2.php';
if (!getperms('1')) {
    header('location:' . e_BASE . 'index.php');
    exit;
}
require_once e_HANDLER . 'userclass_class.php';
include_lan(e_PLUGIN . 'newforumposts_main/languages/' . e_LANGUAGE . '.php');
require_once e_ADMIN . 'auth.php';
$frm = e107::getForm();
$mes = e107::getMessage();
if (isset($_POST['updatesettings'])) {
    $pref['nfp_display'] = intval($_POST['nfp_display']);
    $pref['nfp_caption'] = $tp->toDB($_POST['nfp_caption']);
    $pref['nfp_amount'] = intval($_POST['nfp_amount']);
    $pref['nfp_layer'] = intval(vartrue($_POST['nfp_layer']));
    $pref['nfp_posts'] = intval(vartrue($_POST['nfp_posts']));
    $pref['nfp_layer_height'] = intval($_POST['nfp_layer_height'] ? $_POST['nfp_layer_height'] : 200);
    save_prefs();
}
$ns->tablerender($caption, $mes->render() . $text);
$text = "\n\t<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='menu_conf_form'>\n\t<table class='table adminform'>\t \n\t<colgroup span='2'>\n\t\t<col class='col-label' />\n\t\t<col class='col-control' />\n\t</colgroup>\n\t<tr>\n\t\t<td>" . NFPM_L4 . "</td>\n\t\t<td>" . $frm->select('nfp_display', array(0 => NFPM_L5, 1 => NFPM_L6, 2 => NFPM_L7), $pref['nfp_display']) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . NFPM_L8 . ":</td>\n\t\t<td>" . $frm->text('nfp_caption', $pref['nfp_caption'], '100', array('class' => 'tbox input-text span3')) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td>" . NFPM_L9 . ": </td>\n\t\t<td>" . $frm->text('nfp_amount', $pref['nfp_amount'], '3') . "</td>\n\t</tr>\t \n\t<tr>\n\t\t<td>" . NFPM_L14 . "</td>\n\t\t<td>" . $frm->radio_switch('nfp_posts', $pref['nfp_posts'], LAN_YES, LAN_NO) . "<span class='field-help'>" . NFPM_L15 . "</span></td>\n\t</tr>\t \n\t<tr>\n\t\t<td>" . NFPM_L10 . "</td>\n\t\t<td>" . $frm->radio_switch('nfp_layer', $pref['nfp_layer'], LAN_YES, LAN_NO) . "<br />\n\t\t" . NFPM_L11 . ": " . $frm->text('nfp_layer_height', $pref['nfp_layer_height'], '3') . "</td>\n\t</tr>\n\t</table>\n\t<div class='buttons-bar center'>\n\t\t" . $frm->admin_button('updatesettings', LAN_UPDATE, 'update') . "\n\t</div>\n\t</form>";
$ns->tablerender(NFPM_L12, $text);
require_once e_ADMIN . "footer.php";
Example #30
0
if (isset($f_real_name)) {
    $myprefs["real-name"] = $f_real_name;
    $myprefs["reply-to"] = $f_reply_to;
    $myprefs["save-to-trash"] = $f_save_trash;
    $myprefs["st-only-read"] = $f_st_only_read;
    $myprefs["empty-trash"] = $f_empty_on_exit;
    $myprefs["save-to-sent"] = $f_save_sent;
    $myprefs["rpp"] = $f_rpp;
    $myprefs["add-sig"] = $f_add_sig;
    $myprefs["signature"] = $f_sig;
    $myprefs["timezone"] = $f_timezone;
    $myprefs["display-images"] = $f_display_images;
    $myprefs["editor-mode"] = $f_editor_mode;
    $myprefs["refresh-time"] = $f_refresh_time;
    $myprefs["first-login"] = 1;
    save_prefs($myprefs);
    unset($myprefs);
}
$prefs = load_prefs();
$jssource = "\n\n<script language=\"JavaScript\">\ndisbl = false;\nfunction newmsg() { location = 'newmsg.php?pag={$pag}&folder=" . urlencode($folder) . "&sid={$sid}&tid={$tid}&lid={$lid}'; }\nfunction folderlist() { location = 'folders.php?folder=" . urlencode($folder) . "&sid={$sid}&tid={$tid}&lid={$lid}'}\nfunction goend() { location = 'logout.php?sid={$sid}&tid={$tid}&lid={$lid}'; }\nfunction goinbox() { location = 'messages.php?folder=inbox&sid={$sid}&tid={$tid}&lid={$lid}'; }\nfunction search() { location = 'search.php?sid={$sid}&tid={$tid}&lid={$lid}'; }\nfunction emptytrash() {\tlocation = 'folders.php?empty=trash&folder=" . urlencode($folder) . "&goback=true&sid={$sid}&tid={$tid}&lid={$lid}';}\nfunction addresses() { location = 'addressbook.php?sid={$sid}&tid={$tid}&lid={$lid}'; }\nfunction dis() { \n\twith(document.forms[0]) { \n\t\tf_st_only_read.disabled = !f_save_trash.checked; \n\t\tif(f_st_only_read.checked) f_st_only_read.checked = f_save_trash.checked; \n\t\tdisbl = !f_save_trash.checked\n\t} \n}\nfunction checkDis() { if (disbl) return false; }\n</script>\n\n";
$smarty->assign("umJS", $jssource);
$smarty->assign("umSid", $sid);
$smarty->assign("umLid", $lid);
$smarty->assign("umTid", $tid);
$aval_rpp = array(10, 20, 30, 40, 50, 100, 200);
$sel_rpp = "<select name=f_rpp>\r";
for ($i = 0; $i < count($aval_rpp); $i++) {
    $selected = $prefs["rpp"] == $aval_rpp[$i] ? " selected" : "";
    $sel_rpp .= "<option value=" . $aval_rpp[$i] . $selected . ">" . $aval_rpp[$i] . "\r";
}
$sel_rpp .= "</select>";