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


PHP nicetime函数代码示例

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


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

示例1: gowalla_spotter

function gowalla_spotter()
{
    //set SpotID and execute if there is one
    $post_id = get_the_ID();
    $spot_id = get_post_meta($post_id, "Gowalla", true);
    if ($spot_id != "") {
        // get JSON from Gowalla with cURL
        // create a new cURL resource
        $ch = curl_init();
        // set URL and other appropriate options
        curl_setopt($ch, CURLOPT_URL, "http://api.gowalla.com/spots/{$spot_id}");
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json;charset=utf-8", "Accept: application/json"));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        // grab URL and store it
        $json = curl_exec($ch);
        // close cURL resource, and free up system resources
        curl_close($ch);
        //decode json array
        $json = json_decode($json);
        //print headline with appropriate links
        $output = "";
        $output .= "<b>Latest activity at <a href=\"http://gowalla.com/spots/" . $spot_id . "\">" . get_the_title() . "</a> from <a href=\"http://gowalla.com\">Gowalla</a> </b><br/>";
        // print the activity list: parse every item and write it on the page (or skip if there are no items)
        foreach ($json->last_checkins as $checkin) {
            $output .= sprintf('<img src="%s" alt="" width="25" height="25" /> <a href="%s">%s %s</a> %s (%s)<br />', $checkin->user->image_url, 'http://gowalla.com' . $checkin->user->url, $checkin->user->first_name, $checkin->user->last_name, $checkin->message, nicetime($checkin->created_at));
        }
        echo $output;
    }
}
开发者ID:perkovich,项目名称:Gowalla-Spotter,代码行数:30,代码来源:gowalla-spotter.php

示例2: mysql2AssocArray

function mysql2AssocArray($mysqlPostRow)
{
    global $db, $userPosition, $forumId, $usersForumId;
    $postId = $mysqlPostRow['id'];
    // Times
    $htmlDatetime = date('c', $mysqlPostRow['post_time']);
    $readableTime = date('D, d M Y H:i:s', $mysqlPostRow['post_time']);
    $niceTime = nicetime($mysqlPostRow['post_time']);
    // User and message
    $forumUser = html_entity_decode($mysqlPostRow['sender']);
    $forumUser = smilify($forumUser, $forumUser);
    $forumMessage = URL2link(smilify(nl2br(html_entity_decode($mysqlPostRow['message'])), $forumUser));
    // ip address, delete, edit button
    $headerActions = $userPosition == 'Webmaster' ? decode_ip($mysqlPostRow['ipaddress']) . ' 
        <a class="forum-post-delete" style="color:black;" title="Delete post" href="forum/delete/' . $postId . '">
            <i class="fa fa-trash-o"></i> <span class="sr-only">Delete</span>
        </a>' : '';
    if ($mysqlPostRow['users_forum_id'] == $usersForumId || $userPosition == 'Webmaster') {
        $headerActions .= '
            <a class="forum-post-edit" style="color:black;" title="Edit post" href="forum/edit/' . $postId . '">
                <i class="fa fa-pencil"></i> <span class="sr-only">Edit</span>
            </a>';
    }
    // Likes
    $likeCount = mysqli_query($db, "SELECT count(1) c FROM forum_plusone WHERE message = {$postId} LIMIT 1");
    $likeCount = mysqli_fetch_array($likeCount)['c'];
    if (mysqli_num_rows(mysqli_query($db, "SELECT 1 FROM forum_plusone WHERE message = {$postId} AND cookie = '{$usersForumId}' LIMIT 1"))) {
        $likedClass = 'liked';
        $likeTitle = 'Approved';
    } else {
        $likedClass = 'not-liked';
        $likeTitle = 'Approve Post';
    }
    return array('id' => $mysqlPostRow['id'], 'parentPostId' => $mysqlPostRow['parent_id'], 'htmlDatetime' => $htmlDatetime, 'readableTime' => $readableTime, 'niceTime' => $niceTime, 'forumUser' => $forumUser, 'forumMessage' => $forumMessage, 'headerActions' => $headerActions, 'likeCount' => $likeCount, 'likedClass' => $likedClass, 'likeTitle' => $likeTitle);
}
开发者ID:psdcon,项目名称:ucdtramp,代码行数:35,代码来源:functions_forum.php

