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


PHP ctime函数代码示例

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


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

示例1: postcode

function postcode($post, $set)
{
    global $tzoff, $smallfont, $ip, $quote, $edit, $dateshort, $dateformat, $tlayout, $textcolor, $numdir, $numfil, $tblstart, $hacks, $x_hacks, $loguser;
    $tblend = "</table>";
    $exp = calcexp($post[posts], (ctime() - $post[regdate]) / 86400);
    $lvl = calclvl($exp);
    $expleft = calcexpleft($exp);
    $reinf = syndrome($post[act]);
    $sincelastpost = "";
    $lastactivity = "";
    $since = 'Since: ' . @date($dateshort, $post[regdate] + $tzoff);
    $postdate = date($dateformat, $post[date] + $tzoff);
    if ($set[threadlink]) {
        $threadlink = ", in {$set['threadlink']}";
    }
    /* if($post[edited]){
    			$set[edited].="<hr>$smallfont$post[edited]";
    		}*/
    $sidebars = array(1, 16, 18, 19, 387);
    return "\r\n\t\t{$tblstart}\r\n\t\t{$set['tdbg']} style='width: 20% !important;' rowspan='2'>\r\n\t\t\t{$set['userlink']}{$smallfont}<br>\r\n\t\t\t<center>{$set['userpic']}</center><br>\r\n\t\t\t{$post['title']}<br><br>\r\n\t\t</td>\r\n\r\n\t\t{$set['tdbg']} height=1>\r\n\t\t<table class='fonts' style='clear: both; width: 100%;'>\r\n\t\t\t<tr>\r\n\t\t\t\t<td>Posted on {$postdate}{$threadline}{$post['edited']}</td>\r\n\t\t\t\t<td style='float: right;'>{$quote}{$edit}{$ip}</td>\r\n\t\t\t</tr>\r\n\t\t</table><tr>\r\n\t\t{$set['tdbg']} style='overflow: visible; width: 70%;' height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td></tr>\r\n\t\t{$tblend}\r\n\t\t<br>";
    if (!$set['picture']) {
        $set['picture'] = "images/_.gif";
    }
    if ($_GET['z']) {
        print_r($st['eq']);
    }
}
开发者ID:STJrInuyasha,项目名称:jul,代码行数:27,代码来源:hydra.php

示例2: getstats

function getstats($u, $items = 0, $class = 0)
{
    $stat = array('HP', 'MP', 'Atk', 'Def', 'Int', 'MDf', 'Dex', 'Lck', 'Spd');
    $p = $u[posts];
    $d = (ctime() - $u[regdate]) / 86400;
    for ($i = 0; $i < 9; $i++) {
        $m[$i] = 1;
    }
    for ($i = 1; $i < 7; $i++) {
        $item = $items[$u['eq' . $i]];
        for ($k = 0; $k < 9; $k++) {
            $is = $item['s' . $stat[$k]];
            if (substr($item[stype], $k, 1) == 'm') {
                $m[$k] *= $is / 100;
            } else {
                $a[$k] += $is;
            }
        }
    }
    for ($i = 0; $i < 9; $i++) {
        $stats[$stat[$i]] = max(1, floor(basestat($p, $d, $i) * $m[$i]) + $a[$i]);
    }
    // after calculating stats with items
    for ($k = 0; $k < 9; $k++) {
        if (isset($class[$stat[$k]])) {
            //$stats[$stat[$k]]	= ceil($stats[$stat[$k]] * ($class[$stat[$k]] != 0 ? $class[$stat[$k]] : -1));		// 0 can be 0, anything else will result in 1 because of max(1)
            $stats[$stat[$k]] = ceil($stats[$stat[$k]] * $class[$stat[$k]]);
        }
    }
    $stats[GP] = coins($p, $d) - $u[spent];
    $stats[exp] = calcexp($p, $d);
    $stats[lvl] = calclvl($stats[exp]);
    return $stats;
}
开发者ID:STJrInuyasha,项目名称:jul,代码行数:34,代码来源:rpg.php

示例3: MailifyPage

function MailifyPage($pagehash, $oldpagehash = false)
{
    global $SERVER_ADMIN, $ArchivePageStore;
    $from = isset($SERVER_ADMIN) ? $SERVER_ADMIN : 'foo@bar';
    $head = "From {$from}  " . ctime(time()) . "\r\n";
    $head .= "Subject: " . encode_pagename_for_wikizip($pagehash['pagename']) . "\r\n";
    $head .= "From: {$from} (PhpWiki)\r\n";
    $head .= "Date: " . rfc1123date($pagehash['lastmodified']) . "\r\n";
    $head .= "Mime-Version: 1.0 (Produced by PhpWiki 1.1.x)\r\n";
    if (is_array($oldpagehash)) {
        return $head . MimeMultipart(array(MimeifyPage($oldpagehash), MimeifyPage($pagehash)));
    }
    return $head . MimeifyPage($pagehash);
}
开发者ID:BackupTheBerlios,项目名称:oralux,代码行数:14,代码来源:zip.php

