• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP phorum_get_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: spamhurdle_captcha_build_form

function spamhurdle_captcha_build_form($data)
{
    if (!isset($data['captcha']['html_form'])) {
        return $data;
    }
    global $PHORUM;
    $config = $PHORUM['mod_spamhurdles']['captcha'];
    $captcha = $data['captcha'];
    $form = $captcha['html_form'];
    // The actual value in the captcha is named {FIELDVALUE} in the
    // generated captcha HTML code. Replace it with the actual value.
    $fn = $captcha["input_fieldname"];
    $fieldvalue = isset($_POST[$fn]) ? $_POST[$fn] : "";
    $form = str_replace("{FIELDVALUE}", htmlspecialchars($fieldvalue), $form);
    // Replace SPOKENURL with the URL for the spoken captcha code.
    if ($config["spoken_captcha"] && file_exists($config["flite_location"])) {
        $url = phorum_get_url(PHORUM_ADDON_URL, 'module=spamhurdles', 'hurdle=captcha', 'spokencaptcha=' . rawurlencode(spamhurdles_encrypt($captcha['spoken_text'])));
        $form = str_replace('{SPOKENURL}', htmlspecialchars($url), $form);
    }
    // Replace IMAGE with the URL for the captcha image.
    $url = phorum_get_url(PHORUM_ADDON_URL, 'module=spamhurdles', 'hurdle=captcha', 'imagecaptcha=' . rawurlencode(spamhurdles_encrypt(array('question' => $captcha['question'], 'type' => $captcha['type']))));
    $form = str_replace('{IMAGEURL}', htmlspecialchars($url), $form);
    if (!empty($data['use_editor_block'])) {
        $PHORUM['DATA']['CONTENT'] = $form;
        $PHORUM['DATA']['EDITOR'] = $data['use_editor_block'];
        include phorum_get_template('spamhurdles::editor_block');
    } else {
        print $form;
    }
    return $data;
}
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:captcha.php


示例2: phorum_return_to_list

/**
 * just returns to the list and exits the program
 */
function phorum_return_to_list()
{
    $PHORUM=$GLOBALS["PHORUM"];
    if(!empty($PHORUM["forum_id"])){
        phorum_redirect_by_url(phorum_get_url(PHORUM_LIST_URL));
    }else{
        phorum_redirect_by_url(phorum_get_url(PHORUM_INDEX_URL));
    }
    exit();
}
开发者ID:nistormihai,项目名称:Newscoop,代码行数:13,代码来源:moderation_functions.php


示例3: phorum_user_subscribe

    phorum_user_subscribe( $PHORUM['user']['user_id'], $message["forum_id"], $thread, PHORUM_SUBSCRIPTION_BOOKMARK );
    $PHORUM["DATA"]["MESSAGE"]=$PHORUM["DATA"]["LANG"]["NoMoreEmails"];
    $PHORUM["DATA"]["URL"]["REDIRECT"]=phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $thread);
    $PHORUM["DATA"]["BACKMSG"]=$PHORUM["DATA"]["LANG"]["BackToThread"];
    $template="message";
} elseif(!empty($_POST)) {
    // the user has submitted the form
    $type = (isset($_POST["send_email"])) ? PHORUM_SUBSCRIPTION_MESSAGE : PHORUM_SUBSCRIPTION_BOOKMARK;
    phorum_user_subscribe( $PHORUM['user']['user_id'], $message["forum_id"], $thread, $type );
    $PHORUM["DATA"]["URL"]["REDIRECT"]=phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $thread);
    $PHORUM["DATA"]["BACKMSG"]=$PHORUM["DATA"]["LANG"]["BackToThread"];
    $PHORUM["DATA"]["MESSAGE"]=$PHORUM["DATA"]["LANG"]["BookmarkedThread"];
    $template="message";
} else {
    // we are following a new thread
    $PHORUM["DATA"]["URL"]["ACTION"]=phorum_get_url(PHORUM_FOLLOW_ACTION_URL);
    $PHORUM["DATA"]["SUBJECT"]=htmlspecialchars($message["subject"]);
    $PHORUM["DATA"]["THREAD"]=$thread;
    $PHORUM["DATA"]["FORUM_ID"]=$PHORUM["forum_id"];
    $template="follow";
}


// set all our common URL's
phorum_build_common_urls();

include phorum_get_template("header");
phorum_hook("after_header");
include phorum_get_template($template);
phorum_hook("before_footer");
include phorum_get_template("footer");
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:follow.php


