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


PHP phorum_date函数代码示例

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


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

示例1: phorum_pm_format

function phorum_pm_format($messages)
{
    $PHORUM = $GLOBALS["PHORUM"];
    include_once "./include/format_functions.php";
    // Reformat message so it looks like a forum message (so we can run it
    // through phorum_format_messages) and do some PM specific formatting.
    foreach ($messages as $id => $message) {
        // The formatting code expects a message id.
        $messages[$id]["message_id"] = $id;
        // Read URLs need a folder id, so we only create that URL if
        // one's available.
        if (isset($message['pm_folder_id'])) {
            $folder_id = $message['pm_folder_id'] ? $message['pm_folder_id'] : $message['special_folder'];
            $messages[$id]["URL"]["READ"] = phorum_get_url(PHORUM_PM_URL, "page=read", "folder_id={$folder_id}", "pm_id={$id}");
        }
        // The datestamp is only available for already posted messages.
        if (isset($message['datestamp'])) {
            $messages[$id]["raw_date"] = $message["datestamp"];
            $messages[$id]["date"] = phorum_date($PHORUM["short_date_time"], $message["datestamp"]);
        }
        if (isset($message['meta']) && !is_array($message['meta'])) {
            $messages[$id]['meta'] = unserialize($message['meta']);
        }
        $messages[$id]["body"] = isset($message["message"]) ? $message["message"] : "";
        $messages[$id]["email"] = "";
        $messages[$id]["URL"]["PROFILE"] = phorum_get_url(PHORUM_PROFILE_URL, $message["user_id"]);
        $messages[$id]["recipient_count"] = 0;
        $messages[$id]["receive_count"] = 0;
        if (isset($message["recipients"]) && is_array($message["recipients"])) {
            $receive_count = 0;
            foreach ($message["recipients"] as $rcpt_id => $rcpt) {
                if (!empty($rcpt["read_flag"])) {
                    $receive_count++;
                }
                if (!isset($rcpt["display_name"])) {
                    $messages[$id]["recipients"][$rcpt_id]["display_name"] = $PHORUM["DATA"]["LANG"]["AnonymousUser"];
                } else {
                    $messages[$id]["recipients"][$rcpt_id]["display_name"] = empty($PHORUM["custom_display_name"]) ? htmlspecialchars($rcpt["display_name"], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]) : $rcpt["display_name"];
                    $messages[$id]["recipients"][$rcpt_id]["URL"]["PROFILE"] = phorum_get_url(PHORUM_PROFILE_URL, $rcpt_id);
                }
            }
            $messages[$id]["recipient_count"] = count($message["recipients"]);
            $messages[$id]["receive_count"] = $receive_count;
        }
    }
    // Run the messages through the standard formatting code.
    $messages = phorum_format_messages($messages);
    // Reformat message back to a private message.
    foreach ($messages as $id => $message) {
        $messages[$id]["message"] = $message["body"];
        unset($messages[$id]["body"]);
    }
    return $messages;
}
开发者ID:mgs2,项目名称:kw-forum,代码行数:54,代码来源:pm.php

示例2: foreach

        foreach($_POST["delete"] as $file_id){

            phorum_db_file_delete($file_id);

        }                

    }

    $files = phorum_db_get_user_file_list($PHORUM["user"]["user_id"]);

    $total_size=0;

    foreach($files as $key => $file) {
        $files[$key]["filesize"] = phorum_filesize($file["filesize"]);
        $files[$key]["dateadded"]=phorum_date($PHORUM["short_date"], $file["add_datetime"]);

        $files[$key]["url"]=phorum_get_url(PHORUM_FILE_URL, "file=$key");

        $total_size+=$file["filesize"];
    } 

    $template = "cc_files";

    if($PHORUM["max_file_size"]){
        $PHORUM["DATA"]["FILE_SIZE_LIMIT"]=$PHORUM["DATA"]["LANG"]["FileSizeLimits"] . ' ' . phorum_filesize($PHORUM["max_file_size"]*1024);
    }

    if($PHORUM["file_types"]){
        $PHORUM["DATA"]["FILE_TYPE_LIMIT"]=$PHORUM["DATA"]["LANG"]["FileTypeLimits"];
    }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:files.php