示例4: ctime

                    $sql->query("INSERT INTO `ipbans` SET `ip` = '" . $_SERVER['REMOTE_ADDR'] . "', `date` = '" . ctime() . "', `reason` = 'Send e-mail for password recovery'");
                    @xk_ircsend("102|" . xk(7) . "Auto-IP banned " . xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) . " for this.");
                    @xk_ircsend("1|" . xk(7) . "Auto-IP banned " . xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) . " for repeated failed logins.");
                }
                $msg = "Couldn't login.  Either you didn't enter an existing username, or you haven't entered the right password for the username.";
            }
        }
    }
    $txt .= "{$tccell1}>{$msg}<br>" . redirect('index.php', 'the board', 0);
} elseif ($_POST['action'] == 'logout') {
    setcookie('loguserid', '', time() - 3600, "/", $_SERVER['SERVER_NAME'], false, true);
    setcookie('logverify', '', time() - 3600, "/", $_SERVER['SERVER_NAME'], false, true);
    // May as well unset this as well
    setcookie('logpassword', '', time() - 3600, "/", $_SERVER['SERVER_NAME'], false, true);
    $txt .= "{$tccell1}> You are now logged out.<br>" . redirect('index.php', 'the board', 0);
} elseif (!$_POST['action']) {
    $ipaddr = explode('.', $_SERVER['REMOTE_ADDR']);
    for ($i = 4; $i > 0; --$i) {
        $verifyoptext[$i] = "(" . implode('.', $ipaddr) . ")";
        $ipaddr[$i - 1] = 'xxx';
    }
    $txt .= "<body onload=window.document.REPLIER.username.focus()>\n\t\t<FORM ACTION=login.php NAME=REPLIER METHOD=POST><tr>\n\t\t{$tccellh} width=150>&nbsp;</td>{$tccellh} width=40%>&nbsp</td>{$tccellh} width=150>&nbsp;</td>{$tccellh} width=40%>&nbsp;</td></tr><tr>\n\t\t{$tccell1}><b>User name:</b></td>       {$tccell2l}>{$inpt}=username MAXLENGTH=25 style='width:280px;'></td>\n\t\t{$tccell1} rowspan=2><b>IP Verification:</b></td> {$tccell2l} rowspan=2>\n\t\t\t<select name=verify>\n\t\t\t\t<option selected value=0>Don't use</option>\n\t\t\t\t<option value=1> /8 {$verifyoptext['1']}</option>\n\t\t\t\t<option value=2>/16 {$verifyoptext['2']}</option>\n\t\t\t\t<option value=3>/24 {$verifyoptext['3']}</option>\n\t\t\t\t<option value=4>/32 {$verifyoptext['4']}</option>\n\t\t\t</select><br><small>You can require your IP address to match your current IP, to an extent, to remain logged in.</small>\n\t\t</tr><tr>\n\t\t{$tccell1}><b>Password:</b></td>        {$tccell2l}>{$inpp}=userpass MAXLENGTH=64 style='width:180px;'></td>\n\t\t</tr><tr>\n\t\t{$tccell1}>&nbsp;</td>{$tccell2l} colspan=3>\n\t\t{$inph}=action VALUE=login>\n\t\t{$inps}=submit VALUE=Login></td></tr>\n\t\t</FORM>";
} else {
    // Just what do you think you're doing
    $sql->query("INSERT INTO `ipbans` SET `ip` = '" . $_SERVER['REMOTE_ADDR'] . "', `date` = '" . ctime() . "', `reason` = 'Generic internet exploit searcher'");
    if (!mysql_error()) {
        xk_ircsend("1|" . xk(7) . "Auto-banned asshole trying to be clever with the login form (action: " . xk(8) . $_POST['action'] . xk(7) . ") with IP " . xk(8) . $_SERVER['REMOTE_ADDR'] . xk(7) . ".");
    }
}
print $txt . $tblend . $footer;
printtimedif($startingtime);
开发者ID:StapleButter,项目名称:jul,代码行数:31,代码来源:login.php

