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


PHP times函数代码示例

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


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

示例1: UpdateINI

function UpdateINI()
{
    global $db, $tablepre;
    $time = format_time(times());
    $ini = "; 字段信息配置文件\r\n; Created On {$time}\r\n\r\n";
    foreach (array(1 => 'USE', 2 => 'FEE', 3 => 'OUT') as $k => $v) {
        $ini .= "[{$v}]\r\n";
        $result = $db->getAll("SELECT * FROM `{$tablepre}cardini` WHERE pid='{$k}' AND disabled=0");
        foreach ($result as $r) {
            $ini .= $r['name'] . " = " . "\"" . $r['value'] . "\"\r\n";
        }
        $ini .= "\r\n";
    }
    @file_put_contents(ROOT_PATH . "data/detail.ini", $ini);
}
开发者ID:haseok86,项目名称:millkencode,代码行数:15,代码来源:cache.func.php

示例2: opendir

	// Check for recent beackups
	$dir = "./admin/backup/";
	$handle = opendir($dir);
	$highest = 0;
	while ($file = readdir($handle)) {
		if ($file != "." && $file != ".." && !is_dir($dir.$file)) {
			$nfo = pathinfo($dir.$file);
			if ($nfo['extension'] == 'zip' || $nfo['extension'] == 'sql') {
				$date = str_replace('.zip', '', $nfo['basename']);
				$date = str_replace('.sql', '', $date);
				$valid = preg_match('/(\d{1,2})_(\d{1,2})_(\d{2,4})-(\d{1,2})_(\d{1,2})_(\d{1,2})/', $date, $mktime);
				if ($valid == 0) {
					$diff = times(filemtime($dir.$file));
				}
				else {
					$diff = times(gmmktime($mktime[4], $mktime[5], $mktime[6], $mktime[2], $mktime[1], $mktime[3]));
				}
				if ($diff > $highest) {
					$highest = $diff;
				}
			}
		}
	}
	$days = 7;
	$besttime = time()-$days*24*60*60;
	if ($highest < $besttime) {
		$last = (time()-$highest)/(24*60*60);
		if ($highest == 0) {
			$x1 = $lang->phrase('admin_task_no_backup_found');
		}
		else {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:start.php

示例3: getAge

function getAge($bday)
{
    $now = times();
    if (gmdate("Y", $now) == $bday[0] && gmdate("m", $now) == $bday[1] && gmdate("d", $now) == $bday[2]) {
        $result = 0;
    } else {
        $result = gmdate("Y", $now) - $bday[0];
        if ($bday[1] > gmdate("m", $now)) {
            $result--;
        } elseif ($bday[1] == gmdate("m", $now)) {
            if ($bday[2] > gmdate("d", $now)) {
                $result--;
            }
        }
    }
    return $result;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:17,代码来源:function.global.php

示例4: gmdate

		  <td class="obox" colspan="4"><?php echo $lang->phrase('admin_member_moderate'); ?> &amp; <?php echo $lang->phrase('admin_member_unlock_members'); ?></td>
		</tr>
		<tr>
		  <td class="ubox" width="30%"><?php echo $lang->phrase('admin_member_username'); ?></td>
		  <td class="ubox" width="10%"><?php echo $lang->phrase('admin_member_mail'); ?></td>
		  <td class="ubox" width="15%"><?php echo $lang->phrase('admin_member_registered'); ?></td>
		  <td class="ubox" width="45%"><?php echo $lang->phrase('admin_member_status'); ?> (<input type="checkbox" onchange="check_all(this)" value="delete[]" /> <?php echo $lang->phrase('admin_member_all'); ?>`)</td>
		</tr>
	<?php
	while ($row = $gpc->prepare($db->fetch_object($result))) {
		$row->regdate = gmdate('d.m.Y', times($row->regdate));
		if ($row->lastvisit == 0) {
			$row->lastvisit = $lang->phrase('admin_member_never');
		}
		else {
			$row->lastvisit = gmdate('d.m.Y', times($row->lastvisit));
		}
		?>
		<tr>
		  <td class="mbox"><a title="<?php echo $lang->phrase('admin_member_edit'); ?>" href="admin.php?action=members&job=edit&id=<?php echo $row->id; ?>"><?php echo $row->name; ?></a></td>
		  <td class="mbox" align="center"><a href="mailto:<?php echo $row->mail; ?>"><?php echo $lang->phrase('admin_member_mail'); ?></a></td>
		  <td class="mbox"><?php echo $row->regdate; ?></td>
		  <td class="mbox"><ul>
		  <?php if ($row->confirm == '00' || $row->confirm == '01') { ?>
		  <li><strong><a href="admin.php?action=members&job=confirm&id=<?php echo $row->id; ?>"><?php echo $lang->phrase('admin_member_confirm_user'); ?></a></strong></li>
		  <?php } if ($row->confirm == '00' || $row->confirm == '10') { ?>
		  <li><?php echo $lang->phrase('admin_member_must_activate_via_mail'); ?> [<a href="admin.php?action=members&job=confirm2&id=<?php echo $row->id; ?>"><?php echo $lang->phrase('admin_member_activate_user_completely'); ?></a>]</li>
		  <?php } ?>
		  <li><?php echo $lang->phrase('admin_member_delete_user'); ?> <input type="checkbox" name="delete[]" value="<?php echo $row->id; ?>"></li>
		  </ul></td>
		</tr>
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:members.php

示例5: eval

         ($code = $plugins->load('showtopic_attachments_prepared')) ? eval($code) : null;
         if ($is_img == true) {
             $imagesize = getimagesize($uppath);
             $inner['image_box'] .= $tpl->parse("showtopic/image_box");
         } else {
             $inner['upload_box'] .= $tpl->parse("showtopic/upload_box");
         }
     }
 }
 $anz = 0;
 if (!empty($row->edit)) {
     $edits = explode("\n", $row->edit);
     $anz = count($edits);
     $anz--;
     $lastdata = explode("\t", $edits[$anz - 1]);
     $date = gmdate($lang->phrase('dformat1'), times($lastdata[1]));
     BBProfile($bbcode);
     $why = iif(empty($lastdata[2]), $lang->phrase('post_editinfo_na'), $bbcode->wordwrap($lastdata[2]));
 }
 // Ratings
 $showrating = false;
 $row->rating = 50;
 $ratingcounter = 0;
 if ($config['postrating'] == 1) {
     if (!isset($ratings[$row->id])) {
         $ratings[$row->id] = array();
     }
     if ($my->vlogin && $my->id != $row->mid && !isset($ratings[$row->id][$my->id])) {
         $showrating = true;
     }
     $ratingcounter = count($ratings[$row->id]);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:showtopic.php

示例6: numbers

    if (isset($row['posts'])) {
        $row['posts'] = numbers($row['posts']);
    }
    if (isset($row['birthday'])) {
        $bday = explode('-', $row['birthday']);
        if ($row['birthday'] != null && $row['birthday'] != '0000-00-00') {
            $row['birthday'] = iif($bday[0] > 0, $lang->phrase('members_bday_full'), $lang->phrase('members_bday_short'));
        } else {
            $row['birthday'] = $lang->phrase('members_na');
        }
    }
    if (!empty($row['pic']) && !file_exists($row['pic'])) {
        $row['pic'] = '';
    }
    if (isset($row['lastvisit'])) {
        $row['lastvisit'] = iif($row['lastvisit'] > 0, gmdate($lang->phrase('dformat1'), times($row['lastvisit'])), $lang->phrase('members_na'));
    }
    if (isset($row['online'])) {
        $row['lang_online'] = $lang->phrase('profile_' . iif($row['online'] == 1, 'online', 'offline'));
    }
    ($code = $plugins->load('members_prepare_bit')) ? eval($code) : null;
    $inner['index_bit'] .= $tpl->parse("members/index_bit");
}
($code = $plugins->load('members_prepared')) ? eval($code) : null;
$letter = $lang->phrase('members_all');
$row = array('letter' => '');
$inner['index_letter'] = $tpl->parse("members/index_letter");
$result = $db->query("SELECT DISTINCT UPPER(LEFT(name,1)) AS letter FROM {$db->pre}user ORDER BY letter", __LINE__, __FILE__);
while ($row = mysql_fetch_assoc($result)) {
    $letter =& $row['letter'];
    $inner['index_letter'] .= $tpl->parse("members/index_letter");
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:members.php

示例7: RFCDate

 /**
  * Returns the proper RFC 822 formatted date.
  * @access public
  * @return string
  * @static
  * Modified for Viscacha
  */
 public static function RFCDate()
 {
     global $config;
     // Global forum timezone to number
     $tz = round($config['timezone'], 2);
     // Get the prefix for the timezone
     $tzs = $tz < 0 ? "-" : "+";
     // Get the absolute value of the timezone (without prefix)
     $tz = abs($tz);
     // Get the timestamp according to rfc 822
     $tz = floor($tz) * 100 + ($tz - floor($tz)) * 60;
     // Put everything together
     $result = sprintf("%s %s%04d", gmdate("D, j M Y H:i:s", times(false, $config['timezone'])), $tzs, $tz);
     return $result;
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:22,代码来源:class.phpmailer.php

示例8: get_headboards

$prefix = '';
if ($info['prefix'] > 0) {
    if (isset($prefix_arr[$info['prefix']])) {
        $prefix = $prefix_arr[$info['prefix']]['value'];
        $prefix = $lang->phrase('showtopic_prefix_title');
    }
}
get_headboards($fc, $last);
$breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
$breadcrumb->Add($prefix . $info['topic'], 'showtopic.php?id=' . $info['topic_id'] . SID2URL_x);
$breadcrumb->Add($lang->phrase('edit'));
echo $tpl->parse("header");
if ($info['status'] != 0) {
    error($lang->phrase('topic_closed'), 'showtopic.php?action=jumpto&id=' . $info['topic_id'] . '&topic_id=' . $info['id']);
}
$diff = times() - $info['date'];
if ($config['edit_edit_time'] == 0) {
    $edit_seconds = $diff;
} else {
    $edit_seconds = $config['edit_edit_time'] * 60;
}
$delete_seconds = $config['edit_delete_time'] * 60;
if ($my->mp[4] == 1 && ($info['topic_id'] > 0 || $info['posts'] == 0)) {
    $del_mod = TRUE;
} else {
    $del_mod = FALSE;
}
if ($delete_seconds >= $diff && ($info['topic_id'] > 0 || $info['posts'] == 0)) {
    $del_user = TRUE;
} else {
    $del_user = FALSE;
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:edit.php

示例9: unset

    unset($archive);
    if ($del > 0) {
        $filesystem->unlink($file);
    }
    $filesystem->rmdirr($tempdir);
    $delobj = $scache->load('smileys');
    $delobj->delete();
    ok('admin.php?action=bbcodes&job=smileys', $lang->phrase('admin_bbc_successfully_imported'));
} elseif ($job == 'smileys_export') {
    $smileys = $gpc->get('id', arr_int);
    if (count($smileys) > 0) {
        $sqlwhere = " WHERE id IN (" . implode(',', $smileys) . ") ";
    } else {
        $sqlwhere = "";
    }
    $file = 'smileys_' . gmdate('Ymd', times()) . '.zip';
    $tempdir = "temp/";
    $smilieconfig = $config['smileypath'] . '/smileys.ini';
    $result = $db->query('SELECT `id`, `search`, `replace`, `desc` FROM `' . $db->pre . 'smileys` ' . $sqlwhere);
    $files = array();
    $filedata = array();
    while ($row = $db->fetch_assoc($result)) {
        $filepath = str_replace('{folder}', $config['smileypath'], $row['replace']);
        $filedata[$row['id']] = array('search' => $row['search'], 'replace' => $row['replace'], 'desc' => $row['desc']);
        if (!preg_match('~http(s)?:\\/\\/~i', $filepath)) {
            $files[] = $filepath;
        }
    }
    $myini = new INI();
    $myini->write($smilieconfig, $filedata);
    $files[] = $smilieconfig;
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:bbcodes.php

示例10: urldecode

" /></td>
   <td class="mbox"><input type="radio" name="new" value="<?php 
        echo urldecode($path . '/' . $hfile);
        ?>
" /></td>
  </tr>
  <?php 
    }
    ?>
  <tr>
   <td class="mbox"><?php 
    echo $lang->phrase('admin_design_current_default');
    ?>
</td>
   <td class="mbox"><?php 
    echo gmdate('d.m.Y H:i', times(filemtime($defpath . '/' . $file)));
    ?>
</td>
   <td class="mbox">
   <?php 
    echo iif($revert, '<a class="button" href="admin.php?action=designs&job=templates_file_revert&id=' . $id . '&dir=' . rawurlencode(iif(!empty($sub), $sub . '/')) . '&file=' . rawurldecode($file) . '&default=1">' . $lang->phrase('admin_design_revert') . '</a>', '&nbsp;');
    ?>
</td>
   <td class="mbox"><a class="button" href="admin.php?action=designs&job=templates_file_edit&id=<?php 
    echo $design['template'];
    ?>
&dir=<?php 
    echo rawurlencode(iif(!empty($sub), $sub . '/'));
    ?>
&file=<?php 
    echo rawurldecode($file);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:designs.php

示例11: while

   <td class="ubox" width="10%"><?php 
    echo $lang->phrase('admin_cms_doc_action');
    ?>
</td>
  </tr>
<?php 
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    while ($row = $db->fetch_assoc($result)) {
        if (is_id($row['author']) && isset($memberdata[$row['author']])) {
            $row['author'] = $memberdata[$row['author']];
        } else {
            $row['author'] = $lang->phrase('admin_cms_unknown');
        }
        if ($row['update'] > 0) {
            $row['update'] = gmdate('d.m.Y H:i', times($row['update']));
        } else {
            $row['update'] = $lang->phrase('admin_cms_unknown');
        }
        ?>
  <tr>
   <td class="mbox" width="5%"><input type="checkbox" name="delete[]" value="<?php 
        echo $row['id'];
        ?>
"></td>
   <td class="mbox" width="40%"><a href="admin.php?action=cms&job=doc_edit&id=<?php 
        echo $row['id'];
        ?>
"><?php 
        echo $row['title'];
        ?>
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:cms.php

示例12: foreach

                $useragent = $lang->phrase('admin_spider_not_specified');
            } else {
                $useragent = "<select style=\"width: 90%;\">";
                foreach ($useragents as $ua) {
                    $useragent .= "<option>" . htmlspecialchars($ua) . "</option>";
                }
                $useragent .= "</select> (" . count($useragents) . ")";
            }
            $last_visits = explode('|', $row['last_visit']);
            if (empty($last_visits[0])) {
                $last_visit = $lang->phrase('admin_spider_last_visit_never');
            } else {
                $last_visit = "<select>";
                $last_visits = array_reverse($last_visits);
                foreach ($last_visits as $visit) {
                    $last_visit .= "<option>" . gmdate("d.m.Y @ H:i:s", times($visit)) . "</option>";
                }
                $last_visit .= "</select>";
            }
            ?>
			<tr>
				<td class="mbox" width="25%"><?php 
            echo $row['name'];
            ?>
</td>
				<td class="mbox" width="20%" nowrap="nowrap"><?php 
            echo $useragent;
            ?>
</td>
				<td class="mbox" width="10%" align="center" nowrap="nowrap"><?php 
            echo $row['bot_visits'];
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:spider.php

示例13: LEFT

} else {
    $_GET['order'] = 'ASC';
}
if ($_GET['sort'] == 'regdate' || $_GET['sort'] == 'location') {
    $sort = $_GET['sort'];
} else {
    $sort = 'name';
}
if (strlen($_GET['letter']) == 1) {
    $where = ' WHERE LEFT(name,1) = "' . $_GET['letter'] . '"';
} else {
    $where = '';
}
$start = $_GET['page'] * $config['mlistenzahl'];
$start = $start - $config['mlistenzahl'];
$result = $db->query('SELECT id,name,mail,hp,location,fullname,regdate FROM ' . $db->pre . 'user' . $where . ' ORDER BY ' . $sort . ' ' . $_GET['order'] . ' LIMIT ' . $start . ',' . $config['mlistenzahl'], __LINE__, __FILE__);
if ($db->num_rows() == 0) {
    error($lang->phrase('query_string_error'), 'members.php' . SID2URL_1);
}
$inner['index_bit'] = '';
while ($row = $gpc->prepare($db->fetch_object($result))) {
    $row->regdate = gmdate($lang->phrase('dformat2'), times($row->regdate));
    $inner['index_bit'] .= $tpl->parse("members/index_bit");
}
echo $tpl->parse("members/index");
$mymodules->load('members_bottom');
$slog->updatelogged();
$zeitmessung = t2();
echo $tpl->parse("footer");
$phpdoc->Out();
$db->close();
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:members.php

示例14: BoardSelect


//.........这里部分代码省略.........
                $forum['id2'] = $forum['id'];
            }
            $id = array_search(trim($forum['lname']), $memberdata);
            if (is_id($id)) {
                $forum['lname'] = array($forum['lname'], $id);
            } else {
                $forum['lname'] = array($forum['lname'], 0);
            }
            if ($forum['btopic_id']) {
                $forum['tid'] = $forum['btopic_id'];
            } else {
                $forum['tid'] = $forum['last_topic'];
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] == 1) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['topics'] = '-';
                    $forum['replys'] = '-';
                    $forum['btopic'] = false;
                } else {
                    if (isset($my->mark['f'][$forum['id']]) && $my->mark['f'][$forum['id']] > $forum['bdate'] || $forum['bdate'] < $my->clv || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['new'] = true;
                    }
                    if ($forum['btopic']) {
                        if (strxlen($forum['btopic']) >= 40) {
                            $forum['btopic'] = substr($forum['btopic'], 0, 40);
                            $forum['btopic'] .= "...";
                        }
                        $forum['bdate'] = str_date($lang->phrase('dformat1'), times($forum['bdate']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replys'] = numbers($forum['replys']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] == 1) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                }
                            } else {
                                if (isset($my->mark['f'][$sub_cache[$forum['id']][$i]['id']]) && $my->mark['f'][$sub_cache[$forum['id']][$i]['id']] > $sub_cache[$forum['id']][$i]['bdate'] || $sub_cache[$forum['id']][$i]['bdate'] < $my->clv || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $forums[] = $forum;
            }
        }
        if (count($forums) > 0) {
            $tpl->globalvars(compact("cat", "forums"));
            ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
            echo $tpl->parse("categories");
        }
    }
    return $found;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:101,代码来源:function.viscacha_frontend.php

示例15: iif

        	<span class="stext">
        		<a target="_blank" href="showtopic.php?id=<?php 
            echo $row->id;
            ?>
"><?php 
            echo iif($showprefix, '[' . $prefix . '] ') . $row->topic;
            ?>
</a><br />
        		<?php 
            echo $row->forumname;
            ?>
        	</span>
        </td>
        <td>
        	<?php 
            echo gmdate('d.m.Y H:i', times($row->date));
            ?>
<br />
        	<?php 
            echo iif($row->mid, "<a href='admin.php?action=members&amp;job=edit&amp;id=" . $row->mid . "'>" . $row->name . "</a>", $row->name);
            ?>
        </td>
        <td align="center"><textarea cols="30" rows="3" style="width: 99%;"><?php 
            echo $row->report;
            ?>
</textarea></td>
        </tr>
		<?php 
        }
        ?>
  <tr>
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:posts.php


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