示例3: widget

 /**
  * display widget
  */
 function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     global $wpdb, $user_ID, $table_prefix, $blog_id;
     $userid = $instance['snorl'];
     $result = wordbooker_get_cache($userid);
     echo $before_widget;
     $name = $result->name;
     if (strlen($instance['dname']) > 0) {
         $name = $instance['dname'];
     }
     $title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
     if (!empty($title)) {
         echo $before_title . $title . $after_title;
     }
     echo '<br /><div class="facebook_picture" align="center">';
     echo '<a href="' . $result->url . '" target="facebook">';
     echo '<img src="' . $result->pic . '" alt=" FB photo for ' . $name . '" /></a>';
     echo '</div>';
     if ($result->status) {
         $current_offset = 0;
         #	$current_offset = get_option('gmt_offset');
         echo '<p><br /><a href="' . $result->url . '">' . $name . '</a> : ';
         echo '<i>' . $result->status . '</i><br />';
         if ($instance['df'] == 'fbt') {
             echo '(' . nicetime($result->updated + 3600 * $current_offset) . ').';
         } else {
             echo '(' . date($instance['df'], $result->updated + 3600 * $current_offset) . ').';
         }
     }
     echo "</p>" . $after_widget;
 }
开发者ID:arturo-mayorga,项目名称:am_com,代码行数:35,代码来源:wordbooker_wb_widget.php

示例4: custom_comments

function custom_comments($comment = false, $args = false, $depth = false, $post = false)
{
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    ?>
	<li id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class();
    ?>
>
	    <?php 
    //#FIXME: aşağıdaki komutlar wordpress in fonksiyonlarını kullanmalı ya da en azından fonksiyon tanımlanmalı.
    /*
    		$queçok güzelry = "SELECT comment_arti_eksi FROM  $wpdb->comment_arti_eksi WHERE comment_ID=" . get_comment_ID() . ";";
    		$user_count = $wpdb->get_var($wpdb->prepare($query));
    		echo '<p>User count is ' . $user_count . '</p>';
    */
    $query = "SELECT comment_arti_eksi FROM wp_comment_arti_eksi WHERE comment_ID = " . get_comment_ID() . ";";
    $result = mysql_query($query);
    $row = mysql_fetch_assoc($result);
    //print '<div class="commentHolder" style="position:relative;';
    if ($row[comment_arti_eksi] == '+') {
        print '<div class="commentHolderArti" style="position:relative">';
        print '<img width="25" src="' . get_site_url() . '/wp-content/themes/artilarieksileri/images/arti.png">';
    } else {
        print '<div class="commentHolderEksi" style="position:relative">';
        print '<img width="25" src="' . get_site_url() . '/wp-content/themes/artilarieksileri/images/eksi.png">';
    }
    //print "<font style=\"font-size:20px\">$row[comment_arti_eksi]</font>";
    //$allmiles=$wpdb->get
    //echo '<p>Total miles is '.$allmiles . '</p>';
    ?>

	    <!--<div class="commentContent">-->
		<?php 
    comment_text();
    ?>
		
		<span style="position:absolute;right:0">
		    <?php 
    commenter_link();
    ?>
  
		    <?php 
    print nicetime(get_comment_date('Y-n-j') . ' ' . get_comment_time('H:i'));
    ?>
		</span>

		<?php 
    if ($comment->comment_approved == '0') {
        _e("<p class='unapproved'>Your comment is awaiting moderation.</p>\n", 'moov');
    }
    ?>
	    <!--</div>-->
		  <?php 
    php;
    ?>
		</div>

<?php 
}
开发者ID:google-code-backups,项目名称:pumpmyvote,代码行数:63,代码来源:functions.php

