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

PHP get_date_time函数代码示例

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

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



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

示例1: punish_comments

function punish_comments($hours = 6)
{
    global $globals, $db;
    $log = new Annotation('punish-comment');
    if ($log->read() && $log->time > time() - 3600 * $hours) {
        echo "Comments already verified at: " . get_date_time($log->time) . "\n";
        return false;
    }
    if ($globals['min_karma_for_comments'] > 0) {
        $min_karma = $globals['min_karma_for_comments'];
    } else {
        $min_karma = 4.5;
    }
    $votes_from = time() - $hours * 3600;
    // 'date_sub(now(), interval 6 hour)';
    $comments_from = time() - 2 * $hours * 3600;
    //'date_sub(now(), interval 12 hour)';
    echo "Starting karma_comments...\n";
    $users = "SELECT SQL_NO_CACHE distinct comment_user_id as user_id from comments, users where comment_date > from_unixtime({$comments_from}) and comment_karma < -50 and comment_user_id = user_id and user_level != 'disabled' and user_karma >= {$min_karma}";
    $result = $db->get_results($users);
    $log->store();
    if (!$result) {
        return;
    }
    foreach ($result as $dbuser) {
        $user = new User();
        $user->id = $dbuser->user_id;
        $user->read();
        printf("%07d  %s\n", $user->id, $user->username);
        $punish = 0;
        $comment_votes_count = (int) $db->get_var("SELECT SQL_NO_CACHE count(*) from votes, comments where comment_user_id = {$user->id} and comment_date > from_unixtime({$comments_from}) and vote_type='comments' and vote_link_id = comment_id and  vote_date > from_unixtime({$votes_from}) and vote_user_id != {$user->id}");
        if ($comment_votes_count > 5) {
            $votes_karma = (int) $db->get_var("SELECT SQL_NO_CACHE sum(vote_value) from votes, comments where comment_user_id = {$user->id} and comment_date > from_unixtime({$comments_from}) and vote_type='comments' and vote_link_id = comment_id and vote_date > from_unixtime({$votes_from}) and vote_user_id != {$user->id}");
            if ($votes_karma < 50) {
                $distinct_votes_count = (int) $db->get_var("SELECT SQL_NO_CACHE count(distinct comment_id) from votes, comments where comment_user_id = {$user->id} and comment_date > from_unixtime({$comments_from}) and vote_type='comments' and vote_link_id = comment_id and  vote_date > from_unixtime({$votes_from}) and vote_user_id != {$user->id}");
                $comments_count = (int) $db->get_var("SELECT SQL_NO_CACHE count(*) from comments where comment_user_id = {$user->id} and comment_date > from_unixtime({$comments_from})");
                $comment_coeff = min($comments_count / 10, 1) * min($distinct_votes_count / ($comments_count * 0.75), 1);
                $punish = max(-2, round($votes_karma * $comment_coeff * 1 / 1000, 2));
            }
        }
        if ($punish < -0.1) {
            echo "comments: {$comments_count} votes distinct: {$distinct_votes_count} karma: {$votes_karma} coef: {$comment_coeff} -> {$punish}\n";
            $user->karma += $punish;
            //$user->store();
            $annotation = new Annotation("karma-{$user->id}");
            //$annotation->append(_('Penalización por comentarios').": $punish, nuevo karma: $user->karma\n");
            echo _('Penalización por comentarios') . ": {$punish}, nuevo karma: {$user->karma}\n";
            $log->append(_('Penalización') . " {$user->username}: {$punish}, nuevo karma: {$user->karma}\n");
        }
        $db->barrier();
    }
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:52,代码来源:discard3.php


示例2: do_load

function do_load() {
	global $db, $current_user;
	$annotation = new Annotation('ec2-autoscaler');
	if (!$annotation->read()) {
		return _('no hay estadísticas disponibles');
	}
	$group = unserialize($annotation->text);
	$str = "web instances: $group->instances, ";
	$str .= "cpu average load: ".round($group->load, 2) . "%, ";
	$str .= "cpu max average ($group->measures periods): ".round($group->load_max, 2)."%, ";
	$str .= "stored at: ". get_date_time($annotation->time);
	return $str;
}
开发者ID:rasomu,项目名称:chuza,代码行数:13,代码来源:sneaker-stats.php


示例3: insert_coder

function insert_coder()
{
    if ($_POST['coderpass'] != $_POST['coderpass2']) {
        die('error:  The coder passwords do not match!');
    }
    $username = $_POST['coderuser'];
    $usermail = $_POST['codermail'];
    $secret = mksecret();
    $wantpasshash = md5($secret . $_POST['coderpass'] . $secret);
    $editsecret = mksecret();
    $ret = mysql_query("INSERT INTO users (username, class, passhash, secret, editsecret, email, status, added) VALUES (" . implode(",", array_map("sqlesc", array($username, 8, $wantpasshash, $secret, $editsecret, $usermail, 'confirmed'))) . ",'" . get_date_time() . "')");
    $rndpasshash = createRandomPassword();
    $rndsecret = createRandomPassword();
    $rndeditsecret = createRandomPassword();
    $rex = mysql_query("INSERT INTO users (id, username, class, passhash, secret, editsecret, email, status, added) VALUES (" . implode(",", array_map("sqlesc", array(2, 'System', 1, $rndpasshash, $rndsecret, $rndeditsecret, '[email protected]', 'confirmed'))) . ",'" . get_date_time() . "')");
}
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:16,代码来源:functions.php


示例4: addmp3info

function addmp3info($type, $rlsname, $genre, $year, $hertz, $tp, $bitrate, $bittype, $fromnet, $ann = true)
{
    $w = mysql_query("SELECT COUNT(id) AS tid FROM mp3info WHERE rlsname = " . sqlesc($rlsname) . "") or die("Err1 " . mysql_error());
    $qw = mysql_fetch_assoc($w);
    if ($qw['tid'] == 0) {
        $fromdata = explode(":", trim($fromnet));
        $fromdata[1] = "#" . $fromdata[1];
        mysql_query("INSERT INTO mp3info ( `rlsname` , `genre` , `year` , `hertz` , `type` , `bitrate` , `bittype` , `unixtime` , `addedon` , `fromnet` ) VALUES (" . sqlesc($rlsname) . "," . sqlesc($genre) . "," . sqlesc($year) . "," . sqlesc($hertz) . "," . sqlesc($tp) . "," . sqlesc($bitrate) . "," . sqlesc($bittype) . "," . time() . "," . sqlesc(get_date_time()) . "," . sqlesc($fromnet) . ")") or die('Err2 ' . mysql_error());
        $id = mysql_insert_id();
        mysql_query("INSERT INTO frominfodata ( `infoid` , `type` , `time` , `nick` , `chan` , `network` ) VALUES (" . $id . "," . sqlesc($type) . "," . time() . "," . sqlesc($fromdata[0]) . "," . sqlesc($fromdata[1]) . "," . sqlesc($fromdata[2]) . ")") or die('Err3 ' . mysql_error());
        if ($ann == true) {
            $sbotdata = array($type, $rlsname, $genre, $year, $hertz, $tp, $bitrate, $bittype);
            sendbot(join(" ", $sbotdata));
            return "OK";
        } else {
            return "FAiL";
        }
    }
}
开发者ID:scriptzteam,项目名称:SCENE-SCRiPTS,代码行数:19,代码来源:preinfoadd.php


示例5: print_summary

 function print_summary($link = 0, $length = 0, $single_link = true)
 {
     global $current_user, $globals;
     if (!$this->read) {
         return;
     }
     echo '<li id="c-' . $this->order . '">';
     $this->hidden = $this->karma < -80 || $this->user_level == 'disabled' && $this->type != 'admin';
     if ($this->hidden) {
         $comment_meta_class = 'comment-meta-hidden';
         $comment_class = 'comment-body-hidden';
     } else {
         $comment_meta_class = 'comment-meta';
         $comment_class = 'comment-body';
         if ($this->karma > $globals['comment_highlight_karma']) {
             $comment_class .= ' high';
         }
     }
     $this->link_permalink = $link->get_relative_permalink();
     echo '<div class="' . $comment_class . '">';
     echo '<strong>#' . $this->order . '</strong>';
     echo '&nbsp;&nbsp;<span  id="cid-' . $this->id . '">';
     if ($this->hidden && ($current_user->user_comment_pref & 1) == 0) {
         echo '&#187;&nbsp;<a href="javascript:load_html(\'get_commentmobile.php\',\'comment\',\'cid-' . $this->id . '\',0,' . $this->id . ')" title="' . _('ver comentario') . '">' . _('ver comentario') . '</a>';
     } else {
         $this->print_text($length);
     }
     echo '</span></div>';
     // The comments info bar
     echo '<div class="' . $comment_meta_class . '">';
     if ($this->type == 'admin') {
         $author = '<strong>' . _('admin') . '</strong> ';
     } else {
         $author = '<a href="' . get_user_uri($this->username) . '" title="karma:&nbsp;' . $this->user_karma . '">' . $this->username . '</a> ';
     }
     printf(_('por %s el %s'), $author, get_date_time($this->date));
     // Check that the user can vote
     if ($this->type != 'admin' && $this->user_level != 'disabled') {
         echo '&nbsp;&nbsp;' . _('votos') . ': <span id="vc-' . $this->id . '">' . $this->votes . '</span>, ' . _('karma') . ': <span id="vk-' . $this->id . '">' . $this->karma . '</span>';
     }
     echo '</div>';
     echo "</li>\n";
 }
开发者ID:brainsqueezer,项目名称:fffff,代码行数:43,代码来源:commentmobile.php


示例6: SQL_Query_exec

    }
    SQL_Query_exec("DELETE FROM comments WHERE id = {$id}");
    write_log($CURUSER['username'] . " has deleted comment: ID: {$id}");
    show_error_msg(T_("COMPLETE"), "Comment deleted OK", 1);
}
stdhead(T_("COMMENTS"));
//take comment add
if ($_GET["takecomment"] == 'yes') {
    $body = $_POST['body'];
    if (!$body) {
        show_error_msg(T_("ERROR"), T_("YOU_DID_NOT_ENTER_ANYTHING"), 1);
    }
    if ($type == "torrent") {
        SQL_Query_exec("UPDATE torrents SET comments = comments + 1 WHERE id = {$id}");
    }
    SQL_Query_exec("INSERT INTO comments (user, " . $type . ", added, text) VALUES (" . $CURUSER["id"] . ", " . $id . ", '" . get_date_time() . "', " . sqlesc($body) . ")");
    if (mysql_affected_rows() == 1) {
        show_error_msg(T_("COMPLETED"), "Your Comment was added successfully.", 0);
    } else {
        show_error_msg(T_("ERROR"), T_("UNABLE_TO_ADD_COMMENT"), 0);
    }
}
//end insert comment
//NEWS
if ($type == "news") {
    $res = SQL_Query_exec("SELECT * FROM news WHERE id = {$id}");
    $row = mysql_fetch_array($res);
    if (!$row) {
        show_error_msg(T_("ERROR"), "News id invalid", 0);
        stdfoot();
    }
开发者ID:lavanoid,项目名称:TorrentTrader3,代码行数:31,代码来源:comments.php


示例7: array

$btit_url_last="";
$btit_url_rss="";
if(get_remote_file("http://www.btiteam.org"))
{
    $btit_url_rss="http://www.btiteam.org/smf/index.php?type=rss;action=.xml;board=83;sa=news";
    $btit_url_last="http://www.btiteam.org/last_version.txt";
}
*/
$admin = array();
$res = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}tasks");
if ($res) {
    while ($result = mysql_fetch_array($res)) {
        if ($result["task"] == "sanity") {
            $admin["lastsanity"] = $language["LAST_SANITY"] . "<br />\n" . get_date_time($result["last_time"]) . "<br />\n(" . $language["NEXT"] . ": " . get_date_time($result["last_time"] + intval($GLOBALS["clean_interval"])) . ")<br />\n<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=sanity&amp;action=now\">Do it now!</a><br />";
        } elseif ($result["task"] == "update") {
            $admin["lastscrape"] = "<br />\n" . $language["LAST_EXTERNAL"] . "<br />\n" . get_date_time($result["last_time"]) . "<br />\n(" . $language["NEXT"] . ": " . get_date_time($result["last_time"] + intval($GLOBALS["update_interval"])) . ")<br />";
        }
    }
}
// check if XBTT tables are present in current db
$res = do_sqlquery("SHOW TABLES LIKE 'xbt%'");
$xbt_tables = array('xbt_config', 'xbt_deny_from_hosts', 'xbt_files', 'xbt_files_users', 'xbt_users');
$xbt_in_db = array();
if ($res) {
    while ($result = mysql_fetch_row($res)) {
        $xbt_in_db[] = $result[0];
    }
}
$ad = array_diff($xbt_tables, $xbt_in_db);
if (count($ad) == 0) {
    $admin["xbtt_ok"] = "<br />\nIT SEEMS THAT ALL XBTT TABLES ARE PRESENT!<br />\n<br />\n";
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:31,代码来源:admin.main.php


示例8: date

            $postsList .= '<tr><td class="lista"><b><a title="' . $language['FIRST_UNREAD'] . ': ' . $post['title'] . '" href="' . $btit_settings['url'] . '/index.php?page=forum&amp;action=viewtopic&amp;topicid=' . $post['tid'] . '.msg' . $post['pid'] . '#msg' . $post['pid'] . '">' . $post['title'] . '</a></b><br />' . $language['LAST_POST_BY'] . ' <a href="' . $btit_settings['url'] . '/index.php?page=forum&amp;action=profile;u=' . $post['userid'] . '">' . $post['username'] . '</a><br />On ' . date('d/m/Y H:i:s', $post['added']) . '</td></tr>';
        }
    } else {
        # get posts based if can read
        $lastPosts = get_result('SELECT p.topicid, p.id as pid, t.subject, p.added, p.body, p.userid FROM ' . $topicsTable . ' as t LEFT JOIN ' . $postsTable . ' as p ON p.topicid=t.id LEFT JOIN ' . $TABLE_PREFIX . 'forums as f ON f.id=t.id WHERE f.minclassread<=' . $CURUSER['id_level'] . ($realLastPosts ? '' : ' AND p.id=t.lastpost') . ' ORDER BY p.added DESC ' . $limit);
        # format posts
        foreach ($lastPosts as $post) {
            # get username
            $user = get_result('SELECT ul.prefixcolor, u.username, ul.suffixcolor FROM ' . $TABLE_PREFIX . 'users_level as ul LEFT JOIN ' . $TABLE_PREFIX . 'users as u ON u.id_level=ul.id WHERE u.id=' . $post['userid'] . ' LIMIT 1;', true, $CACHE_DURATION);
            if (isset($user[0])) {
                $user = $user[0];
                $post['username'] = $user['prefixcolor'] . $user['username'] . $user['suffixcolor'];
            } else {
                $post['username'] = '[DELETED USER]';
            }
            $postsList .= '<tr><td class="lista"><b><a href="' . $btit_settings['url'] . '/index.php?page=forum&amp;action=viewtopic&amp;topicid=' . $post['tid'] . '&amp;msg=' . $post['pid'] . '#' . $post['pid'] . '">' . htmlspecialchars(unesc($post['subject'])) . '</a></b><br />' . $language['LAST_POST_BY'] . ' <a href="' . $btit_settings['url'] . '/index.php?page=userdetails&amp;id=' . $post['userid'] . '">' . $post['username'] . '</a><br />On ' . get_date_time($post['added']) . '</td></tr>';
        }
    }
} else {
    $postsList = '<tr><td class="lista">' . $language['NO_TOPIC'] . '</td></tr>';
}
?>
<table cellpadding="4" cellspacing="1" width="100%">
	<tr>
		<td class="lista">
			<table width="100%" cellspacing="2" cellpadding="2">
				<tr>
					<td><?php 