示例4: phorum_api_user_list_subscriptions

    $forum_ids[] = $forum["forum_id"];
}
$subscr_array = phorum_api_user_list_subscriptions($PHORUM['user']['user_id'], $subdays, $forum_ids);
// storage for newflags
$PHORUM['user']['newinfo'] = array();
// go through all subscriptions
$subscr_array_final = array();
unset($subscr_array["forum_ids"]);
foreach ($subscr_array as $id => $data) {
    $data['forum'] = $forums[$data['forum_id']]['name'];
    $data['raw_datestamp'] = $data["modifystamp"];
    $data['datestamp'] = phorum_date($PHORUM["short_date_time"], $data["modifystamp"]);
    $data['raw_lastpost'] = $data['modifystamp'];
    $data['lastpost'] = phorum_date($PHORUM["short_date_time"], $data["modifystamp"]);
    $data["URL"]["READ"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $data["forum_id"], $data["thread"]);
    $data["URL"]["NEWPOST"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $data["forum_id"], $data["thread"], "gotonewpost");
    // Check if there are new messages for the current thread.
    if (!isset($PHORUM['user']['newinfo'][$data["forum_id"]])) {
        $PHORUM['user']['newinfo'][$data["forum_id"]] = null;
        if ($PHORUM['cache_newflags']) {
            $newflagkey = $data["forum_id"] . "-" . $PHORUM['user']['user_id'];
            $PHORUM['user']['newinfo'][$data["forum_id"]] = phorum_cache_get('newflags', $newflagkey, $forums[$data["forum_id"]]['cache_version']);
        }
        if ($PHORUM['user']['newinfo'][$data["forum_id"]] == null) {
            $PHORUM['user']['newinfo'][$data["forum_id"]] = phorum_db_newflag_get_flags($data["forum_id"]);
            if ($PHORUM['cache_newflags']) {
                phorum_cache_put('newflags', $newflagkey, $PHORUM['user']['newinfo'][$data["forum_id"]], 86400, $forums[$data["forum_id"]]['cache_version']);
            }
        }
    }
    $new = array();
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:subthreads.php


示例5: phorum_mod_bbcode_editor_tool_plugin

function phorum_mod_bbcode_editor_tool_plugin()
{
    global $PHORUM;
    $lang = $PHORUM['DATA']['LANG']['mod_bbcode'];
    $nr_of_enabled_tags = 0;
    $enabled = isset($PHORUM['mod_bbcode']['enabled']) ? $PHORUM['mod_bbcode']['enabled'] : array();
    $builtin = $PHORUM['MOD_BBCODE']['BUILTIN'];
    // Register the tool buttons.
    foreach ($PHORUM['mod_bbcode_parser']['taginfo'] as $id => $taginfo) {
        // Skip tool if no editor tools button is implemented.
        if (!$taginfo[BBCODE_INFO_HASEDITORTOOL]) {
            continue;
        }
        // Check if the editor tool should be shown. If not, then skip
        // to the next tag. If there are no settings saved yet for the
        // module, then use the settings from the builtin tag list.
        if (isset($enabled[$id]) && $enabled[$id] != 2 || !isset($PHORUM['mod_bbcode']['enabled'][$id]) && isset($builtin[$id]) && $builtin[$id][BBCODE_INFO_DEFAULTSTATE] != 2) {
            continue;
        }
        // Keep track of the number of enabled tags.
        $nr_of_enabled_tags++;
        // Determine the description to use for the tool. If we can find
        // a description in the language strings, then we use that one.
        // Otherwise, we simply fall back to the less descriptive feature id.
        $description = isset($lang[$id]) ? $lang[$id] : $id;
        // Register the tool button with the Editor Tools module.
        editor_tools_register_tool($id, $description, "./mods/bbcode/icons/{$id}.gif", "editor_tools_handle_{$id}()");
    }
    // Register the bbcode help page, unless no tags were enabled at all.
    if ($nr_of_enabled_tags > 0) {
        $description = isset($lang['bbcode help']) ? $lang['bbcode help'] : 'BBcode help';
        editor_tools_register_help($description, phorum_get_url(PHORUM_ADDON_URL, 'module=bbcode', 'action=help'));
    }
    // Make language strings available for the editor tools javascript code.
    editor_tools_register_translations($lang);
}
开发者ID:mgs2,项目名称:kw-forum,代码行数:36,代码来源:bbcode.php


示例6: array

    $rows = array();
    // get the thread set started
    $rows = phorum_db_get_unapproved_list($forum, $showwaiting, $moddays);
    // loop through and read all the data in.
    foreach ($rows as $key => $row) {
        $numunapproved++;
        $rows[$key]['forumname'] = $foruminfo[$forum]['name'];
        $rows[$key]['checkvar'] = $checkvar;
        if ($checkvar) {
            $checkvar = 0;
        }
        $rows[$key]['forum_id'] = $forum;
        $rows[$key]["URL"]["READ"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $forum, $row["thread"], $row['message_id']);
        // we need to fake the forum_id here
        $PHORUM["forum_id"] = $forum;
        $rows[$key]["URL"]["APPROVE_MESSAGE"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_APPROVE_MESSAGE, $row["message_id"], "prepost=1", "old_forum=" . $oldforum, "onlyunapproved=" . $showwaiting, "moddays=" . $moddays);
        $rows[$key]["URL"]["APPROVE_TREE"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_APPROVE_MESSAGE_TREE, $row["message_id"], "prepost=1", "old_forum=" . $oldforum, "onlyunapproved=" . $showwaiting, "moddays=" . $moddays);
        $rows[$key]["URL"]["DELETE"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_DELETE_TREE, $row["message_id"], "prepost=1", "old_forum=" . $oldforum, "onlyunapproved=" . $showwaiting, "moddays=" . $moddays);
        $PHORUM["forum_id"] = $oldforum;
        $rows[$key]["raw_short_datestamp"] = $row["datestamp"];
        $rows[$key]["short_datestamp"] = phorum_date($PHORUM["short_date_time"], $row["datestamp"]);
    }
    require_once "./include/format_functions.php";
    $rows = phorum_format_messages($rows);
    $PHORUM['DATA']['PREPOST'] = array_merge($PHORUM['DATA']['PREPOST'], $rows);
}
if (!$numunapproved) {
    $PHORUM["DATA"]["UNAPPROVEDMESSAGE"] = $PHORUM["DATA"]["LANG"]["NoUnapprovedMessages"];
}
$PHORUM["DATA"]["HEADING"] = $PHORUM["DATA"]["LANG"]["UnapprovedMessages"];
$template = "cc_prepost";
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:messages.php


