当前位置: 首页>>代码示例>>PHP>>正文


PHP do_sidebar函数代码示例

本文整理汇总了PHP中do_sidebar函数的典型用法代码示例。如果您正苦于以下问题:PHP do_sidebar函数的具体用法?PHP do_sidebar怎么用?PHP do_sidebar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了do_sidebar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hello_world_showpage

function hello_world_showpage()
{
    global $main_smarty, $the_template, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        define('pagename', 'hello_world');
        $main_smarty->assign('pagename', pagename);
        // Method for identifying modules rather than pagename
        define('modulename', 'hello_world');
        $main_smarty->assign('modulename', modulename);
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $main_smarty->display(hello_world_tpl_path . '/blank.tpl');
        $navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_hello_world_BreadCrumb');
        $navwhere['link2'] = URL_hello_world;
        $navwhere['text3'] = '';
        $navwhere['link3'] = '';
        $navwhere['text4'] = '';
        $navwhere['link4'] = '';
        $main_smarty = do_sidebar($main_smarty);
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $main_smarty->assign('tpl_center', hello_world_tpl_path . 'hello_world_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:30,代码来源:hello_world_main.php

示例2: multibox_admin_showpage

function multibox_admin_showpage()
{
    global $main_smarty, $the_template, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        define('pagename', 'multibox_admin');
        $main_smarty->assign('pagename', pagename);
        define('modulename', 'multibox_admin');
        $main_smarty->assign('modulename', modulename);
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $main_smarty->display(multibox_admin_tpl_path . '/blank.tpl');
        $main_smarty = do_sidebar($main_smarty);
        $sql = "SELECT * FROM " . table_totals;
        $results = $db->get_results($sql);
        $main_smarty->assign('results', object_2_array($results));
        if (isset($_REQUEST['action'])) {
            $main_smarty->assign('action', $_REQUEST['action']);
            totals_regenerate();
            $sql = "SELECT * FROM " . table_totals;
            $results = $db->get_results($sql);
            $main_smarty->assign('new_results', object_2_array($results));
        }
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $main_smarty->assign('tpl_center', multibox_admin_tpl_path . 'multibox_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        echo "Page Forbidden";
    }
}
开发者ID:pantofla,项目名称:waterfan,代码行数:33,代码来源:multibox_admin_main.php

示例3: sendannouncement_showpage

function sendannouncement_showpage()
{
    // Method for identifying modules rather than pagename
    define('modulename', 'send_announcement');
    // $main_smarty->assign('modulename', modulename);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 0) {
        header("Location: " . my_base_url . my_pligg_base);
        die;
    }
    global $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    // breadcrumbs
    $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
    $navwhere['link1'] = getmyurl('admin', '');
    $navwhere['text2'] = "Send Announcement";
    $main_smarty->assign('navbar_where', $navwhere);
    $main_smarty->assign('posttitle', "Send Annoucement");
    // breadcrumbs
    $main_smarty->assign('tpl_center', send_announcement_tpl_path . 'sendannouncement');
    $main_smarty->display($the_template . '/pligg.tpl');
}
开发者ID:hyrmedia,项目名称:pligg-cms,代码行数:29,代码来源:send_announcement_main.php

示例4: captcha_showpage

function captcha_showpage()
{
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        global $main_smarty, $the_template;
        $navwhere['text1'] = 'Captcha';
        $navwhere['link1'] = URL_captcha;
        define('pagename', 'captcha');
        $main_smarty->assign('pagename', pagename);
        // New method for identifying modules rather than pagename
        define('modulename', 'captcha');
        $main_smarty->assign('modulename', modulename);
        $main_smarty = do_sidebar($main_smarty, $navwhere);
        if (isset($_REQUEST['action'])) {
            $action = $_REQUEST['action'];
        } else {
            $action = '';
        }
        if ($action == 'enable') {
            if (isset($_REQUEST['captcha'])) {
                $captcha = $_REQUEST['captcha'];
            } else {
                $captcha = '';
            }
            enable_captcha($captcha);
        }
        if ($action == 'configure') {
            if (isset($_REQUEST['captcha'])) {
                $captcha = $_REQUEST['captcha'];
            } else {
                $captcha = '';
            }
            include_once captcha_captchas_path . '/' . $captcha . '/main.php';
            captcha_configure();
            $main_smarty->assign('tpl_center', captcha_tpl_path . '../captchas/' . $captcha . '/captcha_configure');
            $main_smarty->display($template_dir . '/admin/admin.tpl');
            die;
        }
        if ($action == 'EnableReg') {
            $value = isset($_REQUEST['value']) ? $_REQUEST['value'] : '';
            if ($value != '') {
                misc_data_update('captcha_reg_en', $value);
            }
            header('Location: ' . URL_captcha);
        }
        $captcha = get_misc_data('captcha_method');
        if ($captcha == '') {
            $captcha = 'recaptcha';
        }
        $main_smarty->assign('captcha_method', $captcha);
        $main_smarty->assign('tpl_center', captcha_tpl_path . '/captcha_home');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    }
}
开发者ID:pantofla,项目名称:waterfan,代码行数:56,代码来源:captcha_main.php