示例5: loadtlayout

}
loadtlayout();
$user['headtext'] = $user['postheader'];
$user['signtext'] = $user['signature'];
$user['text'] = "Sample text. [quote=fhqwhgads]A sample quote, with a <a href=about:blank>link</a>, for testing your layout.[/quote]This is how your post will appear.";
$user['uid'] = $_GET['id'];
$user['date'] = ctime();
// so that layouts show up regardless of setting (for obvious reasons)
$loguser['viewsig'] = 1;
// shop/rpg such
$shops = $sql->query('SELECT * FROM itemcateg ORDER BY corder');
$eq = $sql->fetchq("SELECT * FROM users_rpg WHERE uid={$id}");
$itemids = array_unique(array($eq['eq1'], $eq['eq2'], $eq['eq3'], $eq['eq4'], $eq['eq5'], $eq['eq6'], $eq['eq7']));
$itemids = implode(',', $itemids);
$eqitems = $sql->query("SELECT * FROM items WHERE id IN ({$itemids})");
while ($item = $sql->fetch($eqitems)) {
    $items[$item['id']] = $item;
}
while ($shop = $sql->fetch($shops)) {
    $shoplist .= "\r\n\t\t\t<tr>\r\n\t\t\t{$tccell1s}>{$shop['name']}</td>\r\n\t\t\t{$tccell2s} width=100%>" . $items[$eq['eq' . $shop['id']]]['name'] . "&nbsp;</td>\r\n\t\t";
}
/* extra munging for whatever reason */
$user['email'] = urlencode($user['email']);
// AKA
if ($user['aka'] && $user['aka'] != $user['name']) {
    $aka = "{$tccell1l} width=150><b>Also known as</td>\t\t\t{$tccell2l}>{$user['aka']}<tr>";
} else {
    $aka = '';
}
print "\r\n\t{$header}\r\n\t<div>{$fonttag} Profile for <b>{$minipic}<span style='color:#{$namecolor}'>{$user['name']}</span></b></div>\r\n<table cellpadding=0 cellspacing=0 border=0>\r\n<td width=100% valign=top>\r\n{$tblstart}\r\n\t{$tccellh} colspan=2><center>General information<tr>\r\n\t<!-- {$tccell1l} width=150><b>Username</td>\t\t\t{$tccell2l}>{$user['name']}<tr> -->\r\n\t{$aka}\r\n\t{$tccell1l} width=150><b>Total posts</td>\t\t\t{$tccell2l}>{$user['posts']} ({$postavg} per day) {$projdate}<br>{$bar}<tr>\r\n\t{$tccell1l} width=150><b>Total threads</td>\t\t{$tccell2l}>{$threadsposted}<tr>\r\n\t{$tccell1l} width=150><b>EXP</td>\t\t\t\t\t{$tccell2l}>{$expstatus}<tr>\r\n" . (false ? "\t{$tccell1l} width=150><b>User rating</td>\t\t\t{$tccell2l}>{$ratingstatus}<tr>" : "") . "\r\n\t{$tccell1l} width=150><b>Registered on</td>\t\t{$tccell2l}>" . @date($dateformat, $user[regdate] + $tzoff) . " (" . floor((ctime() - $user[regdate]) / 86400) . " days ago)<tr>\r\n\t{$tccell1l} width=150><b>Last post</td>\t\t\t{$tccell2l}>{$lastpostdate}{$lastpostlink}<tr>\r\n\t{$tccell1l} width=150><b>Last activity</td>\t\t{$tccell2l}>" . date($dateformat, $user[lastactivity] + $tzoff) . "{$lastip}<tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Contact information<tr>\r\n\t{$tccell1l} width=150><b>Email address</td>\t\t{$tccell2l}><a href='mailto:{$user['email']}'>{$user['email']}</a>&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>Homepage</td>\t\t\t{$tccell2l}><a href='{$user['homepageurl']}'>{$homepagename}</a>&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>ICQ number</td>\t\t\t{$tccell2l}>{$user['icq']} {$icqicon}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>AIM screen name</td>\t\t{$tccell2l}><a href='aim:goim?screenname={$aim}'>{$user['aim']}</a>&nbsp;<tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>User settings<tr>\r\n\t{$tccell1l} width=150><b>Timezone offset</td>\t\t{$tccell2l}>{$tzoffset} hours from the server, {$tzoffrel} hours from you (current time: {$tzdate})<tr>\r\n\t{$tccell1l} width=150><b>Items per page</td>\t\t{$tccell2l}>" . $user['threadsperpage'] . " threads, " . $user['postsperpage'] . " posts<tr>\r\n\t{$tccell1l} width=150><b>Color scheme</td>\t\t{$tccell2l}>" . $schname . "<tr>\r\n{$tblend}\r\n</td><td>&nbsp;&nbsp;&nbsp;</td><td valign=top>\r\n{$tblstart}\r\n\t{$tccellh}><center>RPG status<tr>\r\n\t{$tccell1l}><img src='status.php?u={$id}'>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Equipped Items<tr>\r\n\t{$shoplist}\r\n{$tblend}\r\n</td></table>\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Personal information<tr>\r\n\t{$tccell1l} width=150><b>Real name</td>\t\t\t{$tccell2l}>{$user['realname']}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>Location</td>\t\t\t{$tccell2l}>{$user['location']}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>Birthday</td>\t\t\t{$tccell2l}>{$birthday} {$age}&nbsp;<tr>\r\n\t{$tccell1l} width=150><b>User bio</td>\t\t\t{$tccell2l}>" . dofilters(doreplace2(doreplace($user['bio'], $user['posts'], (ctime() - $user['regdate']) / 86400, $user['name']))) . "&nbsp;<tr>\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellh} colspan=2><center>Sample post<tr>\r\n\t" . threadpost($user, 1) . "\r\n{$tblend}\r\n<br>{$tblstart}\r\n\t{$tccellhs} colspan=2><center>Options<tr>\r\n\t{$tccell2s} colspan=2>\r\n\t<a href=thread.php?user={$id}>Show posts</a> | \r\n\t<a href=forum.php?user={$id}>View threads by this user</a>\r\n\t{$sendpmsg}\r\n  {$ratelink}\r\n  {$moodavatar}\r\n  <tr>\r\n\t{$tccell2s} colspan=2>\r\n\t<a href=postsbyuser.php?id={$id}>List posts by this user</a> |\r\n\t<a href=postsbytime.php?id={$id}>Posts by time of day</a> |\r\n\t<a href=postsbythread.php?id={$id}>Posts by thread</a> | \r\n\t<a href=postsbyforum.php?id={$id}>Posts by forum</td>{$sneek}\r\n\t{$tblend}{$footer}\r\n  ";
printtimedif($startingtime);
开发者ID:STJrInuyasha,项目名称:jul,代码行数:31,代码来源:profile.php