示例7: htmlspecialchars

    $redir = htmlspecialchars($_REQUEST["redir"]);
} elseif (!empty( $_SERVER["HTTP_REFERER"])) {
    $base = strtolower(phorum_get_url(PHORUM_BASE_URL));
    $len = strlen($base);
    if (strtolower(substr($_SERVER["HTTP_REFERER"],0,$len)) == $base) {
        $redir = htmlspecialchars($_SERVER["HTTP_REFERER"]);
    }
}
if (! isset($redir)) {
    $redir = phorum_get_url(PHORUM_LIST_URL);
}

// Setup template data.
$PHORUM["DATA"]["LOGIN"]["redir"] = $redir;
$PHORUM["DATA"]["URL"]["REGISTER"] = phorum_get_url( PHORUM_REGISTER_URL );
$PHORUM["DATA"]["URL"]["ACTION"] = phorum_get_url( PHORUM_LOGIN_ACTION_URL );
$PHORUM["DATA"]["LOGIN"]["forum_id"] = ( int )$PHORUM["forum_id"];
$PHORUM["DATA"]["LOGIN"]["username"] = htmlspecialchars( $username );
$PHORUM["DATA"]["ERROR"] = htmlspecialchars( $error );
$PHORUM["DATA"]["OKMSG"] = htmlspecialchars( $okmsg );

// Set the field to set the focus to after loading.
$PHORUM["DATA"]["FOCUS_TO_ID"] = empty($username) ? "username" : "password";

// Display the page.
include phorum_get_template( "header" );
phorum_hook( "after_header" );
include phorum_get_template( $template );
phorum_hook( "before_footer" );
include phorum_get_template( "footer" );
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:login.php


示例8: phorum_get_forum_info

