本文整理汇总了PHP中get_date函数的典型用法代码示例。如果您正苦于以下问题:PHP get_date函数的具体用法?PHP get_date怎么用?PHP get_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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";
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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');
}
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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];
}
示例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;
}
示例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);
}
}
示例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);
}