echo $language['TOPICS'];
?>
:</td>
开发者ID:wilian32,项目名称:xbtit,代码行数:31,代码来源:forum_block.php


示例9: while

    while ($results = mysqli_fetch_assoc($resource)) {
        //background color for checked poll option
        $bold = "normal";
        if ($CURUSER["uid"] == $results["memberID"]) {
            $bold = "bold";
        }
        //
        if (!$results["username"]) {
            $user = $language["POLL_ACCOUNT_DEL"];
        } else {
            $user = "<a href=\"index.php?page=userdetails&amp;id=" . $results["memberID"] . "\">" . StripSlashes($results["prefixcolor"] . $results["username"] . $results["suffixcolor"]) . "</a>";
        }
        //print rows with voters
        $polls[$i]["option_text"] = $results["optionText"];
        $polls[$i]["ip_address"] = long2ip($results["ipAddress"]);
        $polls[$i]["vote_date"] = get_date_time($results["voteDate"]);
        $polls[$i]["user"] = $user;
        $polls[$i]["bold"] = $bold;
        $i++;
    }
    //Per Page Listing Limitation Start - 7:35 PM 3/22/2007
    if ($count > $perpage) {
        $admintpl->set("poll_pager_bottom", $pagerbottom);
    } else {
        $admintpl->set("poll_pager_bottom", "");
    }
    //Per Page Listing Limitation Stop
    $admintpl->set("show_poller", true, true);
    $admintpl->set("new_poll", false, true);
    $admintpl->set("polls", $polls);
}
开发者ID:fchypzero,项目名称:cybyd,代码行数:31,代码来源:admin.polls.php


