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


PHP showdate函数代码示例

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


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

示例1: render_article

 function render_article($subject, $article, $info)
 {
     global $locale;
     $category = "<a href='" . INFUSIONS . "articles/articles.php?cat_id=" . $info['cat_id'] . "'>" . $info['cat_name'] . "</a>\n";
     $comment = "<a href='" . INFUSIONS . "articles/articles.php?article_id=" . $info['article_id'] . "#comments'> " . format_word($info['article_comments'], $locale['fmt_comment']) . " </a>\n";
     echo render_breadcrumbs();
     echo "<!--pre_article-->";
     echo "<article>\n";
     echo "<div class='news-action text-right'>";
     echo "<a title='" . $locale['global_075'] . "' href='" . BASEDIR . "print.php?type=A&amp;item_id=" . $info['article_id'] . "'><i class='entypo print'></i></a>";
     echo !empty($info['edit_link']) ? "<a href='" . $info['edit_link'] . "' title='" . $locale['global_076'] . "' /><i class='entypo pencil'></i></a>\n" : '';
     echo "</div>\n";
     echo "<div class='news-info'>" . ucfirst($locale['posted']) . " <span class='news-date'>" . showdate("%d %b %Y", $info['article_date']) . "</span> " . $locale['in'] . " {$category} " . $locale['and'] . " {$comment}</div>\n";
     echo "<h2 class='news-title'>{$subject}</h2>";
     echo "<div class='article'>\n";
     echo ($info['article_breaks'] == "y" ? nl2br($article) : $article) . "<br />\n";
     echo "</div>\n";
     echo "<hr />\n";
     echo "<div class='news-user-info clearfix m-b-10'>\n";
     echo "<h4>" . $locale['about'] . " <a href='" . BASEDIR . "profile.php?lookup=" . $info['user_id'] . "'>" . $info['user_name'] . "</a>\n</h4>";
     echo "<div class='pull-left m-r-10'>" . display_avatar($info, '80px') . "</div>\n";
     echo "<strong>" . getuserlevel($info['user_level']) . "</strong><br/>\n";
     echo "<strong>" . $locale['joined'] . showdate('newsdate', $info['user_joined']) . "</strong><br/>\n";
     echo "</div>\n";
     echo "</article>";
     echo "<!--sub_article-->";
     echo $info['page_nav'];
     echo "<hr />\n";
     if ($info['article_allow_comments']) {
         showcomments("A", DB_ARTICLES, "article_id", $_GET['article_id'], INFUSIONS . "articles/articles.php?article_id=" . $_GET['article_id']);
     }
     if ($info['article_allow_ratings']) {
         showratings("A", $_GET['article_id'], INFUSIONS . "articles/articles.php?article_id=" . $_GET['article_id']);
     }
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:35,代码来源:articles.php

示例2: rss_icon

function rss_icon($feed_name, $feed_updfrq, $feed_icon = "", $language = "all", $exists = false)
{
    if ($exists) {
        $rows = true;
    } else {
        $result = dbquery("SELECT feed_name FROM " . DB_SS_FEEDS . " WHERE feed_name='" . $feed_name . "'");
        $rows = dbrows($result);
    }
    if (IF_MULTI_LANGUAGE && $language) {
        $language = $language;
    } else {
        $language = false;
    }
    $feed_language = $language ? "_" . strtolower($language) : "";
    if ($rows != 0) {
        if (!file_exists(INFUSIONS . "ss_feeds_panel/rss/" . $feed_name . "" . $feed_language . ".rss") or file_exists(INFUSIONS . "ss_feeds_panel/rss/" . $feed_name . "" . $feed_language . ".rss") && time() - filemtime(INFUSIONS . "ss_feeds_panel/rss/" . $feed_name . "" . $feed_language . ".rss") > round($feed_updfrq) * (60 * 60)) {
            make_rss($feed_name, $feed_updfrq, $language, true);
        }
        if (file_exists(INFUSIONS . "ss_feeds_panel/locale/" . LOCALESET . "feeds/" . $feed_name . ".php")) {
            include INFUSIONS . "ss_feeds_panel/locale/" . LOCALESET . "feeds/" . $feed_name . ".php";
        } else {
            include INFUSIONS . "ss_feeds_panel/locale/English/feeds/" . $feed_name . ".php";
        }
        $rssfiledate = showdate("longdate", filemtime(INFUSIONS . "ss_feeds_panel/rss/" . $feed_name . "" . $feed_language . ".rss"));
        if ($feed_icon != "") {
            $icon_feed = INFUSIONS . "ss_feeds_panel/images/icon/" . $feed_icon;
        } else {
            $icon_feed = INFUSIONS . "ss_feeds_panel/images/icon/feed_icon01.png";
        }
        $icon_size = @getimagesize($icon_feed);
        echo "<a href='" . INFUSIONS . "ss_feeds_panel/rss/" . $feed_name . "" . $feed_language . ".rss' target='_blank'>\n";
        echo "\t<img src='" . $icon_feed . "' title='" . $locale['feeds_title'] . " - " . $rssfiledate . "' alt='" . $locale['feeds_title'] . " - " . $rssfiledate . "' style='vertical-align: top; width:" . $icon_size[0] . "px; height:" . $icon_size[1] . "px; border: 0pt none;' />\n";
        echo "</a>\n";
    }
}
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:35,代码来源:functions.php

示例3: showratings

function showratings($rating_type, $rating_item_id, $rating_link)
{
    global $locale, $userdata;
    $settings = \fusion_get_settings();
    if ($settings['ratings_enabled'] == "1") {
        if (iMEMBER) {
            $d_rating = dbarray(dbquery("SELECT rating_vote,rating_datestamp FROM " . DB_RATINGS . " WHERE rating_item_id='" . $rating_item_id . "' AND rating_type='" . $rating_type . "' AND rating_user='" . $userdata['user_id'] . "'"));
            if (isset($_POST['post_rating'])) {
                // Rate
                if (isnum($_POST['rating']) && $_POST['rating'] > 0 && $_POST['rating'] < 6 && !isset($d_rating['rating_vote'])) {
                    $result = dbquery("INSERT INTO " . DB_RATINGS . " (rating_item_id, rating_type, rating_user, rating_vote, rating_datestamp, rating_ip, rating_ip_type) VALUES ('{$rating_item_id}', '{$rating_type}', '" . $userdata['user_id'] . "', '" . $_POST['rating'] . "', '" . time() . "', '" . USER_IP . "', '" . USER_IP_TYPE . "')");
                    if ($result) {
                        defender::unset_field_session();
                    }
                }
                redirect($rating_link);
            } elseif (isset($_POST['remove_rating'])) {
                // Unrate
                $result = dbquery("DELETE FROM " . DB_RATINGS . " WHERE rating_item_id='{$rating_item_id}' AND rating_type='{$rating_type}' AND rating_user='" . $userdata['user_id'] . "'");
                if ($result) {
                    defender::unset_field_session();
                }
                redirect($rating_link);
            }
        }
        $ratings = array(5 => $locale['r120'], 4 => $locale['r121'], 3 => $locale['r122'], 2 => $locale['r123'], 1 => $locale['r124']);
        if (!iMEMBER) {
            $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a>", $locale['r104']);
            if (fusion_get_settings("enable_registration") == TRUE) {
                $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a> " . $locale['or'] . " <a href='" . BASEDIR . "register.php'>" . $locale['register'] . "</a>", $locale['r104']);
            }
            echo "<div class='text-center'>" . $message . "</div>\n";
        } elseif (isset($d_rating['rating_vote'])) {
            echo "<div class='display-block'>\n";
            echo openform('removerating', 'post', $rating_link, array('class' => 'display-block text-center'));
            echo sprintf($locale['r105'], $ratings[$d_rating['rating_vote']], showdate("longdate", $d_rating['rating_datestamp'])) . "<br /><br />\n";
            echo form_button('remove_rating', $locale['r102'], $locale['r102'], array('class' => 'btn-default', 'icon' => 'fa fa-times m-r-10'));
            echo closeform();
            echo "</div>\n";
        } else {
            echo "<div class='display-block'>\n";
            echo openform('postrating', 'post', $rating_link, array('max_tokens' => 1, 'notice' => 0, 'class' => 'm-b-20 text-center'));
            echo form_select('rating', $locale['r106'], '', array('options' => $ratings, 'class' => 'display-block text-center'));
            echo form_button('post_rating', $locale['r103'], $locale['r103'], array('class' => 'btn-primary btn-sm', 'icon' => 'fa fa-thumbs-up m-r-10'));
            echo closeform();
            echo "</div>\n";
        }
        $rating_votes = dbarray(dbquery("\n\t\tSELECT\n\t\tSUM(IF(rating_vote='5', 1, 0)) as r120,\n\t\tSUM(IF(rating_vote='4', 1, 0)) as r121,\n\t\tSUM(IF(rating_vote='3', 1, 0)) as r122,\n\t\tSUM(IF(rating_vote='2', 1, 0)) as r123,\n\t\tSUM(IF(rating_vote='1', 1, 0)) as r124\n\t\tFROM " . DB_RATINGS . " WHERE rating_type='" . $rating_type . "' and rating_item_id='" . intval($rating_item_id) . "'\n\t\t"));
        if (!empty($rating_votes)) {
            echo "<div id='ratings' class='rating_container'>\n";
            foreach ($rating_votes as $key => $num) {
                echo progress_bar($num, $locale[$key], FALSE, '10px', TRUE, FALSE);
            }
            echo "</div>\n";
        } else {
            echo "<div class='text-center'>" . $locale['r101'] . "</div>\n";
        }
    }
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:59,代码来源:ratings_include.php

示例4: render_post

function render_post($post)
{
    global $locale, $settings;
    opentable($post['alb_post_title']);
    echo "<div class='post-item'>";
    echo "<div class='post-body'>" . $post['alb_post_text'] . "</div>";
    echo "<div class='post-footer'>";
    echo "<img src='" . AL_BLOG_DIR . "asset/images/user.png' class='icon' /><a href='" . BASEDIR . "profile.php?lookup=" . $post['alb_post_user'] . "'>" . $post['user_name'] . "</a>";
    echo "<img src='" . AL_BLOG_DIR . "asset/images/category.png' class='icon' />" . ($post['alb_cat_title'] != '' ? "<a href='" . FUSION_SELF . "?p=view_category&id=" . $post['alb_post_cat'] . "'>" . $post['alb_cat_title'] . "</a>" : $locale['alb21']);
    echo "<img src='" . AL_BLOG_DIR . "asset/images/calendar.png' class='icon' />" . showdate("forumdate", $post['alb_post_datestamp']);
    echo "<img src='" . AL_BLOG_DIR . "asset/images/comments.png' class='icon' />" . $post['comments'];
    //echo " <a href='".FUSION_SELF."?p=view_post&id=".$post['alb_post_id']."'>".$locale['alb22']."</a>";
    echo "</div>";
    echo "</div>";
    closetable();
    require_once INCLUDES . "comments_include.php";
    showcomments("BL", DB_AL_BLOG_POSTS, "alb_post_id", $_GET['id'], FUSION_SELF . "?p=view_post&id=" . $_GET['id']);
    require_once INCLUDES . "ratings_include.php";
    showratings("B", $_GET['id'], FUSION_SELF . "?p=view_post&id=" . $_GET['id']);
}
开发者ID:SymbolixDEV,项目名称:AL-PHP-Fusion-Addons,代码行数:20,代码来源:functions.php

示例5: render_article

function render_article($subject, $article, $info)
{
    global $locale, $settings, $aidlink;
    $category = "<a href='" . BASEDIR . "articles.php?cat_id=" . $info['cat_id'] . "'>" . $info['cat_name'] . "</a>\n";
    $comment = "<a href='" . BASEDIR . "articles.php?article_id=" . $info['article_id'] . "#comments'>" . $info['article_comments'] . " comment</a>\n";
    echo "<article>\n";
    echo "<div class='news-action text-right'>";
    echo "<a title='" . $locale['global_075'] . "' href='" . BASEDIR . "print.php?type=A&amp;item_id=" . $info['article_id'] . "'><i class='entypo print'></i></a>";
    echo iADMIN && checkrights("A") ? "<a href='" . ADMIN . "articles.php" . $aidlink . "&amp;action=edit&amp;article_id=" . $info['article_id'] . "' title='" . $locale['global_076'] . "' /><i class='entypo pencil'></i></a>\n" : '';
    echo "</div>\n";
    echo "<div class='news-info'>Posted <span class='news-date'>" . showdate("%d %b %Y", $info['article_date']) . "</span> in {$category} and {$comment}</div>\n";
    echo "<h2 class='news-title'>{$subject}</h2>";
    echo "<div class='article'>\n";
    echo ($info['article_breaks'] == "y" ? nl2br($article) : $article) . "<br />\n";
    echo "</div>\n";
    echo "<div class='news-user-info'>\n";
    echo "<h4>About <a href='" . BASEDIR . "profile.php?lookup=" . $info['user_id'] . "'>" . $info['user_name'] . "</a>\n</h4>";
    echo "<div class='pull-left m-r-10'>" . display_avatar($info, '80px') . "</div>\n";
    echo "<strong>" . getuserlevel($info['user_level']) . "</strong><br/>\n";
    echo "<strong>Joined since: " . showdate('newsdate', $info['user_joined']) . "</strong><br/>\n";
    echo "</div>\n";
    echo "</article>";
}
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:23,代码来源:render_news-articles.php

示例6: render_weblinks_item

 function render_weblinks_item($info)
 {
     global $locale;
     echo render_breadcrumbs();
     opentable($locale['400'] . ": " . $info['weblink_cat_name']);
     echo $info['page_nav'] ? "<<div class='text-right'>" . $info['page_nav'] . "</div>" : '';
     if ($info['weblink_rows']) {
         foreach ($info['item'] as $weblink_id => $data) {
             $new = $data['new'] == 1 ? "<span class='label label-success m-r-10' style='padding:3px 10px;'>" . $locale['410'] . "</span>" : '';
             echo "<aside class='display-inline-block m-t-20' style='width:100%;'>\n";
             echo "<span class='weblink_title strong'><a href='" . $data['weblink']['link'] . "' target='_blank'><strong>" . $data['weblink']['name'] . "</strong></a></span>\n";
             echo $new;
             if ($data['weblink_description'] != "") {
                 echo "<div class='weblink_text'>" . nl2br(parse_textarea($data['weblink_description'])) . "</div>\n";
             }
             echo "<span class='display-inline m-r-20'><strong>" . $locale['411'] . "</strong> " . showdate("shortdate", $data['weblink_datestamp']) . "</span>\n";
             echo "<span class='display-inline'><strong>" . $locale['412'] . "</strong> " . $data['weblink_count'] . "</span>\n";
             echo "</aside>\n";
         }
     } else {
         echo "<div class='well text-center'>" . $locale['431'] . "</div>\n";
     }
     closetable();
 }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:24,代码来源:weblinks.php

示例7: count

    } else {
        $poll = "";
        $i = 0;
        $num_opts = count($poll_option);
        $poll_votes = dbcount("(vote_opt)", DB_POLL_VOTES, "poll_id='" . $data['poll_id'] . "'");
        while ($i < $num_opts) {
            $num_votes = dbcount("(vote_opt)", DB_POLL_VOTES, "vote_opt='{$i}' AND poll_id='" . $data['poll_id'] . "'");
            $opt_votes = $poll_votes ? number_format(100 / $poll_votes * $num_votes) : 0;
            $poll .= progress_bar($opt_votes, $poll_option[$i]);
            $poll .= "<div>" . $opt_votes . "% [" . (empty($num_votes) ? 0 : $num_votes) . ($num_votes == 1 ? $locale['global_133'] : $locale['global_134']) . "]</div><br />\n";
            $i++;
        }
        echo "<strong>" . $poll_title . "</strong><br /><br />\n" . $poll;
        echo "<div style='text-align:center'>" . $locale['global_135'] . $poll_votes . "<br />\n";
        if (!iMEMBER) {
            echo $locale['global_132'] . "<br />";
        }
        echo $locale['global_136'] . showdate("shortdate", $data['poll_started']);
        if ($data['poll_ended'] > 0) {
            echo "<br />\n" . $locale['global_137'] . showdate("shortdate", $data['poll_ended']) . "\n";
        }
        $result = dbcount("(poll_id)", DB_POLLS);
        if ($result > 1) {
            echo "<br /><br /><a href='" . INFUSIONS . "member_poll_panel/polls_archive.php' class='side'>" . $locale['global_138'] . "</a>\n";
        }
        echo "</div>\n";
    }
} else {
    echo "<div style='text-align:center'>" . $locale['global_142'] . "</div>\n";
}
closeside();
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:member_poll_panel.php