示例3: phorum_db_get_message_subscriptions

// reading all subscriptions to messages
$subscr_array = phorum_db_get_message_subscriptions($PHORUM['user']['user_id'], $subdays); 

// reading all forums
$forum_ids = $subscr_array['forum_ids'];
unset($subscr_array['forum_ids']);
$forums_arr = phorum_db_get_forums($forum_ids,-1,$PHORUM['vroot']);
$subscr_array_final = array();
foreach($subscr_array as $dummy => $data) {
    if ($data['forum_id'] == 0) {
        $data['forum'] = $PHORUM['DATA']['LANG']['Announcement'];
    } else {
        $data['forum'] = $forums_arr[$data['forum_id']]['name'];
    } 

    $data['datestamp'] = phorum_date($PHORUM["short_date"], $data["modifystamp"]);
    $data['readurl'] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $data["forum_id"], $data["thread"]);

    if(!empty($data["user_id"])) {
        $data["profile_url"] = phorum_get_url(PHORUM_PROFILE_URL, $data["user_id"]);
        // we don't normally put HTML in this code, but this makes it easier on template builders
        $data["linked_author"] = "<a href=\"".$data["profile_url"]."\">".htmlspecialchars($data["author"])."</a>";
    } elseif(!empty($data["email"])) {
        $data["email_url"] = phorum_html_encode("mailto:$data[email]");
        // we don't normally put HTML in this code, but this makes it easier on template builders
        $data["linked_author"] = "<a href=\"".$data["email_url"]."\">".htmlspecialchars($data["author"])."</a>";
    } else {
        $data["linked_author"] = htmlspecialchars($data["author"]);
    }

    $data["subject"]=htmlspecialchars($data["subject"]);
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:subthreads.php

示例4: foreach

foreach ($forums as $forum) {
    if ($forum["folder_flag"]) {
        $forum["URL"]["LIST"] = phorum_get_url(PHORUM_INDEX_URL, $forum["forum_id"]);
    } else {
        if ($PHORUM["hide_forums"] && !phorum_api_user_check_access(PHORUM_USER_ALLOW_READ, $forum["forum_id"])) {
            continue;
        }
        $forum["url"] = phorum_get_url(PHORUM_LIST_URL, $forum["forum_id"]);
        // if there is only one forum in Phorum, redirect to it.
        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"]) {
开发者ID:sheldon,项目名称:dejavu,代码行数:31,代码来源:index_classic.php

示例5: 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

示例6: PhorumInputForm

 $frm = new PhorumInputForm("", "post", "Update");
 $frm->hidden("module", "users");
 $frm->hidden("section", "main");
 $frm->hidden("referrer", $referrer);
 $frm->hidden("user_id", $_REQUEST["user_id"]);
 $frm->addbreak("Edit User");
 $frm->addrow("User Name", htmlspecialchars($user["username"]) . "&nbsp;&nbsp;<a href=\"#forums\">Edit Forum Permissions</a>&nbsp;&nbsp;<a href=\"#groups\">Edit Groups</a>");
 $frm->addrow("Real Name", $frm->text_box("real_name", $user["real_name"], 50));
 $frm->addrow("Email", $frm->text_box("email", $user["email"], 50));
 $frm->addrow("Password (Enter to change)", $frm->text_box("password1", ""));
 $frm->addrow("Password (Confirmation)", $frm->text_box("password2", ""));
 $frm->addrow("Signature", $frm->textarea("signature", $user["signature"]));
 $frm->addrow("Active", $frm->select_tag("active", array("No", "Yes"), $user["active"]));
 $frm->addrow("Forum posts", $user["posts"]);
 $frm->addrow("Registration Date", phorum_date($PHORUM['short_date_time'], $user['date_added']));
 $row = $frm->addrow("Date last active", phorum_date($PHORUM['short_date_time'], $user['date_last_active']));
 $frm->addrow("Administrator", $frm->select_tag("admin", array("No", "Yes"), $user["admin"]));
 $frm->addhelp($row, "Date last active", "This shows the date, when the user was last seen in the forum. Check your setting on \"Track user usage\" in the \"General Settings\". As long as this setting is not enabled, the activity will not be tracked.");
 $cf_header_shown = 0;
 foreach ($PHORUM["PROFILE_FIELDS"] as $key => $item) {
     if ($key === 'num_rows' || !empty($item['deleted'])) {
         continue;
     }
     if (!empty($item['show_in_admin'])) {
         if (!$cf_header_shown) {
             $frm->addbreak('Custom Profile Fields');
             $cf_header_shown = 1;
         }
         $itemval = "[EMPTY]";
         if (isset($user[$item['name']]) && trim($user[$item['name']]) != '') {
             $itemval = trim($user[$item['name']]);
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:users.php

示例7: phorum_relative_date

/**
 * Formats an epoch timestamp to a relative time phrase
 *
 * @param ts - The epoch timestamp to format
 * @return phrase - The formatted phrase
 */
function phorum_relative_date($time)
{
    $PHORUM = $GLOBALS["PHORUM"];
    $today = strtotime(phorum_date('%Y-%m-%d', time()));
    $reldays = ($time - $today) / 86400;
    if ($reldays >= 0 && $reldays < 1) {
        return $PHORUM["DATA"]["LANG"]["relative_today"];
    } else {
        if ($reldays >= 1 && $reldays < 2) {
            return $PHORUM["DATA"]["LANG"]["relative_tomorrow"];
        } else {
            if ($reldays >= -1 && $reldays < 0) {
                return $PHORUM["DATA"]["LANG"]["relative_yesterday"];
            }
        }
    }
    if (abs($reldays) < 30) {
        // less than a month
        $reldays = floor($reldays);
        if ($reldays == 1) {
            $return = $PHORUM["DATA"]["LANG"]["relative_one_day"];
        } else {
            $return = abs($reldays) . " " . $PHORUM["DATA"]["LANG"]["relative_days"];
        }
        $return .= " " . $PHORUM["DATA"]["LANG"]["relative_ago"];
        return $return;
    } elseif (abs($reldays) < 60) {
        // weeks ago
        $relweeks = floor(abs($reldays / 7));
        $return = $relweeks . " " . $PHORUM["DATA"]["LANG"]["relative_weeks"];
        $return .= " " . $PHORUM["DATA"]["LANG"]["relative_ago"];
        return $return;
    } elseif (abs($reldays) < 365) {
        // months ago
        $relmonths = floor(abs($reldays / 30));
        $return = $relmonths . " " . $PHORUM["DATA"]["LANG"]["relative_months"];
        $return .= " " . $PHORUM["DATA"]["LANG"]["relative_ago"];
        return $return;
    } else {
        // years ago
        $relyears = floor(abs($reldays / 365));
        if ($relyears == 1) {
            $return = $PHORUM["DATA"]["LANG"]["relative_one_year"];
        } else {
            $return = $relyears . " " . $PHORUM["DATA"]["LANG"]["relative_years"];
        }
        $return .= " " . $PHORUM["DATA"]["LANG"]["relative_ago"];
        return $return;
    }
}
开发者ID:mgs2,项目名称:kw-forum,代码行数:56,代码来源:format_functions.php

示例8: phorum_htmlpurifier_generate_editmessage

/**
 * Generates an edit message based on a message array
 */
function phorum_htmlpurifier_generate_editmessage($row)
{
    $PHORUM = $GLOBALS['PHORUM'];
    $editmessage = '';
    if (isset($row['meta']['edit_count']) && $row['meta']['edit_count'] > 0) {
        $editmessage = str_replace("%count%", $row['meta']['edit_count'], $PHORUM["DATA"]["LANG"]["EditedMessage"]);
        $editmessage = str_replace("%lastedit%", phorum_date($PHORUM["short_date_time"], $row['meta']['edit_date']), $editmessage);
        $editmessage = str_replace("%lastuser%", $row['meta']['edit_username'], $editmessage);
        $editmessage = "\n\n\n\n{$editmessage}";
    }
    return $editmessage;
}
开发者ID:chaudhary4k4,项目名称:vtigercrm,代码行数:15,代码来源:htmlpurifier.php

示例9: unset

// as the display name.
if ($user["real_name"] == $user["display_name"]) {
    unset($user["real_name"]);
}
$PHORUM["DATA"]["PROFILE"] = $user;
$PHORUM["DATA"]["PROFILE"]["forum_id"] = $PHORUM["forum_id"];
$PHORUM["DATA"]["PROFILE"]["raw_date_added"] = $PHORUM["DATA"]["PROFILE"]["date_added"];
$PHORUM["DATA"]["PROFILE"]["date_added"] = phorum_date($PHORUM['short_date_time'], $PHORUM["DATA"]["PROFILE"]["date_added"]);
if (empty($PHORUM['hide_email_addr']) && !$user['hide_email'] || !empty($PHORUM["user"]["admin"]) || phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_MESSAGES) && PHORUM_MOD_EMAIL_VIEW || phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_USERS) && PHORUM_MOD_EMAIL_VIEW) {
    $PHORUM["DATA"]["PROFILE"]["email"] = phorum_html_encode($user["email"]);
} else {
    $PHORUM["DATA"]["PROFILE"]["email"] = $PHORUM["DATA"]["LANG"]["Hidden"];
}
if ($PHORUM["track_user_activity"] && (!empty($PHORUM["user"]["admin"]) || phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_MESSAGES) || phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_USERS) || !$user["hide_activity"])) {
    $PHORUM["DATA"]["PROFILE"]["raw_date_last_active"] = $PHORUM["DATA"]["PROFILE"]["date_last_active"];
    $PHORUM["DATA"]["PROFILE"]["date_last_active"] = phorum_date($PHORUM['short_date_time'], $PHORUM["DATA"]["PROFILE"]["date_last_active"]);
} else {
    unset($PHORUM["DATA"]["PROFILE"]["date_last_active"]);
}
$PHORUM["DATA"]["PROFILE"]["posts"] = number_format($PHORUM["DATA"]["PROFILE"]["posts"], 0, "", $PHORUM["thous_sep"]);
$PHORUM["DATA"]["PROFILE"]["URL"]["PM"] = phorum_get_url(PHORUM_PM_URL, "page=send", "to_id=" . urlencode($user["user_id"]));
$PHORUM["DATA"]["PROFILE"]["URL"]["ADD_BUDDY"] = phorum_get_url(PHORUM_PM_URL, "page=buddies", "action=addbuddy", "addbuddy_id=" . urlencode($user["user_id"]));
$PHORUM["DATA"]["PROFILE"]["is_buddy"] = phorum_db_pm_is_buddy($user["user_id"]);
// unset($PHORUM["DATA"]["PROFILE"]["signature"]);
$PHORUM["DATA"]["PROFILE"]["URL"]["SEARCH"] = phorum_get_url(PHORUM_SEARCH_URL, "author=" . urlencode($PHORUM["DATA"]["PROFILE"]["user_id"]), "match_type=USER_ID", "match_dates=0", "match_threads=0");
$PHORUM["DATA"]["PROFILE"]["username"] = htmlspecialchars($PHORUM["DATA"]["PROFILE"]["username"], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
if (isset($PHORUM["DATA"]["PROFILE"]["real_name"])) {
    $PHORUM["DATA"]["PROFILE"]["real_name"] = htmlspecialchars($PHORUM["DATA"]["PROFILE"]["real_name"], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
}
if (empty($PHORUM["custom_display_name"])) {
    $PHORUM["DATA"]["PROFILE"]["display_name"] = htmlspecialchars($PHORUM["DATA"]["PROFILE"]["display_name"], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
开发者ID:sleepy909,项目名称:cpassman,代码行数:31,代码来源:profile.php

示例10: phorum_cache_remove

                phorum_cache_remove('user',$user_id);
            }

            // Run the message through the default message formatting.
            list($message) = phorum_pm_format(array($message));

            // Setup data for recipients.
            foreach ($message["recipients"] as $rcpt_id => $rcpt) {
                $message["recipients"][$rcpt_id]["username"] = htmlspecialchars($rcpt["username"]);
                $message["recipients"][$rcpt_id]["to_profile_url"] = phorum_get_url(PHORUM_PROFILE_URL, $rcpt_id);
            }
            $message["recipient_count"] = count($message["recipients"]);

            // Setup URL's and format date.
            $message["from_profile_url"]=phorum_get_url(PHORUM_PROFILE_URL, $message["from_user_id"]);
            $message["date"]=phorum_date($PHORUM["short_date"], $message["datestamp"]);

            $PHORUM["DATA"]["MESSAGE"] = $message;
            $PHORUM["DATA"]["PMLOCATION"] = $PHORUM["DATA"]["LANG"]["PMRead"];

            // re-init folder list to account for change in read flags
            $pm_folders = phorum_db_pm_getfolders(NULL, true);

            // Set folder id to the right folder for this message.
            $folder_id = $message["pm_folder_id"];
            if ($folder_id == 0) {
                $folder_id = $message["special_folder"];
            }

            $template = "pm_read";
开发者ID:nistormihai,项目名称:Newscoop,代码行数:30,代码来源:pm.php

示例11: htmlspecialchars

            $frm->addrow("User Name", htmlspecialchars($user["username"])."&nbsp;&nbsp;<a href=\"#forums\">Edit Forum Permissions</a>&nbsp;&nbsp;<a href=\"#groups\">Edit Groups</a>");

            $frm->addrow("Email", $frm->text_box("email", $user["email"], 50));
            $frm->addrow("Password (Enter to change)", $frm->text_box("password1",""));
            $frm->addrow("Password (Confirmation)", $frm->text_box("password2",""));


            $frm->addrow("Signature", $frm->textarea("signature", htmlspecialchars($user["signature"])));

            $frm->addrow("Active", $frm->select_tag("active", array("No", "Yes"), $user["active"]));

            $frm->addrow("Administrator", $frm->select_tag("admin", array("No", "Yes"), $user["admin"]));

            $frm->addrow("Registration Date", phorum_date("%m/%d/%Y %I:%M%p",$user['date_added']));

            $row=$frm->addrow("Date last active", phorum_date("%m/%d/%Y %I:%M%p",$user['date_last_active']));

            $frm->addhelp($row, "Date last active", "This shows the date, when the user was last seen in the forum. Check your setting on \"Track user usage\" in the \"General Settings\". As long as this setting is not enabled, the activity will not be tracked.");


            $frm->show();

            echo "<br /><hr class=\"PhorumAdminHR\" /><br /><a name=\"forums\"></a>";

            $frm = new PhorumInputForm ("", "post", "Update");

            $frm->hidden("user_id", $_REQUEST["user_id"]);

            $frm->hidden("module", "users");

            $frm->hidden("section", "forums");
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:users.php

示例12: array_reverse

$diffs = array_reverse($edit_tracks);
// push an empty diff for the current status
array_push($diffs, array());
$prev_body = -1;
$prev_subject = -1;
foreach ($diffs as $diff_info) {
    if (!isset($diff_info["user_id"])) {
        $this_version["username"] = empty($PHORUM['custom_display_name']) ? htmlspecialchars($message["author"], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]) : $message["author"];
        $this_version["user_id"] = $message["user_id"];
        $this_version["date"] = phorum_date($PHORUM["long_date_time"], $message["datestamp"]);
        $this_version["original"] = true;
    } else {
        $edit_user = phorum_api_user_get($diff_info['user_id']);
        $this_version["username"] = empty($PHORUM['custom_display_name']) ? htmlspecialchars($edit_user["display_name"], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]) : $edit_user["display_name"];
        $this_version["user_id"] = $diff_info["user_id"];
        $this_version["date"] = phorum_date($PHORUM["long_date_time"], $diff_info["time"]);
        $this_version["original"] = false;
    }
    // only happens in first loop
    if ($prev_body == -1) {
        $prev_body = $message["body"];
    }
    // body diffs
    if (isset($diff_info['diff_body']) && !empty($diff_info['diff_body'])) {
        $colored_body = phorum_unpatch_color($prev_body, $diff_info['diff_body']);
        $prev_body = phorum_unpatch($prev_body, $diff_info['diff_body']);
        $colored_body = htmlspecialchars($colored_body, ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
        $colored_body = str_replace(array("[phorum addition]", "[phorum removal]", "[/phorum addition]", "[/phorum removal]"), array("<span class=\"addition\">", "<span class=\"removal\">", "</span>", "</span>"), $colored_body);
        $colored_body = nl2br($colored_body);
        $this_version["colored_body"] = $colored_body;
    } elseif (!isset($diff_info['diff_body'])) {
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:changes.php

示例13: while

                $title = $strings["LOGLEVELS"][$loginfo["loglevel"]];
                $cat = $strings["CATEGORIES"][$loginfo["category"]];
                // Find detailed info.
                $details = NULL;
                if ($loginfo["details"] !== NULL) {
                    $details = $loginfo["details"];
                }
                // Adding whitespace if the message contains ridiculously long words,
                // so the interface layout won't be wrecked.
                $message = $loginfo["message"];
                while (preg_match('/(\\S{40})\\S/', $message, $m)) {
                    $message = str_replace($m[1], $m[1] . " ", $message);
                }
                // If the event log is linked to a forum message, the generate
                // the URL that points to that message.
                $message_url = NULL;
                if ($loginfo["message_id"] !== NULL && $loginfo["message_id"] > 0) {
                    $message_url = phorum_get_url(PHORUM_FOREIGN_READ_URL, $loginfo["forum_id"], $loginfo["thread_id"], $loginfo["message_id"]);
                }
                if (!isset($PHORUM['short_time'])) {
                    $f = str_replace($PHORUM['short_date'], '', $PHORUM['short_date_time']);
                    $f = preg_replace('/^\\s+|\\s+$/', '', $f);
                    $PHORUM['short_time'] = $f;
                }
                print "==========================\n" . "Log level: {$title}\n" . "Date: " . phorum_date($PHORUM['short_date'], $loginfo["datestamp"]) . "\n" . "Time: " . phorum_date($PHORUM['short_time'], $loginfo["datestamp"]) . "\n" . "Source: " . $loginfo["source"] . "\n" . "Category: " . $cat . "\n" . "Message: " . $message . "\n" . "User info: " . ($loginfo["user_id"] ? "User ID = " . $loginfo["user_id"] . ($loginfo["username"] !== NULL ? ', username = ' . $loginfo["username"] : '') : "Anonymous user") . ", " . "User IP address = " . $loginfo["ip"] . ($loginfo["hostname"] !== NULL ? ", hostname = " . $loginfo["hostname"] : "") . "\n" . ($message_url !== NULL ? "Related message: Forum = " . $loginfo["forum"] . ", Message ID = " . $loginfo["message_id"] . ", URL = " . $message_url . "\n" : "") . ($details !== NULL ? "Additional details:\n" . $details : "") . "\n\n";
            }
        }
    }
}
ob_end_flush();
exit;
开发者ID:samuell,项目名称:Core,代码行数:31,代码来源:download.php

示例14: foreach

// Also, remove the attachments that are not visible from the preview data.
$attach_count = 0;
if (isset($previewmessage["attachments"])) {
    foreach ($previewmessage["attachments"] as $id => $attachment) {
        if ($attachment["keep"]) {
            $attach_count++;
        } else {
            unset($previewmessage["attachments"][$id]);
        }
    }
}
if ($attach_count) {
    // Disable clicking on attachments in the preview (to prevent the
    // browser from jumping to a viewing page, which might break the
    // editing flow). This is not done in the previous loop where the
    // URL is set, so the formatting code for things like embedded
    // attachments can be used.
    foreach ($previewmessage["attachments"] as $nr => $data) {
        $previewmessage["attachments"][$nr]["url"] = $previewmessage["attachments"][$nr]["download_url"] = PREVIEW_NO_ATTACHMENT_CLICK;
    }
} else {
    unset($previewmessage["attachments"]);
}
// Fill the datestamp for new postings.
if ($mode != "edit") {
    $previewmessage["datestamp"] = time();
}
// Format datestamp.
$previewmessage["raw_datestamp"] = $previewmessage["datestamp"];
$previewmessage["datestamp"] = phorum_date($PHORUM["short_date_time"], $previewmessage["datestamp"]);
$PHORUM["DATA"]["PREVIEW"] = $previewmessage;
开发者ID:mgs2,项目名称:kw-forum,代码行数:31,代码来源:action_preview.php

示例15: spamhurdles_api_check_form

/**
 * Check the Spam Hurdles data for a posted form.
 *
 * When a form is posted, then this function has to be called to
 * check the data that was posted.
 *
 * @param string $form_id
 *     An identifier for the current form. This must be the same form id
 *     as the one that was used when calling {@link spamhurdles_api_init()}.
 *
 * @return array
 *     An array, containing two elements.
 *     The first element is the result status of the spam hurdle check.
 *     This is one of SPAMHURDLES_OK, SPAMHURDLES_WARNING or SPAMHURDLES_FATAL.
 *     The second element is the error message or NULL if there was no error.
 */
function spamhurdles_api_check_form($form_id)
{
    global $PHORUM;
    $error = $PHORUM['DATA']['LANG']['mod_spamhurdles']['PostingRejected'];
    $status = SPAMHURDLES_FATAL;
    // Retrieve the spam hurdles data from the form.
    $data = spamhurdles_api_get_formdata($form_id);
    // Check if we were able to retrieve spam hurdles data from the form.
    if ($data === NULL) {
        spamhurdles_log("Spam Hurdles blocked post, form id \"{$form_id}\"", "The posting form was posted without or with invalid " . "Spam Hurdles data.");
        return array($status, $error);
    }
    // Check if the id in the form data is the same as the
    // id that we expect to see.
    if ($data['id'] != $form_id) {
        spamhurdles_log("Spam Hurdles blocked post, form id \"{$form_id}\"", "The posting form was posted with an invalid Spam Hurdles " . "form id.<br/>" . "<br/>" . "Posted form id = {$data['id']}<br/>" . "Expected form id =  {$form_id}");
        return array($status, $error);
    }
    // Check if the TTL on the data didn't expire.
    if ($data['ttl'] < time()) {
        // Only for 5.2. In 5.3 this was moved to formatting API functions.
        if (file_exists('./include/format_functions.php')) {
            require_once './include/format_functions.php';
        }
        spamhurdles_log("Spam Hurdles blocked post, form id \"{$form_id}\"", "The posting form was posted with valid Spam Hurdles data, " . "but the data expired at " . phorum_date($PHORUM["short_date_time"], $data['ttl']));
        return array($status, $error);
    }
    // Let the spam hurdles check the data. If one sees a problem, then
    // it can set the $data['error'] and $data['status'] elements. It can
    // also add log messages to the $data['log'] array.
    $data['error'] = NULL;
    $data['status'] = SPAMHURDLES_OK;
    $data['log'] = array();
    $data = spamhurdles_hurdle_call('check_form', $data, $data['hurdles']);
    $status = $data['status'];
    if ($status !== SPAMHURDLES_OK) {
        spamhurdles_log("Spam Hurdles blocked post, form id \"{$form_id}\"", "Block type: " . ($status === SPAMHURDLES_FATAL ? 'fatal' : 'warning') . "\n" . "Block error: \"" . $data['error'] . "\"" . (empty($data['log']) ? '' : "\n\nInfo: " . implode(' ', $data['log'])));
    }
    return array($data['status'], $data['error']);
}
开发者ID:samuell,项目名称:Core,代码行数:56,代码来源:api.php


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