$forum_info = phorum_get_forum_info(2);
$forum_matches = array();
foreach ($forum_info as $id => $name) {
    $forum_matches[htmlspecialchars($name)] = "message.forum_id = {$id}";
}
$ruledefs = array("body" => array("label" => "Message body", "matches" => array("contains" => "message.body  = *QUERY*", "does not contain" => "message.body != *QUERY*"), "queryfield" => "string"), "subject" => array("label" => "Message subject", "matches" => array("is" => "message.subject  =  QUERY", "is not" => "message.subject !=  QUERY", "contains" => "message.subject  = *QUERY*", "does not contain" => "message.subject != *QUERY*"), "queryfield" => "string"), "date" => array("label" => "Message date", "matches" => array("posted on" => "function:prepare_filter_date", "posted on or before" => "function:prepare_filter_date", "posted before" => "function:prepare_filter_date", "posted after" => "function:prepare_filter_date", "posted on or after" => "function:prepare_filter_date"), "prepare_filter_date" => "message.datestamp", "queryfield" => "date"), "status" => array("label" => "Message status", "matches" => array("approved" => "message.status = " . PHORUM_STATUS_APPROVED, "waiting for approval (on hold)" => "message.status = " . PHORUM_STATUS_HOLD, "disapproved by moderator" => "message.status = " . PHORUM_STATUS_HIDDEN, "hidden (on hold or disapproved)" => "message.status != " . PHORUM_STATUS_APPROVED)), "messagetype" => array("label" => "Message type", "matches" => array("thread starting messages" => "message.parent_id  = 0", "reply messages" => "message.parent_id != 0")), "forum" => array("label" => "Forum", "matches" => $forum_matches), "author" => array("label" => "Author name", "matches" => array("is" => "message.author  =  QUERY", "is not" => "message.author !=  QUERY", "contains" => "message.author  = *QUERY*", "does not contain" => "message.author != *QUERY*", "starts with" => "message.author  =  QUERY*", "does not start with" => "message.author !=  QUERY*", "ends with" => "message.author  = *QUERY", "does not end with" => "message.author !=  QUERY*"), "queryfield" => "string"), "username" => array("label" => "Author username", "matches" => array("is" => "user.username  =  QUERY", "is not" => "user.username !=  QUERY", "contains" => "user.username  = *QUERY*", "does not contain" => "user.username != *QUERY*", "starts with" => "user.username  =  QUERY*", "does not start with" => "user.username !=  QUERY*", "ends with" => "user.username  = *QUERY", "does not end with" => "user.username != *QUERY"), "queryfield" => "string"), "user_id" => array("label" => "Author user id", "matches" => array("is" => "message.user_id  = QUERY", "is not" => "message.user_id != QUERY"), "queryfield" => "string"), "authortype" => array("label" => "Author type", "matches" => array("registered user" => "message.user_id != 0", "anonymous user" => "message.user_id  = 0", "moderator" => "message.moderator_post = 1", "administrator" => "user.admin = 1", "active user" => "user.active = " . PHORUM_USER_ACTIVE, "deactivated user" => "user.active = " . PHORUM_USER_INACTIVE)), "ipaddress" => array("label" => "Author IP/hostname", "matches" => array("is" => "message.ip  =  QUERY", "is not" => "message.ip !=  QUERY", "starts with" => "message.ip  =  QUERY*", "does not start with" => "message.ip !=  QUERY*", "ends with" => "message.ip  = *QUERY", "does not end with" => "message.ip != *QUERY"), "queryfield" => "string"), "threadstate" => array("label" => "Thread status", "matches" => array("open for posting" => "thread.closed = 0", "closed for posting" => "thread.closed = 1")), "threadlastpost" => array("label" => "Thread last post", "matches" => array("posted on or before" => "function:prepare_filter_date", "posted before" => "function:prepare_filter_date", "posted after" => "function:prepare_filter_date", "posted on or after" => "function:prepare_filter_date"), "prepare_filter_date" => "thread.modifystamp", "queryfield" => "date"));
// ----------------------------------------------------------------------
// Handle a posted form
// ----------------------------------------------------------------------
$messages = null;
// selected messages (based on a filter)
$filters = array();
// active filters
$filtermode = "and";
// active filter mode (and / or)
$read_url_template = phorum_get_url(PHORUM_FOREIGN_READ_URL, '%forum_id%', '%thread_id%', '%message_id%');
// If there are messages to delete in the post data, then delete them
// from the database.
$delete_count = 0;
if (isset($_POST["deletemessage"]) && is_array($_POST["deletemessage"])) {
    $msgids = array_keys($_POST["deletemessage"]);
    $msgs = phorum_db_get_message($msgids, "message_id", true);
    $deleted_messages = array();
    foreach ($msgs as $msg) {
        // if the message was already deleted, skip it
        if (isset($delete_messages[$msg["message_id"]])) {
            continue;
        }
        $PHORUM["forum_id"] = $msg["forum_id"];
        $delmode = $msg["parent_id"] == 0 ? PHORUM_DELETE_TREE : PHORUM_DELETE_MESSAGE;
        // A hook to allow modules to implement extra or different
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:message_prune.php


示例9: phorum_feed_make_js

function phorum_feed_make_js($messages, $forums, $feed_url, $feed_title, $feed_description)
{
    $PHORUM = $GLOBALS["PHORUM"];
    // build PHP array to later be turned into a JS object
    $feed["title"] = $feed_title;
    $feed["description"] = $feed_description;
    $feed["modified"] = phorum_date($PHORUM['short_date'], time());
    // Lookup the plain text usernames for the authenticated authors.
    $users = $messages['users'];
    unset($messages['users']);
    unset($users[0]);
    $users = phorum_api_user_get_display_name($users, '', PHORUM_FLAG_PLAINTEXT);
    foreach ($messages as $message) {
        $author = isset($users[$message['user_id']]) && $users[$message['user_id']] != '' ? $users[$message['user_id']] : $message['author'];
        $item = array("title" => strip_tags($message["subject"]), "author" => $author, "category" => $forums[$message["forum_id"]]["name"], "created" => phorum_date($PHORUM['short_date'], $message["datestamp"]), "modified" => phorum_date($PHORUM['short_date'], $message["modifystamp"]), "url" => phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $message["thread"], $message["message_id"]), "description" => $message["body"]);
        if ($message["thread_count"]) {
            $replies = $message["thread_count"] - 1;
            $item["replies"] = $replies;
        }
        $feed["items"][] = $item;
    }
    // this is where we convert the array into js
    $buffer = phorum_array_to_javascript("phorum_feed", $feed);
    return $buffer;
}
开发者ID:sheldon,项目名称:dejavu,代码行数:25,代码来源:feed_functions.php


示例10: phorum_redirect_by_url

     if ($parent_id == 0 && count($forums) < 2) {
         phorum_redirect_by_url($forum['url']);
         exit;
     }
     if ($forum["message_count"] > 0) {
         $forum["raw_last_post"] = $forum["last_post_time"];
         $forum["last_post"] = phorum_date($PHORUM["long_date_time"], $forum["last_post_time"]);
     } else {
         $forum["last_post"] = "&nbsp;";
     }
     $forum["URL"]["LIST"] = phorum_get_url(PHORUM_LIST_URL, $forum["forum_id"]);
     if ($PHORUM["DATA"]["LOGGEDIN"]) {
         $forum["URL"]["MARK_READ"] = phorum_get_url(PHORUM_INDEX_URL, $forum["forum_id"], "markread", $PHORUM['forum_id']);
     }
     if (isset($PHORUM['use_rss']) && $PHORUM['use_rss']) {
         $forum["URL"]["FEED"] = phorum_get_url(PHORUM_FEED_URL, $forum["forum_id"], "type=" . $PHORUM["default_feed"]);
     }
     $forum["raw_message_count"] = $forum["message_count"];
     $forum["message_count"] = number_format($forum["message_count"], 0, $PHORUM["dec_sep"], $PHORUM["thous_sep"]);
     $forum["raw_thread_count"] = $forum["thread_count"];
     $forum["thread_count"] = number_format($forum["thread_count"], 0, $PHORUM["dec_sep"], $PHORUM["thous_sep"]);
     if ($PHORUM["DATA"]["LOGGEDIN"]) {
         if ($PHORUM["show_new_on_index"] == 1) {
             $forum["new_messages"] = number_format($new_counts[$forum["forum_id"]]["messages"], 0, $PHORUM["dec_sep"], $PHORUM["thous_sep"]);
             $forum["new_threads"] = number_format($new_counts[$forum["forum_id"]]["threads"], 0, $PHORUM["dec_sep"], $PHORUM["thous_sep"]);
         } elseif ($PHORUM["show_new_on_index"] == 2) {
             $forum["new_message_check"] = $new_checks[$forum["forum_id"]];
         }
     }
 }
 $forums_shown = true;