示例8: opentable

    $i = 0;
    opentable($locale['global_042']);
    echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'>\n<tr>\n";
    echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_048'] . "</strong></td>\n";
    echo "<td width='100%' class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n";
    echo "<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_049'] . "</strong></td>\n";
    echo "</tr>\n";
    while ($data = dbarray($result)) {
        if ($i % 2 == 0) {
            $row_color = "tbl1";
        } else {
            $row_color = "tbl2";
        }
        echo "<tr>\n";
        echo "<td width='1%' class='" . $row_color . "' style='white-space:nowrap'>" . trimlink($data['forum_name'], 30) . "</td>\n";
        echo "<td width='100%' class='" . $row_color . "'><a href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "&amp;pid=" . $data['post_id'] . "#post_" . $data['post_id'] . "' title='" . $data['thread_subject'] . "'>" . trimlink($data['thread_subject'], 40) . "</a></td>\n";
        echo "<td align='center' width='1%' class='" . $row_color . "' style='white-space:nowrap'>" . showdate("forumdate", $data['post_datestamp']) . "</td>\n";
        echo "</tr>\n";
        $i++;
    }
    echo "</table>\n";
    closetable();
    if ($rows > 20) {
        echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 20, $rows, 3) . "\n</div>\n";
    }
} else {
    opentable($locale['global_042']);
    echo "<div style='text-align:center'><br />\n" . $locale['global_054'] . "<br /><br />\n</div>\n";
    closetable();
}
require_once THEMES . "templates/footer.php";
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:my_posts.php