示例5: mysql_query

    $perintah = "SELECT * FROM artikel WHERE publikasi=1 ORDER BY tgl DESC LIMIT {$awal},{$jml}";
    $hasil = mysql_query($perintah);
    echo '<div id="terpopuler"><ul class="ui-tabs-nav">';
    while ($data = $koneksi_db->sql_fetchrow($hasil)) {
        $judul = AuraCMSSEO($data[1]);
        $gambar = $data['gambar'] == '' ? '<img src="mod/news/images/normal/news-default.jpg">' : '<img src="mod/news/images/normal/' . $data['gambar'] . '">';
        //$id = $data[0];
        echo '<li class="ui-tabs-nav-item">';
        echo '<a href="article-' . $judul . '.html" title="' . $data[1] . '"><span>' . $gambar . '' . limitwords($data[1], 8) . '...</span></a></li>';
    }
    echo "</ul>";
    echo '</div>';
} else {
    $perintah = "SELECT * FROM artikel WHERE publikasi=1 ORDER BY tgl DESC LIMIT {$awal},{$jml}";
    $hasil = mysql_query($perintah);
    echo '<div id="terpopuler"><ul class="ui-tabs-nav">';
    while ($data = $koneksi_db->sql_fetchrow($hasil)) {
        $judul = AuraCMSSEO($data[1]);
        $nicetime = nicetime($data['tgl']);
        $gambar = $data['gambar'] == '' ? '<img src="mod/news/images/normal/news-default.jpg">' : '<img src="mod/news/images/normal/' . $data['gambar'] . '">';
        //$id = $data[0];
        echo '<li class="ui-tabs-nav-item">';
        echo '<a href="article-' . $judul . '.html" title="' . $data[1] . '">' . $gambar . '' . limitwords($data[1], 8) . '...<br>
' . $nicetime . '
</a></li>';
    }
    echo "</ul>";
    echo '</div>';
}
$out = ob_get_contents();
ob_end_clean();
开发者ID:rekysda,项目名称:spinschool2,代码行数:31,代码来源:terakhir.php

示例6: process_lifestream_item


//.........这里部分代码省略.........
            if (preg_match("#^I\\S* \\w* a YouTube video#", $row['content'])) {
                $icon = IMAGE_ROOT . 'silk/film_add.png';
                $row['image'] = $icon;
                $match = preg_match("#I\\S* \\w* a YouTube video -- (.*?) (http.*)#", $row['originaltext'], $matches);
                $row['content'] = sprintf('<a href="%s">%s</a>', $matches[2], $matches[1]);
                $row['source'] = "YouTube";
            } elseif ($row['source'] == "LOVEFiLM.com Updates") {
                $match = preg_match("#(Played|Watched|Has been sent) (.*?): (http://LOVEFiLM.com/r/\\S*)#", $row['originaltext'], $matches);
                if ($match) {
                    $row['content'] = sprintf('%s <a href="%s">%s</a>', $matches[1], $matches[3], $matches[2]);
                }
                $icon = IMAGE_ROOT . 'other/favicon.png';
                $row['source'] = "LOVEFiLM";
            } elseif (strtolower($row['source']) == "foursquare" or strtolower($row['source']) == "foursquare-mayor") {
                if ($row['source'] == "Foursquare-Mayor") {
                    $icon = IMAGE_ROOT . 'foursquare%20icons/mayorCrown.png';
                } else {
                    $icon = IMAGE_ROOT . 'foursquare%20icons/foursquare%20256x256.png';
                }
                $row['content'] = preg_replace("/#\\w*/", "", $row['originaltext']);
                #preg_match("#(http://\S*)#", $row['content'], $matches);
                #echo $row['originaltext']."<br/>";
                $imat = preg_match("#I'm at (.*?) \\((.*?)\\)\\. (http://\\S*)#", $row['originaltext'], $matches);
                if ($imat) {
                    $row['content'] = sprintf('I\'m at <a href="%s">%s</a> (%s)', $matches[3], $matches[1], $matches[2]);
                } else {
                    $row['content'] = twitterFormat($row['content']);
                }
                if (isset($matches[1])) {
                    $row['url'] = $matches[1];
                }
                #$row['content'] = preg_replace("#http://\S*#", "", $row['content']);
                #$row['content'] = twitterFormat($row['content']);
                #$row['url'] = "http://www.champions-online.com/character_profiles/user_characters/Jascain";
            } elseif ($row['source'] == "Kindle") {
                $icon = IMAGE_ROOT . 'silk/book_open.png';
            } elseif ($row['source'] == "Miso") {
                $icon = IMAGE_ROOT . 'silk/television.png';
                preg_match("#(http://\\S*)#", $row['originaltext'], $matches);
                $row['url'] = $matches[1];
                $row['content'] = preg_replace("# http://\\S*#", "", $row['originaltext']);
            } elseif ($row['source'] == "Untappd") {
                $icon = IMAGE_ROOT . 'other/beer.png';
                $row['small_icon'] = IMAGE_ROOT . 'silk/drink.png';
                preg_match("#(http://\\S*)#", $row['originaltext'], $matches);
                $row['url'] = $matches[1];
                $row['content'] = preg_replace("# http://\\S*#", "", $row['originaltext']);
            }
            break;
        case "twitter":
            $icon = IMAGE_ROOT . 'twitter/Twitter-64.png';
            $row['small_icon'] = IMAGE_ROOT . 'twitter/rounded-plain-16x16/twitter-02.png';
            switch ($row['source']) {
                case "Steepster":
                    $icon = IMAGE_ROOT . 'silk/cup.png';
                    $row['content'] = preg_replace("/#\\w*/", "", $row['originaltext']);
                    preg_match("#(http://\\S*)#", $row['content'], $matches);
                    $row['url'] = $matches[1];
                    $row['content'] = preg_replace("#: http://\\S*#", "", $row['content']);
                    break;
                case "Goodreads":
                    $icon = IMAGE_ROOT . 'silk/book_open.png';
                    preg_match("#(http://\\S*)#", $row['originaltext'], $matches);
                    $row['url'] = $matches[1];
                    $row['content'] = preg_replace("# http://\\S*#", "", $row['originaltext']);
                    break;
                default:
                    $row['source'] = "Twitter";
            }
            break;
        case "flickr":
            $icon = IMAGE_ROOT . 'silk/picture.png';
            $row['content'] = sprintf('<a href="%s">%s</a>', $row['url'], $row['content']);
            break;
        case "code":
            $icon = IMAGE_ROOT . 'silk/application_osx_terminal.png';
            $row['content'] = $row['content'];
            break;
        case "oyster":
            $icon = IMAGE_ROOT . 'tfl.png';
            break;
        case "tumblr":
            $icon = IMAGE_ROOT . 'tumblr/tumblr_16.png';
            $row['small_image'] = IMAGE_ROOT . 'tumblr/tumblr_16.png';
            break;
        default:
            $icon = IMAGE_ROOT . 'silk/asterisk_orange.png';
    }
    if ($row['image']) {
        $icon = $row['image'];
        if (!isset($row['small_icon'])) {
            $row['small_icon'] = $icon;
        }
    }
    $row['icon'] = $icon;
    $row['nicetime'] = nicetime($row['epoch']);
    #$row['content'] = $row['type'].$row['content'];
    $row['id'] = md5($row['systemid']);
    return $row;
}
开发者ID:aquarion,项目名称:Lifestream,代码行数:101,代码来源:library.php