开发者ID:sheldon,项目名称:dejavu,代码行数:31,代码来源:index_classic.php


示例11: phorum_email_user

                }
                phorum_email_user($mail_users, $mail_data);
                $PHORUM["DATA"]["URL"]["REDIRECT"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $message["thread"]);
                $PHORUM["DATA"]["BACKMSG"] = $PHORUM["DATA"]["LANG"]["BackToThread"];
                $PHORUM["DATA"]["OKMSG"] = $PHORUM["DATA"]["LANG"]["ReportPostSuccess"];
                $template = "message";
                $report = true;
            }
        } else {
            $PHORUM["DATA"]["ReportPostMessage"] = $PHORUM["DATA"]["LANG"]['ReportPostNotAllowed'];
        }
    }
    // format message
    list($message) = phorum_format_messages(array($message));
    $PHORUM["DATA"]["PostSubject"] = $message["subject"];
    $PHORUM["DATA"]["PostAuthor"] = $message["author"];
    $PHORUM["DATA"]["PostBody"] = $message["body"];
    $PHORUM["DATA"]["raw_PostDate"] = $message["datestamp"];
    $PHORUM["DATA"]["PostDate"] = phorum_date($PHORUM["short_date_time"], $message["datestamp"]);
    $PHORUM["DATA"]["ReportURL"] = phorum_get_url(PHORUM_REPORT_URL, $message_id);
    // if the report was not successfully sent, keep whatever explanation they gave already
    if (isset($_POST["explanation"]) && !$report) {
        $PHORUM["DATA"]["explanation"] = $_POST["explanation"];
    } else {
        $PHORUM["DATA"]["explanation"] = "";
    }
} else {
    $PHORUM["DATA"]["ERROR"] = $PHORUM['DATA']['LANG']['MessageNotFound'];
    $template = 'message';
}
phorum_output($template);
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:report.php


示例12: phorum_setup_announcements