示例9: while

        echo "<table cellpadding='0' cellspacing='0' width='280' class='center'>\n<tr>\n";
        echo "<td width='80' class='tbl'>" . $locale['431'] . "</td>\n";
        echo "<td class='tbl'><input type='text' name='poll_title' value='" . $poll_title . "' class='textbox' style='width:200px' /></td>\n";
        echo "</tr>\n";
        while ($i != $opt_count) {
            $poll_opt = isset($poll_option[$i]) ? $poll_option[$i] : "";
            echo "<tr>\n<td width='80' class='tbl'>" . $locale['432'] . "{$opt}</td>\n";
            echo "<td class='tbl'><input type='text' name='poll_option[" . $i . "]' value='" . $poll_opt . "' class='textbox' style='width:200px' /></td>\n</tr>\n";
            $i++;
            $opt++;
        }
        echo "</table>\n";
        echo "<table cellpadding='0' cellspacing='0' width='280' class='center'>\n<tr>\n";
        echo "<td align='center' class='tbl'><br />\n";
        if (isset($_GET['poll_id']) && !$_GET['poll_ended']) {
            echo "<input type='checkbox' name='close' value='yes' />" . $locale['433'] . "<br /><br />\n";
        }
        if (!isset($_GET['poll_id']) || isset($_GET['poll_id']) && !$_GET['poll_ended']) {
            echo "<input type='hidden' name='opt_count' value='" . $opt_count . "' />\n";
            echo "<input type='submit' name='addoption' value='" . $locale['436'] . "' class='button' />\n";
            echo "<input type='submit' name='preview' value='" . $locale['437'] . "' class='button' />\n";
            echo "<input type='submit' name='save' value='" . $locale['438'] . "' class='button' />\n";
        } else {
            echo $locale['434'] . showdate("shortdate", $poll_started) . "<br />\n";
            echo $locale['435'] . showdate("shortdate", $_GET['poll_ended']) . "<br />\n";
        }
        echo "</td>\n</tr>\n</table>\n</form>\n";
        closetable();
    }
}
require_once THEMES . "templates/footer.php";
开发者ID:roniwahyu,项目名称:AKEUDA,代码行数:31,代码来源:polls.php

