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


PHP session::get_value方法代码示例

本文整理汇总了PHP中session::get_value方法的典型用法代码示例。如果您正苦于以下问题:PHP session::get_value方法的具体用法?PHP session::get_value怎么用?PHP session::get_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在session的用法示例。


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

示例1: emoticons_initialise

function emoticons_initialise()
{
    static $emoticons_array = false;
    if (!is_array($emoticons_array) || sizeof($emoticons_array) < 1) {
        // Get the user's emoticon set from their sesion.
        // Fall back to using the forum default or Beehive default.
        if (($user_emots = session::get_value('EMOTICONS')) === false) {
            $user_emots = forum_get_setting('default_emoticons', null, 'default');
        }
        // Initialize the array incase it's not been done in
        // the definitions.php file by the emoticon authors.
        $emoticon = array();
        // If the user has emoticons set to none (hides them completely)
        // we need to load *all* the emoticon definition files so we can
        // strip them out.
        //
        // If the user has a set specified we load only that set.
        if ($user_emots == 'none') {
            if ($dir = @opendir('emoticons')) {
                while (($file = @readdir($dir)) !== false) {
                    if ($file != '.' && $file != '..' && @is_dir("emoticons/{$file}")) {
                        if (@file_exists("emoticons/{$file}/definitions.php")) {
                            include "emoticons/{$file}/definitions.php";
                        }
                    }
                }
            }
        } else {
            if (@file_exists("emoticons/{$user_emots}/definitions.php")) {
                include "emoticons/{$user_emots}/definitions.php";
            }
        }
        // Check that we have successfully loaded the emoticons.
        // If we have we need to process them a bit, otherwise
        // we bail out.
        if (sizeof($emoticon) > 0) {
            // Reverse the order of the keys and reset the
            // internal pointer.
            krsort($emoticon);
            reset($emoticon);
            // Set up our emoticon text array for display
            // of the selection box on post.php etc.
            $emoticon_text = array();
            // Group similar named emoticons together
            foreach ($emoticon as $key => $value) {
                $emoticon_text[$value][] = $key;
            }
            // Sort our array by key length so we don't have
            // the match text for emoticons inadvertantly matching
            // the wrong emoticon.
            uksort($emoticon, 'sort_by_length_callback');
            // Set our vars for the convert function
            $emoticons_array = $emoticon;
        }
    }
    return $emoticons_array;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:57,代码来源:emoticons.inc.php

示例2: lang_detect

function lang_detect()
{
    if ($language = session::get_value('LANGUAGE')) {
        if (lang_set($language)) {
            return $language;
        }
    }
    $languages = array();
    if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
        $accepted = preg_split('/,\\s*/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
        foreach ($accepted as $accept) {
            $matches_array = array();
            if (!preg_match('/^([a-z]{1,8}(?:[-_][a-z]{1,8})*)(?:;\\s*q=(0(?:\\.[0-9]{1,3})?|1(?:\\.0{1,3})?))?$/i', $accept, $matches_array)) {
                continue;
            }
            $quality = isset($matches_array[2]) ? (double) $matches_array[2] : 1.0;
            $countries = explode('-', $matches_array[1]);
            $region = array_shift($countries);
            $countries2 = explode('_', $region);
            $region = array_shift($countries2);
            foreach ($countries as $country) {
                $languages[$region . '_' . mb_strtoupper($country)] = $quality;
            }
            foreach ($countries2 as $country) {
                $languages[$region . '_' . mb_strtoupper($country)] = $quality;
            }
            if (!isset($languages[$region]) || $languages[$region] < $quality) {
                $languages[$region] = $quality;
            }
        }
    }
    foreach (array_keys($languages) as $language) {
        if (lang_set($language)) {
            return $language;
        }
    }
    return lang_set('en_GB');
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:38,代码来源:lang.inc.php

示例3: header_redirect

         if (preg_match("/^links_detail.php/u", $ret) > 0) {
             header_redirect("links_detail.php?webtag={$webtag}&lid={$lid}&link_approve_success={$lid}");
             exit;
         } else {
             html_draw_top(sprintf('title=%s', gettext("Approve Link")), 'class=window_title');
             html_display_msg(gettext("Approve Link"), sprintf(gettext("Successfully approved link"), $lid), "admin_link_approve.php", 'get', array('back' => gettext("Back")), array('ret' => $ret), '_self', 'center');
             html_draw_bottom();
             exit;
         }
     } else {
         $error_msg_array[] = gettext("Link approval failed");
     }
 } else {
     if (isset($_POST['delete'])) {
         if (links_delete($lid)) {
             if (session::check_perm(USER_PERM_FOLDER_MODERATE, 0) && $link['UID'] != session::get_value('UID')) {
                 admin_add_log_entry(DELETE_LINK, array($lid));
             }
             if (preg_match("/^links_detail.php/u", $ret) > 0) {
                 header_redirect("links_detail.php?webtag={$webtag}&lid={$lid}&link_approve_success={$lid}");
                 exit;
             } else {
                 html_draw_top(sprintf('title=%s', gettext("Approve Link")), 'class=window_title');
                 html_display_msg(gettext("Approve Link"), sprintf(gettext("Successfully deleted link"), $lid), "admin_link_approve.php", 'get', array('back' => gettext("Back")), array('ret' => $ret), '_self', 'center');
                 html_draw_bottom();
                 exit;
             }
         } else {
             $error_msg_array[] = gettext("Error deleting link");
         }
     }
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:admin_link_approve.php

示例4: format_date

function format_date($time)
{
    if (($timezone_id = session::get_value('TIMEZONE')) === false) {
        $timezone_id = forum_get_setting('forum_timezone', null, 27);
    }
    if (($gmt_offset = session::get_value('GMT_OFFSET')) === false) {
        $gmt_offset = forum_get_setting('forum_gmt_offset', null, 0);
    }
    if (($dst_offset = session::get_value('DST_OFFSET')) === false) {
        $dst_offset = forum_get_setting('forum_dst_offset', null, 0);
    }
    if (($dl_saving = session::get_value('DL_SAVING')) === false) {
        $dl_saving = forum_get_setting('forum_dl_saving', null, 'N');
    }
    // Calculate $time in user's timezone.
    $time = $time + $gmt_offset * HOUR_IN_SECONDS;
    // Calculate the current time in user's timezone.
    $current_time = time() + $gmt_offset * HOUR_IN_SECONDS;
    // Check for DST changes
    if ($dl_saving == 'Y' && timestamp_is_dst($timezone_id, $gmt_offset)) {
        // Ammend the $time to include DST
        $time = $time + $dst_offset * HOUR_IN_SECONDS;
        // Ammend the current time to include DST
        $current_time = $current_time + $dst_offset * HOUR_IN_SECONDS;
    }
    // Get the year of $time
    $time_year = gmdate("Y", $time);
    // Get the year for the current time
    $current_year = gmdate('Y', $current_time);
    // Only show the year if it is different to the current year
    if ($time_year != $current_year) {
        if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
            $format = strftime('%#d %b %Y', $time);
        } else {
            $format = strftime('%e %b %Y', $time);
        }
    } else {
        if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
            $format = strftime('%#d %b', $time);
        } else {
            $format = strftime('%e %b', $time);
        }
    }
    return $format;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:45,代码来源:format.inc.php