示例5: karma_showpage

function karma_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('karma_submit_story', sanitize($_REQUEST['karma_submit_story'], 3));
            misc_data_update('karma_submit_comment', sanitize($_REQUEST['karma_submit_comment'], 3));
            misc_data_update('karma_story_publish', sanitize($_REQUEST['karma_story_publish'], 3));
            misc_data_update('karma_story_vote', sanitize($_REQUEST['karma_story_vote'], 3));
            misc_data_update('karma_story_unvote', sanitize($_REQUEST['karma_story_vote_remove'], 3));
            misc_data_update('karma_comment_vote', sanitize($_REQUEST['karma_comment_vote'], 3));
            misc_data_update('karma_story_discard', sanitize($_REQUEST['karma_story_discard'], 3));
            misc_data_update('karma_story_spam', sanitize($_REQUEST['karma_story_spam'], 3));
            misc_data_update('karma_comment_delete', sanitize($_REQUEST['karma_comment_delete'], 3));
            if ($_REQUEST['karma_username'] && $_REQUEST['karma_value'] != 0) {
                $db->query($sql = "UPDATE " . table_users . " SET user_karma=user_karma+'" . $db->escape($_REQUEST['karma_value']) . "' WHERE user_login='" . $db->escape($_REQUEST['karma_username']) . "'");
                if (!$db->rows_affected) {
                    $error = "Wrong username " . sanitize($_REQUEST['karma_username'], 1);
                }
            }
            $main_smarty->assign('error', $error);
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify Karma";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=karma";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'karma');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modify_karma');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', str_replace('"', '"', get_karma_settings()));
        $main_smarty->assign('tpl_center', karma_tpl_path . 'karma_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:51,代码来源:karma_main.php

示例6: close_comments_showpage

function close_comments_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $close_comment_method = trim($_REQUEST['close_comment_method']);
            $close_comment_time = trim($_REQUEST['close_comment_time']);
            if ($close_comment_method == 'time') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } elseif ($close_comment_method == 'manual') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } elseif ($close_comment_method == 'both') {
                misc_data_update('close_comment_method', mysql_real_escape_string($close_comment_method));
            } else {
                $main_smarty->assign('module_error', "Method POST data did not contain an expected value");
            }
            if (is_numeric($close_comment_time)) {
                misc_data_update('close_comment_time', mysql_real_escape_string($close_comment_time));
            } else {
                $main_smarty->assign('module_error', "Time POST data did not contain a numerical value. Please give the second field a value of 0 or higher.");
            }
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'close_comments');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'close_comments_settings');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', get_close_comments_settings());
        $main_smarty->assign('tpl_center', close_comments_tpl_path . 'close_comments_settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:47,代码来源:close_comments_main.php

示例7: zip_install_preview_admin

function zip_install_preview_admin()
{
    global $main_smarty, $the_template, $db, $my_pligg_base;
    force_authentication();
    $amIgod = 0;
    $amIgod = $amIgod + checklevel('admin');
    if ($amIgod == 1) {
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $main_smarty->display(zip_install_tpl_path . '/blank.tpl');
        $navwhere['text2'] = 'ZIP Install';
        $navwhere['link2'] = my_pligg_base . '/module.php?module=zip_install';
        $navwhere['text3'] = '';
        $navwhere['link3'] = '';
        $navwhere['text4'] = '';
        $navwhere['link4'] = '';
        $main_smarty = do_sidebar($main_smarty);
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $action = $_REQUEST['action'];
        switch ($action) {
            case "modules":
                $main_smarty->assign('tpl_center', zip_install_tpl_path . 'zip_install_modules');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
                break;
            case "templates":
                $main_smarty->assign('tpl_center', zip_install_tpl_path . 'zip_install_templates');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
                break;
            case "filemod":
                if (uploadFile(zip_install_absolute_path, $_FILES, "modules")) {
                    redirect(my_pligg_base . '/admin/admin_modules.php?status=uninstalled');
                }
                break;
            case "filetem":
                if (uploadFile(zip_install_absolute_path, $_FILES, "templates")) {
                    redirect(my_pligg_base . '/admin/admin_config.php?page=Template');
                }
                break;
            default:
                $main_smarty->assign('tpl_center', zip_install_tpl_path . 'zip_install');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
                break;
        }
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:46,代码来源:zip_install_main.php

示例8: contactable_showpage

function contactable_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $contactable_input = $_REQUEST['contactable_mail'];
            $result = filter_var($contactable_input, FILTER_VALIDATE_EMAIL);
            // Checking if the email is valid. Returns 'false' if not valid.
            if (!$result) {
                // Email is not valid
                $msg = "Error! Your email address does not appear to be valid.";
            } else {
                // Add email address to database field
                misc_data_update('contactable_mail', mysql_real_escape_string($contactable_input));
            }
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'contactable');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_contactable');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('msg', $msg);
        // Error messages
        $main_smarty->assign('contactable', get_contactable_settings());
        $main_smarty->assign('tpl_center', contactable_tpl_path . 'settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:42,代码来源:contactable_main.php

示例9: pligg_web_toolbar_showpage

function pligg_web_toolbar_showpage()
{
    global $main_smarty, $the_template, $db;
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        define('pagename', 'pligg_web_toolbar');
        $main_smarty->assign('pagename', pagename);
        // Method for identifying modules rather than pagename
        define('modulename', 'pligg_web_toolbar');
        $main_smarty->assign('modulename', modulename);
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_pligg_web_toolbar_BreadCrumb');
        $navwhere['link2'] = URL_pligg_web_toolbar;
        $navwhere['text3'] = '';
        $navwhere['link3'] = '';
        $navwhere['text4'] = '';
        $navwhere['link4'] = '';
        if (isset($_REQUEST['action'])) {
            $action = $_REQUEST['action'];
        } else {
            $action = '';
        }
        if ($action == 'enable') {
            enable_pligg_web_toolbar();
        }
        if ($action == 'disable') {
            disable_pligg_web_toolbar();
        }
        $main_smarty = do_sidebar($main_smarty);
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        $main_smarty->assign('tpl_center', pligg_web_toolbar_tpl_path . 'pligg_web_toolbar_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:40,代码来源:pligg_web_toolbar_main.php

示例10: spam_trigger_showpage

function spam_trigger_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // Save settings
        if ($_POST['submit']) {
            misc_data_update('spam_trigger_light', sanitize($_REQUEST['spam_light'], 3));
            misc_data_update('spam_trigger_medium', sanitize($_REQUEST['spam_medium'], 3));
            misc_data_update('spam_trigger_hard', sanitize($_REQUEST['spam_hard'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=spam_trigger");
            die;
        }
        // breadcrumbs
        $navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
        $navwhere['link1'] = getmyurl('admin', '');
        $navwhere['text2'] = "Modify spam_trigger";
        $navwhere['link2'] = my_pligg_base . "/module.php?module=spam_trigger";
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'spam_trigger');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifyspam_trigger');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', str_replace('"', '"', get_spam_trigger_settings()));
        $main_smarty->assign('places', $spam_trigger_places);
        $main_smarty->assign('tpl_center', spam_trigger_tpl_path . 'spam_trigger_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:40,代码来源:spam_trigger_main.php

示例11: analytics_showpage

function analytics_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            $_REQUEST = str_replace('"', "'", $_REQUEST);
            $analytics_input = substr($_REQUEST['analytics_id'], 0, 14);
            // Shorten input to 14 characters (max length of Analytics IDs)
            if (strlen($analytics_input) > '14') {
                $msg = "Error! The value entered was more than 14 characters in length. Please try again.";
            }
            misc_data_update('analytics_id', mysql_real_escape_string($analytics_input));
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        define('modulename', 'analytics');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_analytics');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('msg', $msg);
        // Error messages
        $main_smarty->assign('settings', get_analytics_settings());
        $main_smarty->assign('tpl_center', analytics_tpl_path . 'settings');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:hyrmedia,项目名称:modules,代码行数:38,代码来源:analytics_main.php

示例12: links_showpage

function links_showpage()
{
    global $db, $main_smarty, $the_template;
    include_once 'config.php';
    include_once mnminclude . 'html1.php';
    include_once mnminclude . 'link.php';
    include_once mnminclude . 'tags.php';
    include_once mnminclude . 'smartyvariables.php';
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    if ($canIhaveAccess == 1) {
        if ($_POST['submit']) {
            misc_data_update('links_comments', sanitize($_REQUEST['links_comments'], 3));
            misc_data_update('links_stories', sanitize($_REQUEST['links_stories'], 3));
            misc_data_update('links_nofollow', sanitize($_REQUEST['links_nofollow'], 3));
            misc_data_update('links_host', sanitize($_REQUEST['links_host'], 3));
            header("Location: " . my_pligg_base . "/module.php?module=links");
            die;
        }
        // breadcrumbs
        $main_smarty->assign('navbar_where', $navwhere);
        $main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
        // breadcrumbs
        define('modulename', 'links');
        $main_smarty->assign('modulename', modulename);
        define('pagename', 'admin_modifylinks');
        $main_smarty->assign('pagename', pagename);
        $main_smarty->assign('settings', links_settings());
        $main_smarty->assign('tpl_center', links_tpl_path . 'links_main');
        $main_smarty->display($template_dir . '/admin/admin.tpl');
    } else {
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
    }
}
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:36,代码来源:links_main.php

示例13: group_print_summary

function group_print_summary($requestID)
{
    global $db, $main_smarty, $the_template;
    if (!is_numeric($requestID)) {
        die;
    }
    $index = 0;
    $group = $db->get_row("SELECT group_id,group_creator, group_status, group_members, group_date, group_name, group_safename, group_description, group_privacy, group_avatar FROM " . table_groups . " WHERE group_id = {$requestID}");
    if ($group) {
        $group_id = $group->group_id;
        $group_name = $group->group_name;
        $group_safename = $group->group_safename;
        $group_description = $group->group_description;
        $group_creator = $group->group_creator;
        $group_status = $group->group_status;
        $group_members = $group->group_members;
        $group_date = $group->group_date;
        $group_privacy = $group->group_privacy;
        $group_avatar = $group->group_avatar;
        //$group_date = date('M j, Y', $group->group_date);
        $date = $db->get_var(" SELECT DATE_FORMAT(group_date, '%b, %e %Y') from " . table_groups . " WHERE group_id = {$group->group_id}");
        //echo $date;
        $group_date = $date;
        //smarty variables
        $main_smarty->assign('group_id', $group_id);
        $main_smarty->assign('group_name', $group_name);
        $main_smarty->assign('group_safename', $group_safename);
        $main_smarty->assign('group_description', $group_description);
        $main_smarty->assign('group_creator', $group_creator);
        $main_smarty->assign('group_status', $group_status);
        $main_smarty->assign('group_members', $group_members);
        $main_smarty->assign('group_privacy', $group_privacy);
        $main_smarty->assign('group_avatar', $group_avatar);
        $main_smarty->assign('group_date', $group_date);
        //get group avatar path
        if ($group_avatar == "uploaded" && file_exists(mnmpath . "avatars/groups_uploaded/" . $group_id . "_" . group_avatar_size_width . ".jpg")) {
            $imgsrc = my_base_url . my_pligg_base . "/avatars/groups_uploaded/" . $group_id . "_" . group_avatar_size_width . ".jpg";
        } else {
            $imgsrc = my_base_url . my_pligg_base . "/templates/" . $the_template . "/img/group_large.gif";
        }
        $main_smarty->assign('imgsrc', $imgsrc);
        //get group creator and his url
        $g_name = get_group_username($group_creator);
        $main_smarty->assign('group_submitter', $g_name);
        $submitter_profile_url = getmyurl('user', $g_name);
        $main_smarty->assign('submitter_profile_url', $submitter_profile_url);
        $main_smarty->assign('group_avatar_url', getmyurl('group_avatar', $group_id));
        //check group admin
        global $current_user;
        if ($current_user->user_id == $group_creator) {
            $main_smarty->assign('is_group_admin', 1);
        }
        //language
        $lang_Created_By = $main_smarty->get_config_vars("PLIGG_Visual_Group_Created_By");
        $lang_Created_On = $main_smarty->get_config_vars("PLIGG_Visual_Group_Created_On");
        $lang_Member = $main_smarty->get_config_vars("PLIGG_Visual_Group_Member");
        //check member
        //include_once(mnminclude.'group.php');
        $main_smarty->assign('is_group_member', isMember($group_id));
        // Joining and unjoining member links
        // Set the url to an empty string if the user has already joined the maximum
        // allowable number of groups
        if (reached_max_joinable_groups($db, $current_user)) {
            $join_url = '';
        } else {
            $join_url = getmyurl("join_group", $group_id);
        }
        $main_smarty->assign('join_group_url', $join_url);
        $main_smarty->assign('unjoin_group_url', getmyurl("unjoin_group", $group_id));
        //check logged or not
        $main_smarty->assign('user_logged_in', $current_user->user_login);
        //sidebar
        $main_smarty = do_sidebar($main_smarty);
        //$main_smarty->assign('form_action', $_SERVER["PHP_SELF"]);
        $group_story_url = getmyurl("group_story_title", $group_safename);
        $main_smarty->assign('group_story_url', $group_story_url);
        $group_edit_url = getmyurl("editgroup", $group_id);
        $group_delete_url = getmyurl("deletegroup", $group_id);
        $group_output .= $main_smarty->fetch(The_Template . '/group_summary.tpl');
        $index++;
    }
    return $group_output;
}
开发者ID:bendroid,项目名称:pligg-cms,代码行数:83,代码来源:group.php

示例14: featured_showpage

function featured_showpage()
{
    global $db, $main_smarty, $the_template;
    $main_smarty = do_sidebar($main_smarty);
    force_authentication();
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('admin');
    if ($canIhaveAccess == 1) {
        // breadcrumbs
        define('modulename', 'featured');
        $main_smarty->assign('modulename', modulename);
        $action = $_REQUEST['action'];
        switch ($action) {
            case "addfeatured":
                if ($_POST['submit'] != null) {
                    $title_safe = addslashes($_POST['featured_link_title']);
                    $description_safe = addslashes($_POST['featured_description']);
                    $info['featured_link_id'] = $_POST['featured_link_id'];
                    $info['featured_link_title'] = $title_safe;
                    $info['featured_description'] = $description_safe;
                    $info['featured_enabled'] = $_POST['status'];
                    if ($_FILES['image']['type'] != null) {
                        $image_type = explode("/", $_FILES['image']['type']);
                    }
                    $image_name = $_FILES['image']['name'];
                    $image_tmp = $_FILES['image']['tmp_name'];
                    // Checking featured ID Exists Or Not
                    if (is_numeric($info['featured_link_id']) == true) {
                        $featured_check = "SELECT featured_link_id FROM " . table_prefix . "featured WHERE featured_link_id=" . $info['featured_link_id'] . "";
                        $result = $db->query($featured_check);
                        $featured_check2 = "SELECT link_id FROM " . table_prefix . "links WHERE link_id=" . $info['featured_link_id'];
                        $result2 = $db->query($featured_check2);
                    }
                    if ($info['featured_link_id'] == null) {
                        $err = "Featured ID must not be left blank!";
                    } else {
                        if (is_numeric($info['featured_link_id']) == false) {
                            $err = "Featured ID must be an integer.";
                        } else {
                            if ($result != null) {
                                $err = "The Featured ID you entered aleady exists in the database.";
                            } else {
                                if ($result2 == null) {
                                    $err = "The Featured ID you entered doesn't match any existing news in the database.";
                                } else {
                                    if ($info['featured_link_title'] == null) {
                                        $err = "Featured Title must not be left blank!";
                                    } else {
                                        if ($info['featured_description'] == null) {
                                            $err = "Featured Description must not be left blank!";
                                        } else {
                                            if ($image_name == null) {
                                                $err = "You must upload an image file to go along with your featured news item!";
                                            } else {
                                                if ($image_type['0'] != 'image') {
                                                    $err = "You must upload an <strong>image file</strong> for the featured image.";
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if ($err) {
                        $main_smarty->assign('err', $err);
                    } else {
                        $handle = fopen($image_tmp, "r");
                        $contents = fread($handle, filesize($image_tmp));
                        $info['featured_image'] = addslashes($contents);
                        $featured_insert = "INSERT INTO " . table_prefix . "featured SET ";
                        foreach ($info as $key => $value) {
                            $featured_insert .= $key . "=" . "'" . $value . "'" . ",";
                        }
                        $featured_insert = substr($featured_insert, 0, strlen($featured_insert) - 1);
                        $db->query($featured_insert);
                        $main_smarty->assign('msg', 'Featured News successfully added!');
                    }
                }
                $main_smarty->assign('tpl_center', featured_tpl_path . 'featured_add');
                $main_smarty->display($template_dir . '/admin/admin.tpl');
                break;
            case "editfeatured":
                $featured_id = $_REQUEST['id'];
                $featured_sql = "SELECT * FROM " . table_prefix . "featured WHERE featured_id=" . $featured_id . "";
                $featured_news = $db->get_results($featured_sql);
                $featured_news = object_2_array($featured_news);
                if ($_POST['submit'] != null) {
                    $title_safe = addslashes($_POST['featured_link_title']);
                    $description_safe = addslashes($_POST['featured_description']);
                    $info['featured_link_id'] = $_POST['featured_link_id'];
                    $info['featured_link_title'] = $title_safe;
                    $info['featured_description'] = $description_safe;
                    $info['featured_enabled'] = $_POST['status'];
                    if ($_FILES['image']['type'] != null) {
                        $image_type = explode("/", $_FILES['image']['type']);
                    }
                    $image_name = $_FILES['image']['name'];
                    $image_tmp = $_FILES['image']['tmp_name'];
                    // Checking featured ID Exists Or Not
//.........这里部分代码省略.........
开发者ID:hyrmedia,项目名称:modules,代码行数:101,代码来源:featured_main.php

示例15: getmyurl

$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
$navwhere['link1'] = getmyurl('admin', '');
$navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_2');
$navwhere['link2'] = my_pligg_base . "/admin_categories.php";
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));
// breadcrumbs
$canIhaveAccess = 0;
$canIhaveAccess = $canIhaveAccess + checklevel('god');
if ($canIhaveAccess == 1) {
    // clear the category sidebar module from the cache so it can regenerate in case we make changes
    $main_smarty->cache = 2;
    $main_smarty->cache_dir = "cache";
    $main_smarty->clear_cache();
    $main_smarty->cache = false;
    $smarty = do_sidebar($smarty);
    $QEIPA = array('table_name' => table_categories, 'field_name' => 'category_name', 'key' => 'category__auto_id');
    // a unique identifier for the row
    $smarty->assign('qeip_CatName', $QEIPA);
    $QEIPA = array('table_name' => table_categories, 'field_name' => 'category_parent', 'key' => 'category__auto_id');
    // a unique identifier for the row
    $smarty->assign('qeip_CatParent', $QEIPA);
    $QEIPA = array('table_name' => table_categories, 'field_name' => 'category_order', 'key' => 'category__auto_id');
    // a unique identifier for the row
    $smarty->assign('qeip_CatOrder', $QEIPA);
    $QEIP = new QuickEIP();
    rebuild_the_tree();
    ordernew();
    //display_the_tree_table();
    // put the category tree into an array for use in the qeip dropdown
    if (isset($_REQUEST['action'])) {
开发者ID:holsinger,项目名称:openfloor,代码行数:31,代码来源:admin_categories.php


注:本文中的do_sidebar函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。