Ejemplo n.º 1
0
/**
 * This function creates a Group of Overlay Form
 *
 * Creates a Form for a group of overlay using the supplied defaults (if specified).
 *
 * @param array $group array of values describing a group of overlay
 * @return string HTML string of overlay form
 */
function MAPS_getGroupOverlayForm($group = array())
{
    global $_CONF, $_TABLES, $_MAPS_CONF, $LANG_MAPS_1, $LANG_configselects, $LANG_ACCESS, $_USER, $_GROUPS, $_SCRIPTS;
    $display = COM_startBlock('<h1>' . $LANG_MAPS_1['group_edit'] . ' ' . $group['o_group_name'] . '</h1>');
    $template = COM_newTemplate($_CONF['path'] . 'plugins/maps/templates');
    $template->set_file(array('map' => 'group_overlay_form.thtml'));
    $template->set_var('yes', $LANG_MAPS_1['yes']);
    $template->set_var('no', $LANG_MAPS_1['no']);
    //informations
    $template->set_var('group_overlay_presentation', $LANG_MAPS_1['group_overlay_presentation']);
    $template->set_var('informations', $LANG_MAPS_1['informations']);
    $template->set_var('name_label', $LANG_MAPS_1['group_overlay_name_label']);
    $template->set_var('name', stripslashes($group['o_group_name']));
    $template->set_var('required_field', $LANG_MAPS_1['required_field']);
    //Form validation
    $template->set_var('save_button', $LANG_MAPS_1['save_button']);
    if ($group['o_group_id'] > 0) {
        $template->set_var('delete_button', '<option value="delete">' . $LANG_MAPS_1['delete_button'] . '</option>');
    } else {
        $template->set_var('delete_button', '');
    }
    $template->set_var('ok_button', $LANG_MAPS_1['ok_button']);
    if (isset($group['o_group_id'])) {
        $template->set_var('o_group_id', '<input type="hidden" name="o_group_id" value="' . $group['o_group_id'] . '" />');
    } else {
        $template->set_var('o_group_id', '');
    }
    $display .= $template->parse('output', 'map');
    $display .= COM_endBlock();
    return $display;
}
Ejemplo n.º 2
0
/**
* Adds an event to the user's calendar
*
* The user has asked that an event be added to their personal
* calendar.  Show a confirmation screen.
*
* @param    string  $eid    event ID to add to user's calendar
* @return   string          HTML for confirmation form
*
*/
function adduserevent($eid)
{
    global $_CONF, $_TABLES, $LANG_CALJP_1;
    $retval = '';
    $eventsql = "SELECT * FROM {$_TABLES['eventsjp']} WHERE eid='{$eid}'" . COM_getPermSql('AND');
    $result = DB_query($eventsql);
    $nrows = DB_numRows($result);
    if ($nrows == 1) {
        $retval .= COM_startBlock(sprintf($LANG_CALJP_1[11], COM_getDisplayName()));
        $A = DB_fetchArray($result);
        $cal_template = COM_newTemplate($_CONF['path'] . 'plugins/calendarjp/templates/');
        $cal_template->set_file(array('addevent' => 'addevent.thtml'));
        $cal_template->set_var('intro_msg', $LANG_CALJP_1[8]);
        $cal_template->set_var('lang_event', $LANG_CALJP_1[12]);
        $event_title = stripslashes($A['title']);
        if (!empty($A['url']) && $A['url'] != 'http://') {
            $event_title_and_url = COM_createLink($event_title, $A['url'], array('class' => 'url'));
            $cal_template->set_var('event_url', $A['url']);
            $cal_template->set_var('event_begin_anchortag', '<a href="' . $A['url'] . '" class="url">');
            $cal_template->set_var('event_end_anchortag', '</a>');
        } else {
            $event_title_and_url = $event_title;
            $cal_template->set_var('event_url', '');
            $cal_template->set_var('event_begin_anchortag', '');
            $cal_template->set_var('event_end_anchortag', '');
        }
        $cal_template->set_var('event_title', $event_title_and_url);
        $cal_template->set_var('event_title_only', $event_title);
        $cal_template->set_var('lang_starts', $LANG_CALJP_1[13]);
        $cal_template->set_var('lang_ends', $LANG_CALJP_1[14]);
        $thestart = COM_getUserDateTimeFormat($A['datestart'] . ' ' . $A['timestart']);
        $theend = COM_getUserDateTimeFormat($A['dateend'] . ' ' . $A['timeend']);
        if ($A['allday'] == 0) {
            $cal_template->set_var('event_start', $thestart[0]);
            $cal_template->set_var('event_end', $theend[0]);
        } else {
            $cal_template->set_var('event_start', strftime($_CONF['shortdate'], $thestart[1]));
            $cal_template->set_var('event_end', strftime($_CONF['shortdate'], $theend[1]));
        }
        $cal_template->set_var('lang_where', $LANG_CALJP_1[4]);
        $location = stripslashes($A['location']) . '<br' . XHTML . '>' . stripslashes($A['address1']) . '<br' . XHTML . '>' . stripslashes($A['address2']) . '<br' . XHTML . '>' . stripslashes($A['city']) . ', ' . stripslashes($A['state']) . ' ' . $A['zipcode'];
        $cal_template->set_var('event_location', $location);
        $cal_template->set_var('lang_description', $LANG_CALJP_1[5]);
        $description = stripslashes($A['description']);
        if (empty($A['postmode']) || $A['postmode'] == 'plaintext') {
            $description = COM_nl2br($description);
        }
        $cal_template->set_var('event_description', PLG_replaceTags($description));
        $cal_template->set_var('event_id', $eid);
        $cal_template->set_var('lang_addtomycalendar', $LANG_CALJP_1[9]);
        $cal_template->set_var('gltoken_name', CSRF_TOKEN);
        $cal_template->set_var('gltoken', SEC_createToken());
        $cal_template->parse('output', 'addevent');
        $retval .= $cal_template->finish($cal_template->get_var('output'));
        $retval .= COM_endBlock();
    } else {
        $retval .= COM_showMessage(23);
    }
    return $retval;
}
Ejemplo n.º 3
0
function MG_saveEnroll()
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG03;
    if ($_MG_CONF['member_albums'] != 1) {
        echo COM_refresh($_MG_CONF['site_url'] . '/index.php');
        exit;
    }
    if (!isset($_MG_CONF['member_quota'])) {
        $_MG_CONF['member_quota'] = 0;
    }
    $sql = "SELECT album_id FROM {$_TABLES['mg_albums']} " . "WHERE owner_id=" . intval($_USER['uid']) . " AND album_parent=" . intval($_MG_CONF['member_album_root']);
    $result = DB_query($sql);
    $nRows = DB_numRows($result);
    if ($nRows > 0) {
        $display = COM_startBlock('', '', COM_getBlockTemplate('_msg_block', 'header'));
        $display .= $LANG_MG03['existing_member_album'];
        $display .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        $display = MG_createHTMLDocument($display);
        COM_output($display);
        exit;
    }
    $uid = $_USER['uid'];
    $aid = plugin_user_create_mediagallery($uid, 1);
    DB_change($_TABLES['mg_userprefs'], 'member_gallery', 1, 'uid', $uid);
    DB_change($_TABLES['mg_userprefs'], 'quota', intval($_MG_CONF['member_quota']), 'uid', $uid);
    if (DB_error()) {
        $sql = "INSERT INTO {$_TABLES['mg_userprefs']} " . "(uid, active, display_rows, display_columns, mp3_player, playback_mode, tn_size, quota, member_gallery) " . "VALUES (" . $uid . ",1,0,0,-1,-1,-1," . intval($_MG_CONF['member_quota']) . ",1)";
        DB_query($sql, 1);
    }
    echo COM_refresh($_MG_CONF['site_url'] . '/album.php?aid=' . $aid);
    exit;
}
Ejemplo n.º 4
0
/**
* Shows all polls in system
*
* List all the polls on the system if no $pid is provided
*
* @return   string          HTML for poll listing
*
*/
function polllist()
{
    global $_CONF, $_TABLES, $_USER, $_PO_CONF, $LANG25, $LANG_LOGIN, $LANG_POLLS;
    $retval = '';
    if (empty($_USER['username']) && ($_CONF['loginrequired'] == 1 || $_PO_CONF['pollsloginrequired'] == 1)) {
        $retval = COM_startBlock($LANG_LOGIN[1], '', COM_getBlockTemplate('_msg_block', 'header'));
        $login = new Template($_CONF['path_layout'] . 'submit');
        $login->set_file(array('login' => 'submitloginrequired.thtml'));
        $login->set_var('xhtml', XHTML);
        $login->set_var('login_message', $LANG_LOGIN[2]);
        $login->set_var('site_url', $_CONF['site_url']);
        $login->set_var('lang_login', $LANG_LOGIN[3]);
        $login->set_var('lang_newuser', $LANG_LOGIN[4]);
        $login->parse('output', 'login');
        $retval .= $login->finish($login->get_var('output'));
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
    } else {
        require_once $_CONF['path_system'] . 'lib-admin.php';
        $header_arr = array(array('text' => $LANG25[9], 'field' => 'topic', 'sort' => true), array('text' => $LANG25[20], 'field' => 'voters', 'sort' => true), array('text' => $LANG25[3], 'field' => 'unixdate', 'sort' => true), array('text' => $LANG_POLLS['open_poll'], 'field' => 'is_open', 'sort' => true));
        $defsort_arr = array('field' => 'unixdate', 'direction' => 'desc');
        $text_arr = array('has_menu' => false, 'title' => $LANG_POLLS['pollstitle'], 'instructions' => "", 'icon' => '', 'form_url' => '');
        $query_arr = array('table' => 'polltopics', 'sql' => $sql = "SELECT *,UNIX_TIMESTAMP(date) AS unixdate, display " . "FROM {$_TABLES['polltopics']} WHERE 1=1", 'query_fields' => array('topic'), 'default_filter' => COM_getPermSQL(), 'query' => '', 'query_limit' => 0);
        $retval .= ADMIN_list('polls', 'plugin_getListField_polls', $header_arr, $text_arr, $query_arr, $defsort_arr);
    }
    return $retval;
}
Ejemplo n.º 5
0
/**
* Prints the user submission lists at the top
*
* @param    string  $token  CSRF token
* @return   string          HTML for the C&C block
*
*/
function usersubmissions($token)
{
    global $_CONF, $_TABLES, $LANG_ADMIN, $LANG29, $_IMAGE_TYPE;
    require_once $_CONF['path_system'] . 'lib-admin.php';
    $retval = '';
    // writing the menu on top
    $menu_arr = array(array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
    $retval .= COM_startBlock($LANG29[13], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= ADMIN_createMenu($menu_arr, $LANG29['submissions_desc'], $_CONF['layout_url'] . '/images/icons/moderation.' . $_IMAGE_TYPE);
    // IMPORTANT - If any of the below submission lists change, please
    // update the function SEC_hasModerationAccess in lib-security.php to
    // reflect the changes
    if (SEC_hasRights('story.moderate')) {
        $retval .= itemlist('story', $token);
    }
    if ($_CONF['listdraftstories'] == 1) {
        if (SEC_hasRights('story.edit')) {
            $retval .= itemlist('story_draft', $token);
        }
    }
    if ($_CONF['commentsubmission'] == 1) {
        if (SEC_hasRights('comment.moderate')) {
            $retval .= itemlist('comment', $token);
        }
    }
    if ($_CONF['usersubmission'] == 1) {
        if (SEC_hasRights('user.edit') && SEC_hasRights('user.delete')) {
            $retval .= userlist($token);
        }
    }
    $retval .= PLG_showModerationList($token);
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 6
0
function forum_admin_list()
{
    global $_TABLES, $LANG_ADMIN, $LANG_GF00, $LANG_GF91, $LANG_GF06, $_CONF, $_FF_CONF;
    USES_lib_admin();
    $retval = '';
    $selected = '';
    $menu_arr = array();
    $admin_list = new Template($_CONF['path'] . 'plugins/forum/templates/admin/');
    $admin_list->set_file('admin-list', 'index.thtml');
    $admin_list->set_var('block_start', COM_startBlock($LANG_GF91['gfstats']));
    $menu_arr = FF_adminNav($LANG_GF06['1']);
    $admin_list->set_var('admin_menu', ADMIN_createMenu($menu_arr, $LANG_GF00['instructions'], $_CONF['site_url'] . '/forum/images/forum.png'));
    // CATEGORIES
    $numcats = DB_query("SELECT id FROM {$_TABLES['ff_categories']}");
    $totalcats = DB_numRows($numcats);
    // FORUMS
    $numforums = DB_query("SELECT forum_id FROM {$_TABLES['ff_forums']}");
    $totalforums = DB_numRows($numforums);
    // TOPICS
    $numtopics = DB_query("SELECT id FROM {$_TABLES['ff_topic']} WHERE pid = 0");
    $totaltopics = DB_numRows($numtopics);
    // POSTS
    $numposts = DB_query("SELECT id FROM {$_TABLES['ff_topic']}");
    $totalposts = DB_numRows($numposts);
    // VIEWS
    $numviews = DB_query("SELECT SUM(views) AS TOTAL FROM {$_TABLES['ff_topic']}");
    $totalviews = DB_fetchArray($numviews);
    // AVERAGE POSTS
    if ($totalposts != 0) {
        $avgcposts = $totalposts / $totalcats;
        $avgcposts = round($avgcposts);
        $avgfposts = $totalposts / $totalforums;
        $avgfposts = round($avgfposts);
        $avgtposts = $totalposts / $totaltopics;
        $avgtposts = round($avgtposts);
    } else {
        $avgcposts = 0;
        $avgfposts = 0;
        $avgtposts = 0;
    }
    // AVERAGE VIEWS
    if ($totalviews['TOTAL'] != 0) {
        $avgcviews = $totalviews['TOTAL'] / $totalcats;
        $avgcviews = round($avgcviews);
        $avgfviews = $totalviews['TOTAL'] / $totalforums;
        $avgfviews = round($avgfviews);
        $avgtviews = $totalviews['TOTAL'] / $totaltopics;
        $avgtviews = round($avgtviews);
    } else {
        $avgcviews = 0;
        $avgfviews = 0;
        $avgtviews = 0;
    }
    $admin_list->set_var(array('statsmsg' => $LANG_GF91['statsmsg'], 'totalcatsmsg' => $LANG_GF91['totalcats'], 'totalcats' => $totalcats, 'totalforumsmsg' => $LANG_GF91['totalforums'], 'totalforums' => $totalforums, 'totaltopicsmsg' => $LANG_GF91['totaltopics'], 'totaltopics' => $totaltopics, 'totalpostsmsg' => $LANG_GF91['totalposts'], 'totalposts' => $totalposts, 'totalviewsmsg' => $LANG_GF91['totalviews'], 'totalviews' => $totalviews['TOTAL'], 'category' => $LANG_GF91['category'], 'forum' => $LANG_GF91['forum'], 'topic' => $LANG_GF91['topic'], 'avgpmsg' => $LANG_GF91['avgpmsg'], 'avgcposts' => $avgcposts, 'avgfposts' => $avgfposts, 'avgtposts' => $avgtposts, 'avgvmsg' => $LANG_GF91['avgvmsg'], 'avgcviews' => $avgcviews, 'avgfviews' => $avgfviews, 'avgtviews' => $avgtviews));
    $admin_list->set_var('block_end', COM_endBlock());
    $admin_list->parse('output', 'admin-list');
    $retval .= $admin_list->finish($admin_list->get_var('output'));
    return $retval;
}
Ejemplo n.º 7
0
function MG_access_denied()
{
    global $LANG_MG00, $LANG_ACCESS;
    $display = COM_startBlock($LANG_ACCESS['accessdenied'], '', COM_getBlockTemplate('_msg_block', 'header')) . '<br' . XHTML . '>' . $LANG_MG00['access_denied_msg'] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
    $display = MG_createHTMLDocument($display);
    COM_output($display);
    exit;
}
Ejemplo n.º 8
0
function MG_quotaReport($page, $quotaquery, $usedquery)
{
    global $_TABLES, $_MG_CONF, $_CONF, $LANG_MG01, $LANG_MG03;
    $counter = 0;
    $rowcounter = 1;
    $retval = '';
    $start = $page * 50;
    $end = 50;
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file(array('report' => 'quotareport.thtml'));
    $retval .= COM_startBlock('', '', COM_getBlockTemplate('_admin_block', 'header'));
    $T->set_var(array('lang_username' => $LANG_MG01['username'], 'lang_active' => $LANG_MG01['active'], 'lang_quota' => $LANG_MG01['quota'], 'lang_used' => $LANG_MG01['used']));
    $T->set_block('report', 'UserRow', 'uRow');
    if ($quotaquery > 0) {
        $quotaselect = $quotaquery * 1048676;
    } else {
        $quotaselect = 0;
    }
    $tres = DB_query("SELECT COUNT(gl.uid) AS count FROM {$_TABLES['users']} AS gl LEFT JOIN {$_TABLES['mg_userprefs']} AS mg ON gl.uid=mg.uid WHERE gl.status = 3 AND gl.uid > 2 AND mg.member_gallery=1 AND mg.quota >= " . $quotaselect);
    $trow = DB_fetchArray($tres);
    $total_records = $trow['count'];
    $sql = "SELECT gl.uid,  gl.status, gl.username, gl.fullname, mg.member_gallery, mg.quota FROM {$_TABLES['users']} AS gl LEFT JOIN {$_TABLES['mg_userprefs']} AS mg ON gl.uid=mg.uid WHERE gl.status = 3 AND gl.uid > 2 AND mg.member_gallery=1 AND mg.quota >= " . $quotaselect . " ORDER BY gl.username ASC LIMIT {$start},{$end}";
    $result = DB_query($sql);
    while ($userRow = DB_fetchArray($result)) {
        $uid = $userRow['uid'];
        $quota_mb = MG_getUserQuota($uid) / 1048676;
        $quota = number_format($quota_mb, 2);
        $used_mb = (double) MG_quotaUsage($uid) / 1048576;
        $used = number_format($used_mb, 2);
        if ($quotaquery > 0) {
            // limit based on quota
            if ($quota_mb >= $quotaquery) {
                $show = 1;
            } else {
                $show = 0;
            }
        } else {
            $show = 1;
        }
        if ($show) {
            $T->set_var(array('result_row' => $rowcounter, 'rowclass' => $rowcounter % 2 ? '2' : '1', 'username' => '<a href="' . $_MG_CONF['admin_url'] . 'edituser.php?uid=' . $uid . '">' . $userRow['username'] . " (" . $userRow['fullname'] . ")</a>", 'uid' => $uid, 'quota' => $quota == 0 ? 'Unlimited' : $quota, 'used' => $used, 'active' => MG_getUserActive($uid)));
            $T->parse('uRow', 'UserRow', true);
            $rowcounter++;
            $counter++;
        }
    }
    $T->set_var(array('site_admin_url' => $_MG_CONF['admin_url'], 'used' => $usedquery, 'quota' => $quotaquery, 'lang_go' => $LANG_MG03['go'], 'lang_quota' => $LANG_MG01['quota'], 'lang_used' => $LANG_MG01['used'], 'lang_batch_update' => $LANG_MG01['batch_quota_update'], 'lang_update' => $LANG_MG01['update'], 'pagenav' => COM_printPageNavigation($_MG_CONF['admin_url'] . 'quotareport.php', $page + 1, ceil($total_records / 50))));
    $T->parse('output', 'report');
    $retval .= $T->finish($T->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 9
0
function MG_invalidRequest()
{
    global $LANG_MG02, $_CONF, $_MG_CONF;
    $retval = '';
    $retval .= COM_startBlock($LANG_MG02['error_header'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $T = new Template($_MG_CONF['template_path']);
    $T->set_file('admin', 'error.thtml');
    $T->set_var('errormessage', $LANG_MG02['generic_error']);
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 10
0
function display_hello($hello_id)
{
    global $_CONF, $_TABLES, $LANG_HELLO01;
    $display = COM_startBlock($LANG_HELLO01['email'] . ' #' . $hello_id);
    // generate the display from the template
    $display_hello = new Template($_CONF['path'] . 'plugins/hello/templates/admin');
    $display_hello->set_file(array('display_hello' => 'hello_display.thtml'));
    $requete = "SELECT content FROM {$_TABLES['hello']} WHERE hello_id = " . $hello_id . " limit 1";
    $result_objet_cherche = DB_query($requete);
    $objet_cherche = DB_fetchArray($result_objet_cherche);
    $display_hello->set_var('hello_display', stripslashes($objet_cherche[0]));
    $display .= $display_hello->parse('output', 'display_hello');
    $display .= COM_endBlock();
    // return results
    return $display;
}
Ejemplo n.º 11
0
/**
 * Returns admin menu display
 *
 * Generates the admin menu from the template and returns the result as a string of HTML
 *
 * @return string HTML of admin menu
 */
function CLASSIFIEDS_admin_menu()
{
    global $_CONF, $LANG_CLASSIFIEDS_1, $_TABLES;
    $retval = COM_startBlock();
    // generate the menu from the template
    $menu = new Template($_CONF['path'] . 'plugins/classifieds/templates/menus');
    $menu->set_file(array('menu' => 'admin_menu.thtml'));
    $menu->set_var('site_url', $_CONF['site_url']);
    $menu->set_var('classifieds', $LANG_CLASSIFIEDS_1['plugin_name']);
    $menu->set_var('classifieds_list', $LANG_CLASSIFIEDS_1['classifieds_list']);
    $menu->set_var('categories_list', $LANG_CLASSIFIEDS_1['categories_list']);
    $retval .= $menu->parse('output', 'menu');
    $retval .= COM_endBlock();
    // retval results
    return $retval;
}
Ejemplo n.º 12
0
/**
*   Build the admin list of pages
*   @return string      HTML content
*/
function EXP_adminList()
{
    global $_CONF, $_TABLES, $LANG_ADMIN, $LANG_ACCESS, $_CONF_EXP, $LANG_EX00;
    USES_lib_admin();
    $retval = '';
    $header_arr = array(array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false), array('text' => 'Page ID', 'field' => 'exid', 'sort' => true), array('text' => 'Title', 'field' => 'title', 'sort' => true), array('text' => 'URL', 'field' => 'url', 'sort' => true), array('text' => 'Hits', 'field' => 'hits', 'sort' => true));
    $menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/plugins/' . $_CONF_EXP['pi_name'] . '/edit.php?exid=0', 'text' => 'Add New'), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
    $defsort_arr = array('field' => 'exid', 'direction' => 'asc');
    $header_str = $LANG_EX00['header'] . ' ' . $LANG_EX00['version'] . ' ' . $_CONF_EXP['pi_version'];
    $retval .= COM_startBlock($header_str, '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= ADMIN_createMenu($menu_arr, 'Administer External Pages', plugin_geticon_external());
    $text_arr = array('has_extras' => true, 'form_url' => "{$_CONF['site_admin_url']}/plugins/{$_CONF_EXP['pi_name']}/index.php");
    $query_arr = array('table' => 'external', 'sql' => "SELECT * FROM {$_TABLES['external']} ", 'query_fields' => array('title', 'url'), 'default_filter' => COM_getPermSql());
    $retval .= ADMIN_list('external', 'EXP_getAdminListField', $header_arr, $text_arr, $query_arr, $defsort_arr, '', '', '', $form_arr);
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 13
0
function CUSTOM_handle404($alternate_url = '')
{
    global $_CONF, $_USER, $LANG_404;
    // send 404 in any case
    header('HTTP/1.1 404 Not Found');
    header('Status: 404 Not Found');
    $display .= COM_startBlock($LANG_404[1]);
    if (isset($_SERVER['SCRIPT_URI'])) {
        $url = strip_tags($_SERVER['SCRIPT_URI']);
    } else {
        $request = $_SERVER['REQUEST_URI'];
        $url = 'http://' . $_SERVER['HTTP_HOST'] . strip_tags($request);
    }
    // Add log stuff
    if (isset($_USER['uid'])) {
        $byuser = $_USER['uid'] . '@' . $_SERVER['REMOTE_ADDR'];
    } else {
        $byuser = '******' . $_SERVER['REMOTE_ADDR'];
    }
    $refurl = $_SERVER['HTTP_REFERER'];
    $remoteaddress = $_SERVER['REMOTE_ADDR'];
    $timestamp = @strftime('%c');
    $logentry = "404 Error generated by {$byuser} for url: {$url} - Referring url: {$refurl}";
    $logfile = $_CONF['path_log'] . '404.log';
    if (!($file = fopen($logfile, 'a'))) {
    } else {
        fputs($file, "{$timestamp} - {$logentry} \n");
    }
    $display .= CUSTOM_getStaticpage('404');
    $display .= sprintf($LANG_404[2], $url);
    if ($alternate_url != '') {
        $display .= sprintf($LANG_404[4], $alternate_url);
    } else {
        $display .= $LANG_404[3];
    }
    $display .= COM_endBlock();
    // $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_404[1]));
    $display = COM_createHTMLDocument($display, array('what' => 'none', 'pagetitle' => $LANG_404[1], 'rightblock' => false));
    COM_output($display);
    exit;
    // Do not want to go any further
}
Ejemplo n.º 14
0
function _logoEdit()
{
    global $_CONF, $_LOGO, $_TABLES, $LANG_ADMIN, $LANG_LOGO, $_IMAGE_TYPE;
    $retval = '';
    $menu_arr = array(array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
    $retval .= COM_startBlock($LANG_LOGO['logo_options'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= ADMIN_createMenu($menu_arr, $LANG_LOGO['instructions'], $_CONF['layout_url'] . '/images/icons/logo.' . $_IMAGE_TYPE);
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    if (file_exists($_CONF['path_html'] . '/images/' . $_LOGO['logo_name'])) {
        $current_logo = '<img src="' . $_CONF['site_url'] . '/images/' . $_LOGO['logo_name'] . '" alt="" border="0"/>';
    } else {
        $current_logo = $LANG_LOGO['no_logo_graphic'];
    }
    $T = new Template($_CONF['path_layout'] . 'admin/logo/');
    $T->set_file('admin', 'logo.thtml');
    $T->set_var(array('s_form_action' => $_CONF['site_admin_url'] . '/logo.php', 'graphic_logo_selected' => $_LOGO['use_graphic_logo'] == 1 ? ' checked="checked"' : '', 'text_logo_selected' => $_LOGO['use_graphic_logo'] == 0 ? ' checked="checked"' : '', 'no_logo_selected' => $_LOGO['use_graphic_logo'] == -1 ? ' checked="checked"' : '', 'slogan_selected' => $_LOGO['display_site_slogan'] == 1 ? ' checked="checked"' : '', 'current_logo_graphic' => $current_logo));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
Ejemplo n.º 15
0
/**
*   Create the common header for all admin functions
*
*   @param  string  $page   Current page.  Used for selecting menus
*   @return string      HTML for admin header portion.
*/
function EVLIST_adminHeader($page)
{
    global $_CONF, $LANG_ADMIN, $LANG_EVLIST, $_EV_CONF;
    $retval = '';
    USES_lib_admin();
    $menu_arr = array();
    if ($page == 'events') {
        $menu_arr[] = array('url' => EVLIST_URL . '/event.php?edit=event', 'text' => $LANG_EVLIST['new_event']);
    } else {
        $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php', 'text' => $LANG_EVLIST['events']);
    }
    if ($page == 'calendars') {
        $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?editcal=x', 'text' => $LANG_EVLIST['new_calendar']);
    } else {
        $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?view=calendars', 'text' => $LANG_EVLIST['calendars']);
    }
    if ($page == 'categories') {
        $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?editcat=x', 'text' => $LANG_EVLIST['new_category']);
    } else {
        $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?categories=x', 'text' => $LANG_EVLIST['categories']);
    }
    if ($_EV_CONF['enable_rsvp']) {
        if ($page == 'tickettypes') {
            $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?editticket=0', 'text' => $LANG_EVLIST['new_ticket_type']);
        } else {
            $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?tickettypes', 'text' => $LANG_EVLIST['ticket_types']);
        }
    }
    $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?importcalendar=x', 'text' => $LANG_EVLIST['import_calendar']);
    $menu_arr[] = array('url' => EVLIST_ADMIN_URL . '/index.php?import=x', 'text' => $LANG_EVLIST['import_from_csv']);
    $menu_arr[] = array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']);
    $retval .= COM_startBlock('evList ' . $_EV_CONF['pi_version'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= ADMIN_createMenu($menu_arr, $LANG_EVLIST['admin_instr'][$page], plugin_geticon_evlist());
    $retval .= COM_endBlock();
    return $retval;
}
Ejemplo n.º 16
0
    case 'save':
        // 保存
        $retval = LIB_Save($pi_name, $edt_flg, $navbarMenu, $menuno);
        $information['pagetitle'] = $retval['title'];
        $display .= $retval['display'];
        break;
    case 'delete':
        // 削除
        $display .= LIB_delete($pi_name);
        break;
    case 'copy':
        //コピー
    //コピー
    case 'edit':
        // 編集
        if (!empty($id)) {
            $information['pagetitle'] = $LANG_DATABOX_ADMIN['piname'] . $LANG_DATABOX_ADMIN['edit'];
            $display .= LIB_Edit($pi_name, $id, $edt_flg, $msg, "", $mode);
        }
        break;
    default:
        // 初期表示、一覧表示
        $information['pagetitle'] = $LANG_DATABOX_ADMIN['piname'];
        if (isset($msg)) {
            $display .= COM_showMessage($msg, $pi_name);
        }
        $display .= LIB_List($pi_name);
}
$display = COM_startBlock($LANG_DATABOX_ADMIN['piname'], '', COM_getBlockTemplate('_admin_block', 'header')) . ppNavbarjp($navbarMenu, $LANG_DATABOX_admin_menu[$menuno]) . LIB_Menu($pi_name) . $display . COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display = DATABOX_displaypage($pi_name, '_admin', $display, $information);
COM_output($display);
Ejemplo n.º 17
0
function LIB_import($pi_name)
{
    global $_CONF;
    $lang_box_admin = "LANG_" . strtoupper($pi_name) . "_ADMIN";
    global ${$lang_box_admin};
    $lang_box_admin = ${$lang_box_admin};
    $tmpl = new Template($_CONF['path'] . "plugins/" . THIS_PLUGIN . "/templates/admin/");
    $tmpl->set_file(array('import' => 'import.thtml'));
    $tmpl->set_var('site_admin_url', $_CONF['site_admin_url']);
    $tmpl->set_var('gltoken_name', CSRF_TOKEN);
    $tmpl->set_var('gltoken', SEC_createToken());
    $tmpl->set_var('xhtml', XHTML);
    $tmpl->set_var('script', THIS_SCRIPT);
    $tmpl->set_var('importmsg', $lang_box_admin['importmsg']);
    $tmpl->set_var('importfile', $lang_box_admin['importfile']);
    $tmpl->set_var('submit', $lang_box_admin['submit']);
    $tmpl->parse('output', 'import');
    $import = $tmpl->finish($tmpl->get_var('output'));
    $retval = "";
    $retval .= COM_startBlock($lang_box_admin['import'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= $import;
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 18
0
/**
* Display form to email a story to someone.
*
* @param    string  $sid    ID of article to email
* @return   string          HTML for email story form
*
*/
function mailstoryform($sid, $to = '', $toemail = '', $from = '', $fromemail = '', $shortmsg = '', $msg = 0)
{
    global $_CONF, $_TABLES, $_USER, $LANG08, $LANG_LOGIN;
    require_once $_CONF['path_system'] . 'lib-story.php';
    $retval = '';
    if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_CONF['emailstoryloginrequired'] == 1)) {
        $retval = COM_startBlock($LANG_LOGIN[1], '', COM_getBlockTemplate('_msg_block', 'header'));
        $login = new Template($_CONF['path_layout'] . 'submit');
        $login->set_file(array('login' => 'submitloginrequired.thtml'));
        $login->set_var('xhtml', XHTML);
        $login->set_var('site_url', $_CONF['site_url']);
        $login->set_var('site_admin_url', $_CONF['site_admin_url']);
        $login->set_var('layout_url', $_CONF['layout_url']);
        $login->set_var('login_message', $LANG_LOGIN[2]);
        $login->set_var('lang_login', $LANG_LOGIN[3]);
        $login->set_var('lang_newuser', $LANG_LOGIN[4]);
        $login->parse('output', 'login');
        $retval .= $login->finish($login->get_var('output'));
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        return $retval;
    }
    $story = new Story();
    $result = $story->loadFromDatabase($sid, 'view');
    if ($result != STORY_LOADED_OK) {
        return COM_refresh($_CONF['site_url'] . '/index.php');
    }
    if ($msg > 0) {
        $retval .= COM_showMessage($msg);
    }
    if (empty($from) && empty($fromemail)) {
        if (!COM_isAnonUser()) {
            $from = COM_getDisplayName($_USER['uid'], $_USER['username'], $_USER['fullname']);
            $fromemail = DB_getItem($_TABLES['users'], 'email', "uid = {$_USER['uid']}");
        }
    }
    $mail_template = new Template($_CONF['path_layout'] . 'profiles');
    $mail_template->set_file('form', 'contactauthorform.thtml');
    $mail_template->set_var('xhtml', XHTML);
    $mail_template->set_var('site_url', $_CONF['site_url']);
    $mail_template->set_var('site_admin_url', $_CONF['site_admin_url']);
    $mail_template->set_var('layout_url', $_CONF['layout_url']);
    $mail_template->set_var('start_block_mailstory2friend', COM_startBlock($LANG08[17]));
    $mail_template->set_var('lang_title', $LANG08[31]);
    $mail_template->set_var('story_title', $story->displayElements('title'));
    $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $sid);
    $mail_template->set_var('story_url', $url);
    $link = COM_createLink($story->displayElements('title'), $url);
    $mail_template->set_var('story_link', $link);
    $mail_template->set_var('lang_fromname', $LANG08[20]);
    $mail_template->set_var('name', $from);
    $mail_template->set_var('lang_fromemailaddress', $LANG08[21]);
    $mail_template->set_var('email', $fromemail);
    $mail_template->set_var('lang_toname', $LANG08[18]);
    $mail_template->set_var('toname', $to);
    $mail_template->set_var('lang_toemailaddress', $LANG08[19]);
    $mail_template->set_var('toemail', $toemail);
    $mail_template->set_var('lang_cc', $LANG08[36]);
    $mail_template->set_var('lang_cc_description', $LANG08[37]);
    $mail_template->set_var('lang_shortmessage', $LANG08[27]);
    $mail_template->set_var('shortmsg', htmlspecialchars($shortmsg));
    $mail_template->set_var('lang_warning', $LANG08[22]);
    $mail_template->set_var('lang_sendmessage', $LANG08[16]);
    $mail_template->set_var('story_id', $sid);
    $mail_template->set_var('end_block', COM_endBlock());
    PLG_templateSetVars('emailstory', $mail_template);
    $mail_template->parse('output', 'form');
    $retval .= $mail_template->finish($mail_template->get_var('output'));
    return $retval;
}
Ejemplo n.º 19
0
    COM_olderStuff();
    return;
}
$display = FF_siteHeader();
// Check if the number of records was specified to show
$page = isset($_GET['page']) ? COM_applyFilter($_GET['page'], true) : 0;
$show = isset($_GET['show']) ? COM_applyFilter($_GET['show'], true) : 0;
if (empty($show)) {
    $show = 20;
}
// Check if this is the first page.
if (empty($page) || $page < 1) {
    $page = 1;
}
$display .= FF_Navbar($navbarMenu, $LANG_GF06['5']);
$display .= COM_startBlock($LANG_GF02['msg193']);
$p = new Template($_CONF['path'] . 'plugins/forum/templates/admin/');
$p->set_file(array('page' => 'migratestories.thtml', 'records' => 'migrate_records.thtml'));
if (!empty($_GET['num_stories'])) {
    $p->set_var('status_message', sprintf($LANG_GF02['msg192'], $_GET['num_stories'], $_GET['num_posts']));
} else {
    $p->set_var('show_message', 'none');
}
if (!empty($_REQUEST['seltopic']) and $_REQUEST['seltopic'] != 'all') {
    $curtopic = $_REQUEST['seltopic'];
    if ($_REQUEST['seltopic'] == "submissions") {
        $sql = "select tid,sid,title,date, 0 as comments from {$_TABLES['storysubmission']}";
        $countsql = DB_query("SELECT COUNT(*) FROM {$_TABLES['storysubmission']}");
    } else {
        $sql = "select tid,sid,title,date,comments from {$_TABLES['stories']} where tid='" . DB_escapeString($curtopic) . "'";
        $countsql = DB_query("SELECT COUNT(*) FROM {$_TABLES['stories']} where tid='" . DB_escapeString($curtopic) . "'");
Ejemplo n.º 20
0
// | 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 (at your option) any later version.                    |
// |                                                                           |
// | This program 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, write to the Free Software Foundation,   |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
/**
* @package Test
*/
require_once '../lib-common.php';
// take user back to the homepage if the plugin is not active
if (!in_array('test', $_PLUGINS)) {
    echo COM_refresh($_CONF['site_url'] . '/index.php');
    exit;
}
$display = '';
// MAIN
$display .= COM_siteHeader('menu', $LANG_TEST_1['plugin_name']);
$display .= COM_startBlock($LANG_TEST_1['plugin_name']);
$display .= '<p>Welcome to the ' . $LANG_TEST_1['plugin_name'] . ' plugin, ' . $_USER['username'] . '!</p>';
$display .= COM_endBlock();
$display .= COM_siteFooter();
echo $display;
Ejemplo n.º 21
0
// | This program 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, write to the Free Software Foundation,   |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//
require_once '../../../lib-common.php';
// Only let users with nexflow.edit rights to access this page
if (!SEC_hasRights('nexflow.edit')) {
    $display = COM_siteHeader();
    $display .= COM_startBlock($LANG_NF00['access_denied']);
    $display .= $LANG_NF00['admin_access_error'];
    $display .= COM_endBlock();
    $display .= COM_siteFooter(true);
    echo $display;
    exit;
}
require_once $_CONF['path'] . 'plugins/nexflow/config.php';
require_once $_CONF['path_system'] . 'classes/navbar.class.php';
if (isset($_USER['uid'])) {
    $userid = $_USER['uid'];
} else {
    $userid = 1;
}
$templateID = COM_applyFilter($_POST['templateID'], true);
if ($templateID == 0) {
Ejemplo n.º 22
0
// | 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, write to the Free Software Foundation,  |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.          |
// |                                                                          |
// +--------------------------------------------------------------------------+
require_once '../../../lib-common.php';
require_once $_CONF['path'] . '/plugins/calendar/autoinstall.php';
USES_lib_install();
if (!SEC_inGroup('Root')) {
    // Someone is trying to illegally access this page
    COM_errorLog("Someone has tried to illegally access the Calendar install/uninstall page.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$REMOTE_ADDR}", 1);
    $display = COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_startBlock($LANG_ACCESS['accessdenied']) . $LANG_ACCESS['plugin_access_denied_msg'] . COM_endBlock() . COM_siteFooter();
    echo $display;
    exit;
}
/**
* Main Function
*/
if (SEC_checkToken()) {
    $action = COM_applyFilter($_GET['action']);
    if ($action == 'install') {
        if (plugin_install_calendar()) {
            // Redirects to the plugin editor
            echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=44');
            exit;
        } else {
            echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=72');
Ejemplo n.º 23
0
 /**
  * Shows search form
  *
  * Shows advanced search page
  *
  * @author Tony Bibbs, tony AT geeklog DOT net
  * @return string HTML output for form
  *
  */
 public function showForm()
 {
     global $_CONF, $_TABLES, $LANG09;
     $retval = '';
     // Verify current user my use the search form
     if (!$this->_isFormAllowed()) {
         return SEC_loginRequiredForm();
     }
     $retval .= COM_startBlock($LANG09[1], 'advancedsearch.html');
     $searchform = COM_newTemplate($_CONF['path_layout'] . 'search');
     $searchform->set_file(array('searchform' => 'searchform.thtml', 'authors' => 'searchauthors.thtml'));
     $searchform->set_var('search_intro', $LANG09[19]);
     $searchform->set_var('lang_keywords', $LANG09[2]);
     $searchform->set_var('lang_keytype', $LANG09[36]);
     $searchform->set_var('lang_date', $LANG09[20]);
     $searchform->set_var('lang_to', $LANG09[21]);
     $searchform->set_var('date_format', $LANG09[22]);
     $searchform->set_var('lang_topic', $LANG09[3]);
     $searchform->set_var('lang_all', $LANG09[4]);
     $searchform->set_var('topic_option_list', TOPIC_getTopicListSelect($this->_topic, 2, true));
     $searchform->set_var('lang_type', $LANG09[5]);
     $searchform->set_var('lang_results', $LANG09[59]);
     $searchform->set_var('lang_per_page', $LANG09[60]);
     $searchform->set_var('lang_exact_phrase', $LANG09[43]);
     $searchform->set_var('lang_all_words', $LANG09[44]);
     $searchform->set_var('lang_any_word', $LANG09[45]);
     $searchform->set_var('lang_titles', $LANG09[69]);
     $escquery = htmlspecialchars($this->_query);
     $escquery = str_replace(array('{', '}'), array('&#123;', '&#125;'), $escquery);
     $searchform->set_var('query', $escquery);
     $searchform->set_var('datestart', $this->_dateStart);
     $searchform->set_var('dateend', $this->_dateEnd);
     if ($this->_titlesOnly) {
         $searchform->set_var('title_checked', ' checked="checked"');
     } else {
         $searchform->set_var('title_checked', '');
     }
     $phrase_selected = '';
     $all_selected = '';
     $any_selected = '';
     if ($this->_keyType == 'phrase') {
         $phrase_selected = 'selected="selected"';
     } else {
         if ($this->_keyType == 'all') {
             $all_selected = 'selected="selected"';
         } else {
             if ($this->_keyType == 'any') {
                 $any_selected = 'selected="selected"';
             }
         }
     }
     $searchform->set_var('key_phrase_selected', $phrase_selected);
     $searchform->set_var('key_all_selected', $all_selected);
     $searchform->set_var('key_any_selected', $any_selected);
     $options = '';
     $plugintypes = array('all' => $LANG09[4], 'stories' => $LANG09[6], 'comments' => $LANG09[7]);
     $plugintypes = array_merge($plugintypes, PLG_getSearchTypes());
     // Generally I don't like to hardcode HTML but this seems easiest
     foreach ($plugintypes as $key => $val) {
         $options .= "<option value=\"{$key}\"";
         if ($this->_type == $key) {
             $options .= ' selected="selected"';
         }
         $options .= ">{$val}</option>" . LB;
     }
     $searchform->set_var('plugin_types', $options);
     if ($_CONF['contributedbyline'] == 1) {
         $searchform->set_var('lang_authors', $LANG09[8]);
         $searchusers = array();
         $result = DB_query("SELECT DISTINCT uid FROM {$_TABLES['comments']}");
         while ($A = DB_fetchArray($result)) {
             $searchusers[$A['uid']] = $A['uid'];
         }
         $result = DB_query("SELECT DISTINCT uid FROM {$_TABLES['stories']} WHERE (date <= NOW()) AND (draft_flag = 0)");
         while ($A = DB_fetchArray($result)) {
             $searchusers[$A['uid']] = $A['uid'];
         }
         $inlist = implode(',', $searchusers);
         if (!empty($inlist)) {
             $sql = "SELECT uid,username,fullname FROM {$_TABLES['users']} WHERE uid IN ({$inlist})";
             if (isset($_CONF['show_fullname']) && $_CONF['show_fullname'] == 1) {
                 /* Caveat: This will group all users with an emtpy fullname
                  *         together, so it's not exactly sorted by their
                  *         full name ...
                  */
                 $sql .= ' ORDER BY fullname,username';
             } else {
                 $sql .= ' ORDER BY username';
             }
             $result = DB_query($sql);
             $options = '';
             while ($A = DB_fetchArray($result)) {
                 $options .= '<option value="' . $A['uid'] . '"';
                 if ($A['uid'] == $this->_author) {
                     $options .= ' selected="selected"';
                 }
                 $options .= '>' . htmlspecialchars(COM_getDisplayName('', $A['username'], $A['fullname'])) . '</option>';
             }
             $searchform->set_var('author_option_list', $options);
             $searchform->parse('author_form_element', 'authors', true);
         } else {
             $searchform->set_var('author_form_element', '<input type="hidden" name="author" value="0"' . XHTML . '>');
         }
     } else {
         $searchform->set_var('author_form_element', '<input type="hidden" name="author" value="0"' . XHTML . '>');
     }
     // Results per page
     $options = '';
     $limits = explode(',', $_CONF['search_limits']);
     foreach ($limits as $limit) {
         $options .= "<option value=\"{$limit}\"";
         if ($_CONF['num_search_results'] == $limit) {
             $options .= ' selected="selected"';
         }
         $options .= ">{$limit}</option>" . LB;
     }
     $searchform->set_var('search_limits', $options);
     $searchform->set_var('lang_search', $LANG09[10]);
     PLG_templateSetVars('search', $searchform);
     $searchform->parse('output', 'searchform');
     $retval .= $searchform->finish($searchform->get_var('output'));
     $retval .= COM_endBlock();
     return $retval;
 }
Ejemplo n.º 24
0
    global $_CONF, $_DB, $_TABLES, $_USER, $_GUS_VARS;
    $_DB->setDisplayError(TRUE);
    require_once $_CONF['path'] . 'plugins/gus/sql/gus.php';
    // build tables
    foreach ($_SQL as $sql) {
        DB_query($sql);
    }
    // insert data
    foreach ($_DATA as $data) {
        DB_query($data);
    }
}
/* 
* Main Function
*/
$display = COM_siteHeader() . COM_startBlock($LANG_GUS00['install_header']);
$action = isset($_GET['action']) ? COM_applyFilter($_GET['action']) : '';
if ($action === 'install') {
    if (plugin_install_gus()) {
        $img_url = $_CONF['site_url'] . '/gus/images/' . $_GUS_IMG_name;
        $blockManager = $_CONF['site_admin_url'] . '/block.php';
        $admin_url = $_CONF['site_admin_url'] . '/plugins/gus/index.php';
        $import_url = $_CONF['site_admin_url'] . '/plugins/gus/import.php';
        $readme_url = $_CONF['site_admin_url'] . '/plugins/gus/readme.html';
        $display .= "<img align=left src=\"{$img_url}\" alt='GUS Icon' width=48 height=48>" . '<p>I have created all the necessary tables and activated the Who\'s Online block. ' . "If you do not want to use it, then you may disable it by changing the GUS config.php file located in the plugins/gus directory. " . "<p>To configure GUS, go to the <a href=\"{$admin_url}\">admin page</a>.\n\t\t\tInformation about the various configuration options\tmay be found in the \n\t\t\t<a href=\"{$readme_url}#config\">README file</a>." . "<p>If you would like to support development of this plugin, there are some suggestions in the  \n\t\t\t<a href=\"{$readme_url}#you\">README file</a>.";
        // check for old stats to see if we should add an import link
        if ($_ST_plugin_name != '') {
            $stats_version = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name = '{$_ST_plugin_name}'");
            $display .= "<hr>I notice you have the stats plugin version {$stats_version} installed as '{$_ST_plugin_name}'. ";
            if ($stats_version !== '1.3') {
                $display .= "<p>If you had version 1.3 installed, I could import its data. \n\t\t\t\t\tIf you update this in the future, you can import its data from \n\t\t\t\t\tthe <a href=\"{$admin_url}\">admin page</a>.";
Ejemplo n.º 25
0
function _at_Header()
{
    global $_CONF, $LANG_ADMIN, $LANG32;
    $retval = '';
    $retval .= COM_startBlock($LANG32[87], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 26
0
/**
 * Displays a list of topics
 * Lists all the topics and their icons.
 *
 * @param    string $token Security token to use in list
 * @return   string      HTML for the topic list
 */
function listTopics($token)
{
    global $_CONF, $_TABLES, $LANG27, $LANG_ACCESS, $LANG_ADMIN, $_SCRIPTS;
    require_once $_CONF['path_system'] . 'lib-admin.php';
    $_SCRIPTS->setJavaScriptFile('admin.topic', '/javascript/admin.topic.js');
    $retval = '';
    $retval .= COM_startBlock($LANG27[8], '', COM_getBlockTemplate('_admin_block', 'header'));
    $menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/topic.php?mode=edit', 'text' => $LANG_ADMIN['create_new']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
    $retval .= ADMIN_createMenu($menu_arr, $LANG27[9], $_CONF['layout_url'] . "/images/icons/topic.png");
    $header_arr[] = array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false);
    $header_arr[] = array('text' => $LANG27[10], 'field' => 'sortnum', 'sort' => true);
    $header_arr[] = array('text' => $LANG27[53], 'field' => 'image', 'sort' => false);
    $header_arr[] = array('text' => $LANG27[3], 'field' => 'topic', 'sort' => false);
    $header_arr[] = array('text' => $LANG27[2], 'field' => 'tid', 'sort' => true);
    $header_arr[] = array('text' => $LANG27[52], 'field' => 'story', 'sort' => false);
    $header_arr[] = array('text' => $LANG_ACCESS['access'], 'field' => 'access', 'sort' => false);
    $header_arr[] = array('text' => $LANG27[33], 'field' => 'inherit', 'sort' => false);
    $header_arr[] = array('text' => $LANG27[35], 'field' => 'hidden', 'sort' => false);
    $defsort_arr = array('field' => 'sortnum', 'direction' => 'asc');
    $text_arr = array('has_extras' => true, 'form_url' => $_CONF['site_admin_url'] . '/topic.php');
    $query_arr = array('table' => 'topics', 'sql' => "SELECT * FROM {$_TABLES['topics']} WHERE 1=1 ", 'query_fields' => array('topic'), 'default_filter' => COM_getPermSQL('AND'));
    $retval .= ADMIN_list('topics', 'ADMIN_getListField_topics', $header_arr, $text_arr, $query_arr, $defsort_arr, '', $token);
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 27
0
function MB_editMenu($mid)
{
    global $_CONF, $_TABLES, $_ST_CONF, $stMenu, $LANG_MB00, $LANG_MB01, $LANG_MB_ADMIN, $LANG_MB_TYPES, $LANG_MB_GLTYPES, $LANG_MB_GLFUNCTION, $LANG_MB_MENU_TYPES;
    $retval = '';
    $menu_id = $mid;
    $menu = menu::getInstance($menu_id);
    $menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/menu.php?mode=menu&amp;menu=' . $menu_id, 'text' => $LANG_MB01['return_to'] . $menu->name), array('url' => $_CONF['site_admin_url'] . '/menu.php', 'text' => $LANG_MB01['menu_list']));
    $retval .= COM_startBlock($LANG_MB01['menu_builder'] . ' :: ' . $LANG_MB01['edit_element'] . ' for ' . $menu->name, '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= ADMIN_createMenu($menu_arr, $LANG_MB_ADMIN[5], $_CONF['layout_url'] . '/images/icons/menubuilder.png');
    // build menu type select
    $menuTypeSelect = '<select id="menutype" name="menutype">' . LB;
    while ($types = current($LANG_MB_MENU_TYPES)) {
        $menuTypeSelect .= '<option value="' . key($LANG_MB_MENU_TYPES) . '"';
        if (key($LANG_MB_MENU_TYPES) == $menu->type) {
            $menuTypeSelect .= ' selected="selected"';
        }
        $menuTypeSelect .= '>' . $types . '</option>' . LB;
        next($LANG_MB_MENU_TYPES);
    }
    $menuTypeSelect .= '</select>' . LB;
    // build group select
    $rootUser = DB_getItem($_TABLES['group_assignments'], 'ug_uid', 'ug_main_grp_id=1');
    $usergroups = SEC_getUserGroups($rootUser);
    $usergroups[$LANG_MB01['non-logged-in']] = 998;
    uksort($usergroups, "strnatcasecmp");
    $group_select = '<select id="group" name="group">' . LB;
    for ($i = 0; $i < count($usergroups); $i++) {
        $group_select .= '<option value="' . $usergroups[key($usergroups)] . '"';
        if ($usergroups[key($usergroups)] == $menu->group_id) {
            $group_select .= ' selected="selected"';
        }
        $group_select .= '>' . ucfirst(key($usergroups)) . '</option>' . LB;
        next($usergroups);
    }
    $group_select .= '</select>' . LB;
    $T = new Template($_CONF['path_layout'] . 'admin/menu');
    $T->set_file(array('admin' => 'editmenu.thtml'));
    if ($mid == 1 || $mid == 2 || $mid == 3) {
        $disabled = ' readonly ';
    } else {
        $disabled = '';
    }
    $menu_active_check = $menu->active == 1 ? ' checked="checked"' : '';
    $T->set_var(array('group_select' => $group_select, 'menutype' => $menu->type, 'menutype_select' => $menuTypeSelect, 'menuactive' => $menu->active == 1 ? ' checked="checked"' : ' ', 'form_action' => $_CONF['site_admin_url'] . '/menu.php', 'menu_id' => $mid, 'menuname' => $menu->name, 'enabled' => $menu_active_check, 'disabled' => $disabled));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
Ejemplo n.º 28
0
    if (isset($_GET['mode'])) {
        $mode = COM_applyFilter($_GET['mode']);
    }
}
$T = new Template($_MG_CONF['template_path']);
$T->set_file('admin', 'administration.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_MG_CONF['site_url'], 'lang_admin' => $LANG_MG00['admin'], 'xhtml' => XHTML));
if ($mode == $LANG_MG01['save'] && !empty($LANG_MG01['save'])) {
    MG_createUsers();
    exit;
} elseif ($mode == $LANG_MG01['cancel']) {
    echo COM_refresh($_MG_CONF['admin_url'] . 'index.php');
    exit;
} else {
    if (isset($_REQUEST['page'])) {
        $page = COM_applyFilter($_REQUEST['page'], true) - 1;
        if ($page < 0) {
            $page = 0;
        }
    } else {
        $page = 0;
    }
    $T->set_var(array('admin_body' => MG_selectUsers($page), 'title' => $LANG_MG01['batch_create_members'], 'lang_help' => '<img src="' . MG_getImageFile('button_help.png') . '" style="border:none;" alt="?"' . XHTML . '>', 'help_url' => $_MG_CONF['site_url'] . '/docs/usage.html#Batch_Create_Member_Albums'));
}
$T->parse('output', 'admin');
$display = COM_startBlock($LANG_MG00['admin'], '', COM_getBlockTemplate('_admin_block', 'header'));
$display .= MG_showAdminMenu('member_albums');
$display .= $T->finish($T->get_var('output'));
$display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
$display = COM_createHTMLDocument($display);
COM_output($display);
Ejemplo n.º 29
0
// | 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, write to the Free Software Foundation,   |
// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.           |
// |                                                                           |
// +---------------------------------------------------------------------------+
//
include_once 'gf_functions.php';
require_once $_CONF['path'] . 'plugins/forum/debug.php';
// Common Debug Code
$ip = COM_applyFilter($_REQUEST['ip']);
$forum = COM_applyFilter($_REQUEST['forum'], true);
$op = COM_applyFilter($_REQUEST['op']);
echo COM_siteHeader();
echo COM_startBlock($LANG_GF96['gfipman']);
echo ppNavbar($navbarMenu, $LANG_GF06['7']);
if ($op == 'banip' && $ip != '') {
    if ($_POST['sure'] == 'yes') {
        DB_query("INSERT INTO {$_TABLES['gf_banned_ip']} (host_ip) VALUES ('{$ip}')");
        forum_statusMessage($LANG_GF96['ipbanned'], $_CONF['site_admin_url'] . '/plugins/forum/ips.php', $LANG_GF96['ipbanned']);
        echo COM_endBlock();
        echo adminfooter();
        echo COM_siteFooter();
        exit;
    }
    if ($_POST['sure'] != 'yes') {
        $ips_unban = new Template($_CONF['path_layout'] . 'forum/layout/admin');
        $ips_unban->set_file(array('ips_unban' => 'ips_unban.thtml'));
        $ips_unban->set_var('phpself', $_CONF['site_admin_url'] . '/plugins/forum/ips.php');
        $ips_unban->set_var('deletenote1', sprintf($LANG_GF93['deleteforumnote1'], $forumname));
Ejemplo n.º 30
0
// 20120509 fieldset add
define('THIS_PLUGIN', 'databox');
require_once '../../../lib-common.php';
if (!in_array('databox', $_PLUGINS)) {
    COM_handle404();
    exit;
}
require_once $_CONF['path'] . 'plugins/databox/lib/ppNavbar.php';
$edt_flg = FALSE;
// 権限チェック
if (SEC_hasRights('databox.admin')) {
} else {
    $information = array();
    $information['pagetitle'] = $MESSAGE[30];
    $display = "";
    $display .= COM_startBlock($MESSAGE[30], '', COM_getBlockTemplate('_msg_block', 'header'));
    $display .= $MESSAGE[35];
    $display .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
    COM_accessLog("User {$_USER['username']} tried to illegally access the databox administration screen.");
    $display = DATABOX_displaypage($pi_name, '_admin', $display, $information);
    COM_output($display);
    exit;
}
$adminurl = $_CONF['site_admin_url'] . '/plugins/' . THIS_PLUGIN . "/";
$navbarMenu = array();
$navbarMenu[$LANG_DATABOX_admin_menu['1']] = $adminurl . 'information.php';
$navbarMenu[$LANG_DATABOX_admin_menu['2']] = $adminurl . 'data.php';
$navbarMenu[$LANG_DATABOX_admin_menu['3']] = $adminurl . 'field.php';
$navbarMenu[$LANG_DATABOX_admin_menu['31']] = $adminurl . 'fieldset.php';
$navbarMenu[$LANG_DATABOX_admin_menu['4']] = $adminurl . 'category.php';
$navbarMenu[$LANG_DATABOX_admin_menu['5']] = $adminurl . 'group.php';