本文整理汇总了PHP中get_date函数的典型用法代码示例。如果您正苦于以下问题:PHP get_date函数的具体用法?PHP get_date怎么用?PHP get_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_date函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: usertable
function usertable($res, $frame_caption)
{
global $CURUSER, $lang;
$htmlout = '';
$htmlout .= begin_frame($frame_caption, true);
$htmlout .= begin_table();
$htmlout .= "<tr>\r\n <td class='colhead'>{$lang['common_rank']}</td>\r\n <td class='colhead' align='left'>{$lang['user']}</td>\r\n <td class='colhead'>{$lang['user_ul']}</td>\r\n <td class='colhead' align='left'>{$lang['user_ulspeed']}</td>\r\n <td class='colhead'>{$lang['user_dl']}</td>\r\n <td class='colhead' align='left'>{$lang['user_dlspeed']}</td>\r\n <td class='colhead' align='right'>{$lang['common_ratio']}</td>\r\n <td class='colhead' align='left'>{$lang['user_joined']}</td>\r\n\r\n </tr>";
$num = 0;
while ($a = mysql_fetch_assoc($res)) {
++$num;
$highlight = $CURUSER["id"] == $a["userid"] ? " bgcolor='#BBAF9B'" : "";
if ($a["downloaded"]) {
$ratio = $a["uploaded"] / $a["downloaded"];
$color = get_ratio_color($ratio);
$ratio = number_format($ratio, 2);
if ($color) {
$ratio = "<font color='{$color}'>{$ratio}</font>";
}
} else {
$ratio = $lang['common_infratio'];
}
$htmlout .= "<tr{$highlight}><td align='center'>{$num}</td><td align='left'{$highlight}><a href='userdetails.php?id=" . $a["userid"] . "'><b>" . $a["username"] . "</b></a>" . "</td><td align='right'{$highlight}>" . mksize($a["uploaded"]) . "</td><td align='right'{$highlight}>" . mksize($a["upspeed"]) . "/s" . "</td><td align='right'{$highlight}>" . mksize($a["downloaded"]) . "</td><td align='right'{$highlight}>" . mksize($a["downspeed"]) . "/s" . "</td><td align='right'{$highlight}>" . $ratio . "</td><td align='left'>" . get_date($a['added'], '') . " (" . get_date($a['added'], '', 0, 1) . ")</td></tr>";
}
$htmlout .= end_table();
$htmlout .= end_frame();
return $htmlout;
}
开发者ID:thefkboss,项目名称:U-232,代码行数:27,代码来源:topten.php
示例2: do_log_sql
function do_log_sql($stdlog, $text_log, &$LINK)
{
if (!mysql_ping($GLOBALS["LINK"])) {
$do_mysql_reconect = 1;
fputs($stdlog, get_date() . " MySQL Connect failed" . "\n");
} else {
$do_mysql_reconect = 0;
fputs($stdlog, get_date() . " " . $text_log . "\n");
}
while ($do_mysql_reconect == 1) {
$config_file = '../../app/etc/config.xml';
if (file_exists($config_file)) {
$xml = simplexml_load_file($config_file);
$CONF_MYSQL_HOST = (string) $xml->parameters->mysql->host;
$CONF_MYSQL_USERNAME = (string) $xml->parameters->mysql->username;
$CONF_MYSQL_PASSWORD = (string) $xml->parameters->mysql->password;
$CONF_MYSQL_DBNAME = (string) $xml->parameters->mysql->dbname;
}
$GLOBALS["LINK"] = mysql_pconnect($CONF_MYSQL_HOST, $CONF_MYSQL_USERNAME, $CONF_MYSQL_PASSWORD);
mysql_select_db($CONF_MYSQL_DBNAME, $GLOBALS["LINK"]);
if (mysql_ping($GLOBALS["LINK"])) {
$do_mysql_reconect = 0;
fputs($stdlog, get_date() . " MySQL Connect restored" . "\n");
}
}
return "1";
}
开发者ID:hakerillo66,项目名称:mikbill_distr,代码行数:27,代码来源:sms_2.php
示例3: calendar
function calendar($m, $y)
{
$today = get_date('', 'j');
$weekday = get_date(mktime(0, 0, 0, $m, 1, $y), 'w');
$totalday = Days4month($y, $m);
$start = strtotime($y . '-' . $m . '-1');
$end = strtotime($y . '-' . $m . '-' . $totalday);
// $rs=iCMS_DB::getArray("SELECT A.*,F.name,F.dir FROM `#iCMS@__article` AS A,#iCMS@__forum AS F WHERE A.status='1' AND A.fid=F.fid AND F.status='1' AND pubdate>='$start' AND pubdate<='$end'");
// for ($i=0;$i<count($rs);$i++) {
// $pubdate=get_date($rs[$i]['pubdate'],'Y-n-j');
// $dates[$pubdate]
// //$postdates .= ($postdates ? ',' : '').get_date($rs[$i]['pubdate'],'Y-n-j');
// }
$br = 0;
$days = '<tr>';
for ($i = 1; $i <= $weekday; $i++) {
$days .= '<td> </td>';
$br++;
}
for ($i = 1; $i <= $totalday; $i++) {
$br++;
//$td = (strpos(",$postdates,",','.$y.'-'.$m.'-'.$i.",") !== false) ? '<a href="index.php?date='.$y.'_'.$m.'_'.$i.'"><b>'.$i.'</b></a>' :$i;
$days .= '<td>' . $i . '</td>';
if ($br >= 7) {
$days .= '</tr><tr>';
$br = 0;
}
}
if ($br != 0) {
for ($i = $br; $i < 7; $i++) {
$days .= '<td> </td>';
}
}
return $days;
}
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:35,代码来源:function.php
示例4: Copyright
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: GPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V5 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(0);
ignore_user_abort(1);
require_once INCL_DIR . 'function_happyhour.php';
//==Putyns HappyHour
$f = $INSTALLER09['happyhour'];
$happy = unserialize(file_get_contents($f));
$happyHour = strtotime($happy["time"]);
$curDate = TIME_NOW;
$happyEnd = $happyHour + 3600;
if ($happy["status"] == 0 && $INSTALLER09['happy_hour'] == true) {
write_log("Happy hour was @ " . get_date($happyHour, 'LONG', 1, 0) . " and Catid " . $happy["catid"] . " ");
happyFile("set");
} elseif ($curDate > $happyEnd && $happy["status"] == 1) {
happyFile("reset");
}
//== End
if ($queries > 0) {
write_log("Happyhour Clean -------------------- Happyhour cleanup Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:46,代码来源:happyhour_update.php
示例5: calendar
function calendar($m, $y)
{
$today = get_date(0, 'j');
$weekday = get_date(mktime(0, 0, 0, $m, 1, $y), 'w');
$totalday = days_in_month($y, $m);
$start = strtotime($y . '-' . $m . '-1');
$end = strtotime($y . '-' . $m . '-' . $totalday);
$br = 0;
$days = '<tr class="day">';
for ($i = 1; $i <= $weekday; $i++) {
$days .= '<td></td>';
$br++;
}
for ($i = 1; $i <= $totalday; $i++) {
$br++;
$dcp = $this->day_count_post[$y . '-' . $m . '-' . $i];
$dcp or $dcp = 0;
if ($i == $today) {
$days .= '<td class="today"><b>' . $i . '</b><hr />' . $dcp . '篇</td>';
} else {
$days .= '<td><b>' . $i . '</b><hr />' . $dcp . '篇</td>';
}
if ($br >= 7) {
$days .= '</tr><tr class="day">';
$br = 0;
}
}
if ($br != 0) {
for ($i = $br; $i < 7; $i++) {
$days .= '<td></td>';
}
}
return $days;
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:34,代码来源:iJob.class.php
示例6: calendar
function calendar($m, $y, $iCMS)
{
$today = get_date('', 'j');
$weekday = get_date(mktime(0, 0, 0, $m, 1, $y), 'w');
$totalday = Days4month($y, $m);
$start = strtotime($y . '-' . $m . '-1');
$end = strtotime($y . '-' . $m . '-' . $totalday);
$postdates = '';
$rs = $iCMS->db->getArray("SELECT A.*,C.name,C.dir FROM `#iCMS@__article` AS A,#iCMS@__catalog AS C WHERE visible='1' AND A.cid=C.id AND C.ishidden='0' AND pubdate>='{$start}' AND pubdate<='{$end}'");
for ($i = 0; $i < count($rs); $i++) {
$postdates .= ($postdates ? ',' : '') . get_date($rs[$i]['pubdate'], 'Y-n-j');
}
$br = 0;
$days = '<tr>';
for ($i = 1; $i <= $weekday; $i++) {
$days .= '<td> </td>';
$br++;
}
for ($i = 1; $i <= $totalday; $i++) {
$br++;
$td = strpos(",{$postdates},", ',' . $y . '-' . $m . '-' . $i . ",") !== false ? '<a href="index.php?date=' . $y . '_' . $m . '_' . $i . '"><b>' . $i . '</b></a>' : $i;
$days .= '<td>' . $td . '</td>';
if ($br >= 7) {
$days .= '</tr><tr>';
$br = 0;
}
}
if ($br != 0) {
for ($i = $br; $i < 7; $i++) {
$days .= '<td> </td>';
}
}
return $days;
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:34,代码来源:function.php
示例7: postcheck
function postcheck()
{
global $db_openpost, $db_postallowtime, $timestamp;
//list($openpost, $poststart, $postend) = explode("\t", $db_openpost);
list($openpost, $poststart, $poststartminute, $postend, $postendminute) = explode("\t", $db_openpost);
$minute = get_date($timestamp, 'i');
$GLOBALS['db_poststart'] = $poststart;
$GLOBALS['db_poststartminute'] = $poststartminute;
$GLOBALS['db_postend'] = $postend;
$GLOBALS['db_postendminute'] = $postendminute;
if ($openpost == 1 && $this->groupid != 3 && $this->groupid != 4) {
if ($poststart < $postend && ($this->hours < $poststart || $this->hours == $poststart && $minute < $poststartminute || ($this->hours > $postend || $this->hours == $postend && $minute > $postendminute))) {
return $this->showmsg('post_openpost');
} elseif ($poststart > $postend && (($this->hours < $poststart || $this->hours == $poststart && $minute < $poststartminute) && ($this->hours > $postend || $this->hours == $postend && $minute > $postendminute))) {
return $this->showmsg('post_openpost');
} elseif ($poststart == $postend && $this->hours == $poststart && ($minute < $poststartminute || $minute > $postendminute)) {
return $this->showmsg('post_openpost');
}
}
if ($this->groupid == '7') {
return $this->showmsg('reg_check');
}
$userGroupsService = L::loadClass('UserGroups', 'user');
$systemGroup = $userGroupsService->getUserGroupIds('system');
if (!in_array($this->groupid, $systemGroup) && $db_postallowtime && $timestamp - $this->user['regdate'] < $db_postallowtime * 60) {
return $this->showmsg('post_newrg_limit');
}
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:28,代码来源:post.class.php
示例8: getCodeSentNumOfDay
/**
* 某日的实名认证验证码发送量
* @param string $day 'Y-m-d'
* @return int
*/
function getCodeSentNumOfDay($day = null)
{
$platformApiClient = $this->_getPlatformApiClient();
$day == null && ($day = get_date(time(), 'Y-m-d'));
$response = (int) $this->_jsonDecode($platformApiClient->get('credit.statistics.countsitemobileverifybyday', array('day' => $day)));
return new ApiResponse($response);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:12,代码来源:class_Authentication.php
示例9: cleanup_show_main
function cleanup_show_main()
{
$count1 = get_row_count('cleanup');
$perpage = 15;
$pager = pager($perpage, $count1, 'staffpanel.php?tool=cleanup_manager&');
$htmlout = "<h2>Current Cleanup Tasks</h2>\n <table class='torrenttable' bgcolor='#333333' border='1' cellpadding='5px' width='80%'>\n <tr>\n <td class='colhead'>Cleanup Title & Description</td>\n <td class='colhead' width='150px'>Runs every</td>\n <td class='colhead' width='150px'>Next Clean Time</td>\n <td class='colhead' width='40px'>Edit</td>\n <td class='colhead' width='40px'>Delete</td>\n <td class='colhead' width='40px'>Off/On</td>\n <td class='colhead' style='width: 40px;'>Run now</td>\n </tr>";
$sql = sql_query("SELECT * FROM cleanup ORDER BY clean_time ASC " . $pager['limit']) or sqlerr(__FILE__, __LINE__);
if (!mysqli_num_rows($sql)) {
stderr('Error', 'Fucking panic now!');
}
while ($row = mysqli_fetch_assoc($sql)) {
$row['_clean_time'] = get_date($row['clean_time'], 'LONG');
$row['clean_increment'] = $row['clean_increment'];
$row['_class'] = $row['clean_on'] != 1 ? " style='color:red'" : '';
$row['_title'] = $row['clean_on'] != 1 ? " (Locked)" : '';
$row['_clean_time'] = $row['clean_on'] != 1 ? "<span style='color:red'>{$row['_clean_time']}</span>" : $row['_clean_time'];
$htmlout .= "<tr>\n <td{$row['_class']}><strong>{$row['clean_title']}{$row['_title']}</strong><br />{$row['clean_desc']}</td>\n <td>" . mkprettytime($row['clean_increment']) . "</td>\n <td>{$row['_clean_time']}</td>\n <td align='center'><a href='staffpanel.php?tool=cleanup_manager&action=cleanup_manager&mode=edit&cid={$row['clean_id']}'>\n <img src='./pic/aff_tick.gif' alt='Edit Cleanup' title='Edit' border='0' height='12' width='12' /></a></td>\n\n <td align='center'><a href='staffpanel.php?tool=cleanup_manager&action=cleanup_manager&mode=delete&cid={$row['clean_id']}'>\n <img src='./pic/aff_cross.gif' alt='Delete Cleanup' title='Delete' border='0' height='12' width='12' /></a></td>\n <td align='center'><a href='staffpanel.php?tool=cleanup_manager&action=cleanup_manager&mode=unlock&cid={$row['clean_id']}&clean_on={$row['clean_on']}'>\n <img src='./pic/warned.png' alt='On/Off Cleanup' title='on/off' border='0' height='12' width='12' /></a></td>\n<td align='center'><a href='staffpanel.php?tool=cleanup_manager&action=cleanup_manager&mode=run&cid={$row['clean_id']}'>Run it now</a></td>\n </tr>";
}
$htmlout .= "</table>";
if ($count1 > $perpage) {
$htmlout .= $pager['pagerbottom'];
}
$htmlout .= "<br />\n <span class='btn'><a href='./staffpanel.php?tool=cleanup_manager&action=cleanup_manager&mode=new'>Add New</a></span>";
echo stdhead('Cleanup Manager - View') . $htmlout . stdfoot();
}
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:25,代码来源:cleanup_manager.php
示例10: parse
function parse($data, $query)
{
$items = array('domain.name' => 'Nome de domínio / Domain Name:', 'domain.created' => 'Data de registo / Creation Date (dd/mm/yyyy):', 'domain.nserver.' => 'Nameserver:', 'domain.status' => 'Estado / Status:', 'owner' => 'Titular / Registrant', 'bill' => 'Entidade Gestora / Billing Contact', 'admin' => 'Responsável Administrativo / Admin Contact', 'tech' => 'Responsável Técnico / Tech Contact', '#' => 'Nameserver Information');
$r['regrinfo'] = get_blocks($data['rawdata'], $items);
if (empty($r['regrinfo']['domain']['name'])) {
$r['regrinfo']['registered'] = 'no';
return;
}
$r['regrinfo']['domain']['created'] = get_date($r['regrinfo']['domain']['created'], 'dmy');
if ($r['regrinfo']['domain']['status'] == 'ACTIVE') {
$r['regrinfo']['registered'] = 'yes';
} else {
$r['regrinfo']['registered'] = 'no';
}
if (isset($r['regrinfo']['admin'])) {
$r['regrinfo']['admin'] = get_contact($r['regrinfo']['admin']);
}
if (isset($r['regrinfo']['owner'])) {
$r['regrinfo']['owner'] = get_contact($r['regrinfo']['owner']);
}
if (isset($r['regrinfo']['tech'])) {
$r['regrinfo']['tech'] = get_contact($r['regrinfo']['tech']);
}
if (isset($r['regrinfo']['bill'])) {
$r['regrinfo']['bill'] = get_contact($r['regrinfo']['bill']);
}
$r['regyinfo'] = array('referrer' => 'http://www.fccn.pt', 'registrar' => 'FCCN');
return $r;
}
开发者ID:BGCX067,项目名称:faireconnaitre-svn-to-git,代码行数:29,代码来源:whois.pt.php
示例11: plugin_epoch_inline
function plugin_epoch_inline()
{
$value = func_get_args();
$args = func_num_args();
if ($args > 3) {
return '&epoch(utime[,class]);';
}
$array = explode(',', $value[0]);
$format = Time::format($array[0]);
$passaage = Time::passage($array[0]);
$class = !empty($array[1]) ? $array[1] : 'epoch';
$ret = '<time datetime="' . get_date('c', $value[0]) . '" class="' . $class . '" title="' . $passaage . '">' . $format . '</time>';
if (!empty($value[1])) {
$erapse = MUTIME - $value[0];
if ($erapse < 432000) {
$ret .= ' <span class="';
if ($erapse < 86400) {
$ret .= 'new1';
} else {
$ret .= 'new5';
}
$ret .= '">New</span>';
}
}
return $ret;
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:26,代码来源:epoch.inc.php
示例12: plugin_counter_get_count
function plugin_counter_get_count($page)
{
global $vars;
static $counters = array();
static $default;
if (!isset($default)) {
$default = array('total' => 0, 'date' => get_date('Y/m/d'), 'today' => 0, 'yesterday' => 0, 'ip' => '');
}
if (!is_page($page)) {
return $default;
}
if (isset($counters[$page])) {
return $counters[$page];
}
// Set default
$counters[$page] = $default;
$modify = FALSE;
$file = COUNTER_DIR . encode($page) . PLUGIN_COUNTER_SUFFIX;
$fp = fopen($file, file_exists($file) ? 'r+' : 'w+') or die('counter.inc.php: Cannot open COUTER_DIR/' . basename($file));
set_file_buffer($fp, 0);
flock($fp, LOCK_EX);
rewind($fp);
foreach ($default as $key => $val) {
// Update
$counters[$page][$key] = rtrim(fgets($fp, 256));
if (feof($fp)) {
break;
}
}
if ($counters[$page]['date'] != $default['date']) {
// New day
$modify = TRUE;
$is_yesterday = $counters[$page]['date'] == get_date('Y/m/d', strtotime('yesterday', UTIME));
$counters[$page]['ip'] = $_SERVER['REMOTE_ADDR'];
$counters[$page]['date'] = $default['date'];
$counters[$page]['yesterday'] = $is_yesterday ? $counters[$page]['today'] : 0;
$counters[$page]['today'] = 1;
$counters[$page]['total']++;
} else {
if ($counters[$page]['ip'] != $_SERVER['REMOTE_ADDR']) {
// Not the same host
$modify = TRUE;
$counters[$page]['ip'] = $_SERVER['REMOTE_ADDR'];
$counters[$page]['today']++;
$counters[$page]['total']++;
}
}
// Modify
if ($modify && $vars['cmd'] == 'read') {
rewind($fp);
ftruncate($fp, 0);
foreach (array_keys($default) as $key) {
fputs($fp, $counters[$page][$key] . "\n");
}
}
flock($fp, LOCK_UN);
fclose($fp);
return $counters[$page];
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:59,代码来源:counter.inc.php
示例13: resetInfo
function resetInfo($tid, $atcdb)
{
global $timestamp;
$reset = $this->db->get_one("SELECT obtitle,retitle,endtime,umpire,judge FROM pw_debates WHERE tid=" . S::sqlEscape($tid));
$reset['debateable'] = !$reset['judge'] && $reset['endtime'] > $timestamp ? '' : "disabled";
$reset['endtime'] = get_date($reset['endtime'], "Y-m-d H:i");
return $reset;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:8,代码来源:post_5.class.php
示例14: docleanup
function docleanup($data)
{
global $INSTALLER09, $queries;
set_time_limit(0);
ignore_user_abort(1);
$lconf = sql_query('SELECT * FROM lottery_config') or sqlerr(__FILE__, __LINE__);
while ($aconf = mysqli_fetch_assoc($lconf)) {
$lottery_config[$aconf['name']] = $aconf['value'];
}
if ($lottery_config['enable'] && TIME_NOW > $lottery_config['end_date']) {
$q = mysqli_query($GLOBALS["___mysqli_ston"], 'SELECT t.user as uid, u.seedbonus, u.modcomment FROM tickets as t LEFT JOIN users as u ON u.id = t.user ORDER BY RAND() ') or sqlerr(__FILE__, __LINE__);
while ($a = mysqli_fetch_assoc($q)) {
$tickets[] = $a;
}
shuffle($tickets);
$lottery['winners'] = array();
$lottery['total_tickets'] = count($tickets);
for ($i = 0; $i < $lottery['total_tickets']; $i++) {
if (!isset($lottery['winners'][$tickets[$i]['uid']])) {
$lottery['winners'][$tickets[$i]['uid']] = $tickets[$i];
}
if ($lottery_config['total_winners'] == count($lottery['winners'])) {
break;
}
}
if ($lottery_config['use_prize_fund']) {
$lottery['total_pot'] = $lottery_config['prize_fund'];
} else {
$lottery['total_pot'] = $lottery['total_tickets'] * $lottery_config['ticket_amount'];
}
$lottery['user_pot'] = round($lottery['total_pot'] / $lottery_config['total_winners'], 2);
$msg['subject'] = sqlesc('You have won the lottery');
$msg['body'] = sqlesc('Congratulations, You have won : ' . $lottery['user_pot'] . '. This has been added to your seedbonus total amount. Thanks for playing Lottery.');
foreach ($lottery['winners'] as $winner) {
$_userq[] = '(' . $winner['uid'] . ',' . ($winner['seedbonus'] + $lottery['user_pot']) . ',' . sqlesc("User won the lottery: " . $lottery['user_pot'] . " at " . get_date(TIME_NOW, 'LONG') . "\n" . $winner['modcomment']) . ')';
$_pms[] = '(0,' . $winner['uid'] . ',' . $msg['subject'] . ',' . $msg['body'] . ',' . TIME_NOW . ')';
}
$lconfig_update = array('(\'enable\',0)', '(\'lottery_winners_time\',' . TIME_NOW . ')', '(\'lottery_winners_amount\',' . $lottery['user_pot'] . ')', '(\'lottery_winners\',\'' . join('|', array_keys($lottery['winners'])) . '\')');
if (count($_userq)) {
sql_query('INSERT INTO users(id,seedbonus,modcomment) VALUES ' . join(',', $_userq) . ' ON DUPLICATE KEY UPDATE seedbonus = values(seedbonus), modcomment = values(modcomment)') or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
}
if (count($_pms)) {
sql_query('INSERT INTO messages(sender, receiver, subject, msg, added) VALUES ' . join(',', $_pms)) or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
}
sql_query('INSERT INTO lottery_config(name,value) VALUES ' . join(',', $lconfig_update) . ' ON DUPLICATE KEY UPDATE value=values(value)') or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
sql_query('DELETE FROM tickets') or die(is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
}
//==End 09 seedbonus lottery by putyn
if ($queries > 0) {
write_log("Lottery clean-------------------- lottery Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:58,代码来源:lotteryclean.php
示例15: plugin_recent_convert
function plugin_recent_convert()
{
global $vars, $date_format, $_recent_plugin_frame, $show_passage;
static $exec_count = 1;
$recent_lines = PLUGIN_RECENT_DEFAULT_LINES;
if (func_num_args()) {
$args = func_get_args();
if (!is_numeric($args[0]) || isset($args[1])) {
return PLUGIN_RECENT_USAGE . '<br />';
} else {
$recent_lines = $args[0];
}
}
// Show only N times
if ($exec_count > PLUGIN_RECENT_EXEC_LIMIT) {
return '#recent(): You called me too much' . '<br />' . "\n";
} else {
++$exec_count;
}
if (!file_exists(PLUGIN_RECENT_CACHE)) {
return '#recent(): Cache file of RecentChanges not found' . '<br />';
}
// Get latest N changes
$lines = file_head(PLUGIN_RECENT_CACHE, $recent_lines);
if ($lines == FALSE) {
return '#recent(): File can not open' . '<br />' . "\n";
}
$script = get_script_uri();
$date = $items = '';
foreach ($lines as $line) {
list($time, $page) = explode("\t", rtrim($line));
$_date = get_date($date_format, $time);
if ($date != $_date) {
// End of the day
if ($date != '') {
$items .= '</ul>' . "\n";
}
// New day
$date = $_date;
$items .= '<strong>' . $date . '</strong>' . "\n" . '<ul class="recent_list">' . "\n";
}
$s_page = htmlsc($page);
if ($page == $vars['page']) {
// No need to link to the page you just read, or notify where you just read
$items .= ' <li>' . $s_page . '</li>' . "\n";
} else {
$r_page = rawurlencode($page);
$passage = $show_passage ? ' ' . get_passage($time) : '';
$items .= ' <li><a href="' . $script . '?' . $r_page . '"' . ' title="' . $s_page . $passage . '">' . $s_page . '</a></li>' . "\n";
}
}
// End of the day
if ($date != '') {
$items .= '</ul>' . "\n";
}
return sprintf($_recent_plugin_frame, count($lines), $items);
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:57,代码来源:recent.inc.php
示例16: resetInfo
function resetInfo($tid, $atcdb)
{
$reset = $this->db->get_one("SELECT * FROM pw_activity WHERE tid=" . S::sqlEscape($tid));
$reset['starttime'] = get_date($reset['starttime'], "Y-m-d H:i");
$reset['endtime'] = get_date($reset['endtime'], "Y-m-d H:i");
$reset['deadline'] = get_date($reset['deadline'], "Y-m-d H:i");
$reset['sel_' . $reset['sexneed']] = 'checked';
return $reset;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:9,代码来源:post_2.class.php
示例17: docleanup
function docleanup($data)
{
global $INSTALLER09, $queries, $mc1;
set_time_limit(1200);
ignore_user_abort(1);
// ===Clear funds on first day of the month
if (date("d") == 1) {
sql_query("TRUNCATE funds");
}
//if (mysqli_affected_rows() > 0)
$mc1->delete_value('totalfunds_');
// ===End
//== Donation Progress Mod Updated For Tbdev 2009/2010 by Bigjoos/pdq
$res = sql_query("SELECT id, modcomment, vipclass_before FROM users WHERE donor='yes' AND donoruntil < " . TIME_NOW . " AND donoruntil <> '0'") or sqlerr(__FILE__, __LINE__);
$msgs_buffer = $users_buffer = array();
if (mysqli_num_rows($res) > 0) {
$subject = "Donor status removed by system.";
$msg = "Your Donor status has timed out and has been auto-removed by the system, and your Vip status has been removed. We would like to thank you once again for your support to {$INSTALLER09['site_name']}. If you wish to re-new your donation, Visit the site paypal link. Cheers!\n";
while ($arr = mysqli_fetch_assoc($res)) {
$modcomment = $arr['modcomment'];
$modcomment = get_date(TIME_NOW, 'DATE', 1) . " - Donation status Automatically Removed By System.\n" . $modcomment;
$modcom = sqlesc($modcomment);
$msgs_buffer[] = '(0,' . $arr['id'] . ',' . TIME_NOW . ', ' . sqlesc($msg) . ',' . sqlesc($subject) . ')';
$users_buffer[] = '(' . $arr['id'] . ',' . $arr['vipclass_before'] . ',\'no\',\'0\', ' . $modcom . ')';
$update['class'] = $arr['vipclass_before'];
$mc1->begin_transaction('user' . $arr['id']);
$mc1->update_row(false, array('class' => $update['class'], 'donor' => 'no', 'donoruntil' => 0));
$mc1->commit_transaction($INSTALLER09['expires']['user_cache']);
$mc1->begin_transaction('user_stats_' . $arr['id']);
$mc1->update_row(false, array('modcomment' => $modcomment));
$mc1->commit_transaction($INSTALLER09['expires']['user_stats']);
$mc1->begin_transaction('MyUser_' . $arr['id']);
$mc1->update_row(false, array('class' => $update['class'], 'donor' => 'no', 'donoruntil' => 0));
$mc1->commit_transaction($INSTALLER09['expires']['curuser']);
$mc1->delete_value('inbox_new_' . $arr['id']);
$mc1->delete_value('inbox_new_sb_' . $arr['id']);
}
$count = count($users_buffer);
if ($count > 0) {
sql_query("INSERT INTO messages (sender,receiver,added,msg,subject) VALUES " . implode(', ', $msgs_buffer)) or sqlerr(__FILE__, __LINE__);
sql_query("INSERT INTO users (id, class, donor, donoruntil, modcomment) VALUES " . implode(', ', $users_buffer) . " ON DUPLICATE key UPDATE class=values(class),\n donor=values(donor),donoruntil=values(donoruntil),modcomment=concat(values(modcomment),modcomment)") or sqlerr(__FILE__, __LINE__);
write_log("Cleanup: Donation status expired - " . $count . " Member(s)");
}
unset($users_buffer, $msgs_buffer, $update, $count);
}
//===End===//
if ($queries > 0) {
write_log("Delete Old Funds Clean -------------------- Delete Old Funds cleanup Complete using {$queries} queries --------------------");
}
if (false !== mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
$data['clean_desc'] = mysqli_affected_rows($GLOBALS["___mysqli_ston"]) . " items deleted/updated";
}
if ($data['clean_log']) {
cleanup_log($data);
}
}
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:56,代码来源:funds_update.php
示例18: do_get_reply
function do_get_reply()
{
$this->id or exit("请选择要操作的评论");
$comment = iDB::row("SELECT * FROM `#iCMS@__comment` WHERE `id`='{$this->id}' LIMIT 1");
empty($comment) && exit('<div class="claerfix mb10"></div>评论已被删除');
echo nl2br($comment->content);
echo '<div class="claerfix mb10"></div>';
echo '<span class="label">' . get_date($comment->addtime, 'Y-m-d H:i:s') . '</span> ';
echo '<span class="label label-info"><i class="fa fa-thumbs-o-up"></i> ' . $comment->up . '</span>';
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:10,代码来源:comment.app.php
示例19: snatchtable_staff
function snatchtable_staff($res)
{
global $INSTALLER09, $lang, $CURUSER, $id;
$htmlout_snatch = '';
$count2 = 0;
// $htmlout_snatch .= "<tr><td class='one' align='right' valign='top'><b>{$lang['userdetails_snatched']}</b></td><td class='one'>";
$htmlout_snatch .= "<table border='1' cellspacing='0' cellpadding='5' align='center'><tr><td class='colhead' align='center'>{$lang['userdetails_s_cat']}</td><td class='colhead' align='left'>{$lang['userdetails_s_torr']}</td>" . "<td class='colhead' align='center'>{$lang['userdetails_s_sl']}</td><td class='colhead' align='center'>{$lang['userdetails_s_up']}" . ($INSTALLER09['ratio_free'] ? "" : "{$lang['userdetails_s_down']}") . "</td><td class='colhead' align='center'>{$lang['userdetails_s_tsize']}</td>" . "<td class='colhead' align='center'>{$lang['userdetails_ratio']}</td><td class='colhead' align='center'>{$lang['userdetails_client']}</td></tr>";
while ($arr = mysqli_fetch_assoc($res)) {
//=======change colors
$count2 = ++$count2 % 2;
$class = $count2 == 0 ? 'one' : 'two';
//=== speed color red fast green slow ;)
if ($arr["upspeed"] > 0) {
$ul_speed = $arr["upspeed"] > 0 ? mksize($arr["upspeed"]) : ($arr["seedtime"] > 0 ? mksize($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : mksize(0));
} else {
$ul_speed = mksize($arr["uploaded"] / ($arr['l_a'] - $arr['s'] + 1));
}
if ($arr["downspeed"] > 0) {
$dl_speed = $arr["downspeed"] > 0 ? mksize($arr["downspeed"]) : ($arr["leechtime"] > 0 ? mksize($arr["downloaded"] / $arr["leechtime"]) : mksize(0));
} else {
$dl_speed = mksize($arr["downloaded"] / ($arr['c'] - $arr['s'] + 1));
}
switch (true) {
case $dl_speed > 600:
$dlc = 'red';
break;
case $dl_speed > 300:
$dlc = 'orange';
break;
case $dl_speed > 200:
$dlc = 'yellow';
break;
case $dl_speed < 100:
$dlc = 'Chartreuse';
break;
}
if ($arr["downloaded"] > 0) {
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color='" . get_ratio_color($ratio) . "'><b>{$lang['userdetails_s_ratio']}</b><br />{$ratio}</font>";
} else {
if ($arr["uploaded"] > 0) {
$ratio = $lang['userdetails_inf'];
} else {
$ratio = "N/A";
}
}
if (XBT_TRACKER === false) {
$htmlout_snatch .= "<tr><td class='{$class}' align='center'>" . ($arr['owner'] == $id ? "<b><font color='orange'>{$lang['userdetails_s_towner']}</font></b><br />" : "" . ($arr['complete_date'] != '0' ? "<b><font color='lightgreen'>{$lang['userdetails_s_fin']}</font></b><br />" : "<b><font color='red'>{$lang['userdetails_s_nofin']}</font></b><br />") . "") . "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($arr['image']) . "' alt='" . htmlsafechars($arr['name']) . "' title='" . htmlsafechars($arr['name']) . "' /></td>" . "\n <td class='{$class}'><a class='altlink' href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['torrentid'] . "'><b>" . htmlsafechars($arr['torrent_name']) . "</b></a>" . ($arr['complete_date'] != '0' ? "<br /><font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['start_date'], 0, 1) . "</font><br />" : "<font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['start_date'], 0, 1) . "</font><br /><font color='orange'>{$lang['userdetails_s_laction']}" . get_date($arr['last_action'], 0, 1) . "</font>" . get_date($arr['complete_date'], 0, 1) . " " . ($arr['complete_date'] == '0' ? "" . ($arr['owner'] == $id ? "" : "[ " . mksize($arr["size"] - $arr["downloaded"]) . "{$lang['userdetails_s_still']}]") . "" : "") . "") . $lang['userdetails_s_finished'] . get_date($arr['complete_date'], 0, 1) . "" . ($arr['complete_date'] != '0' ? "<br /><font color='silver'>{$lang['userdetails_s_ttod']}" . ($arr['leechtime'] != '0' ? mkprettytime($arr['leechtime']) : mkprettytime($arr['c'] - $arr['s']) . "") . "</font> <font color='{$dlc}'>[ {$lang['userdetails_s_dled']} {$dl_speed} ]</font><br />" : "<br />") . "<font color='lightblue'>" . ($arr['seedtime'] != '0' ? $lang['userdetails_s_tseed'] . mkprettytime($arr['seedtime']) . " </font><font color='{$dlc}'> " : $lang['userdetails_s_tseedn']) . "</font><font color='lightgreen'> [ {$lang['userdetails_s_uspeed']} " . $ul_speed . " ] </font>" . ($arr['complete_date'] == '0' ? "<br /><font color='{$dlc}'>{$lang['userdeta
|
请发表评论