示例6: intval

require 'lib/function.php';
$windowtitle = "Posts by time of day";
require 'lib/layout.php';
if (!isset($_GET['posttime'])) {
    $posttime = 86400;
} else {
    $posttime = intval($_GET['posttime']);
}
if ($id) {
    $qstrings[] = "user={$id}";
    $from = " from " . $sql->resultq("SELECT name FROM users WHERE id={$id}");
} else {
    $from = ' on the board';
}
if ($posttime !== 0) {
    $qstrings[] = "date > " . (ctime() - $posttime);
    $during = ' during the last ' . timeunits2($posttime);
}
if (empty($qstrings)) {
    $qwhere = '1';
} else {
    $qwhere = implode(' AND ', $qstrings);
}
$posts = $sql->query("SELECT count(*) AS cnt, FROM_UNIXTIME(date,'%k') AS hour FROM posts WHERE {$qwhere} GROUP BY hour");
$link = "<a href=postsbytime.php?" . ($id ? "id={$id}&" : "") . "posttime";
print "{$header}{$smallfont}\n\t\tTimeframe:\n\t\t{$link}=86400>Last day</a> |\n\t\t{$link}=604800>Last week</a> |\n\t\t{$link}=2592000>Last 30 days</a> |\n\t\t{$link}=31536000>Last year</a> |\n\t\t{$link}=0>All-time</a><br>\n\t\t{$fonttag} Posts{$from} by time of day{$during}:\n\t\t{$tblstart}\n\t\t\t{$tccellh} width=100>Time</td>\n\t\t\t{$tccellh} width=50>Posts</td>\n\t\t\t{$tccellh}>&nbsp</tr>";
$postshour = array_fill(0, 24, 0);
$max = 0;
while ($h = $sql->fetch($posts)) {
    if (($postshour[$h['hour']] = $h['cnt']) > $max) {
        $max = $h['cnt'];
开发者ID:STJrInuyasha,项目名称:jul,代码行数:31,代码来源:postsbytime.php

示例7: freeForAll

 /**
  * freeForAll()
  */
 public static function freeForAll($f_szDate)
 {
     global $g_arrClub;
     if (empty($g_arrClub['id']) || !($szDate = common::checkDate($f_szDate))) {
         return false;
     }
     $iUtc = common::mktime($szDate);
     $iToday = date('w', $iUtc);
     if (date('Y-m-d', ctime()) !== $szDate) {
         return false;
     }
     return $szDate === $g_arrClub['free_for_all'] || strstr($g_arrClub['ignore_rules_for_days'], (string) $iToday) || null !== $g_arrClub['ignore_rules_after_hours'] && math_time(date('H:i', ctime())) > math_time($g_arrClub['ignore_rules_after_hours']);
 }
开发者ID:rudiedirkx,项目名称:MVC-Framework-3,代码行数:16,代码来源:inc.cls.common.php

示例8: array

    if (!$comment) {
        $comment = $bkp;
    }
}
// ID => [u]ser, [c]comment text, [e]mail, [ip] */
$db[$id]['co'][$cid] = array('id' => $cid, 'u' => $name, 'e' => $mail, 'ip' => CLIENT_IP, 'c' => $comment, 'ed' => $edit_id);
db_save_news($db, $nloc);
// save db piece
db_comm_sync($id, $cid);
// update latest comments
// Hook comment checker
if (hook('add_comment_checker', FALSE)) {
    return FALSE;
}
// Notify for New Comment
if (getoption('notify_comment')) {
    $url = $_SERVER['HTTP_REFERER'];
    $date = date(getoption('timestamp_active'), ctime());
    $subject = i18n("CuteNews - New Comment Added");
    $message = i18n("New Comment was added by %1 on %3 at %4\n\n%2 ", $name, $comment, $date, $url);
    cn_send_mail(getoption('notify_email'), $subject, $message);
}
// Also, remember non authorized user
if (!$logged_as_member && isset($_POST['cn_remember_me'])) {
    cn_guest_auth($name, $mail);
}
// Redirect...
$ref = preg_replace('/&edit_id=\\d+/', '', REQ('referer'));
echo '<script type="text/javascript">window.location="' . addslashes($ref) . '";</script>';
echo '<div><a href="' . $refer . '">click there</a> if automatic redirect not work</div>';
return FALSE;
开发者ID:JulioCF,项目名称:cutenews-2.0,代码行数:31,代码来源:add_comment.php

示例9: floor

<?php

require 'lib/function.php';
require 'lib/rpg.php';
if (!intval($u)) {
    die;
}
$user = $sql->fetchq("SELECT name,posts,regdate,users_rpg.* FROM users,users_rpg WHERE id='{$u}' AND uid=id");
$p = $user['posts'];
$d = (ctime() - $user['regdate']) / 86400;
if (!$it) {
    $it = 0;
}
if (!$ne) {
    $items = $sql->getarraybykey("SELECT * FROM items WHERE id={$user['eq1']} OR id={$user['eq2']} OR id={$user['eq3']} OR id={$user['eq4']} OR id={$user['eq5']} OR id={$user['eq6']} OR id={$it}", 'id');
}
if (!$nc) {
    $class = $sql->fetchq("SELECT * FROM `rpg_classes` WHERE `id` = '" . $user['class'] . "'");
}
if ($ct) {
    $GPdif = floor($items[$user['eq' . $ct]][coins] * 0.6) - $items[$it][coins];
    $user['eq' . $ct] = $it;
}
$st = getstats($user, $items, $class);
$st['GP'] += $GPdif;
if ($st['lvl'] > 0) {
    $pct = 1 - calcexpleft($st['exp']) / totallvlexp($st['lvl']);
}
if (!$class) {
    $class['name'] = "None";
}
开发者ID:StapleButter,项目名称:jul,代码行数:31,代码来源:status.php

示例10: while

 print $tblstart;
 $userid = -1;
 while ($user = $sql->fetch($users)) {
     $user[name] = str_replace(' ', '', $user['name']);
     $user[name] = str_replace(' ', '', $user['name']);
     if (strcasecmp($user[name], $username2) == 0) {
         $userid = $u;
     }
 }
 $nomultis = $sql->fetchq("SELECT * FROM `users` WHERE `lastip` = '{$REMOTE_ADDR}'");
 //	$nomultis	= false;
 if ($userid == -1 and $pass and $pass != "123" and $name && (!$nomultis || $isadmin)) {
     if (!mysql_num_rows($users)) {
         $userlevel = 3;
     }
     $currenttime = ctime();
     $ipaddr = getenv("REMOTE_ADDR");
     if (!$x_hacks['host'] && false) {
         $sql->query("INSERT INTO `pendingusers` SET `username` = '{$name}', `password` = '" . $pass . "', `ip` = '{$ipaddr}', `time` = '{$currenttime}'") or print mysql_error();
         //		$sql->query("INSERT INTO `ipbans` SET `ip` = '$ipaddr', `reason` = 'Automagic ban', `banner` = 'Acmlmboard'");
         print "{$tccell1}>Thank you, {$username}, for registering your account.<br>" . redirect('index.php', 'the board', 0);
     } else {
         $ircout['name'] = stripslashes($name);
         $ircout['ip'] = $ipaddr;
         // No longer useful
         //$ircout['pmatch']	= $sql -> resultq("SELECT COUNT(*) FROM `users` WHERE `password` = '". md5($pass) ."'");
         $sql->query("INSERT INTO `users` SET `name` = '{$name}', `password` = '" . md5($pass) . "', `powerlevel` = '0', `postsperpage` = '20', `threadsperpage` = '50', `lastip` = '{$ipaddr}', `layout` = '1', `scheme` = '0', `lastactivity` = '{$currenttime}', `regdate` = '{$currenttime}'") or print mysql_error();
         $newuserid = mysql_insert_id();
         $sql->query("UPDATE users SET `password` = '" . getpwhash($pass, $newuserid) . "' WHERE `id` = '{$newuserid}'");
         $ircout['id'] = $newuserid;
         xk_ircout("user", $ircout['name'], $ircout);
开发者ID:STJrInuyasha,项目名称:jul,代码行数:31,代码来源:register.php

示例11: intval

if ($_GET['forum']) {
    $fid = intval($_GET['forum']);
    $forum = $sql->fetchq("SELECT title, minpower FROM forums WHERE id={$fid}");
    if ($forum['minpower'] > 0 && $power < $forum['minpower']) {
        errorpage('You don\'t have access to view posts in this forum.', 'return to the board', 'index.php');
    }
    $where = "in {$forum['title']}";
    $forumquery = " AND t.forum = {$fid}";
} else {
    $forumquery = '';
    $where = "on the board";
}
if ($_GET['time']) {
    $time = intval($_GET['time']);
    $when = " over the past " . timeunits2($time);
    $timequery = ' AND p.date > ' . (ctime() - $time);
} else {
    $timequery = $when = '';
}
if (!$page) {
    $page = 0;
}
if (!$ppp) {
    $ppp = 50;
}
$min = $ppp * $page;
$posts = $sql->query("SELECT p.id,thread,ip,date,num,t.title,minpower " . "FROM posts p " . "LEFT JOIN threads t ON (thread=t.id) " . "LEFT JOIN forums f ON (t.forum=f.id) " . "WHERE p.user={$id}{$forumquery}{$timequery} ORDER BY p.id DESC");
$posttotal = mysql_num_rows($posts);
// Seek to page
if (!@mysql_data_seek($posts, $min)) {
    $page = 0;
开发者ID:StapleButter,项目名称:jul,代码行数:31,代码来源:postsbyuser.php

示例12: htmlspecialchars

<?php

require 'lib/function.php';
require 'lib/layout.php';
$userid = htmlspecialchars(stripslashes($_GET['userid']));
$vd = date('m-d-y', ctime());
if (!$m && !$d && !$y) {
    $m = date("m", ctime() - 86400);
    $d = date("d", ctime() - 86400);
    $y = date("y", ctime() - 86400);
}
if (!$v) {
    $v = 0;
    $dd = mktime(0, 0, 0, substr($vd, 0, 2), substr($vd, 3, 2), substr($vd, 6, 2));
    // + (3*3600);
    $dd2 = mktime(0, 0, 0, substr($vd, 0, 2), substr($vd, 3, 2) + 1, substr($vd, 6, 2));
    // + (3*3600);
} else {
    $dd = mktime(0, 0, 0, $m, $d, $y);
    // + (3*3600);
    $dd2 = mktime(0, 0, 0, $m, $d + 1, $y);
    // + (3*3600);
}
$users = $sql->query("SELECT u.id,u.name,u.aka,u.sex,u.powerlevel,COUNT(*) AS cnt FROM users AS u,posts AS p WHERE p.user=u.id AND p.date>={$dd} AND p.date<{$dd2} AND u.powerlevel >= 0 GROUP BY u.id ORDER BY cnt DESC");
$i = 0;
if (!$u) {
    $u = 0;
    $n = $loguser['name'];
} elseif ($u == 2) {
    $n = $userid;
}
开发者ID:StapleButter,项目名称:jul,代码行数:31,代码来源:acs.php

示例13: microtime

echo $form;
// ---------------------------------------------------------------------------------------------------------------------
if ($dosearch) {
    $mc_start = microtime(true);
    // Remove parameters for go to news from searchbox
    $_static_qr = 'dosearch,archives,search,from_date_year,from_date_month,from_date_day,to_date_year,to_date_month,to_date_day,search_st,number,archive,template';
    $st = -1;
    $_next_link = FALSE;
    $_number = $number;
    $archive_id = 0;
    // get archive list
    $_list_archives = db_get_archives();
    krsort($_list_archives);
    reset($_list_archives);
    $news = db_index_load('');
    $c_time = ctime();
    $itemid = 0;
    if (strlen($search) < 3) {
        echo "<div>Too short request!</div>";
    } else {
        $block = '';
        $found = 0;
        do {
            reset($news);
            // repeat, while data exists
            while ($news) {
                // pop top element
                $id = key($news);
                unset($news[$id]);
                if ($id > $c_time) {
                    continue;
开发者ID:JulioCF,项目名称:cutenews-2.0,代码行数:31,代码来源:search.php

示例14: postcode

function postcode($post, $set)
{
    global $tzoff, $smallfont, $ip, $quote, $edit, $dateshort, $dateformat, $tlayout, $textcolor, $numdir, $numfil, $tblstart, $hacks, $x_hacks, $loguser;
    $tblend = "</table>";
    $exp = calcexp($post['posts'], (ctime() - $post['regdate']) / 86400);
    $lvl = calclvl($exp);
    $expleft = calcexpleft($exp);
    if ($tlayout == 1) {
        $level = "Level: {$lvl}";
        $poststext = "Posts: ";
        $postnum = "{$post['num']}/";
        $posttotal = $post['posts'];
        $experience = "EXP: {$exp}<br>For next: {$expleft}";
        $totalwidth = 96;
        $barwidth = $totalwidth - round(@($expleft / totallvlexp($lvl)) * $totalwidth);
        if ($barwidth < 1) {
            $barwidth = 0;
        }
        if ($barwidth > 0) {
            $baron = "<img src=images/{$numdir}" . "bar-on.gif width={$barwidth} height=8>";
        }
        if ($barwidth < $totalwidth) {
            $baroff = "<img src=images/{$numdir}" . 'bar-off.gif width=' . ($totalwidth - $barwidth) . ' height=8>';
        }
        $bar = "<br><img src=images/{$numdir}" . "barleft.gif height=8>{$baron}{$baroff}<img src=images/{$numdir}" . 'barright.gif height=8>';
    } else {
        $level = "<img src=images/{$numdir}" . "level.gif width=36 height=8><img src=numgfx.php?n={$lvl}&l=3&f={$numfil} height=8>";
        $experience = "<img src=images/{$numdir}" . "exp.gif width=20 height=8><img src=numgfx.php?n={$exp}&l=5&f={$numfil} height=8><br><img src=images/{$numdir}" . "fornext.gif width=44 height=8><img src=numgfx.php?n={$expleft}&l=2&f={$numfil} height=8>";
        $poststext = "<img src=images/_.gif height=2><br><img src=images/{$numdir}" . "posts.gif width=28 height=8>";
        $postnum = "<img src=numgfx.php?n={$post['num']}/&l=5&f={$numfil} height=8>";
        $posttotal = "<img src=numgfx.php?n={$post['posts']}&f={$numfil}" . ($post['num'] ? '' : '&l=4') . " height=8>";
        $totalwidth = 56;
        $barwidth = $totalwidth - round(@($expleft / totallvlexp($lvl)) * $totalwidth);
        if ($barwidth < 1) {
            $barwidth = 0;
        }
        if ($barwidth > 0) {
            $baron = "<img src=images/{$numdir}" . "bar-on.gif width={$barwidth} height=8>";
        }
        if ($barwidth < $totalwidth) {
            $baroff = "<img src=images/{$numdir}" . 'bar-off.gif width=' . ($totalwidth - $barwidth) . ' height=8>';
        }
        $bar = "<br><img src=images/{$numdir}" . "barleft.gif width=2 height=8>{$baron}{$baroff}<img src=images/{$numdir}" . 'barright.gif width=2 height=8>';
    }
    if (!$post['num']) {
        $postnum = '';
        if ($postlayout == 1) {
            $posttotal = "<img src=numgfx.php?n={$post['posts']}&f={$numfil}&l=4 height=8>";
        }
    }
    $reinf = syndrome(filter_int($post['act']));
    if ($post['lastposttime']) {
        $sincelastpost = 'Since last post: ' . timeunits(ctime() - $post['lastposttime']);
    }
    $lastactivity = 'Last activity: ' . timeunits(ctime() - $post['lastactivity']);
    $since = 'Since: ' . @date($dateshort, $post['regdate'] + $tzoff);
    $postdate = date($dateformat, $post['date'] + $tzoff);
    $threadlink = "";
    if (filter_string($set['threadlink'])) {
        $threadlink = ", in {$set['threadlink']}";
    }
    $post['edited'] = filter_string($post['edited']);
    if ($post['edited']) {
        //		.="<hr>$smallfont$post[edited]";
    }
    $sidebars = array(1, 3, 19, 89, 387, 45, 92, 47);
    $sidebars = array(1, 19, 89, 387, 45, 92, 47, 1420, 1090, 2100, 2069);
    // Large block of user-specific hacks follows //
    if ($post['uid'] == 1 && !$x_hacks['host'] && true) {
        global $numdir;
        $numdir_ = $numdir;
        $numdir = "num3/";
        if ($post['num']) {
            $numtext = generatenumbergfx($post['num'], 1, true) . "<br>" . generatenumbergfx($post['posts']);
        } else {
            $numtext = generatenumbergfx($post['posts'], 1, true);
        }
        $numdir = $numdir_;
        return "\n\t{$tblstart}\n\t{$set['tdbg']} rowspan=2 style='padding: 5px 1px 5px 1px;'>\n\t  <center>{$set['userlink']}{$smallfont}<br>\n\t  {$set['userrank']}\n\t\t{$reinf}\n\t\t<br>\n\t\t<br>{$set['userpic']}\n\t\t<br><br>{$numtext}</center>\n\t  <br><img src=images/_.gif width=200 height=1>\n\t</td>\n\t{$set['tdbg']} height=1 width=100%>\n\t  <table cellspacing=0 cellpadding=2 width=100% class=fonts>\n\t    <td>Posted on {$postdate}{$threadlink}{$post['edited']}</td>\n\t    <td width=255><nobr>{$quote}{$edit}{$ip}\n\t  </table><tr>\n\t{$set['tdbg']} height=220 id=\"post" . $post['id'] . "\">{$post['headtext']}{$post['text']}{$post['signtext']}</td>\n\t{$tblend}";
    }
    // Inu's sidebar
    // (moved up here for to display for everyone during doomclock mode!)
    if ($post['uid'] == "2100" && !$x_hacks['host']) {
        $posttable = "<table style=\"border:none;border-spacing:0px;\">";
        // doomclock
        if (($doomclock_time = mktime(12, 20, 0, 4, 20, 2014) - cmicrotime()) >= 0) {
            $doomclock_secs = (int) ($doomclock_time % 60);
            $doomclock_mins = (int) ($doomclock_time % 3600 / 60);
            $doomclock_hrs = (int) ($doomclock_time / 3600);
            $doomclock_str = sprintf(" %d=%02d=%02d", $doomclock_hrs, $doomclock_mins, $doomclock_secs);
            $doomclock_desc = "{$doomclock_hrs} hours, {$doomclock_mins} minutes, {$doomclock_secs} seconds";
            $posttable .= "<tr><td><img src=\"images/inu/cifont/d.gif\" title=\"Doomsday\"></td><td align='right'>";
            $posttable .= inu_hexclock($doomclock_desc, $doomclock_time);
            $posttable .= "</td><td align='right'><img src=\"/images/inu/7sd.php?s=>FFF{$doomclock_str}\"></td></tr>";
        }
        if ($post['num']) {
            $posttable .= "<tr><td><img src=\"images/inu/cifont/p.gif\" title=\"Post Number\"></td><td>";
            $posttable .= inu_binaryposts($post['num'], "images/dot3.gif", "images/dot1.gif", $post['posts']);
            $posttable .= "</td><td align='right'><img src=\"/images/inu/7sd.php?s=" . sprintf("%4d", $post['num']) . "\"></td></tr>";
        }
//.........这里部分代码省略.........
开发者ID:STJrInuyasha,项目名称:jul,代码行数:101,代码来源:regular.php

示例15: htmlspecialchars

    $polltbl = "{$tblstart}\r\n\t\t\t<tr>{$tccellc} colspan=3><b>" . htmlspecialchars($poll['question']) . "</td></tr>\r\n\t\t\t<tr>{$tccell2ls} colspan=3>" . nl2br(dofilters($poll['briefing'])) . "</td></tr>\r\n\t\t\t{$choices}\r\n\t\t\t<tr>{$tccell2l} colspan=3>{$smallfont} {$polltext} {$tvotes_u} user{$s_have} voted. {$polledit}</td></tr>\r\n\t\t\t{$tblend}<br>\r\n\t\t\t";
}
loadtlayout();
switch ($loguser['viewsig']) {
    case 1:
        $sfields = ',headtext,signtext';
        break;
    case 2:
        $sfields = ',u.postheader headtext,u.signature signtext';
        break;
    default:
        $sfields = '';
        break;
}
$ufields = userfields();
$activity = $sql->query("SELECT user, count(*) num FROM posts WHERE date>" . (ctime() - 86400) . " GROUP BY user");
while ($n = $sql->fetch($activity)) {
    $act[$n['user']] = $n['num'];
}
$postlist = "\r\n\t\t{$polltbl}\r\n\t\t{$tblstart}\r\n\t\t{$modfeats}\r\n\t\t{$errormsgs}\r\n\t";
if ($log && $id && $forum['id']) {
    $headlinks .= " - <a href=index.php?action=markforumread&forumid={$forum['id']}>Mark forum read</a>";
    $header = makeheader($header1, $headlinks, $header2 . ($fonline ? "{$tblstart}{$tccell1s}>{$fonline}{$tblend}" : ""));
}
$threadforumlinks = "\r\n\t\t<table width=100%><td align=left>{$fonttag}<a href=index.php>" . $boardname . "</a>" . ($forum['title'] ? " - <a href=forum.php?id={$forumid}>{$forum['title']}</a>" : "") . " - {$thread['title']}</td><td align=right>{$smallfont}\r\n\t";
if ($forumid) {
    if ($forum['pollstyle'] != -2) {
        $threadforumlinks .= "<a href=newthread.php?poll=1&id={$forumid}>{$newpollpic}</a> - ";
    } else {
        $threadforumlinks .= "<img src=\"images/nopolls.png\" align=\"absmiddle\"> - ";
    }
开发者ID:STJrInuyasha,项目名称:jul,代码行数:31,代码来源:thread.php


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