示例10: dbrows

 $items_count = dbrows($result);
 if (!$items_count) {
     continue;
 }
 $contents[$table]['colwidth'] = floor(12 / $items_count);
 $data = array();
 $count = 1;
 while ($row = dbarray($result)) {
     $keys = array_keys($row);
     foreach ($keys as $i => $key) {
         $keys[$i] = '{' . $key . '}';
     }
     $row['content'] = str_replace("../../images", IMAGES, $row['content']);
     $pairs = array_combine($keys, array_values($row));
     $cat = $row['cat_id'] ? "<a href='" . strtr($config['categoryLinkPattern'], $pairs) . "'>" . $row['cat_name'] . "</a>" : $locale['home_0102'];
     $data[$count] = array('cat' => $cat, 'url' => strtr($config['contentLinkPattern'], $pairs), 'title' => $row['title'], 'meta' => $locale['home_0105'] . profile_link($row['user_id'], $row['user_name'], $row['user_status']) . " " . showdate('newsdate', $row['datestamp']) . $locale['home_0106'] . $cat, 'content' => parse_textarea($row['content']), 'datestamp' => $row['datestamp'], 'cat_name' => $row['cat_name']);
     /* Infusion Settings Readings */
     switch ($table) {
         case DB_NEWS:
             if ($config['infSettings']['news_image_frontpage']) {
                 // if it's 0 use uploaded photo, 1 always use category image
                 // go for cat image always
                 if ($row['cat_image']) {
                     $data[$count]['image'] = INFUSIONS . "news/news_cats/" . $row['cat_image'];
                 }
             } else {
                 // go for image if available
                 if ($row['image'] || $row['cat_image']) {
                     if ($row['cat_image']) {
                         $data[$count]['image'] = INFUSIONS . "news/news_cats/" . $row['cat_image'];
                     }
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:31,代码来源:home.php

示例11: dbquery

    }
    if ($fieldsvar) {
        $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_message, tt.thread_subject,\r\n\t\t\ttf.forum_access FROM " . DB_POSTS . " tp\r\n\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tf.forum_id = tp.forum_id\r\n\t\t\tLEFT JOIN " . DB_THREADS . " tt ON tt.thread_id = tp.thread_id\t\t\t\r\n\t\t\tWHERE " . groupaccess('forum_access') . ($_GET['forum_id'] != 0 ? " AND tf.forum_id=" . $_GET['forum_id'] : "") . "\r\n\t\t\tAND " . $fieldsvar . ($_GET['datelimit'] != 0 ? " AND post_datestamp>=" . (time() - $_GET['datelimit']) : ""));
        $rows = dbrows($result);
    } else {
        $rows = 0;
    }
    if ($rows) {
        $items_count .= THEME_BULLET . "&nbsp;<a href='" . FUSION_SELF . "?stype=forums&amp;stext=" . $_GET['stext'] . "&amp;" . $composevars . "'>" . $rows . " " . ($rows == 1 ? $locale['f402'] : $locale['f403']) . " " . $locale['522'] . "</a><br  />\n";
        $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_message, tp.post_datestamp, tt.thread_subject,\r\n\t\t\ttt.thread_sticky, tf.forum_access, tu.user_id, tu.user_name, tu.user_status FROM " . DB_POSTS . " tp\r\n\t\t\tLEFT JOIN " . DB_THREADS . " tt ON tp.thread_id = tt.thread_id\r\n\t\t\tLEFT JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\r\n\t\t\tLEFT JOIN " . DB_USERS . " tu ON tp.post_author=tu.user_id\r\n\t\t\tWHERE " . groupaccess('forum_access') . ($_GET['forum_id'] != 0 ? " AND tf.forum_id=" . $_GET['forum_id'] : "") . "\r\n\t\t\tAND " . $fieldsvar . ($_GET['datelimit'] != 0 ? " AND post_datestamp>=" . (time() - $_GET['datelimit']) : "") . "\r\n\t\t\tORDER BY " . $sortby . " " . ($_GET['order'] == 1 ? "ASC" : "DESC") . ($_GET['stype'] != "all" ? " LIMIT " . $_GET['rowstart'] . ",10" : ""));
        while ($data = dbarray($result)) {
            $search_result = "";
            $text_all = search_striphtmlbbcodes(iADMIN ? $data['post_message'] : preg_replace("#\\[hide\\](.*)\\[/hide\\]#si", "", $data['post_message']));
            $text_frag = search_textfrag($text_all);
            $subj_c = search_stringscount($data['thread_subject']);
            $text_c = search_stringscount($data['post_message']);
            // $text_frag = highlight_words($swords, $text_frag);
            $search_result .= ($data['thread_sticky'] == 1 ? "<strong>" . $locale['f404'] . "</strong> " : "") . "<a href='" . FORUM . "viewthread.php?thread_id=" . $data['thread_id'] . "&amp;highlight=" . urlencode($_GET['stext']) . "&amp;pid=" . $data['post_id'] . "#post_" . $data['post_id'] . "'>" . $data['thread_subject'] . "</a>" . "<br  /><br  />\n";
            // $search_result .= ($data['thread_sticky'] == 1 ? "<strong>".$locale['f404']."</strong> " : "")."<a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."&amp;highlight=".urlencode($_GET['stext'])."&amp;pid=".$data['post_id']."#post_".$data['post_id']."'>".highlight_words($swords, $data['thread_subject'])."</a>"."<br  /><br  />\n";
            $search_result .= "<div class='quote' style='width:auto;height:auto;overflow:auto'>" . $text_frag . "</div><br  />";
            $search_result .= "<span class='small2'>" . $locale['global_070'] . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "\n";
            $search_result .= $locale['global_071'] . showdate("longdate", $data['post_datestamp']) . "</span><br  />\n";
            $search_result .= "<span class='small'>" . $subj_c . " " . ($subj_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['f406'] . " " . $locale['f407'] . ", ";
            $search_result .= $text_c . " " . ($text_c == 1 ? $locale['520'] : $locale['521']) . " " . $locale['f406'] . " " . $locale['f408'] . "</span><br  /><br  />\n";
            search_globalarray($search_result);
        }
    } else {
        $items_count .= THEME_BULLET . "&nbsp;0 " . $locale['f403'] . " " . $locale['522'] . "<br  />\n";
    }
    $navigation_result = search_navigation($rows);
}
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:search_forums_include.php

示例12: countdown

function countdown($time)
{
    $updated = stripinput($time);
    $second = 1;
    $minute = $second * 60;
    $hour = $minute * 60;
    // microseconds
    $day = 24 * $hour;
    $month = days_current_month() * $day;
    $year = date("L", $updated) > 0 ? 366 * $day : 365 * $day;
    $timer = array($year => "year", $month => "month", $day => "day", $hour => "hour", $minute => "minute", $second => "second");
    foreach ($timer as $arr => $unit) {
        $calc = $updated / $arr;
        // balance timestamp
        if ($calc >= 1) {
            $answer = round($calc);
            $s = $answer > 1 ? "s" : "";
            return "<abbr class='atooltip' data-toggle='tooltip' data-placement='top' title='~" . showdate('newsdate', $updated + time()) . "'>{$answer} " . $unit . $s . "</abbr>";
        }
    }
    if (!isset($answer)) {
        return "<abbr class='atooltip' data-toggle='tooltip' data-placement='top' title='" . showdate('newsdate', time()) . "'>now</abbr>";
    }
}
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:24,代码来源:theme_functions_include.php

示例13: profile_link

             echo "<div class='forum_attachments_content'>" . $print_files . "</div>";
             echo "</fieldset>\n";
         }
         if ($print_images != '') {
             if ($print_files != '') {
                 echo "<br />";
             }
             echo "\n<fieldset class='forum_attachments'>";
             echo "<legend class='forum_attachments_legend'>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . ($count_images > 1 ? $locale['506b'] : $locale['506']) . "</legend>";
             echo "<div class='forum_attachments_content'>" . $print_images . "</div>";
             echo "</fieldset>\n";
         }
     }
 }
 if ($data['post_edittime'] != "0") {
     echo "\n<fieldset class='forum_edit'>\n" . $locale['508'] . profile_link($data['post_edituser'], $data['edit_name'], $data['edit_status']) . $locale['509'] . showdate("forumdate", $data['post_edittime']) . "</fieldset>";
     // Pimped: added profile_link()
 }
 if ($data['post_showsig'] && isset($data['user_sig']) && $data['user_sig']) {
     echo "\n<fieldset class='forum_signatur'>\r\n\t\t\t<legend class='forum_signatur_legend'>" . $locale['507d'] . "</legend>" . nl2br(parseubb(parsesmileys($data['user_sig']), "b|i|u||center|small|url|mail|img|color")) . "\r\n\t\t\t</fieldset>";
 }
 echo "<!--sub_forum_post--></td>\n</tr>\n";
 // Pimped: Post Ratings ->
 if ($settings['forum_post_ratings']) {
     $show = post_ratings_show($data['post_id']);
     $do = '';
     if (iMEMBER && $userdata['user_id'] !== $data['user_id']) {
         $do .= "<span id='rb_" . $data['post_id'] . "'>";
         $do .= post_ratings_do($data['post_id'], $userdata['user_id'], $data['post_author'], false);
         $do .= "</span>&nbsp;";
     }
开发者ID:MichaelFichtner,项目名称:RadioLaFamilia,代码行数:31,代码来源:viewthread.php

示例14: dbquery

    }
    $result = dbquery("SELECT tp.forum_id, tp.thread_id, tp.post_id, tp.post_author, IF(tp.post_datestamp>tp.post_edittime, tp.post_datestamp, tp.post_edittime) AS post_timestamp,\r\n\t\ttf.forum_name, tf.forum_access, tt.thread_subject, tu.user_id, tu.user_name, tu.user_status\r\n\t\tFROM " . DB_FORUM_POSTS . " tp\r\n\t\tLEFT JOIN " . DB_FORUMS . " tf ON tp.forum_id = tf.forum_id\r\n\t\tLEFT JOIN " . DB_FORUM_THREADS . " tt ON tp.thread_id = tt.thread_id\r\n\t\tLEFT JOIN " . DB_USERS . " tu ON tp.post_author = tu.user_id\r\n\t\t" . (multilang_table("FO") ? "WHERE tf.forum_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('tf.forum_access') . " AND tp.post_hidden='0' AND tt.thread_hidden='0' AND (tp.post_datestamp > '" . $lastvisited . "' OR tp.post_edittime > '" . $lastvisited . "')\r\n\t\tGROUP BY tp.thread_id\r\n\t\tORDER BY post_timestamp DESC LIMIT " . $_GET['rowstart'] . ",20");
    $i = 0;
    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n<tr>\n";
    echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>" . $locale['global_048'] . "</strong></td>\n";
    echo "<td class='tbl2'><strong>" . $locale['global_044'] . "</strong></td>\n";
    echo "<td width='1%' class='tbl2' style='text-align:center;white-space:nowrap'><strong>" . $locale['global_050'] . "</strong></td>\n";
    echo "</tr>\n";
    $threads = dbrows($result);
    while ($data = dbarray($result)) {
        if ($i % 2 == 0) {
            $row_color = "tbl1";
        } else {
            $row_color = "tbl2";
        }
        echo "<tr>\n";
        echo "<td width='1%' class='" . $row_color . "' style='white-space:nowrap'>" . $data['forum_name'] . "</td>\n";
        echo "<td class='" . $row_color . "'><a href='" . INFUSIONS . "forum/viewthread.php?thread_id=" . $data['thread_id'] . "&amp;pid=" . $data['post_id'] . "#post_" . $data['post_id'] . "'>" . $data['thread_subject'] . "</a></td>\n";
        echo "<td width='1%' class='" . $row_color . "' style='text-align:center;white-space:nowrap'>" . profile_link($data['post_author'], $data['user_name'], $data['user_status']) . "<br />\n" . showdate("forumdate", $data['post_timestamp']) . "</td>\n";
        echo "</tr>\n";
        $i++;
    }
    echo "<tr>\n<td align='center' colspan='4' class='tbl1'>" . sprintf($locale['global_055'], $rows, $threads) . "</td>\n</tr>\n</table>\n";
} else {
    echo "<div style='text-align:center'><br />" . sprintf($locale['global_055'], 0, 0) . "<br /><br /></div>\n";
}
closetable();
if ($threads > 20) {
    echo "<div align='center' style='margin-top:5px;'>\n" . makepagenav($_GET['rowstart'], 20, $threads, 3) . "\n</div>\n";
}
require_once THEMES . "templates/footer.php";
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:new_posts.php

示例15: render_edit_form

 public function render_edit_form()
 {
     global $locale, $userdata, $forum_settings, $defender;
     $thread_data = $this->thread_info['thread'];
     if ((!iMOD or !iSUPERADMIN) && $thread_data['thread_locked']) {
         redirect(INFUSIONS . 'forum/index.php');
     }
     if (isset($_GET['post_id']) && isnum($_GET['post_id'])) {
         add_to_title($locale['global_201'] . $locale['forum_0503']);
         add_breadcrumb(array('link' => '', 'title' => $locale['forum_0503']));
         $result = dbquery("SELECT tp.*, tt.thread_subject, tt.thread_poll, tt.thread_author, tt.thread_locked, MIN(tp2.post_id) AS first_post\n\t\t\t\tFROM " . DB_FORUM_POSTS . " tp\n\t\t\t\tINNER JOIN " . DB_FORUM_THREADS . " tt on tp.thread_id=tt.thread_id\n\t\t\t\tINNER JOIN " . DB_FORUM_POSTS . " tp2 on tp.thread_id=tp2.thread_id\n\t\t\t\tWHERE tp.post_id='" . intval($_GET['post_id']) . "' AND tp.thread_id='" . intval($thread_data['thread_id']) . "' AND tp.forum_id='" . intval($thread_data['forum_id']) . "'\n\t\t\t\tGROUP BY tp2.post_id\n\t\t\t\t");
         if (dbrows($result) > 0) {
             $post_data = dbarray($result);
             if ((iMOD or iSUPERADMIN) || $this->getThreadPermission("can_reply") && $post_data['post_author'] == $userdata['user_id']) {
                 $is_first_post = $post_data['post_id'] == $this->thread_info['post_firstpost'] ? TRUE : FALSE;
                 // no edit if locked
                 if ($post_data['post_locked'] && !iMOD) {
                     redirect(INFUSIONS . "forum/postify.php?post=edit&error=5&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $post_data['post_id']);
                 }
                 // no edit if time limit reached
                 if (!iMOD && ($forum_settings['forum_edit_timelimit'] > 0 && time() - $forum_settings['forum_edit_timelimit'] * 60 > $post_data['post_datestamp'])) {
                     redirect(INFUSIONS . "forum/postify.php?post=edit&error=6&forum_id=" . $thread_data['forum_id'] . "&thread_id=" . $thread_data['thread_id'] . "&post_id=" . $post_data['post_id']);
                 }
                 // execute form post actions
                 if (isset($_POST['post_edit'])) {
                     require_once INCLUDES . "flood_include.php";
                     // all data is sanitized here.
                     if (!flood_control("post_datestamp", DB_FORUM_POSTS, "post_author='" . $userdata['user_id'] . "'")) {
                         // have notice
                         $post_data = array('forum_id' => $thread_data['forum_id'], 'thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], "thread_subject" => "", 'post_message' => form_sanitizer($_POST['post_message'], '', 'post_message'), 'post_showsig' => isset($_POST['post_showsig']) ? 1 : 0, 'post_smileys' => isset($_POST['post_smileys']) || isset($_POST['post_message']) && preg_match("#(\\[code\\](.*?)\\[/code\\]|\\[geshi=(.*?)\\](.*?)\\[/geshi\\]|\\[php\\](.*?)\\[/php\\])#si", $_POST['post_message']) ? 1 : 0, 'post_author' => $userdata['user_id'], 'post_datestamp' => $post_data['post_datestamp'], 'post_ip' => USER_IP, 'post_ip_type' => USER_IP_TYPE, 'post_edituser' => $userdata['user_id'], 'post_edittime' => time(), 'post_editreason' => form_sanitizer($_POST['post_editreason'], '', 'post_editreason'), 'post_hidden' => 0, 'notify_me' => 0, 'post_locked' => $forum_settings['forum_edit_lock'] || isset($_POST['post_locked']) ? 1 : 0);
                         // require thread_subject if first post
                         if ($is_first_post == TRUE) {
                             $post_data['thread_subject'] = form_sanitizer($_POST['thread_subject'], '', 'thread_subject');
                         }
                         if ($defender->safe()) {
                             // Prepare forum merging action
                             $last_post_author = dbarray(dbquery("SELECT post_author FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC LIMIT 1"));
                             if ($last_post_author == $post_data['post_author'] && $thread_data['forum_merge']) {
                                 $last_message = dbarray(dbquery("SELECT post_id, post_message FROM " . DB_FORUM_POSTS . " WHERE thread_id='" . $thread_data['thread_id'] . "' ORDER BY post_id DESC"));
                                 $post_data['post_id'] = $last_message['post_id'];
                                 $post_data['post_message'] = $last_message['post_message'] . "\n\n" . $locale['forum_0640'] . " " . showdate("longdate", time()) . ":\n" . $post_data['post_message'];
                                 dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE));
                             } else {
                                 dbquery_insert(DB_FORUM_POSTS, $post_data, 'update', array('primary_key' => 'post_id', 'keep_session' => TRUE));
                             }
                             // Delete attachments if there is any
                             foreach ($_POST as $key => $value) {
                                 if (!strstr($key, "delete_attach")) {
                                     continue;
                                 }
                                 $key = str_replace("delete_attach_", "", $key);
                                 $result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . $post_data['post_id'] . "' AND attach_id='" . (isnum($key) ? $key : 0) . "'");
                                 if (dbrows($result) != 0 && $value) {
                                     $adata = dbarray($result);
                                     unlink(FORUM . "attachments/" . $adata['attach_name']);
                                     dbquery("DELETE FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . $post_data['post_id'] . "' AND attach_id='" . (isnum($key) ? $key : 0) . "'");
                                 }
                             }
                             if (!empty($_FILES) && is_uploaded_file($_FILES['file_attachments']['tmp_name'][0]) && $this->getThreadPermission("can_upload_attach")) {
                                 $upload = form_sanitizer($_FILES['file_attachments'], '', 'file_attachments');
                                 if ($upload['error'] == 0) {
                                     foreach ($upload['target_file'] as $arr => $file_name) {
                                         $attachment = array('thread_id' => $thread_data['thread_id'], 'post_id' => $post_data['post_id'], 'attach_name' => $file_name, 'attach_mime' => $upload['type'][$arr], 'attach_size' => $upload['source_size'][$arr], 'attach_count' => '0');
                                         dbquery_insert(DB_FORUM_ATTACHMENTS, $attachment, 'save', array('keep_session' => TRUE));
                                     }
                                 }
                             }
                             if ($defender->safe()) {
                                 redirect(INFUSIONS . "forum/postify.php?post=edit&error=0&amp;forum_id=" . intval($post_data['forum_id']) . "&amp;thread_id=" . intval($post_data['thread_id']) . "&amp;post_id=" . intval($post_data['post_id']));
                             }
                         }
                     }
                 }
                 // template data
                 $form_action = INFUSIONS . "forum/viewthread.php?action=edit&amp;forum_id=" . $thread_data['forum_id'] . "&amp;thread_id=" . $thread_data['thread_id'] . "&amp;post_id=" . $_GET['post_id'];
                 // get attachment.
                 $attachments = array();
                 $attach_rows = 0;
                 if ($this->getThreadPermission("can_upload_attach") && !empty($this->thread_info['post_items'][$post_data['post_id']]['post_attachments'])) {
                     // need id
                     $a_result = dbquery("SELECT * FROM " . DB_FORUM_ATTACHMENTS . " WHERE post_id='" . intval($post_data['post_id']) . "' AND thread_id='" . intval($thread_data['thread_id']) . "'");
                     $attach_rows = dbrows($a_result);
                     if ($attach_rows > 0) {
                         while ($a_data = dbarray($a_result)) {
                             $attachments[] = $a_data;
                         }
                     }
                 }
                 $info = array('title' => $locale['forum_0507'], 'description' => $locale['forum_2000'] . $thread_data['thread_subject'], 'openform' => openform('input_form', 'post', $form_action, array('enctype' => $this->getThreadPermission("can_upload_attach") ? TRUE : FALSE)), 'closeform' => closeform(), 'forum_id_field' => form_hidden('forum_id', '', $post_data['forum_id']), 'thread_id_field' => form_hidden('thread_id', '', $post_data['thread_id']), "forum_field" => "", 'subject_field' => $this->thread_info['post_firstpost'] == $_GET['post_id'] ? form_text('thread_subject', $locale['forum_0600'], $thread_data['thread_subject'], array('required' => TRUE, 'placeholder' => $locale['forum_2001'], "class" => 'm-t-20 m-b-20')) : form_hidden("thread_subject", "", $thread_data['thread_subject']), 'message_field' => form_textarea('post_message', $locale['forum_0601'], $post_data['post_message'], array('required' => TRUE, 'autosize' => TRUE, 'no_resize' => TRUE, 'preview' => TRUE, 'form_name' => 'input_form', 'bbcode' => TRUE)), 'delete_field' => form_checkbox('delete', $locale['forum_0624'], '', array('class' => 'm-b-0')), 'edit_reason_field' => form_text('post_editreason', $locale['forum_0611'], $post_data['post_editreason'], array('placeholder' => '', 'class' => 'm-t-20 m-b-20')), 'attachment_field' => $this->getThreadPermission("can_upload_attach") ? form_fileinput('file_attachments[]', $locale['forum_0557'], "", array('input_id' => 'file_attachments', 'upload_path' => INFUSIONS . 'forum/attachments/', 'type' => 'object', 'preview_off' => TRUE, 'multiple' => TRUE, 'max_count' => $attach_rows > 0 ? $forum_settings['forum_attachmax_count'] - $attach_rows : $forum_settings['forum_attachmax_count'], 'valid_ext' => $forum_settings['forum_attachtypes'])) . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t <div class='m-b-20'>\n<small>" . sprintf($locale['forum_0559'], parsebytesize($forum_settings['forum_attachmax']), str_replace('|', ', ', $forum_settings['forum_attachtypes']), $forum_settings['forum_attachmax_count']) . "</small>\n</div>\n" : "", "poll_form" => "", 'smileys_field' => form_checkbox('post_smileys', $locale['forum_0622'], $post_data['post_smileys'], array('class' => 'm-b-0')), 'signature_field' => array_key_exists("user_sig", $userdata) && $userdata['user_sig'] ? form_checkbox('post_showsig', $locale['forum_0623'], $post_data['post_showsig'], array('class' => 'm-b-0')) : '', 'sticky_field' => (iMOD || iSUPERADMIN) && $is_first_post ? form_checkbox('thread_sticky', $locale['forum_0620'], $thread_data['thread_sticky'], array('class' => 'm-b-0')) : '', 'lock_field' => iMOD || iSUPERADMIN ? form_checkbox('thread_locked', $locale['forum_0621'], $thread_data['thread_locked'], array('class' => 'm-b-0')) : '', 'hide_edit_field' => form_checkbox('hide_edit', $locale['forum_0627'], '', array('class' => 'm-b-0')), 'post_locked_field' => iMOD || iSUPERADMIN ? form_checkbox('post_locked', $locale['forum_0628'], $post_data['post_locked'], array('class' => 'm-b-0')) : '', 'notify_field' => '', 'post_buttons' => form_button('post_edit', $locale['forum_0504'], $locale['forum_0504'], array('class' => 'btn-primary')) . form_button('cancel', $locale['cancel'], $locale['cancel'], array('class' => 'btn-default m-l-10')), 'last_posts_reply' => '');
                 $a_info = '';
                 if (!empty($attachments)) {
                     foreach ($attachments as $a_data) {
                         $a_info .= "<label><input type='checkbox' name='delete_attach_" . $a_data['attach_id'] . "' value='1' /> " . $locale['forum_0625'] . "</label>\n" . "<a href='" . INFUSIONS . "forum/attachments/" . $a_data['attach_name'] . "'>" . $a_data['attach_name'] . "</a> [" . parsebytesize($a_data['attach_size']) . "]\n" . "<br/>\n";
                     }
                     $info['attachment_field'] = $a_info . $info['attachment_field'];
                 }
                 postform($info);
             } else {
                 redirect(INFUSIONS . 'forum/index.php');
                 // no access
//.........这里部分代码省略.........
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:101,代码来源:Viewthread.php


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