function phorum_setup_announcements()
{
    global $PHORUM;
    // This variable will be used to store the formatted announcements.
    $PHORUM['DATA']['MOD_ANNOUNCEMENTS'] = '';
    // Check if we are on a page on which the announcements have to be shown.
    if (phorum_page == 'index') {
        // Hide the announcements, unless enabled for "index".
        $hide = empty($PHORUM["mod_announcements"]["pages"]["index"]);
        // Show announcements for the root page if "home" is enabled.
        if ($PHORUM['vroot'] == $PHORUM['forum_id'] && !empty($PHORUM["mod_announcements"]["pages"]["home"])) {
            $hide = FALSE;
        }
        if ($hide) {
            return;
        }
    } else {
        if (empty($PHORUM["mod_announcements"]["pages"][phorum_page])) {
            return;
        }
    }
    // Check if we need to show announcements.
    $ann_forum_id = NULL;
    // Inside a vroot, where we have a vroot configuration for the forum
    // to use for announcements and the current forum is not that
    // announcement forum.
    if ($PHORUM['vroot'] > 0 && !empty($PHORUM["mod_announcements"]["vroot"][$PHORUM['vroot']]) && $PHORUM["forum_id"] != $PHORUM["mod_announcements"]["vroot"][$PHORUM['vroot']]) {
        $ann_forum_id = $PHORUM["mod_announcements"]["vroot"][$PHORUM['vroot']];
        // Inside the top level folder, where we have a forum that is configured
        // to be used for announcements and the current forum is not that
        // announcement forum.
    } elseif ($PHORUM['vroot'] == 0 && !empty($PHORUM["mod_announcements"]["forum_id"]) && $PHORUM["forum_id"] != $PHORUM["mod_announcements"]["forum_id"]) {
        $ann_forum_id = $PHORUM["mod_announcements"]["forum_id"];
    }
    // If no announcement forum_id is found, no announcements
    // have to be shown.
    if ($ann_forum_id === NULL) {
        return;
    }
    // Retrieve the last number of posts from the announcement forum.
    $messages = phorum_db_get_recent_messages($PHORUM["mod_announcements"]["number_to_show"], 0, $ann_forum_id, 0, true);
    unset($messages["users"]);
    // No announcements to show? Then we are done.
    if (count($messages) == 0) {
        return;
    }
    // Read the newflags information for authenticated users.
    $newinfo = NULL;
    if ($PHORUM["DATA"]["LOGGEDIN"]) {
        $newflagkey = $ann_forum_id . "-" . $PHORUM['user']['user_id'];
        if ($PHORUM['cache_newflags']) {
            $newinfo = phorum_cache_get('newflags', $newflagkey, $PHORUM['cache_version']);
        }
        if ($newinfo == NULL) {
            $newinfo = phorum_db_newflag_get_flags($ann_forum_id);
            if ($PHORUM['cache_newflags']) {
                phorum_cache_put('newflags', $newflagkey, $newinfo, 86400, $PHORUM['cache_version']);
            }
        }
    }
    require_once "./include/format_functions.php";
    // Process the announcements.
    foreach ($messages as $message) {
        // Skip this message if it's older than the number of days that was
        // configured in the settings screen.
        if (!empty($PHORUM["mod_announcements"]["days_to_show"]) && $message["datestamp"] < time() - $PHORUM["mod_announcements"]["days_to_show"] * 86400) {
            continue;
        }
        // Check if there are new messages in the thread.
        if (isset($newinfo)) {
            $new = 0;
            foreach ($message["meta"]["message_ids"] as $id) {
                if (!isset($newinfo[$id]) && $id > $newinfo['min_id']) {
                    $new = 1;
                    break;
                }
            }
            // There are new messages. Setup the template data for showing
            // a new flag.
            if ($new) {
                $message["new"] = $new ? $PHORUM["DATA"]["LANG"]["newflag"] : NULL;
                $message["URL"]["NEWPOST"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $message["thread"], "gotonewpost");
            } elseif ($PHORUM["mod_announcements"]["only_show_unread"]) {
                continue;
            }
        }
        // Setup template data for the message.
        unset($message['body']);
        $message["lastpost"] = phorum_date($PHORUM["short_date_time"], $message["modifystamp"]);
        $message["raw_datestamp"] = $message["datestamp"];
        $message["datestamp"] = phorum_date($PHORUM["short_date_time"], $message["datestamp"]);
        $message["URL"]["READ"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $message["forum_id"], $message["message_id"]);
        $PHORUM["DATA"]["ANNOUNCEMENTS"][] = $message;
    }
    // If all announcements were skipped, then we are done.
    if (!isset($PHORUM["DATA"]["ANNOUNCEMENTS"])) {
        return;
    }
    // format / clean etc. the messages found
    $PHORUM["DATA"]["ANNOUNCEMENTS"] = phorum_format_messages($PHORUM["DATA"]["ANNOUNCEMENTS"]);
//.........这里部分代码省略.........
开发者ID:mgs2,项目名称:kw-forum,代码行数:101,代码来源:announcements.php


示例13: isset

}

// Setup template data.
$PHORUM["DATA"]["PROFILE"] = $user;
$PHORUM["DATA"]["PROFILE"]["forum_id"] = isset($PHORUM["forum_id"]) ? $PHORUM['forum_id'] : 0;
$PHORUM["DATA"]["PROFILE"]["PANEL"] = $panel;

// Set the back-URL and -message.
if ($PHORUM['forum_id'] > 0 && $PHORUM['folder_flag'] == 0) {
    $PHORUM['DATA']['URL']['BACK'] = phorum_get_url(PHORUM_LIST_URL);
    $PHORUM['DATA']['URL']['BACKTITLE'] = $PHORUM['DATA']['LANG']['BacktoForum'];
} else {
    if(isset($PHORUM['forum_id'])) {
        $PHORUM['DATA']['URL']['BACK'] = phorum_get_url(PHORUM_INDEX_URL,$PHORUM['forum_id']);
    } else {
        $PHORUM['DATA']['URL']['BACK'] = phorum_get_url(PHORUM_INDEX_URL);
    }
    $PHORUM['DATA']['URL']['BACKTITLE'] = $PHORUM['DATA']['LANG']['BackToForumList'];
}