示例5: gettext

if (session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
    echo "                      <tr>\n";
    echo "                        <td align=\"left\">&nbsp;</td>\n";
    echo "                      </tr>\n";
    echo "                      <tr>\n";
    echo "                        <td align=\"left\"><h2>", gettext("Admin"), "</h2></td>\n";
    echo "                      </tr>\n";
    echo "                      <tr>\n";
    echo "                        <td align=\"left\">", form_checkbox("closed", "Y", gettext("Close for posting"), isset($closed) ? $closed == 'Y' : false), "</td>\n";
    echo "                      </tr>\n";
    echo "                      <tr>\n";
    echo "                        <td align=\"left\">", form_checkbox("sticky", "Y", gettext("Make sticky"), isset($sticky) ? $sticky == 'Y' : false), "</td>\n";
    echo "                      </tr>\n";
}
echo "                    </table>\n";
if (($user_emoticon_pack = session::get_value('EMOTICONS')) === false) {
    $user_emoticon_pack = forum_get_setting('default_emoticons', null, 'default');
}
if ($emoticon_preview_html = emoticons_preview($user_emoticon_pack)) {
    echo "                    <br />\n";
    echo "                    <table width=\"196\" class=\"messagefoot\" cellspacing=\"0\">\n";
    echo "                      <tr>\n";
    echo "                        <td align=\"left\" class=\"subhead\">", gettext("Emoticons"), "</td>\n";
    if (($page_prefs & POST_EMOTICONS_DISPLAY) > 0) {
        echo "                        <td class=\"subhead\" align=\"right\">", form_submit_image('hide.png', 'emots_toggle', 'hide', '', 'button_image toggle_button', '', 'button_image toggle_button'), "&nbsp;</td>\n";
    } else {
        echo "                        <td class=\"subhead\" align=\"right\">", form_submit_image('show.png', 'emots_toggle', 'show', '', 'button_image toggle_button', '', 'button_image toggle_button'), "&nbsp;</td>\n";
    }
    echo "                      </tr>\n";
    echo "                      <tr>\n";
    echo "                        <td align=\"left\" colspan=\"2\">\n";
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:create_poll.php

示例6: cache_disable

USA
======================================================================*/
// Bootstrap
require_once 'boot.php';
// Includes required by this page.
require_once BH_INCLUDE_PATH . 'cache.inc.php';
require_once BH_INCLUDE_PATH . 'constants.inc.php';
require_once BH_INCLUDE_PATH . 'header.inc.php';
require_once BH_INCLUDE_PATH . 'html.inc.php';
require_once BH_INCLUDE_PATH . 'lang.inc.php';
require_once BH_INCLUDE_PATH . 'logon.inc.php';
require_once BH_INCLUDE_PATH . 'session.inc.php';
// Don't cache this page - fixes problems with Opera.
cache_disable();
// Get the user's saved left frame width.
if (($left_frame_width = session::get_value('LEFT_FRAME_WIDTH')) === false) {
    $left_frame_width = 280;
}
html_draw_top('frame_set_html', 'pm_popup_disabled');
$frameset = new html_frameset_cols('start', "{$left_frame_width},*");
if (isset($_GET['left']) && $_GET['left'] == "threadlist") {
    $frameset->html_frame("thread_list.php?webtag={$webtag}", html_get_frame_name('left'));
} else {
    $frameset->html_frame("start_left.php?webtag={$webtag}", html_get_frame_name('left'));
}
if (isset($_GET['show']) && $_GET['show'] == "visitors") {
    $frameset->html_frame("visitor_log.php?webtag={$webtag}", html_get_frame_name('right'));
} else {
    $frameset->html_frame("start_main.php?webtag={$webtag}", html_get_frame_name('right'));
}
$frameset->output_html();
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:start.php

示例7: stats_get_post_tallys

function stats_get_post_tallys($start_timestamp, $end_timestamp)
{
    if (!($db = db::get())) {
        return false;
    }
    if (!is_numeric($start_timestamp)) {
        return false;
    }
    if (!is_numeric($end_timestamp)) {
        return false;
    }
    if (!($table_prefix = get_table_prefix())) {
        return false;
    }
    $post_tallys = array('user_stats' => array(), 'post_count' => 0);
    $uid = session::get_value('UID');
    $post_start_datetime = date(MYSQL_DATETIME, $start_timestamp);
    $post_end_datetime = date(MYSQL_DATETIME, $end_timestamp);
    $sql = "SELECT COUNT(POST.PID) AS TOTAL_POST_COUNT ";
    $sql .= "FROM `{$table_prefix}POST` POST ";
    $sql .= "WHERE POST.CREATED > CAST('{$post_start_datetime}' AS DATETIME) ";
    $sql .= "AND POST.CREATED < CAST('{$post_end_datetime}' AS DATETIME)";
    if (!($result = $db->query($sql))) {
        return false;
    }
    list($post_tallys['post_count']) = $result->fetch_row();
    $sql = "SELECT POST.FROM_UID AS UID, USER.LOGON, USER.NICKNAME, ";
    $sql .= "USER_PEER.PEER_NICKNAME, COUNT(POST.PID) AS POST_COUNT ";
    $sql .= "FROM `{$table_prefix}POST` POST ";
    $sql .= "LEFT JOIN USER USER ON (USER.UID = POST.FROM_UID) ";
    $sql .= "LEFT JOIN `{$table_prefix}USER_PEER` USER_PEER ";
    $sql .= "ON (USER_PEER.PEER_UID = USER.UID AND USER_PEER.UID = '{$uid}') ";
    $sql .= "WHERE POST.CREATED > CAST('{$post_start_datetime}' AS DATETIME) ";
    $sql .= "AND POST.CREATED < CAST('{$post_end_datetime}' AS DATETIME) ";
    $sql .= "GROUP BY POST.FROM_UID ORDER BY POST_COUNT DESC ";
    $sql .= "LIMIT 0, 20";
    if (!($result = $db->query($sql))) {
        return false;
    }
    if ($result->num_rows > 0) {
        while ($user_stats = $result->fetch_assoc()) {
            if (isset($user_stats['LOGON']) && isset($user_stats['PEER_NICKNAME'])) {
                if (!is_null($user_stats['PEER_NICKNAME']) && strlen($user_stats['PEER_NICKNAME']) > 0) {
                    $user_stats['NICKNAME'] = $user_stats['PEER_NICKNAME'];
                }
            }
            if (!isset($user_stats['LOGON'])) {
                $user_stats['LOGON'] = gettext("Unknown user");
            }
            if (!isset($user_stats['NICKNAME'])) {
                $user_stats['NICKNAME'] = "";
            }
            $post_tallys['user_stats'][] = $user_stats;
        }
    }
    return $post_tallys;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:57,代码来源:stats.inc.php

示例8: post_delete

function post_delete($tid, $pid)
{
    if (!is_numeric($tid)) {
        return false;
    }
    if (!is_numeric($pid)) {
        return false;
    }
    if (!($table_prefix = get_table_prefix())) {
        return false;
    }
    if (!($db = db::get())) {
        return false;
    }
    if (($approve_uid = session::get_value('UID')) === false) {
        return false;
    }
    $current_datetime = date(MYSQL_DATETIME, time());
    if (thread_is_poll($tid) && $pid == 1) {
        $sql = "UPDATE LOW_PRIORITY `{$table_prefix}THREAD` SET POLL_FLAG = 'N', ";
        $sql .= "MODIFIED = CAST('{$current_datetime}' AS DATETIME) WHERE TID = '{$tid}'";
        if (!$db->query($sql)) {
            return false;
        }
    }
    $sql = "UPDATE LOW_PRIORITY `{$table_prefix}THREAD` SET DELETED = 'Y', ";
    $sql .= "MODIFIED = CAST('{$current_datetime}' AS DATETIME) WHERE TID = '{$tid}' AND LENGTH = 1";
    if (!$db->query($sql)) {
        return false;
    }
    $sql = "UPDATE LOW_PRIORITY `{$table_prefix}POST_CONTENT` SET CONTENT = NULL ";
    $sql .= "WHERE TID = '{$tid}' AND PID = '{$pid}'";
    if (!$db->query($sql)) {
        return false;
    }
    $sql = "UPDATE LOW_PRIORITY `{$table_prefix}POST` ";
    $sql .= "SET APPROVED = CAST('{$current_datetime}' AS DATETIME), ";
    $sql .= "APPROVED_BY = '{$approve_uid}' WHERE TID = '{$tid}' ";
    $sql .= "AND PID = '{$pid}'";
    if (!$db->query($sql)) {
        return false;
    }
    return true;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:44,代码来源:post.inc.php

示例9: word_filter_ob_callback

function word_filter_ob_callback($content)
{
    if (($rand_hash = session::get_value('RAND_HASH')) === false) {
        return word_filter_remove_ob_tags($content);
    }
    $rand_hash = preg_replace("/[^a-z]/iu", "", $rand_hash);
    if (!($user_wordfilter = word_filter_get_from_session())) {
        return word_filter_remove_ob_tags($content);
    }
    $pattern_array = $user_wordfilter['pattern_array'];
    $replace_array = $user_wordfilter['replace_array'];
    $pattern_match = sprintf('/<\\/?strip_%1$s>/u', $rand_hash);
    $content_array = preg_split($pattern_match, $content);
    foreach ($content_array as $key => $content_match) {
        if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) {
            $content_array[$key] = strip_tags($new_content);
        }
    }
    $content = implode('', $content_array);
    $pattern_match = sprintf('/<\\/?nostrip_%1$s>/u', $rand_hash);
    $content_array = preg_split($pattern_match, $content);
    foreach ($content_array as $key => $content_match) {
        if ($key % 2 && ($new_content = @preg_replace($pattern_array, $replace_array, $content_match))) {
            $content_array[$key] = $new_content;
        }
    }
    $content = implode('', $content_array);
    return word_filter_remove_ob_tags($content);
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:29,代码来源:word_filter.inc.php

示例10: light_html_guest_error

require_once BH_INCLUDE_PATH . 'session.inc.php';
require_once BH_INCLUDE_PATH . 'thread.inc.php';
require_once BH_INCLUDE_PATH . 'user.inc.php';
require_once BH_INCLUDE_PATH . 'user_rel.inc.php';
require_once BH_INCLUDE_PATH . 'word_filter.inc.php';
// Check we're logged in correctly
if (!session::logged_in()) {
    light_html_guest_error();
}
if (!folder_get_by_type_allowed(FOLDER_ALLOW_NORMAL_THREAD)) {
    light_html_message_type_error();
}
$show_sigs = session::get_value('VIEW_SIGS') == 'N' ? false : true;
$uid = session::get_value('UID');
$page_prefs = session::get_post_page_prefs();
if (($high_interest = session::get_value('MARK_AS_OF_INT')) === false) {
    $high_interest = "N";
}
$valid = true;
$new_thread = false;
$t_to_uid = 0;
$t_sig = user_get_sig($uid);
if (isset($_POST['t_newthread']) && (isset($_POST['post']) || isset($_POST['preview']))) {
    $new_thread = true;
    if (isset($_POST['t_threadtitle']) && strlen(trim($_POST['t_threadtitle'])) > 0) {
        $t_threadtitle = trim($_POST['t_threadtitle']);
    } else {
        $error_msg_array[] = gettext("You must enter a title for the thread!");
        $valid = false;
    }
    if (isset($_POST['t_fid']) && is_numeric($_POST['t_fid'])) {
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:lpost.php

示例11: html_draw_top


//.........这里部分代码省略.........
    }
    if (isset($stylesheet_array) && is_array($stylesheet_array)) {
        foreach ($stylesheet_array as $stylesheet) {
            if (isset($stylesheet['filename']) && isset($stylesheet['media'])) {
                html_include_css($stylesheet['filename'], $stylesheet['media']);
            }
        }
    }
    if ($style_path_ie6 = html_get_style_sheet('style_ie6.css')) {
        echo "<!--[if IE 6]>\n";
        html_include_css($style_path_ie6);
        echo "<![endif]-->\n";
    }
    if (isset($inline_css)) {
        echo "<style type=\"text/css\">\n";
        echo "<!--\n\n", $inline_css, "\n\n//-->\n";
        echo "</style>\n";
    }
    // Font size (not for Guests)
    if (session::logged_in()) {
        html_include_css(html_get_forum_file_path(sprintf('font_size.php?webtag=%s', $webtag)), 'screen', 'user_font');
    }
    if ($base_target) {
        echo "<base target=\"{$base_target}\" />\n";
    }
    html_include_javascript(html_get_forum_file_path('js/jquery-1.7.1.min.js'));
    html_include_javascript(html_get_forum_file_path('js/jquery-ui-1.8.22.autocomplete.min.js'));
    html_include_javascript(html_get_forum_file_path('js/jquery.parsequery.js'));
    html_include_javascript(html_get_forum_file_path('js/jquery.sprintf.js'));
    html_include_javascript(html_get_forum_file_path('js/jquery.url.js'));
    html_include_javascript(html_get_forum_file_path('js/general.js'));
    if ($frame_set_html === false) {
        // Check for any new PMs.
        if (session::logged_in()) {
            // Check to see if the PM popup is disabled on the current page.
            if ($pm_popup_disabled === false) {
                // Pages we don't want the popup to appear on
                $pm_popup_disabled_pages = array('admin.php', 'attachments.php', 'change_pw.php', 'confirm_email.php', 'dictionary.php', 'discussion.php', 'display_emoticons.php', 'edit_attachments.php', 'email.php', 'font_size.php', 'forgot_pw.php', 'get_attachment.php', 'index.php', 'mods_list.php', 'nav.php', 'pm.php', 'pm_edit.php', 'pm_folders.php', 'pm_messages.php', 'pm_options.php', 'poll_results.php', 'start.php', 'search_popup.php', 'threads_rss.php', 'user.php', 'user_font.php', 'user_profile.php', 'user_stats.php');
                // Check that we're not on one of the pages.
                if (!in_array(basename($_SERVER['PHP_SELF']), $pm_popup_disabled_pages)) {
                    html_include_javascript(html_get_forum_file_path('js/pm.js'));
                }
            }
            // Overflow auto-resize functionality.
            $resize_images_page = array('admin_post_approve.php', 'create_poll.php', 'delete.php', 'display.php', 'edit.php', 'edit_poll.php', 'edit_signature.php', 'messages.php', 'post.php', 'pm_write.php', 'pm_edit.php', 'pm_messages.php');
            if (in_array(basename($_SERVER['PHP_SELF']), $resize_images_page)) {
                if (session::get_value('USE_OVERFLOW_RESIZE') == 'Y') {
                    html_include_javascript(html_get_forum_file_path('js/overflow.js'));
                }
            }
            // Mouseover spoiler pages
            $message_display_pages = array('admin_post_approve.php', 'create_poll.php', 'delete.php', 'display.php', 'edit.php', 'edit_poll.php', 'edit_signature.php', 'ldisplay.php', 'lmessages.php', 'lpost.php', 'messages.php', 'post.php');
            if (in_array(basename($_SERVER['PHP_SELF']), $message_display_pages)) {
                html_include_javascript(html_get_forum_file_path('js/spoiler.js'));
            }
        }
        // Stats Display pages
        $stats_display_pages = array('messages.php');
        if (in_array(basename($_SERVER['PHP_SELF']), $stats_display_pages)) {
            html_include_javascript(html_get_forum_file_path('js/stats.js'));
        }
    }
    reset($arg_array);
    foreach ($arg_array as $func_args) {
        html_include_javascript(html_get_forum_file_path("js/{$func_args}"));
    }
    html_include_javascript(html_get_forum_file_path("ckeditor/ckeditor.js"));
    html_include_javascript(html_get_forum_file_path("ckeditor/adapters/jquery.js"));
    html_include_javascript(html_get_forum_file_path("json.php?webtag={$webtag}"));
    if ($frame_set_html === true && ($google_analytics_code = html_get_google_analytics_code())) {
        echo "<script type=\"text/javascript\">\n\n";
        echo "  var _gaq = _gaq || [];\n";
        echo "  _gaq.push(['_setAccount', '{$google_analytics_code}']);\n";
        echo "  _gaq.push(['_trackPageview']);\n\n";
        echo "  (function() {\n";
        echo "    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
        echo "    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
        echo "    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
        echo "  })();\n\n";
        echo "</script>\n";
    }
    if ($frame_set_html === false && forum_get_setting('show_share_links', 'Y') && session::get_value('SHOW_SHARE_LINKS') == 'Y') {
        echo "<script type=\"text/javascript\" src=\"https://apis.google.com/js/plusone.js\">\n";
        echo "{lang: 'en-GB'}\n";
        echo "</script>\n";
        echo "<script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script>\n";
        echo "<script type=\"text/javascript\" src=\"http://connect.facebook.net/en_US/all.js#xfbml=1\"></script>\n";
    }
    echo "</head>\n\n";
    if ($frame_set_html === false) {
        echo "<body", $body_class ? " class=\"{$body_class}\">\n" : ">\n";
        if (html_output_adsense_settings() && adsense_check_user() && adsense_check_page()) {
            adsense_output_html();
            echo "<br />\n";
        }
        if (forum_get_setting('show_share_links', 'Y') && session::get_value('SHOW_SHARE_LINKS') == 'Y') {
            echo '<div id="fb-root"></div>';
        }
    }
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:101,代码来源:html.inc.php

示例12: gettext

    echo "                  <td align=\"left\" width=\"25\">&nbsp;</td>\n";
    echo "                </tr>\n";
}
echo "                <tr>\n";
echo "                  <td align=\"left\" colspan=\"5\">&nbsp;</td>\n";
echo "                </tr>\n";
echo "              </table>\n";
echo "            </td>\n";
echo "          </tr>\n";
echo "        </table>\n";
echo "      </td>\n";
echo "    </tr>\n";
echo "    <tr>\n";
echo "      <td align=\"left\">&nbsp;</td>\n";
echo "    </tr>\n";
if ($uid == session::get_value('UID')) {
    if (!is_md5($aid)) {
        $aid = md5(uniqid(mt_rand()));
    }
    if ($popup == 1) {
        echo "    <tr>\n";
        echo "      <td align=\"center\">";
        echo "        <a href=\"attachments.php?webtag={$webtag}&amp;aid={$aid}\" class=\"button popup 660x500\" id=\"attachments\"><span>", gettext("Attachments"), "</span></a>\n";
        echo "        &nbsp;", form_submit('delete', gettext("Delete")), "&nbsp;", form_submit('close', gettext("Close"));
        echo "      </td>\n";
        echo "    </tr>\n";
    } else {
        echo "    <tr>\n";
        echo "      <td align=\"center\">";
        echo "        <a href=\"attachments.php?webtag={$webtag}&amp;aid={$aid}\" class=\"button popup 660x500\" id=\"attachments\"><span>", gettext("Attachments"), "</span></a>\n";
        echo "        &nbsp;", form_submit('delete', gettext("Delete"));
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:edit_attachments.php

示例13: user_get_profile_entries

function user_get_profile_entries($uid)
{
    if (!($db = db::get())) {
        return false;
    }
    if (!is_numeric($uid)) {
        return false;
    }
    if (!($table_prefix = get_table_prefix())) {
        return false;
    }
    $user_profile_array = array();
    $session_uid = session::get_value('UID');
    $peer_relationship = user_get_relationship($uid, $session_uid);
    $user_friend = USER_FRIEND;
    $sql = "SELECT PROFILE_SECTION.PSID, PROFILE_ITEM.PIID, PROFILE_ITEM.NAME, ";
    $sql .= "PROFILE_ITEM.TYPE, PROFILE_ITEM.OPTIONS, USER_PROFILE.ENTRY, USER_PROFILE.PRIVACY ";
    $sql .= "FROM `{$table_prefix}PROFILE_SECTION` PROFILE_SECTION ";
    $sql .= "LEFT JOIN `{$table_prefix}PROFILE_ITEM` PROFILE_ITEM ";
    $sql .= "ON (PROFILE_ITEM.PSID = PROFILE_SECTION.PSID) ";
    $sql .= "LEFT JOIN `{$table_prefix}USER_PROFILE` USER_PROFILE ";
    $sql .= "ON (USER_PROFILE.PIID = PROFILE_ITEM.PIID AND USER_PROFILE.UID = '{$uid}' ";
    $sql .= "AND (USER_PROFILE.PRIVACY = 0 OR USER_PROFILE.UID = '{$session_uid}' ";
    $sql .= "OR (USER_PROFILE.PRIVACY = 1 AND ({$peer_relationship} & {$user_friend} > 0)))) ";
    $sql .= "WHERE USER_PROFILE.ENTRY IS NOT NULL ORDER BY PROFILE_SECTION.POSITION, ";
    $sql .= "PROFILE_ITEM.POSITION, PROFILE_ITEM.PIID";
    if (!($result = $db->query($sql))) {
        return false;
    }
    if ($result->num_rows == 0) {
        return false;
    }
    while ($user_profile_data = $result->fetch_assoc()) {
        if (strlen(trim($user_profile_data['ENTRY'])) > 0) {
            if ($user_profile_data['TYPE'] == PROFILE_ITEM_RADIO || $user_profile_data['TYPE'] == PROFILE_ITEM_DROPDOWN) {
                $profile_item_options_array = explode("\n", $user_profile_data['OPTIONS']);
                if (isset($profile_item_options_array[$user_profile_data['ENTRY']])) {
                    $user_profile_array[$user_profile_data['PSID']][$user_profile_data['PIID']] = $user_profile_data;
                }
            } else {
                $user_profile_array[$user_profile_data['PSID']][$user_profile_data['PIID']] = $user_profile_data;
            }
        }
    }
    return sizeof($user_profile_array) > 0 ? $user_profile_array : false;
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:46,代码来源:user_profile.inc.php

示例14: gettext

echo "                    <table class=\"posthead\" width=\"95%\">\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" width=\"25%\">", gettext("From"), ":</td>\n";
echo "                        <td align=\"left\">", word_filter_add_ob_tags($from_user['NICKNAME'], true), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\">", gettext("Subject"), ":</td>\n";
echo "                        <td align=\"left\">", form_input_text("t_subject", isset($subject) ? htmlentities_array($subject) : '', 54, 128), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" valign=\"top\">", gettext("Message"), ":</td>\n";
echo "                        <td align=\"left\">", form_textarea("t_message", isset($message) ? htmlentities_array($message) : '', 12, 51), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" valign=\"top\">&nbsp;</td>\n";
echo "                        <td align=\"left\">", form_checkbox('t_use_email_addr', 'Y', gettext("Use my real email address to send this message"), isset($use_email_addr) ? $use_email_addr : session::get_value('USE_EMAIL_ADDR') == 'Y'), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" colspan=\"2\">&nbsp;</td>\n";
echo "                      </tr>\n";
echo "                    </table>\n";
echo "                  </td>\n";
echo "                </tr>\n";
echo "              </table>\n";
echo "            </td>\n";
echo "          </tr>\n";
echo "        </table>\n";
echo "      </td>\n";
echo "    </tr>\n";
echo "    <tr>\n";
echo "      <td align=\"left\">&nbsp;</td>\n";
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:email.php

示例15: threads_search_user_subscriptions

function threads_search_user_subscriptions($thread_search, $interest_type = THREAD_NOINTEREST, $page = 1)
{
    if (!($db = db::get())) {
        return false;
    }
    if (!is_numeric($interest_type)) {
        $interest_type = THREAD_NOINTEREST;
    }
    if (!is_numeric($page)) {
        $page = 1;
    }
    if (!($table_prefix = get_table_prefix())) {
        return false;
    }
    $offset = calculate_page_offset($page, 20);
    $thread_search = $db->escape($thread_search);
    $thread_subscriptions_array = array();
    $uid = session::get_value('UID');
    if ($interest_type != THREAD_NOINTEREST) {
        $sql = "SELECT SQL_CALC_FOUND_ROWS THREAD.TID, ";
        $sql .= "TRIM(CONCAT_WS(' ', COALESCE(FOLDER.PREFIX, ''), THREAD.TITLE)) AS TITLE, ";
        $sql .= "USER_THREAD.INTEREST FROM `{$table_prefix}THREAD` THREAD ";
        $sql .= "LEFT JOIN `{$table_prefix}FOLDER` FOLDER ON (FOLDER.FID = THREAD.FID) ";
        $sql .= "LEFT JOIN `{$table_prefix}USER_THREAD` USER_THREAD ON (USER_THREAD.TID = THREAD.TID ";
        $sql .= "AND USER_THREAD.UID = '{$uid}') WHERE USER_THREAD.INTEREST = '{$interest_type}' ";
        $sql .= "AND THREAD.TITLE LIKE '{$thread_search}%' ORDER BY THREAD.MODIFIED DESC ";
        $sql .= "LIMIT {$offset}, 20";
    } else {
        $sql = "SELECT SQL_CALC_FOUND_ROWS THREAD.TID, ";
        $sql .= "TRIM(CONCAT_WS(' ', COALESCE(FOLDER.PREFIX, ''), THREAD.TITLE)) AS TITLE, ";
        $sql .= "USER_THREAD.INTEREST FROM `{$table_prefix}THREAD` THREAD ";
        $sql .= "LEFT JOIN `{$table_prefix}FOLDER` FOLDER ON (FOLDER.FID = THREAD.FID) ";
        $sql .= "LEFT JOIN `{$table_prefix}USER_THREAD` USER_THREAD ON (USER_THREAD.TID = THREAD.TID ";
        $sql .= "AND USER_THREAD.UID = '{$uid}') WHERE USER_THREAD.INTEREST <> 0 ";
        $sql .= "AND THREAD.TITLE LIKE '{$thread_search}%' ORDER BY THREAD.MODIFIED DESC ";
        $sql .= "LIMIT {$offset}, 20";
    }
    if (!($result = $db->query($sql))) {
        return false;
    }
    $sql = "SELECT FOUND_ROWS() AS ROW_COUNT";
    if (!($result_count = $db->query($sql))) {
        return false;
    }
    list($thread_subscriptions_count) = $result_count->fetch_row();
    if ($result->num_rows == 0 && $thread_subscriptions_count > 0 && $page > 1) {
        return threads_search_user_subscriptions($thread_search, $interest_type, $page - 1);
    }
    while ($thread_data_array = $result->fetch_assoc()) {
        $thread_subscriptions_array[] = $thread_data_array;
    }
    return array('thread_count' => $thread_subscriptions_count, 'thread_array' => $thread_subscriptions_array);
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:53,代码来源:threads.inc.php


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