示例7: db_query

   case 2:
       // PC von User aus dem oberen Teil der Rangliste blockieren
       $victim = db_query('SELECT * FROM users WHERE rank<=50 ORDER BY RAND() LIMIT 1;');
       if (!$victim) {
           continue;
       }
       $victim = mysql_fetch_assoc($victim);
       if ((int) $victim['id'] == 0) {
           continue;
       }
       #echo '<br>id='.$victim['id'];
       $vpc = @mysql_fetch_assoc(db_query('SELECT id,ip,name FROM pcs WHERE owner=' . $victim['id'] . ' ORDER BY RAND() LIMIT 1;'));
       $blocked = time() + 6 * 60 * 60;
       db_query('UPDATE pcs SET blocked=\'' . mysql_escape_string($blocked) . '\' WHERE id=' . $vpc['id'] . ';');
       addsysmsg($victim['id'], 'Dein PC 10.47.' . $vpc['ip'] . ' (' . $vpc['name'] . ') wurde durch einen b&ouml;sartigen Wurm, der im Moment im Netz kursiert,
 bis ' . nicetime($blocked) . ' blockiert!');
       db_query('INSERT INTO logs SET type=\'worm_blockpc\', usr_id=\'' . mysql_escape_string($victim['id']) . '\', payload=\'blocked pc ' . $vpc['id'] . '\';');
       break;
   case 3:
       // PC von aktivem User aus dem Mittelfeld der Rangliste Credits schenken
       $ts = time() - 24 * 60 * 60;
       $victim = db_query('SELECT * FROM users WHERE (rank>50 AND login_time>' . mysql_escape_string($ts) . ') ORDER BY RAND() LIMIT 1;');
       echo mysql_error();
       if (!$victim) {
           continue;
       }
       $victim = mysql_fetch_assoc($victim);
       if ((int) $victim['id'] == 0) {
           continue;
       }
       #echo '<br>id='.$victim['id'];
开发者ID:dergriewatz,项目名称:htn-original,代码行数:31,代码来源:worm.php

示例8: act_prepare

function act_prepare($act_raw, $act_disp)
{
    global $options_act, $wpdb;
    $wp_url = get_bloginfo('wpurl');
    switch ($act_disp) {
        case 'admin':
        case 'csv':
            $act_date = nicetime($act_raw->act_date, true);
            $act_user = $act_raw->display_name;
            break;
        case 'rss':
            $act_date = gmdate('r', strtotime($act_raw->act_date));
            $act_user = '<a href="' . $wp_url . '/' . $options_act['act_author_path'] . '/' . $act_raw->user_nicename . '" title="' . __('View Profile', 'wp-activity') . '">' . $act_raw->display_name . '</a>';
            break;
        case 'frontend':
        default:
            $act_date = nicetime($act_raw->act_date);
            $act_user = '<a href="' . $wp_url . '/' . $options_act['act_author_path'] . '/' . $act_raw->user_nicename . '" title="' . __('View Profile', 'wp-activity') . '">' . $act_raw->display_name . '</a>';
            break;
    }
    switch ($act_raw->act_type) {
        case 'CONNECT':
            ($act_disp == 'admin' or $act_disp == 'csv') ? $act_params = $act_raw->act_params : ($act_params = '');
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('has logged in.', 'wp-activity'), 'params' => $act_params);
            break;
        case 'LOGIN_FAIL':
            $act_post_tab = explode("###", $act_raw->act_params);
            $act_done = array('class' => 'activity_warning', 'user' => $act_post_tab[0], 'text' => '', 'params' => $act_post_tab[1]);
            break;
        case 'ACCESS_DENIED':
            $act_post_tab = explode("###", $act_raw->act_params);
            $act_done = array('class' => 'activity_warning', 'user' => '', 'text' => '', 'params' => $act_post_tab[0]);
            break;
        case 'POST_ADD':
            if (is_numeric($act_raw->act_params)) {
                $act_post = get_post($act_raw->act_params);
                if ($act_raw->id != $act_post->post_author and !$strict_logs) {
                    //this is a check if post author has been changed in admin post edition.
                    $sql = "UPDATE " . $wpdb->prefix . "activity SET user_id = '" . $act_post->post_author . "' WHERE id = '" . $act_raw->id . "'";
                    $wpdb->query($sql);
                }
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
                }
            } else {
                $act_params = $act_raw->act_params;
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('published', 'wp-activity'), 'params' => $act_params);
            break;
        case 'POST_EDIT':
            if (is_numeric($act_raw->act_params)) {
                $act_post = get_post($act_raw->act_params);
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
                }
            } else {
                $act_params = $act_raw->act_params;
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('edited', 'wp-activity'), 'params' => $act_params);
            break;
        case 'POST_DEL':
            $act_post_tab = explode("###", $act_raw->act_params);
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('deleted', 'wp-activity'), 'params' => $act_post_tab[0]);
            break;
        case 'COMMENT_ADD':
            if (is_numeric($act_raw->act_params)) {
                $act_comment = get_comment($act_raw->act_params);
                $act_post = get_post($act_comment->comment_post_ID);
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '#comment-' . $act_comment->comment_ID . '">' . $act_post->post_title . '</a>';
                }
            } else {
                $act_comment_tab = explode("###", $act_raw->act_params);
                if (isset($act_comment_tab[1])) {
                    $act_post = get_post($act_comment_tab[0]);
                    if ($act_disp == 'csv') {
                        $act_params = $act_post->post_title;
                    } else {
                        $act_params = '<a href="' . get_permalink($act_post->ID) . '">' . $act_post->post_title . '</a>';
                    }
                } else {
                    $act_params = $act_raw->act_params;
                }
            }
            $act_done = array('class' => '', 'user' => $act_user, 'text' => __('commented', 'wp-activity'), 'params' => $act_params);
            break;
        case 'COMMENT_EDIT':
            if (is_numeric($act_raw->act_params)) {
                $act_comment = get_comment($act_raw->act_params);
                $act_post = get_post($act_comment->comment_post_ID);
                if ($act_disp == 'csv') {
                    $act_params = $act_post->post_title;
                } else {
                    $act_params = '<a href="' . get_permalink($act_post->ID) . '#comment-' . $act_comment->comment_ID . '">' . $act_post->post_title . '</a>';
//.........这里部分代码省略.........
开发者ID:ar-mohammadi,项目名称:cwr_cwrdiversity.org,代码行数:101,代码来源:wp-activity.php

示例9: page_lastupdate

function page_lastupdate()
{
    global $page_array;
    return $page_array["lastupdate"] ? nicetime(time() - $page_array["lastupdate"]) . " ago" : "";
}
开发者ID:JakeCoxon,项目名称:Pages,代码行数:5,代码来源:view.php

示例10: mysqli_query

    case 'post':
        echo "<div class=\"row\">";
        if (isset($_GET['id'])) {
            $specific_posts = mysqli_query($db, "SELECT * FROM forum_posts WHERE id='" . $_GET['id'] . "' AND forum='" . $forum . "' ORDER BY `post_time` DESC");
            echo "<h3 class=\"col-xs-12\">Showing " . $_GET['title'] . " post</h3>";
        } elseif (isset($_GET['person'])) {
            $specific_posts = mysqli_query($db, "SELECT * FROM forum_posts WHERE sender='" . $_GET['person'] . "' AND forum='" . $forum . "' ORDER BY `post_time` DESC");
            echo "<h3 class=\"col-xs-12\">Showing posts submitted by " . $_GET['person'] . "</h3>";
        } elseif (isset($_GET['day'])) {
            $specific_posts = mysqli_query($db, "SELECT * FROM forum_posts WHERE post_time>='" . $_GET['day'] . "' AND post_time <'" . ($_GET['day'] + 86400) . "' AND forum='" . $forum . "' ORDER BY `post_time` DESC");
            echo "<h3 class=\"col-xs-12\">Showing all posts from " . date('j M Y', $_GET['day']) . "</h3>";
        }
        while ($specific_post = mysqli_fetch_array($specific_posts, MYSQL_ASSOC)) {
            $htmlDatetime = date('c', $specific_post['post_time']);
            $readableTime = date('D, d M Y H:i:s', $specific_post['post_time']);
            $niceTime = nicetime($specific_post['post_time']);
            $forumUserEmoji = html_entity_decode($specific_post['sender']);
            $forumUser = smilify($forumUserEmoji, $forumUserEmoji);
            $forumMessage = URL2link(smilify(nl2br(html_entity_decode($specific_post['message'])), $forumUserEmoji));
            ?>
            <div class="col-xs-12 forum-post">
                <div class="post-header"> <!--top bar with name, time and other details. bottom border-->
                    <strong class="post-header-name"><?php 
            echo $forumUser;
            ?>
</strong>
                    <small class="post-header-time">
                        <time datetime="<?php 
            echo $htmlDatetime;
            ?>
" title="<?php 
开发者ID:psdcon,项目名称:ucdtramp,代码行数:31,代码来源:forum_stats.php

示例11: session_start

<?php

session_start();
require_once "../include.php";
if (!isIn()) {
    die;
}
global $mysqlusername, $mysqlpassword, $mysqldatabase, $mysqllocation;
$db = new mysqli($mysqllocation, $mysqlusername, $mysqlpassword, $mysqldatabase);
date_default_timezone_set('Asia/Singapore');
echo "<table style=\"width:100%\"><tr class=\"red\"><th colspan=\"2\" class=\"red\">BBT News Headlines</th></tr>";
$query = "SELECT newstext, time FROM news WHERE time <= " . time() . " ORDER BY time DESC LIMIT 30";
$result = $db->query($query) or die($db->error);
if ($result->num_rows <= 0) {
    echo "<tr><td colspan=\"2\" class=\"table-bordered\">There are no news reports at the moment.</td></tr>";
}
while ($row = $result->fetch_assoc()) {
    echo "<tr>";
    echo "<td class=\"table-bordered\">" . $row["newstext"] . "</td>";
    echo "<td class=\"table-bordered\" style=\"width:25%\">" . nicetime($row["time"]) . "</td>";
    echo "</tr>";
}
echo "</table>";
开发者ID:yicheng340,项目名称:Econs-Forex-Game,代码行数:23,代码来源:newshandler.php

示例12: time

        ?>
</td>
		<td class="forum-caption" width="1%" style="white-space:nowrap"><?php 
        echo $locale['addondb403'];
        ?>
</td>
		<td class="forum-caption" width="1%" style="white-space:nowrap"><?php 
        echo $locale['addondb404'];
        ?>
</td>
	</tr>
<?php 
    }
    $ver = "v" . $data['version_h'] . "." . $data['version_l'] . ($data['version_s'] != "" ? " " . $data['version_s'] : "");
    $addon_author = $data['addon_author_name'] == "" ? $locale['addondb409'] : $data['addon_author_name'];
    $data['addon_date'] + 604800 > time() + $settings['timeoffset'] * 3600 ? $time = nicetime(showdate("%Y-%m-%d %H:%M:%S", $data['addon_date'])) : ($time = showdate("%d. %B", $data['addon_date']));
    if ($data['addon_date'] + $settings_global['set_new_time'] > time() + $settings['timeoffset'] * 3600) {
        $new = "<img src='" . ADDON_IMG . "new.png' border='0' alt='' />";
    } else {
        $new = "";
    }
    ?>
    <tr>
		<td class="tbl1" style="white-space:nowrap"><a href="view.php?addon_id=<?php 
    echo $data['addon_id'];
    ?>
"><?php 
    echo $new . trimlink($data['addon_name'], 30);
    ?>
</a></td>
		<td class="tbl2" width="1%" style="white-space:nowrap"><?php 
开发者ID:xXxthebeastxXx,项目名称:addondb,代码行数:31,代码来源:index.php

示例13: geoip_record_by_addr

</strong> users registered,<br>
		<strong><?php 
    echo $getwows_number_all;
    ?>
</strong> wows given,<br>
		<strong><?php 
    echo $getwows_number_today;
    ?>
</strong> given today.

		<p>Last wow was given to <?php 
    $hex = $lastwowuser['usrname_color'];
    echo "<span style='color:#{$hex}' class=\"table-color " . $lastwowuser["bg_color"] . " font-" . $lastwowuser["sig_font"] . "\"";
    $rsGeoData_lastusr = geoip_record_by_addr($gi, $lastwowuser['ip']);
    geoip_close($gi);
    echo "><img src='/images/flags/" . strtolower($rsGeoData_lastusr->country_code) . ".gif' title='" . htmlentities($rsGeoData_lastusr->country_name) . "' alt='" . htmlentities($rsGeoData_lastusr->country_name) . "'/> " . $lastwowuser['username'] . "</span><br><strong title='" . $getwows_last['wow_date'] . "'>" . nicetime($getwows_last['wow_date']) . "</strong>";
    if (!isset($wow_from)) {
        echo " from <strong>" . $city . $state . $country . " <img src='/images/flags/" . strtolower($rsGeoData->country_code) . ".gif' title='" . htmlentities($rsGeoData->country_name) . "' alt='" . htmlentities($rsGeoData->country_name) . "'/></strong>";
    } else {
        echo $wow_from;
    }
    ?>
.</p>

		<h3>Leaderboard</h3>
		<table style="min-width:220px;margin:0 auto;text-align:left">
		<?php 
    while ($leaderboard = mysqli_fetch_assoc($leaderboard_sql)) {
        $gi = geoip_open($_SERVER['DOCUMENT_ROOT'] . "/geoip/GeoLiteCity.dat", GEOIP_STANDARD);
        $rsGeoData = geoip_record_by_addr($gi, $leaderboard['ip']);
        $hex = $leaderboard['usrname_color'];
开发者ID:Galaxy421,项目名称:WOWMeter,代码行数:31,代码来源:main.php

示例14: load_tagging

/**
 * This is registered at cb_head ANCHOR. This loads the photo tagging
 * plugin in clipbucket. You can use tagger_configurations filter to change
 * tagger configurations. Following is the list of configurations :
 * 
 *      |=  Show Tag labels =| BOOL
 *      showLabels => true
 * 
 *      |=  Provide an element ID and labels will loaded in them =| STRING
 *      labelWrapper => null
 * 
 *      |= Open labels links in new window =| BOOL
 *      labelLinksNew => false
 * 
 *      |= Make string like facebook: Tag1, Tag2 and Tag3 =| BOOL
 *      makeString => true
 * 
 *      |= We JS to create string. Set true, to create using CSS. Be warn CSS might not work in >IE9 =| BOOL
 *      makeStringCSS => false
 * 
 *      |= This wraps Remove Tag link in round brackets ( ) =| BOOL
 *      wrapDeleteLinks => true
 * 
 *      |= Show a little indicator arrow. Note: Arrow is created purely from CSS. Might not work in >IE9 =| BOOL
 *      use_arrows => true 
 *      
 *      |= To display Tag Photo elsewhere, provide an element ID  =| STRING
 *      buttonWrapper => null
 * 
 *      |= This will add a tag icon previous to Tag Photo text =| BOOL
 *      addIcon => true
 * 
 * @global object $db
 * @global object $cbphoto
 * @global array $photo
 * @global object $userquery
 * @return none 
 */
function load_tagging()
{
    global $db, $cbphoto, $photo, $userquery;
    if (USE_PHOTO_TAGGING != true) {
        return false;
    }
    if (empty($photo) || !$photo || !isset($photo['ci_id'])) {
        return false;
    }
    $options = $cbphoto->get_default_tagger_configs();
    $phrases = $options['phrases'];
    /* User does not need phrases in apply_filters() function */
    unset($options['phrases']);
    $options = apply_filters($options, 'tagger_configurations');
    /* Put back phrases in $options, over-wrtting JS Plugin Phrases */
    $options['phrases'] = $phrases;
    $options['allowTagging'] = $photo['allow_tagging'];
    $tags = $cbphoto->get_photo_tags($photo['photo_id']);
    $autoComplete = $options['autoComplete'];
    $uid = userid();
    if ($uid) {
        $friends = $userquery->get_contacts($uid, 0, 'yes');
    }
    if ($friends) {
        foreach ($friends as $contact) {
            $fa[$contact['contact_userid']] = $contact['username'];
            $typeahead[] = $contact['username'];
        }
    }
    if ($tags) {
        /* Tags exists */
        foreach ($tags as $tag) {
            $needs_update = false;
            /* Check if tag is active or not and if current user is not tagger or owner of photo or is guest, do not show tag */
            if (!$uid && $tag['ptag_active'] == 'no' || $tag['ptag_active'] == 'no' && $uid && $tag['ptag_by_userid'] != $uid && $tag['photo_owner_userid'] != $uid) {
                continue;
            }
            $ta = array();
            $ta['id'] = $tag['ptag_id'];
            $ta['key'] = $tag['ptag_key'];
            $ta['width'] = $tag['ptag_width'];
            $ta['height'] = $tag['ptag_height'];
            $ta['left'] = $tag['ptag_left'];
            $ta['top'] = $tag['ptag_top'];
            $ta['label'] = $tag['username'] = $tag['ptag_username'];
            $ta['added_by'] = $tag['ptag_by_username'];
            $ta['date_added'] = nicetime($tag['date_added'], true);
            if ($tag['ptag_active'] == 'no') {
                $ta['pending'] = true;
            }
            /* Photo owner and User which has tagged */
            if ($uid == $tag['photo_owner_userid'] || $uid == $tag['ptag_by_userid']) {
                $ta['canDelete'] = true;
            }
            /* 
            	If make sure tag is a user
            	See which person is online, tagger or tagged
            	If Tagger is online, give him option to delete
            
            	if Tagged is online, check if it's tagger's friend
            	if true, give option to delete
            */
//.........这里部分代码省略.........
开发者ID:yukisky,项目名称:clipbucket,代码行数:101,代码来源:functions_photos.php

示例15: str_replace

            case 'plgaup_getcouponcode_vm':
            case 'plgaup_alphagetcouponcode_vm':
            case 'sysplgaup_buypointswithpaypal':
                echo '';
                break;
            default:
                echo str_replace("\\", "", $item->datareference);
        }
        ?>
				</div>
				<div class="small" style="margin-left:<?php 
        echo $margin;
        ?>
px;margin-top:2px;">
				<?php 
        echo nicetime($item->insert_date);
        ?>
	
				</div>
			<div style="margin-left:<?php 
        echo $margin;
        ?>
px;margin-top:3px;">
				<span class="small">
				<?php 
        if ($user->id || !$user->id && $com_params->get('allowGuestUserViewProfil', 1)) {
            echo '<a href="' . $profil . '">' . $usrname . '</a>';
        } else {
            echo $usrname;
        }
        ?>
开发者ID:q0821,项目名称:esportshop,代码行数:31,代码来源:default.php


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