// Load the include file for the current panel.
$panel = basename($panel);
if (file_exists("./include/controlcenter/$panel.php")) {
    include "./include/controlcenter/$panel.php";
} else {
    include "./include/controlcenter/summary.php";
}

// The include file can set the template we have to use for
// displaying the main part of the control panel screen
// in the $template variable.
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:control.php


示例14: unset

// Retrieve the recent messages.
$recent = $PHORUM['DB']->get_recent_messages($count, 0, $forum_id, $thread_id, $threads_only);
unset($recent["users"]);
// Add newflag info to the messages.
if ($PHORUM["DATA"]["LOGGEDIN"]) {
    $type = $threads_only ? PHORUM_NEWFLAGS_BY_THREAD : PHORUM_NEWFLAGS_BY_MESSAGE;
    $recent = phorum_api_newflags_apply_to_messages($recent, $type);
}
// Format the messages.
$recent = phorum_api_format_messages($recent);
// Apply the list hook to the messages.
if (isset($PHORUM["hooks"]["list"])) {
    $recent = phorum_api_hook("list", $recent);
}
// Retrieve information about the forums for the active user.
$allowed_forums = phorum_api_user_check_access(PHORUM_USER_ALLOW_READ, PHORUM_ACCESS_LIST);
$forums = $PHORUM['DB']->get_forums($allowed_forums);
foreach ($forums as $id => $forum) {
    $forums[$id]['url'] = phorum_get_url(PHORUM_LIST_URL, $forum['forum_id']);
}
// Add forum info to the messages and clean up data.
foreach ($recent as $id => $message) {
    $recent[$id]['foruminfo'] = array('id' => $message['forum_id'], 'name' => $forums[$message['forum_id']]['name'], 'url' => $forums[$message['forum_id']]['url']);
    // Strip fields that the caller should not see in the return data.
    unset($recent[$id]['email']);
    unset($recent[$id]['ip']);
    unset($recent[$id]['meta']);
    unset($recent[$id]['msgid']);
}
// Return the results.
phorum_ajax_return(array_values($recent));
开发者ID:netovs,项目名称:Core,代码行数:31,代码来源:call.getrecentmessages.php


示例15: phorum_email_moderators