示例10: elseif

    } elseif ($chances == 3) {
        $banthisip = getip();
        $first = ip2long($banthisip);
        $last = ip2long($banthisip);
        $added = sqlesc(get_date_time());
        $msg = sqlesc("disabled after 3 tries");
        mysql_query("UPDATE users SET enabled='no' WHERE username=" . sqlesc($name));
        mysql_query("DELETE FROM secureiptable WHERE username=" . sqlesc($name));
        mysql_query("INSERT INTO bans (added, addedby, first, last, comment) VALUES({$added}, 14, {$first}, {$last}, {$msg})") or sqlerr(__FILE__, __LINE__);
        // change id to your id to recieve a pm if someone was banned or just comment it out
        mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES (0, 1, '" . get_date_time() . "', " . sqlesc($msg) . ", 0, " . sqlesc($subject) . ")");
        die;
    } else {
        $iptrack = getip();
        $trackingyou = ip2long($iptrack);
        mysql_query("INSERT INTO secureiptable VALUES(0, " . sqlesc($name) . ", " . sqlesc($trackingyou) . ", 1, '" . get_date_time() . "', 0)") or sqlerr(__FILE__, __LINE__);
        stderr("Error", "Wrong Pin #, You got 3 tries left before having your account disabled!<br/><br/><input type=\"button\" value=\" Go Back \" onclick=\"history.back()\">", false);
    }
}
// end of 3 failed code
$tempip = getip();
$first1 = trim($tempip);
$last1 = trim($tempip);
$first = ip2long($first1);
$last = ip2long($last1);
$doubleip = mysql_query("SELECT * FROM ipsecureip WHERE {$first} >= first AND {$last} <= last") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($doubleip) > 0) {
    stderr("Error", "This IP is already in there no need to re-add");
    die;
} else {
    stdhead("Request to add TempIP Gateway");
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:takesecureip.php


示例11: benc

 $dict[$i]['value']['info'] = $info[$i];
 $dict[$i] = benc($dict[$i]);
 $dict[$i] = bdec($dict[$i]);
 list($ann[$i], $info[$i]) = dict_check($dict[$i], "announce(string):info");
 unset($dict['value']['created by']);
 $infohash[$i] = pack("H*", sha1($info[$i]["string"]));
 /* ...... end of Private Tracker mod */
 $torrent[$i] = str_replace("_", " ", $torrent[$i]);
 $torrent[$i] = str_replace("'", " ", $torrent[$i]);
 $torrent[$i] = str_replace("\"", " ", $torrent[$i]);
 $torrent[$i] = str_replace(",", " ", $torrent[$i]);
 $nfo[$i] = sqlesc(str_replace("\r\r\n", "\r\n", @file_get_contents($nfofilename[$i])));
 $first = $shortfname[$i][1];
 $second = $dname[$i];
 $third = $torrent[$i][1];
 $ret = mysql_query("INSERT INTO torrents (search_text, filename, owner, visible, info_hash, name, size, numfiles, type, descr, ori_descr, category, save_as, added, last_action, nfo) VALUES (" . implode(",", array_map("sqlesc", array(searchfield("{$first} {$second} {$third}"), $fname[$i], $CURUSER["id"], "no", $infohash[$i], $torrent[$i][1], $totallen, count($filelist[$i]), $type, $descr, $descr, $cat[$i], $dname[$i]))) . ", '" . get_date_time() . "', '" . get_date_time() . "', {$nfo[$i]})");
 // //////new torrent upload detail sent to shoutbox//////////
 if ($CURUSER["anonymous"] == 'yes') {
     $message = "[url={$BASEURL}/multidetails.php?id1={$ids['0']}&id2={$ids['1']}&id3={$ids['2']}&id4={$ids['3']}&id5={$ids['4']}]Multiple Torrents were just uploaded! Click here to see them[/url] - Anonymous User";
 } else {
     $message = "[url={$BASEURL}/multidetails.php?id1={$ids['0']}&id2={$ids['1']}&id3={$ids['2']}&id4={$ids['3']}&id5={$ids['4']}]Multiple Torrents were just uploaded! Click here to see them[/url]  Uploaded by " . safechar($CURUSER["username"]) . "";
 }
 // ///////////////////////////END///////////////////////////////////
 if (!$ret) {
     if (mysql_errno() == 1062) {
         bark("#{$i} torrent was already uploaded!");
     }
     bark("mysql puked: " . mysql_error());
 }
 $id = mysql_insert_id();
 $ids[] = $id;
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:takemultiupload.php


示例12: do_load

function do_load()
{
    global $db, $current_user;
    $annotation = new Annotation('ec2_watch');
    if (!$annotation->read()) {
        return _('no hay estadísticas disponibles');
    }
    $group = json_decode($annotation->text);
    $str = "web instances: {$group->instances}, ";
    $str .= "cpu average load: " . round($group->avg_load, 2) . "%, ";
    $str .= "last action: {$group->action} ";
    $str .= "last change: " . get_date_time($group->changed_ts) . " ";
    $str .= "stored at: " . get_date_time($annotation->time);
    return $str;
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:15,代码来源:sneaker-stats.php


示例13: count

    case 'ignored':
        if ($prefered_id != $current_user->user_id) {
            return;
        }
        $friend_value = 'AND friend_value < 0';
        $prefered_total = $db->get_var("SELECT count(*) FROM friends WHERE friend_type='manual' AND friend_from={$prefered_id} {$friend_value}");
        $dbusers = $db->get_results("SELECT friend_to as who, unix_timestamp(friend_date) as date FROM friends, users WHERE friend_type='manual' AND friend_from={$prefered_id} and user_id = friend_to {$friend_value} order by user_login asc LIMIT {$prefered_offset},{$prefered_page_size}");
        break;
}
if ($dbusers) {
    $friend = new User();
    foreach ($dbusers as $dbuser) {
        $friend->id = $dbuser->who;
        $friend->read();
        $title = $friend->username;
        if ($dbuser->date > 0) {
            $title .= sprintf(' %s %s', _('desde'), get_date_time($dbuser->date));
        }
        echo '<div class="friends-item">';
        echo '<a href="' . get_user_uri($friend->username) . '" title="' . $title . '">';
        echo '<img class="avatar" src="' . get_avatar_url($friend->id, $friend->avatar, 20) . '" width="20" height="20" alt="' . $friend->username . '"/>';
        echo $friend->username . '</a>&nbsp;';
        if ($current_user->user_id > 0 && $current_user->user_id != $friend->id) {
            echo '<a id="friend-' . $prefered_type . '-' . $current_user->user_id . '-' . $friend->id . '" href="javascript:get_votes(\'get_friend.php\',\'' . $current_user->user_id . '\',\'friend-' . $prefered_type . '-' . $current_user->user_id . '-' . $friend->id . '\',0,\'' . $friend->id . '\')">' . User::friend_teaser($current_user->user_id, $friend->id) . '</a>';
        }
        echo '</div>';
    }
    echo "<br clear='left'/>\n";
    do_contained_pages($prefered_id, $prefered_total, $prefered_page, $prefered_page_size, 'get_friends_bars.php', $prefered_type, $prefered_type . '-container');
    echo "<br clear='all'/>\n";
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:31,代码来源:get_friends_bars.php


示例14: number_format

    print '<h3><a href=\'userdetails.php?id=' . $userid . '\'>Go to ' . $user['username'] . '\'s Profile</a></h3><br />';
}
print "<table class=main width=737 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>";
$fcount = number_format(get_row_count("friends", "WHERE userid='" . $userid . "' AND confirmed = 'yes'"));
// print("<h2 align=left><a name=\"friends\">".$user['username']." has ".$fcount." Friends</a></h2>\n");
print "<h2 align=left><a name=\"friends\">" . $user['username'] . " has " . $fcount . " Friend " . ($fcount > 1 ? "s" : "") . "</a></h2>\n";
print "<table width=737 border=1 cellspacing=0 cellpadding=5><tr><td>";
$i = 0;
$res = mysql_query("SELECT f.friendid as id, u.username AS name, u.class, u.avatar, u.title, u.donor, u.warned, u.enabled, u.last_access FROM friends AS f LEFT JOIN users as u ON f.friendid = u.id WHERE userid={$userid} AND f.confirmed='yes' ORDER BY name") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0) {
    $friends = "<em>" . $user['username'] . " has no friends.</em>";
} else {
    while ($friend = mysql_fetch_array($res)) {
        $pm_pic = "<img src=" . $pic_base_url . "button_pm.gif alt='Send PM' border=0>";
        $dt = gmtime() - 180;
        $online = $friend["last_access"] >= '' . get_date_time($dt) . '' ? '&nbsp;<img src=' . $pic_base_url . 'user_online.gif border=0 alt=Online>' : '<img src=' . $pic_base_url . 'user_offline.gif border=0 alt=Offline>';
        $title = htmlspecialchars($friend["title"]);
        if (!$title) {
            $title = get_user_class_name($friend["class"]);
        }
        $body1 = "<a href=userdetails.php?id=" . $friend['id'] . "><b>" . $friend['name'] . "</b></a>" . get_user_icons($friend) . " ({$title}) {$online}<br /><br />last seen on " . $friend['last_access'] . "<br />(" . get_elapsed_time(sql_timestamp_to_unix_timestamp($friend['last_access'])) . " ago)";
        $body2 = $id == $CURUSER['id'] ? "" : "<br /><a href=friends.php?id={$CURUSER['id']}&action=add&type=friend&targetid=" . $friend['id'] . ">Add Friend</a>" . "<br /><br /><a href=sendmessage.php?receiver=" . $friend['id'] . ">" . $pm_pic . "</a>";
        $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars($friend["avatar"]) : "";
        // if (!$avatar)
        // $avatar = "".$pic_base_url."default_avatar.gif";
        if ($i % 2 == 0) {
            print "<table width=737 style='padding: 0px'><tr><td class=bottom style='padding: 5px' width=50% align=center>";
        } else {
            print "<td class=bottom style='padding: 5px' width=50% align=center>";
        }
        print "<table class=main width=737 height=75px>";
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:userfriends.php


示例15: mysql_query

if($checkinv['enabled'] === 'no' || $checkinv['deleted'] == '1' || $checkinv['warned'] === 'yes')
	bark('Bjóðandi má ekki vera óvirkur, eyddur eða hafa viðvörun.');
if($invite['email'] != $email)
	bark('Þessi boðslykill er eingöngu nothæfur til að búa til aðgang fyrir netfangið '.$invite['email']);
if(mysql_num_rows($query) < 1)
	bark("Þetta er rangur boðslykill");
mysql_query("UPDATE invites SET used=1 WHERE secret_hash = '$invid' AND email='$email'") or sqlerr();
hit_count();
$md5secret = md5(mksecret());
$secret = mksecret();
$wantpasshash = md5($secret . $wantpassword . $secret);
$editsecret = mksecret();

$ret = mysql_query("INSERT INTO users (username, passhash, secret, editsecret, email, enabled, md5secret, invitari, status, added) VALUES (" .
	implode(",", array_map("sqlesc", array($wantusername, $wantpasshash, $secret, $editsecret, $email, 'yes', $md5secret, $invitari, 'pending'))) .
		",'" . get_date_time() . "')");
$id = mysql_insert_id();

if (!$ret) {
	if (mysql_errno() == 1062) {
		bark("Notandanafn er nú þegar til!");
		}
	bark("borked");
}


//write_log("User account $id ($wantusername) was created");

$psecret = md5($editsecret);

$body = <<<EOD
开发者ID:herrag33k,项目名称:TomTorrent,代码行数:31,代码来源:takesignup.php


示例16: isset

    $tid = isset($_POST["tid"]) ? 0 + $_POST["tid"] : 0;
    if ($tid == 0) {
        stderr(":w00t:", "wtf are your trying to do!?");
    }
    if (get_row_count("torrents", "where id=" . $tid) != 1) {
        stderr(":w00t:", "That is not a torrent !!!!");
    }
    $q = mysql_query("SELECT s.downloaded as sd , t.id as tid, t.name,t.size, u.username,u.id as uid,u.downloaded as ud FROM torrents as t LEFT JOIN snatched as s ON s.torrentid = t.id LEFT JOIN users as u ON u.id = s.userid WHERE t.id =" . $tid) or print mysql_error();
    while ($a = mysql_fetch_assoc($q)) {
        $newd = $a["ud"] > 0 ? $a["ud"] - $a["sd"] : 0;
        $new_download[] = "(" . $a["uid"] . "," . $newd . ")";
        $tname = $a["name"];
        $msg = "Hey , " . $a["username"] . "\n";
        $msg .= "Looks like torrent [b]" . $a["name"] . "[/b] is nuked and we want to take back the data you downloaded\n";
        $msg .= "So you downloaded " . prefixed($a["sd"]) . " your new download will be " . prefixed($newd) . "\n";
        $pms[] = "(0," . $a["uid"] . "," . sqlesc(get_date_time()) . "," . sqlesc($msg) . ")";
    }
    //send the pm !!
    mysql_query("INSERT into messages (sender, receiver, added, msg) VALUES " . join(",", $pms)) or print mysql_error();
    //update user download amount
    mysql_query("INSERT INTO users (id,downloaded) VALUES " . join(",", $new_download) . " ON DUPLICATE key UPDATE downloaded=values(downloaded)") or print mysql_error();
    deletetorrent($tid);
    stderr(":w00t:", "it worked! long live tbdev!");
    write_log("Torrent {$tname} was deleted by " . $CURUSER["username"] . " and users Re-Paid Download");
} else {
    stdhead("Torrent Reset");
    begin_frame();
    ?>
	<form action="<?php 
    echo $_SERVER["PHP_SELF"];
    ?>
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:datareset.php


示例17: stderr

    $option12 = $_POST["option12"];
    $option13 = $_POST["option13"];
    $option14 = $_POST["option14"];
    $option15 = $_POST["option15"];
    $option16 = $_POST["option16"];
    $option17 = $_POST["option17"];
    $option18 = $_POST["option18"];
    $option19 = $_POST["option19"];
    $sort = $_POST["sort"];
    if (!$question || !$option0 || !$option1) {
        stderr("Error", "Missing form data!");
    }
    if ($pollid) {
        sql_query("UPDATE polls SET " . "question = " . sqlesc($question) . ", " . "option0 = " . sqlesc($option0) . ", " . "option1 = " . sqlesc($option1) . ", " . "option2 = " . sqlesc($option2) . ", " . "option3 = " . sqlesc($option3) . ", " . "option4 = " . sqlesc($option4) . ", " . "option5 = " . sqlesc($option5) . ", " . "option6 = " . sqlesc($option6) . ", " . "option7 = " . sqlesc($option7) . ", " . "option8 = " . sqlesc($option8) . ", " . "option9 = " . sqlesc($option9) . ", " . "option10 = " . sqlesc($option10) . ", " . "option11 = " . sqlesc($option11) . ", " . "option12 = " . sqlesc($option12) . ", " . "option13 = " . sqlesc($option13) . ", " . "option14 = " . sqlesc($option14) . ", " . "option15 = " . sqlesc($option15) . ", " . "option16 = " . sqlesc($option16) . ", " . "option17 = " . sqlesc($option17) . ", " . "option18 = " . sqlesc($option18) . ", " . "option19 = " . sqlesc($option19) . ", " . "sort = " . sqlesc($sort) . " " . "WHERE id = {$pollid}") or sqlerr(__FILE__, __LINE__);
    } else {
        sql_query("INSERT INTO polls VALUES(0" . ", '" . get_date_time() . "'" . ", " . sqlesc($question) . ", " . sqlesc($option0) . ", " . sqlesc($option1) . ", " . sqlesc($option2) . ", " . sqlesc($option3) . ", " . sqlesc($option4) . ", " . sqlesc($option5) . ", " . sqlesc($option6) . ", " . sqlesc($option7) . ", " . sqlesc($option8) . ", " . sqlesc($option9) . ", " . sqlesc($option10) . ", " . sqlesc($option11) . ", " . sqlesc($option12) . ", " . sqlesc($option13) . ", " . sqlesc($option14) . ", " . sqlesc($option15) . ", " . sqlesc($option16) . ", " . sqlesc($option17) . ", " . sqlesc($option18) . ", " . sqlesc($option19) . ", " . sqlesc($sort) . ", 0 " . ")") or sqlerr(__FILE__, __LINE__);
        $pollnum = mysql_insert_id();
        sql_query("UPDATE topics SET pollid = {$pollnum} WHERE id = {$topicid}");
    }
    header("Location: {$returnto}");
    die;
}
stdhead();
?>

<table border=1 cellspacing=0 cellpadding=5 width=80%>
<?php 
if ($pollid) {
    print "<tr><td class=colhead2 colspan=2 align=center><h1>Edit poll</h1></td></tr>";
} else {
    print "<tr><td class=colhead2 colspan=2 align=center><h1>Add poll</h1></td></tr>";
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:31,代码来源:makepostpoll.php


示例18: sqlesc

                $added = sqlesc(time());
                do_sqlquery("INSERT INTO {$TABLE_PREFIX}bannedip (added, addedby, first, last, comment) VALUES({$added}, {$CURUSER['uid']}, {$firstip}, {$lastip}, {$comment})", true);
            }
        }
        // don't break, so now we read directly ;)
    // don't break, so now we read directly ;)
    case '':
    case 'read':
    default:
        $banned = array();
        $getbanned = do_sqlquery("SELECT b.*, u.username FROM {$TABLE_PREFIX}bannedip b LEFT JOIN {$TABLE_PREFIX}users u ON u.id=b.addedby ORDER BY b.added DESC", true);
        $rowsbanned = @mysql_num_rows($getbanned);
        $admintpl->set("frm_action", "index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=banip&amp;action=write");
        $i = 0;
        if ($rowsbanned > 0) {
            $admintpl->set("no_records", false, true);
            while ($arr = mysql_fetch_assoc($getbanned)) {
                $banned[$i]["first_ip"] = long2ip($arr["first"]);
                $banned[$i]["last_ip"] = long2ip($arr["last"]);
                $banned[$i]["date"] = get_date_time($arr['added']);
                $banned[$i]["comments"] = htmlspecialchars(unesc($arr["comment"]));
                $banned[$i]["by"] = "<a href=\"index.php?page=userdetails&amp;id=" . $arr["addedby"] . "\">" . unesc($arr["username"]) . "</a>";
                $banned[$i]["remove"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=banip&amp;action=delete&amp;ip={$arr['id']}\" onclick=\"return confirm('" . str_replace("'", "\\'", $language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
                $i++;
            }
        } else {
            $admintpl->set("no_records", true, true);
        }
        $admintpl->set("bannedip", $banned);
        $admintpl->set("language", $language);
}
开发者ID:r4kib,项目名称:cyberfun-xbtit,代码行数:31,代码来源:admin.banip.php


示例19: UNIX_TIMESTAMP

echo "Period (h): $period<br>\n";

$from_time = "date_sub(now(), interval 4 day)";
#$from_where = "FROM votes, links WHERE  


$last_published = $db->get_var("SELECT SQL_NO_CACHE UNIX_TIMESTAMP(max(link_published_date)) from links WHERE link_status='published'");
if (!$last_published) $last_published = $now - 24*3600*30;
$history_from = $last_published - 200*3600;

$diff = $now - $last_published;

$d = min(MAX, MAX - ($diff/3000)*(MAX-MIN) );
$d = max(0.80, $d);
print "Last published at: " . get_date_time($last_published) ."<br>\n";
echo "Decay: $d<br>\n";

$continue = true;
$i= 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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