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


PHP thread_get函数代码示例

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


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

示例1: nodeurl

function nodeurl($lang, $thread_id, $node_id)
{
    global $db_debug;
    $flag = $db_debug;
    $db_debug = false;
    $action = false;
    $args = array();
    if ($thread_id) {
        $r = thread_get($lang, $thread_id);
        if (!$r) {
            return false;
        }
        $action = $r['thread_type'];
        $args[] = $r['thread_name'];
    }
    if ($node_id) {
        $r = node_get($lang, $node_id);
        if (!$r) {
            return false;
        }
        $args[] = $r['node_name'];
    }
    $db_debug = $flag;
    return url($action, $lang, $args);
}
开发者ID:RazorMarx,项目名称:izend,代码行数:25,代码来源:nodeurl.php

示例2: threadsummary

function threadsummary($lang, $thread)
{
    global $system_languages, $with_toolbar;
    if (!user_has_role('writer')) {
        return run('error/unauthorized', $lang);
    }
    $slang = false;
    if (isset($_GET['slang'])) {
        $slang = $_GET['slang'];
    } else {
        $slang = $lang;
    }
    if (!in_array($slang, $system_languages)) {
        return run('error/notfound', $lang);
    }
    $thread_id = thread_id($thread);
    if (!$thread_id) {
        return run('error/notfound', $lang);
    }
    $r = thread_get($lang, $thread_id);
    if (!$r) {
        return run('error/notfound', $lang);
    }
    extract($r);
    /* thread_name thread_title thread_type thread_abstract thread_cloud thread_image thread_visits thread_nosearch thread_nocloud thread_nocomment thread_nomorecomment thread_novote thread_nomorevote thread_created thread_modified */
    $thread_search = !$thread_nosearch;
    $thread_tag = !$thread_nocloud;
    $thread_comment = !$thread_nocomment;
    $thread_morecomment = !$thread_nomorecomment;
    $thread_vote = !$thread_novote;
    $thread_morevote = !$thread_nomorevote;
    $thread_contents = array();
    $r = thread_get_contents($lang, $thread_id, false);
    if ($r) {
        $thread_url = url('thread', $lang) . '/' . $thread_id;
        foreach ($r as $c) {
            extract($c);
            /* node_id node_name node_title node_number node_ignored */
            $node_url = $thread_url . '/' . $node_id . '?' . 'slang=' . $slang;
            $thread_contents[] = compact('node_id', 'node_title', 'node_url', 'node_ignored');
        }
    }
    $headline_text = translate('threadall:title', $slang);
    $headline_url = url('thread', $lang) . '?' . 'slang=' . $slang;
    $headline = compact('headline_text', 'headline_url');
    $title = view('headline', false, $headline);
    $sidebar = view('sidebar', false, compact('title'));
    head('title', $thread_title ? $thread_title : $thread_id);
    head('description', $thread_abstract);
    head('keywords', $thread_cloud);
    head('robots', 'noindex, nofollow');
    $edit = user_has_role('writer') ? url('threadedit', $_SESSION['user']['locale']) . '/' . $thread_id . '?' . 'clang=' . $lang : false;
    $banner = build('banner', $lang, $with_toolbar ? compact('headline') : compact('headline', 'edit'));
    $scroll = true;
    $toolbar = $with_toolbar ? build('toolbar', $lang, compact('edit', 'scroll')) : false;
    $content = view('threadsummary', $slang, compact('thread_id', 'thread_title', 'thread_abstract', 'thread_cloud', 'thread_image', 'thread_visits', 'thread_search', 'thread_tag', 'thread_comment', 'thread_morecomment', 'thread_vote', 'thread_morevote', 'thread_ilike', 'thread_tweet', 'thread_plusone', 'thread_linkedin', 'thread_pinit', 'thread_created', 'thread_modified', 'thread_contents'));
    $output = layout('viewing', compact('toolbar', 'banner', 'content', 'sidebar'));
    return $output;
}
开发者ID:RazorMarx,项目名称:izend,代码行数:59,代码来源:threadsummary.php

示例3: suggest

function suggest($lang, $arglist = false)
{
    global $search_all, $rss_thread;
    $cloud = false;
    if (is_array($arglist)) {
        if (isset($arglist[0])) {
            $cloud = $arglist[0];
        }
    }
    $cloud_id = false;
    if ($cloud) {
        $cloud_id = cloud_id($cloud);
        if (!$cloud_id) {
            header('HTTP/1.1 404 Not Found');
            return false;
        }
        if ($cloud_id == $rss_thread) {
            if (!user_has_role('administrator')) {
                header('HTTP/1.1 401 Unauthorized');
                return false;
            }
        }
        $r = thread_get($lang, $cloud_id);
        if (!$r) {
            header('HTTP/1.1 404 Not Found');
            return false;
        }
        extract($r);
        /* thread_type thread_nosearch */
        if ($thread_type == 'thread' or $thread_nosearch) {
            header('HTTP/1.1 404 Not Found');
            return false;
        }
    } else {
        if ($search_all !== true) {
            header('HTTP/1.1 404 Not Found');
            return false;
        }
    }
    $term = isset($arglist['term']) ? $arglist['term'] : false;
    if (!$term) {
        header('HTTP/1.1 400 Bad Request');
        return false;
    }
    $r = cloud_suggest($lang, $cloud_id, $term);
    if (!$r) {
        header('HTTP/1.1 404 Not Found');
        return false;
    }
    $taglist = array();
    foreach ($r as $tag) {
        $taglist[] = $tag['tag_name'];
    }
    return json_encode($taglist);
}
开发者ID:RazorMarx,项目名称:izend,代码行数:55,代码来源:suggest.php

示例4: foldersummary

function foldersummary($lang, $folder)
{
    global $with_toolbar;
    $folder_id = thread_id($folder);
    if (!$folder_id) {
        return run('error/notfound', $lang);
    }
    $r = thread_get($lang, $folder_id);
    if (!$r) {
        return run('error/notfound', $lang);
    }
    extract($r);
    /* thread_type thread_name thread_title thread_abstract thread_cloud */
    if ($thread_type != 'folder') {
        return run('error/notfound', $lang);
    }
    $folder_name = $thread_name;
    $folder_title = $thread_title;
    $folder_abstract = $thread_abstract;
    $folder_cloud = $thread_cloud;
    if ($folder_title) {
        head('title', $folder_title);
    }
    if ($folder_abstract) {
        head('description', $folder_abstract);
    }
    if ($folder_cloud) {
        head('keywords', $folder_cloud);
    }
    $folder_contents = array();
    $r = thread_get_contents($lang, $folder_id);
    if ($r) {
        $folder_url = url('folder', $lang) . '/' . $folder_name;
        foreach ($r as $c) {
            extract($c);
            /* node_name node_title */
            if (!$node_title) {
                continue;
            }
            $page_title = $node_title;
            $page_url = $folder_url . '/' . $node_name;
            $folder_contents[] = compact('page_title', 'page_url');
        }
    }
    $content = view('foldersummary', false, compact('folder_id', 'folder_title', 'folder_contents'));
    $edit = user_has_role('writer') ? url('folderedit', $_SESSION['user']['locale']) . '/' . $folder_id . '?' . 'clang=' . $lang : false;
    $validate = url('folder', $lang) . '/' . $folder_name;
    $banner = build('banner', $lang, $with_toolbar ? false : compact('edit', 'validate'));
    $toolbar = $with_toolbar ? build('toolbar', $lang, compact('edit', 'validate')) : false;
    $output = layout('standard', compact('toolbar', 'banner', 'content'));
    return $output;
}
开发者ID:RazorMarx,项目名称:izend,代码行数:52,代码来源:foldersummary.php

示例5: email_send_folder_subscription

function email_send_folder_subscription($fuid, $fid, $tid, $pid, $modified, &$exclude_user_array)
{
    // Validate function arguments
    if (!is_numeric($fuid)) {
        return false;
    }
    if (!is_numeric($fid)) {
        return false;
    }
    if (!is_numeric($tid)) {
        return false;
    }
    if (!is_numeric($pid)) {
        return false;
    }
    if (!is_numeric($modified)) {
        return false;
    }
    // Check the thread is valid
    if (!($thread = thread_get($tid))) {
        return false;
    }
    // Get the from user details
    if (!($from_user = user_get($fuid))) {
        return false;
    }
    // Get the forum details.
    if (!($table_prefix = get_table_prefix())) {
        return false;
    }
    if (!($forum_fid = get_forum_fid())) {
        return false;
    }
    // Get the Swift Mailer Transport
    if (!($transport = Swift_TransportFactory::get())) {
        return false;
    }
    //Create the Mailer using the returned Transport
    $mailer = Swift_Mailer::newInstance($transport);
    // Create a new message
    $message = Swift_MessageBeehive::newInstance();
    // Database connection.
    if (!($db = db::get())) {
        return false;
    }
    // Make sure $exclude_user_array is an array.
    if (!is_array($exclude_user_array)) {
        $exclude_user_array = array();
    }
    // Add the $fuid to it.
    array_push($exclude_user_array, $fuid);
    // Make sure it only contains numbers and implode it.
    $exclude_user_list = implode(",", array_filter($exclude_user_array, 'is_numeric'));
    // Get the forum webtag
    $webtag = get_webtag();
    // Only send the email to people who logged after the thread was modified.
    $last_visit_datetime = date(MYSQL_DATETIME, $modified);
    $sql = "SELECT USER_FOLDER.UID, USER.LOGON, USER.NICKNAME, USER.EMAIL ";
    $sql .= "FROM `{$table_prefix}USER_FOLDER` USER_FOLDER ";
    $sql .= "LEFT JOIN USER ON (USER.UID = USER_FOLDER.UID) ";
    $sql .= "LEFT JOIN USER_FORUM ON (USER_FORUM.UID = USER_FOLDER.UID ";
    $sql .= "AND USER_FORUM.FID = '{$forum_fid}') WHERE USER_FOLDER.FID = '{$fid}' ";
    $sql .= "AND USER_FORUM.LAST_VISIT > CAST('{$last_visit_datetime}' AS DATETIME) ";
    $sql .= "AND USER_FOLDER.INTEREST = 1 AND USER_FOLDER.UID NOT IN ({$exclude_user_list})";
    if (!($result = $db->query($sql))) {
        return false;
    }
    if ($result->num_rows < 1) {
        return false;
    }
    while ($to_user = $result->fetch_assoc()) {
        // Validate the email address before we continue.
        if (!email_address_valid($to_user['EMAIL'])) {
            continue;
        }
        // Add the uid to exclude array
        array_push($exclude_user_array, $to_user['UID']);
        // Get the required variables (forum name, subject, recipient, etc.) and
        // pass them all through the recipient's word filter.
        $forum_name = word_filter_apply(forum_get_setting('forum_name', null, 'A Beehive Forum'), $to_user['UID'], true);
        $subject = word_filter_apply(sprintf(gettext("Subscription Notification from %s"), $forum_name), $to_user['UID'], true);
        $recipient = word_filter_apply(format_user_name($to_user['LOGON'], $to_user['NICKNAME']), $to_user['UID'], true);
        $message_author = word_filter_apply(format_user_name($from_user['LOGON'], $from_user['NICKNAME']), $to_user['UID'], true);
        $thread_title = word_filter_apply($thread['TITLE'], $to_user['UID'], true);
        // Generate link to the forum itself
        $forum_link = html_get_forum_uri("index.php?webtag={$webtag}&fid={$fid}");
        // Generate the message link.
        $message_link = html_get_forum_uri("index.php?webtag={$webtag}&msg={$tid}.{$pid}");
        // Generate the message body.
        $message_body = wordwrap(sprintf(gettext("Hello %s,\r\n\r\n%s posted a message in a folder you are subscribed to on %s.\r\n\r\nThe subject is: %s.\r\n\r\nTo read that message and others in the same discussion, go to:\r\n%s\r\n\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nNote: If you do not wish to receive email notifications of new messages in this thread, go to: %s and adjust your Interest level by clicking on the folder's icon at the top of page."), $recipient, $message_author, $forum_name, $thread_title, $message_link, $forum_link));
        // Add the recipient
        $message->setTo($to_user['EMAIL'], $recipient);
        // Set the subject
        $message->setSubject($subject);
        // Set the message body
        $message->setBody($message_body);
        // Send the email
        $mailer->send($message);
    }
    return true;
//.........这里部分代码省略.........
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:101,代码来源:email.inc.php

示例6: booksummary

function booksummary($lang, $book)
{
    global $with_toolbar;
    $book_id = thread_id($book);
    if (!$book_id) {
        return run('error/notfound', $lang);
    }
    $r = thread_get($lang, $book_id);
    if (!$r) {
        return run('error/notfound', $lang);
    }
    extract($r);
    /* thread_name thread_title thread_abstract thread_cloud thread_image thread_nocloud thread_nosearch */
    if ($thread_type != 'book') {
        return run('error/notfound', $lang);
    }
    $book_name = $thread_name;
    $book_title = $thread_title;
    $book_abstract = $thread_abstract;
    $book_cloud = $thread_cloud;
    $book_modified = $thread_modified;
    $book_nocloud = $thread_nocloud;
    $book_nosearch = $thread_nosearch;
    $book_novote = $thread_novote;
    $book_nomorevote = $thread_nomorevote;
    if ($book_title) {
        head('title', $book_title);
    }
    if ($book_abstract) {
        head('description', $book_abstract);
    }
    if ($book_cloud) {
        head('keywords', $book_cloud);
    }
    head('date', $book_modified);
    $book_contents = array();
    $r = thread_get_contents($lang, $book_id);
    if ($r) {
        $book_url = url('book', $lang) . '/' . $book_name;
        foreach ($r as $c) {
            extract($c);
            /* node_id node_name node_title node_number */
            $page_id = $node_id;
            $page_title = $node_title;
            $page_url = $book_url . '/' . $node_name;
            $book_contents[] = compact('page_id', 'page_title', 'page_url');
        }
    }
    $vote = false;
    if (!$book_novote) {
        $nomore = (!$book_contents or $book_nomorevote) ? true : false;
        $vote = build('vote', $lang, $book_id, 'thread', $nomore);
    }
    $besocial = $sharebar = false;
    if ($book_contents) {
        $ilike = $thread_ilike;
        $tweetit = $thread_tweet;
        $plusone = $thread_plusone;
        $linkedin = $thread_linkedin;
        $pinit = $thread_pinit;
        if ($tweetit) {
            $tweet_text = $thread_abstract ? $thread_abstract : $thread_title;
            $tweetit = $tweet_text ? compact('tweet_text') : true;
        }
        if ($pinit) {
            $pinit_text = $thread_abstract ? $thread_abstract : $thread_title;
            $pinit_image = $thread_image;
            $pinit = $pinit_text && $pinit_image ? compact('pinit_text', 'pinit_image') : false;
        }
        list($besocial, $sharebar) = socialize($lang, compact('ilike', 'tweetit', 'plusone', 'linkedin', 'pinit'));
    }
    $content = view('booksummary', false, compact('book_id', 'book_title', 'book_abstract', 'book_contents', 'besocial', 'vote'));
    $search = false;
    if (!$book_nosearch) {
        $search_text = '';
        $search_url = url('search', $lang, $book_name);
        $suggest_url = url('suggest', $lang, $book_name);
        $search = view('searchinput', $lang, compact('search_url', 'search_text', 'suggest_url'));
    }
    $cloud = false;
    if (!$book_nocloud) {
        $cloud_url = url('search', $lang, $book_name);
        $byname = $bycount = $index = true;
        $cloud = build('cloud', $lang, $cloud_url, $book_id, false, 30, compact('byname', 'bycount', 'index'));
    }
    $headline_text = translate('bookall:title', $lang);
    $headline_url = url('book', $lang);
    $headline = compact('headline_text', 'headline_url');
    $title = view('headline', false, $headline);
    $sidebar = view('sidebar', false, compact('search', 'cloud', 'title'));
    $search = !$book_nosearch ? compact('search_url', 'search_text', 'suggest_url') : false;
    $edit = user_has_role('writer') ? url('bookedit', $_SESSION['user']['locale']) . '/' . $book_id . '?' . 'clang=' . $lang : false;
    $validate = url('book', $lang) . '/' . $book_name;
    $banner = build('banner', $lang, $with_toolbar ? compact('headline', 'search') : compact('headline', 'edit', 'validate', 'search'));
    $toolbar = $with_toolbar ? build('toolbar', $lang, compact('edit', 'validate')) : false;
    $output = layout('standard', compact('sharebar', 'toolbar', 'banner', 'sidebar', 'content'));
    return $output;
}
开发者ID:RazorMarx,项目名称:izend,代码行数:98,代码来源:booksummary.php

示例7: thread_split

function thread_split($tid, $spid, $split_type, &$error_str)
{
    if (!($db = db::get())) {
        return false;
    }
    if (!is_numeric($tid)) {
        return false;
    }
    if (!is_numeric($spid)) {
        return false;
    }
    if (!in_array($split_type, array(THREAD_SPLIT_REPLIES, THREAD_SPLIT_FOLLOWING))) {
        return false;
    }
    if (!($table_prefix = get_table_prefix())) {
        return thread_split_error(THREAD_SPLIT_FORUM_ERROR, $error_str);
    }
    if (!($thread_data = thread_get($tid))) {
        return thread_split_error(THREAD_SPLIT_THREAD_ERROR, $error_str);
    }
    if (!($forum_fid = get_forum_fid())) {
        return thread_split_error(THREAD_SPLIT_THREAD_ERROR, $error_str);
    }
    if (!is_numeric($spid) || $spid < 2 || $spid > $thread_data['LENGTH']) {
        return thread_split_error(THREAD_SPLIT_INVALID_ARGS, $error_str);
    }
    if (!is_numeric($split_type)) {
        return thread_split_error(THREAD_SPLIT_INVALID_ARGS, $error_str);
    }
    thread_set_closed($tid, true);
    $pid_array = array();
    switch ($split_type) {
        case THREAD_SPLIT_REPLIES:
            $pid_array = thread_split_get_replies($tid, $spid, $pid_array);
            break;
        case THREAD_SPLIT_FOLLOWING:
            $pid_array = thread_split_get_following($tid, $spid, $pid_array);
            break;
    }
    if (!is_array($pid_array) || sizeof($pid_array) < 1) {
        thread_split_error(THREAD_SPLIT_POST_ERROR, $error_str);
        thread_set_closed($tid, $thread_data['CLOSED'] > 0);
        return false;
    }
    if (!($new_tid = post_create_thread($thread_data['FID'], $thread_data['BY_UID'], $thread_data['TITLE'], 'N', 'N', true))) {
        thread_split_error(THREAD_SPLIT_CREATE_ERROR, $error_str);
        thread_set_closed($tid, $thread_data['CLOSED'] > 0);
        return false;
    }
    if (!($thread_new = thread_get($new_tid, true, true))) {
        thread_split_error(THREAD_SPLIT_CREATE_ERROR, $error_str);
        thread_set_closed($tid, $thread_data['CLOSED'] > 0);
        return false;
    }
    $pid_list = implode(',', $pid_array);
    $sql = "INSERT INTO `{$table_prefix}POST` (TID, REPLY_TO_PID, ";
    $sql .= "FROM_UID, TO_UID, VIEWED, CREATED, STATUS, APPROVED, APPROVED_BY, ";
    $sql .= "EDITED, EDITED_BY, IPADDRESS, MOVED_TID, MOVED_PID) ";
    $sql .= "SELECT '{$new_tid}', REPLY_TO_PID, FROM_UID, TO_UID, NULL, NOW(), ";
    $sql .= "STATUS, APPROVED, APPROVED_BY, EDITED, EDITED_BY, IPADDRESS, TID, ";
    $sql .= "PID FROM `{$table_prefix}POST` WHERE TID = {$tid} ";
    $sql .= "AND PID IN ({$pid_list}) ORDER BY CREATED";
    if (!$db->query($sql)) {
        // Unlock the original thread if it wasn't originally locked.
        thread_set_closed($tid, $thread_data['CLOSED'] > 0);
        // Return error message.
        return thread_split_error(THREAD_SPLIT_QUERY_ERROR, $error_str);
    }
    // Copy the post contents to the new thread
    $sql = "INSERT INTO `{$table_prefix}POST_CONTENT` (TID, PID, CONTENT) ";
    $sql .= "SELECT POST.TID, POST.PID, POST_CONTENT.CONTENT FROM `{$table_prefix}POST` POST ";
    $sql .= "LEFT JOIN `{$table_prefix}POST_CONTENT` POST_CONTENT ";
    $sql .= "ON (POST_CONTENT.TID = POST.MOVED_TID AND POST_CONTENT.PID = MOVED_PID) ";
    $sql .= "WHERE POST.TID = '{$new_tid}'";
    if (!$db->query($sql)) {
        // Unlock the original thread if it wasn't originally locked.
        thread_set_closed($tid, $thread_data['CLOSED'] > 0);
        // Return error message.
        return thread_split_error(THREAD_SPLIT_QUERY_ERROR, $error_str);
    }
    // Insert the new Sphinx Search IDs.
    $sql = "INSERT INTO `{$table_prefix}POST_SEARCH_ID` (TID, PID) ";
    $sql .= "SELECT {$new_tid}, POST.PID FROM `{$table_prefix}POST` POST ";
    $sql .= "WHERE POST.TID = '{$new_tid}'";
    if (!$db->query($sql)) {
        // Unlock the original thread if it wasn't originally locked.
        thread_set_closed($tid, $thread_data['CLOSED'] > 0);
        // Return error message.
        return thread_merge_error(THREAD_MERGE_QUERY_ERROR, $error_str);
    }
    // Update the REPLY_TO_PIDs in the new thread
    $sql = "INSERT INTO `{$table_prefix}POST` (TID, PID, REPLY_TO_PID) ";
    $sql .= "SELECT TARGET_POST.TID, TARGET_POST.PID, SOURCE_POST.PID ";
    $sql .= "FROM `{$table_prefix}POST` TARGET_POST ";
    $sql .= "INNER JOIN `{$table_prefix}POST` SOURCE_POST ";
    $sql .= "ON (SOURCE_POST.MOVED_TID = TARGET_POST.MOVED_TID ";
    $sql .= "AND TARGET_POST.REPLY_TO_PID = SOURCE_POST.MOVED_PID) ";
    $sql .= "WHERE TARGET_POST.TID = '{$new_tid}' AND TARGET_POST.PID > 1 ";
    $sql .= "ON DUPLICATE KEY UPDATE REPLY_TO_PID = VALUES(REPLY_TO_PID) ";
    if (!$db->query($sql)) {
//.........这里部分代码省略.........
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:101,代码来源:thread.inc.php

示例8: header

         exit;
     }
     header('Content-Type: application/json');
     $content = json_encode(array('success' => true, 'font_size' => $user_prefs['FONT_SIZE'], 'html' => messages_fontsize_form($tid, $pid, true, $user_prefs['FONT_SIZE'])));
     break;
 case 'post_options':
     if (!session::logged_in()) {
         break;
     }
     cache_disable();
     if (!isset($_GET['msg']) || !validate_msg($_GET['msg'])) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     list($tid, $pid) = explode('.', $_GET['msg']);
     if (!($thread_data = thread_get($tid, session::check_perm(USER_PERM_ADMIN_TOOLS, 0)))) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     if (!($content = message_get_post_options_html($tid, $pid, $thread_data['FID']))) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     break;
 case 'poll_add_question':
     if (!session::logged_in()) {
         break;
     }
     cache_disable();
     if (!isset($_GET['question_number']) || !is_numeric($_GET['question_number'])) {
         header_status(500, 'Internal Server Error');
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:ajax.php

示例9: message_get_meta_content

function message_get_meta_content($msg, &$meta_keywords, &$meta_description)
{
    if (!validate_msg($msg)) {
        return;
    }
    list($tid, $pid) = explode('.', $msg);
    if (($thread_data = thread_get($tid)) && ($message_content = message_get_content($tid, $pid))) {
        $meta_keywords_array = search_extract_keywords(strip_tags(htmlentities_decode_array($message_content)));
        $meta_description = $thread_data['TITLE'];
        $meta_keywords = htmlentities_array(implode(',', $meta_keywords_array['keywords_array']));
    }
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:12,代码来源:messages.inc.php

示例10: folderpage

function folderpage($lang, $folder, $page)
{
    global $with_toolbar;
    $folder_id = thread_id($folder);
    if (!$folder_id) {
        return run('error/notfound', $lang);
    }
    $page_id = thread_node_id($folder_id, $page, $lang);
    if (!$page_id) {
        return run('error/notfound', $lang);
    }
    $r = thread_get($lang, $folder_id);
    if (!$r) {
        return run('error/notfound', $lang);
    }
    extract($r);
    /* thread_type thread_name thread_title thread_abstract thread_cloud thread_image */
    if (!($thread_type == 'folder' or $thread_type == 'book' or $thread_type == 'story')) {
        return run('error/notfound', $lang);
    }
    $folder_name = $thread_name;
    $folder_title = $thread_title;
    $folder_abstract = $thread_abstract;
    $folder_cloud = $thread_cloud;
    $r = thread_get_node($lang, $folder_id, $page_id);
    if (!$r) {
        return run('error/notfound', $lang);
    }
    extract($r);
    /* node_number node_ignored node_name node_title node_abstract node_cloud node_image node_user_id node_visits node_nocomment node_nomorecomment node_novote node_nomorevote node_ilike node_tweet node_plusone node_linkedin node_pinit */
    if ($node_ignored) {
        return run('error/notfound', $lang);
    }
    $page_user_id = $node_user_id;
    $page_name = $node_name;
    $page_title = $node_title;
    $page_abstract = $node_abstract;
    $page_cloud = $node_cloud;
    $page_modified = $node_modified;
    if ($page_title) {
        head('title', $page_title);
    } else {
        if ($folder_title) {
            head('title', $folder_title);
        }
    }
    if ($page_abstract) {
        head('description', $page_abstract);
    } else {
        if ($folder_abstract) {
            head('description', $folder_abstract);
        }
    }
    if ($page_cloud) {
        head('keywords', $page_cloud);
    } else {
        if ($folder_cloud) {
            head('keywords', $folder_cloud);
        }
    }
    head('date', $page_modified);
    $page_contents = build('nodecontent', $lang, $page_id);
    $page_comment = false;
    if (!($thread_nocomment or $node_nocomment)) {
        $nomore = (!$page_contents or $thread_nomorecomment or $node_nomorecomment) ? true : false;
        $page_url = url('folder', $lang) . '/' . $folder_name . '/' . $page_name;
        $page_comment = build('nodecomment', $lang, $page_id, $page_user_id, $page_url, $nomore);
    }
    $vote = false;
    if (!($thread_novote or $node_novote)) {
        $nomore = (!$page_contents or $thread_nomorevote or $node_nomorevote) ? true : false;
        $vote = build('vote', $lang, $page_id, 'node', $nomore);
    }
    $visits = false;
    if ($thread_visits and $node_visits) {
        $nomore = user_has_role('writer');
        $visits = build('visits', $lang, $page_id, $nomore);
    }
    $besocial = $sharebar = false;
    if ($page_contents or $page_comment) {
        $ilike = $thread_ilike && $node_ilike;
        $tweetit = $thread_tweet && $node_tweet;
        $plusone = $thread_plusone && $node_plusone;
        $linkedin = $thread_linkedin && $node_linkedin;
        $pinit = $thread_pinit && $node_pinit;
        if ($tweetit) {
            $tweet_text = $node_abstract ? $node_abstract : ($node_title ? $node_title : $thread_title);
            $tweetit = $tweet_text ? compact('tweet_text') : true;
        }
        if ($pinit) {
            $pinit_text = $node_abstract ? $node_abstract : ($node_title ? $node_title : $thread_title);
            $pinit_image = $node_image;
            $pinit = $pinit_text && $pinit_image ? compact('pinit_text', 'pinit_image') : false;
        }
        list($besocial, $sharebar) = socialize($lang, compact('ilike', 'tweetit', 'plusone', 'linkedin', 'pinit'));
    }
    $content = view('folderpage', false, compact('page_title', 'page_contents', 'page_comment', 'besocial', 'vote', 'visits'));
    $edit = user_has_role('writer') ? url('folderedit', $_SESSION['user']['locale']) . '/' . $folder_id . '/' . $page_id . '?' . 'clang=' . $lang : false;
    $validate = url('folder', $lang) . '/' . $folder_name . '/' . $page_name;
    $banner = build('banner', $lang, $with_toolbar ? false : compact('edit', 'validate'));
//.........这里部分代码省略.........
开发者ID:RazorMarx,项目名称:izend,代码行数:101,代码来源:folderpage.php

示例11: thread_get

<?php

$array = thread_get('mySharedVar');
print_r($array);
sleep(5);
echo 'Done';
开发者ID:rathwamukesh,项目名称:php_threads,代码行数:6,代码来源:thread.php

示例12: foreach

    echo "                      <table width=\"95%\">\n";
}
if (sizeof($selected_array) > 0) {
    foreach ($selected_array as $selected_option) {
        if ($type == SEARCH_LOGON && ($user_data = user_get_by_logon($selected_option))) {
            if ($multi === 'Y') {
                echo "                      <tr>\n";
                echo "                        <td align=\"left\">", form_checkbox("selected[]", htmlentities_array($user_data['LOGON']), '', true), "&nbsp;<a href=\"user_profile.php?webtag={$webtag}&amp;uid={$user_data['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($user_data['LOGON'], $user_data['NICKNAME']), true), "</a></td>\n";
                echo "                      </tr>\n";
            } else {
                echo "                      <tr>\n";
                echo "                        <td align=\"left\">", form_radio("selected", htmlentities_array($user_data['LOGON']), '', true), "&nbsp;<a href=\"user_profile.php?webtag={$webtag}&amp;uid={$user_data['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($user_data['LOGON'], $user_data['NICKNAME']), true), "</a></td>\n";
                echo "                      </tr>\n";
            }
        } else {
            if ($thread_data = thread_get($selected_option)) {
                echo "                      <tr>\n";
                echo "                        <td align=\"left\">", form_radio("selected", $thread_data['TID'], '', true), "&nbsp;<a href=\"messages.php?webtag={$webtag}&amp;msg={$thread_data['TID']}.1\" target=\"_blank\">", word_filter_add_ob_tags($thread_data['TITLE'], true), "</a></td>\n";
                echo "                      </tr>\n";
            }
        }
    }
    if (isset($search_results_array['results_array']) && sizeof($search_results_array['results_array']) > 0) {
        echo "                      <tr>\n";
        echo "                        <td align=\"left\"><hr /></td>\n";
        echo "                      </tr>\n";
    }
}
if (isset($search_results_array['results_array']) && sizeof($search_results_array['results_array']) > 0) {
    foreach ($search_results_array['results_array'] as $search_result) {
        if ($type == SEARCH_LOGON && !in_array($search_result['LOGON'], $selected_array)) {
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:search_popup.php

示例13: threadeditsummary

function threadeditsummary($lang, $clang, $thread)
{
    global $supported_threads, $with_toolbar;
    if (!user_has_role('writer')) {
        return run('error/unauthorized', $lang);
    }
    $confirmed = false;
    $thread_id = thread_id($thread);
    if (!$thread_id) {
        return run('error/notfound', $lang);
    }
    $action = 'init';
    if (isset($_POST['thread_edit'])) {
        $action = 'edit';
    } else {
        if (isset($_POST['thread_reorder'])) {
            $action = 'reorder';
        } else {
            if (isset($_POST['node_create'])) {
                $action = 'create';
            } else {
                if (isset($_POST['node_copy'])) {
                    $action = 'copy';
                } else {
                    if (isset($_POST['node_delete'])) {
                        $action = 'delete';
                    } else {
                        if (isset($_POST['node_confirmdelete'])) {
                            $action = 'delete';
                            $confirmed = true;
                        } else {
                            if (isset($_POST['node_hide'])) {
                                $action = 'hide';
                            } else {
                                if (isset($_POST['node_show'])) {
                                    $action = 'show';
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    $thread_type = $thread_name = $thread_title = $thread_abstract = $thread_cloud = $thread_image = false;
    $thread_search = $thread_tag = false;
    $thread_comment = $thread_morecomment = $thread_vote = $thread_morevote = false;
    $thread_ilike = $thread_tweet = $thread_plusone = $thread_linkedin = $thread_pinit = false;
    $thread_visits = false;
    $thread_nosearch = $thread_nocloud = $thread_nocomment = $thread_nomorecomment = $thread_novote = $thread_nomorevote = true;
    $new_node_name = $new_node_title = $new_node_number = false;
    $old_node_number = false;
    $p = false;
    switch ($action) {
        case 'init':
        case 'reset':
            $r = thread_get($clang, $thread_id, false);
            if ($r) {
                extract($r);
                /* thread_type thread_name thread_title thread_abstract thread_cloud thread_image thread_visits thread_nosearch thread_nocloud thread_nocomment thread_nomorecomment thread_novote thread_nomorevote */
            }
            $thread_search = !$thread_nosearch;
            $thread_tag = !$thread_nocloud;
            $thread_comment = !$thread_nocomment;
            $thread_morecomment = !$thread_nomorecomment;
            $thread_vote = !$thread_novote;
            $thread_morevote = !$thread_nomorevote;
            break;
        case 'edit':
        case 'create':
        case 'copy':
        case 'delete':
        case 'hide':
        case 'show':
        case 'reorder':
            if (isset($_POST['thread_type'])) {
                $thread_type = readarg($_POST['thread_type']);
            }
            if (isset($_POST['thread_title'])) {
                $thread_title = readarg($_POST['thread_title']);
            }
            if (isset($_POST['thread_name'])) {
                $thread_name = strtofname(readarg($_POST['thread_name']));
            }
            if (!$thread_name and $thread_title) {
                $thread_name = strtofname($thread_title);
            }
            if (isset($_POST['thread_abstract'])) {
                $thread_abstract = readarg($_POST['thread_abstract']);
            }
            if (isset($_POST['thread_image'])) {
                $thread_image = readarg($_POST['thread_image']);
            }
            if (isset($_POST['thread_cloud'])) {
                $thread_cloud = readarg($_POST['thread_cloud'], true, false);
                // trim but DON'T strip!
                preg_match_all('/(\\S+)/', $thread_cloud, $r);
                $thread_cloud = implode(' ', array_unique($r[0]));
            }
            if (isset($_POST['thread_search'])) {
//.........这里部分代码省略.........
开发者ID:RazorMarx,项目名称:izend,代码行数:101,代码来源:threadeditsummary.php

示例14: list

} else {
    if (isset($_POST['msg']) && validate_msg($_POST['msg'])) {
        $msg = $_POST['msg'];
        list($tid, $pid) = explode(".", $_POST['msg']);
    } else {
        html_draw_error(gettext("The requested thread could not be found or access was denied."));
    }
}
// Get the folder ID for the current message
if (!($fid = thread_get_folder($tid))) {
    html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
// UID of the current user.
$uid = session::get_value('UID');
// Get the existing thread data.
if (!($thread_data = thread_get($tid, true))) {
    html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
// Array to hold error messages
$error_msg_array = array();
// Array of valid thread deletion types
$thread_delete_valid_types = array(THREAD_DELETE_PERMENANT, THREAD_DELETE_NON_PERMENANT);
// Back button clicked.
if (isset($_POST['back'])) {
    header_redirect("messages.php?webtag={$webtag}&msg={$msg}");
    exit;
}
// Code for handling functionality from messages.php
if (isset($_GET['markasread']) && is_numeric($_GET['markasread'])) {
    if (in_range($_GET['markasread'], 0, $thread_data['LENGTH'])) {
        $mark_as_read = $_GET['markasread'];
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:thread_options.php

示例15: header_redirect

            header_redirect("messages.php?webtag={$webtag}&msg={$msg}");
        }
    }
}
// Number of posts per page
if (isset($_SESSION['POSTS_PER_PAGE']) && is_numeric($_SESSION['POSTS_PER_PAGE'])) {
    $posts_per_page = max(min($_SESSION['POSTS_PER_PAGE'], 30), 10);
} else {
    $posts_per_page = 20;
}
$high_interest = isset($_SESSION['MARK_AS_OF_INT']) && $_SESSION['MARK_AS_OF_INT'] == 'Y' ? 'Y' : 'N';
if (!($folder_data = thread_get_folder($tid))) {
    html_draw_error(gettext("The requested folder could not be found or access was denied."));
}
$perm_folder_moderate = session::check_perm(USER_PERM_FOLDER_MODERATE, $folder_data['FID']);
if (!($thread_data = thread_get($tid, $perm_folder_moderate, false, $perm_folder_moderate))) {
    html_draw_error(gettext("The requested thread could not be found or access was denied."));
}
if (!($messages = messages_get($tid, $pid, $posts_per_page))) {
    html_draw_error(gettext("That post does not exist in this thread!"));
}
html_draw_top(array('title' => $thread_data['TITLE'], 'class' => 'window_title', 'js' => array('js/post.js', 'js/poll.js', 'js/messages.js', 'ckeditor/ckeditor.js'), 'base_target' => '_blank'));
if (isset($thread_data['STICKY']) && isset($thread_data['STICKY_UNTIL'])) {
    if ($thread_data['STICKY'] == "Y" && $thread_data['STICKY_UNTIL'] != 0 && time() > $thread_data['STICKY_UNTIL']) {
        thread_set_sticky($tid, false);
        $thread_data['STICKY'] = "N";
    }
}
$show_sigs = session::show_sigs();
$page_prefs = session::get_post_page_prefs();
$msg_count = count($messages);
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:31,代码来源:messages.php


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