function phorum_email_moderators($message)
{
    $PHORUM = $GLOBALS["PHORUM"];
    $mail_users = phorum_api_user_list_moderators($PHORUM['forum_id'], $PHORUM['email_ignore_admin'], TRUE);
    if (count($mail_users)) {
        include_once "./include/format_functions.php";
        if ($message["status"] > 0) {
            // just notification of a new message
            $mailsubjecttpl = 'NewUnModeratedSubject';
            $mailmessagetpl = 'NewUnModeratedMessage';
            $mailsubject = $PHORUM["DATA"]["LANG"]['NewUnModeratedSubject'];
            $mailmessage = $PHORUM["DATA"]["LANG"]['NewUnModeratedMessage'];
        } else {
            // posts needing approval
            $mailsubjecttpl = 'NewModeratedSubject';
            $mailmessagetpl = 'NewModeratedMessage';
            $mailsubject = $PHORUM["DATA"]["LANG"]['NewModeratedSubject'];
            $mailmessage = $PHORUM["DATA"]["LANG"]['NewModeratedMessage'];
        }
        $mail_data = array("forumname" => strip_tags($PHORUM["DATA"]["NAME"]), "forum_id" => $PHORUM['forum_id'], "message_id" => $message['message_id'], "author" => phorum_api_user_get_display_name($message["user_id"], $message["author"], PHORUM_FLAG_PLAINTEXT), "subject" => $message['subject'], "full_body" => $message['body'], "plain_body" => phorum_strip_body($message['body']), "approve_url" => phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=messages"), "read_url" => phorum_get_url(PHORUM_READ_URL, $message['thread'], $message['message_id']), "mailmessage" => $mailmessage, "mailsubject" => $mailsubject, "mailmessagetpl" => $mailmessagetpl, "mailsubjecttpl" => $mailsubjecttpl, "language" => $PHORUM['language']);
        if (isset($_POST[PHORUM_SESSION_LONG_TERM])) {
            // strip any auth info from the read url
            $mail_data["read_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["read_url"]);
            $mail_data["approve_url"] = preg_replace("!,{0,1}" . PHORUM_SESSION_LONG_TERM . "=" . urlencode($_POST[PHORUM_SESSION_LONG_TERM]) . "!", "", $mail_data["approve_url"]);
        }
        phorum_email_user($mail_users, $mail_data);
    }
}
开发者ID:sleepy909,项目名称:cpassman,代码行数:28,代码来源:email_functions.php


示例16: phorum_api_file_check_read_access


//.........这里部分代码省略.........
 *
 *     On success, it returns an array containing descriptive data for
 *     the file. The following fields are available in this array:
 *     <ul>
 *     <li>file_id: The file_id for the requested file.</li>
 *     <li>filename: The name of the file.</li>
 *     <li>filesize: The size of the file in bytes.</li>
 *     <li>add_datetime: Epoch timestamp describing at what time
 *         the file was stored.</li>
 *     <li>message_id: The message to which a message is linked
 *         (in case it is a message attachment).</li>
 *     <li>user_id: The user to which a message is linked
 *         (in case it is a private user file).</li>
 *     <li>link: A value describing to what type of entity the file is
 *         linked. One of {@link PHORUM_LINK_USER},
 *         {@link PHORUM_LINK_MESSAGE}, {@link PHORUM_LINK_EDITOR} and
 *         {@link PHORUM_LINK_TEMPFILE}.</li>
 *     </ul>
 */
function phorum_api_file_check_read_access($file_id, $flags = 0)
{
    global $PHORUM;
    settype($file_id, "int");
    // Reset error storage.
    $GLOBALS["PHORUM"]["API"]["errno"] = NULL;
    $GLOBALS["PHORUM"]["API"]["error"] = NULL;
    // Check if the active user has read access for the active forum_id.
    if (!$flags & PHORUM_FLAG_IGNORE_PERMS && !phorum_check_read_common()) {
        return phorum_api_error_set(PHORUM_ERRNO_NOACCESS, "Read permission for file (id {$file_id}) denied.");
    }
    // Retrieve the descriptive file data for the file from the database.
    // Return an error if the file does not exist.
    $file = phorum_db_file_get($file_id, FALSE);
    if (empty($file)) {
        return phorum_api_error_set(PHORUM_ERRNO_NOTFOUND, "The requested file (id {$file_id}) was not found.");
    }
    // For the standard database based file storage, we do not have to
    // do checks for checking file existence (since the data is in the
    // database and we found the record for it). Storage modules might
    // have to do additional checks though (e.g. to see if the file data
    // exists on disk), so here we give them a chance to check for it.
    // This hook can also be used for implementing additional access
    // rules. The hook can use phorum_api_error_set() to return an error.
    // Hooks should be aware that their input might not be $file, but
    // FALSE instead, in which case they should immediately return
    // FALSE themselves.
    if (isset($PHORUM["hooks"]["file_check_read_access"])) {
        $file = phorum_hook("file_check_read_access", $file, $flags);
        if ($file === FALSE) {
            return FALSE;
        }
    }
    // If we do not do any permission checking, then we are done.
    if ($flags & PHORUM_FLAG_IGNORE_PERMS) {
        return $file;
    }
    // Is the file linked to a forum message? In that case, we have to
    // check if the message does really belong to the requested forum_id.
    if ($file["link"] == PHORUM_LINK_MESSAGE && !empty($file["message_id"])) {
        // Retrieve the message. If retrieving the message is not possible
        // or if the forum if of the message is different from the requested
        // forum_id, then return an error.
        $message = phorum_db_get_message($file["message_id"], "message_id", TRUE);
        if (empty($message)) {
            return phorum_api_error_set(PHORUM_ERRNO_INTEGRITY, "An integrity problem was detected in the database: " . "file id {$file_id} is linked to non existent " . "message_id {$file["message_id"]}.");
        }
        if ($message["forum_id"] != $PHORUM["forum_id"]) {
            return phorum_api_error_set(PHORUM_ERRNO_NOACCESS, "Permission denied for reading the file: it does not " . "belong to the requested forum_id {$PHORUM["forum_id"]}.");
        }
    }
    // A general purpose URL host matching regexp, that we'll use below.
    $matchhost = '!^https?://([^/]+)/!i';
    // See if off site links are allowed. If this is not the case, then
    // check if an off site link is requested. We use the HTTP_REFERER for
    // doing the off site link check. This is not a water proof solution
    // (since HTTP referrers can be faked), but it will be good enough for
    // stopping the majority of the off site requests.
    if (isset($_SERVER["HTTP_REFERER"]) && $PHORUM["file_offsite"] != PHORUM_OFFSITE_ANYSITE && preg_match($matchhost, $_SERVER["HTTP_REFERER"])) {
        // Generate the base URL for the Phorum.
        $base = strtolower(phorum_get_url(PHORUM_BASE_URL));
        // Strip query string from the base URL. We mainly want to
        // check if the location matches the Phorum location.
        // Otherwise, we might get in troubles with things like
        // URI authentication, where a session id is added to the URL.
        $base = preg_replace('/\\?.*$/', '', $base);
        // FORUMONLY: Links to forum files are only allowed from the forum.
        // Check if the referrer URL starts with the base Phorum URL.
        if ($PHORUM["file_offsite"] == PHORUM_OFFSITE_FORUMONLY) {
            $refbase = substr($_SERVER["HTTP_REFERER"], 0, strlen($base));
            if (strcasecmp($base, $refbase) != 0) {
                return phorum_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP phorum_hook函数代码示例发布时间:2022-05-15
下一篇:
PHP phorum_get_file_name函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap