本文整理汇总了PHP中misc::getmicrotime方法的典型用法代码示例。如果您正苦于以下问题:PHP misc::getmicrotime方法的具体用法?PHP misc::getmicrotime怎么用?PHP misc::getmicrotime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类misc
的用法示例。
在下文中一共展示了misc::getmicrotime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
}
require_once $config['basepath'] . '/include/login.inc.php';
$login = new login();
if (isset($_GET['action']) && $_GET['action'] == 'log_out') {
$login->log_out();
}
if (!isset($_GET['action'])) {
$_GET['action'] = 'index';
}
if (strpos($_GET['action'], '://') !== false) {
$_GET['action'] = 'index';
}
// Add GetMicroTime Function
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$start_time = $misc->getmicrotime();
require_once $config['basepath'] . '/include/class/template/core.inc.php';
// NEW TEMPLATE SYSTEM
$page = new page_admin();
if (isset($_GET['popup']) && $_GET['popup'] != 'blank') {
$page->load_page($config['admin_template_path'] . '/popup.html');
} else {
$page->load_page($config['admin_template_path'] . '/main.html');
}
// Allow Addons/Functions to pass back custom jscript.
global $jscript, $jscript_last;
$jscript = '';
$jscript_last = '';
//Load Content
$page->auto_replace_tags('', true);
if ($_GET['action'] == 'edit_page') {
示例2: misc
function searchbox_render($browse_caption, $browse_field_name, $pclass, $searchbox_type)
{
// builds a searchbox for any given item you want
// to let users search by
global $conn, $config, $lang;
$display = '';
require_once $config['basepath'] . '/include/misc.inc.php';
$misc = new misc();
$time = $misc->getmicrotime();
$class_sql = '';
if (!empty($_GET['pclass'])) {
$pclass = $_GET['pclass'];
}
if (!empty($pclass)) {
//$classes = array();
//$classes = explode('|', $_GET['pclass']);
foreach ($pclass as $class) {
// Ignore non numberic values
if (is_numeric($class)) {
if (!empty($class_sql)) {
$class_sql .= ' OR ';
}
$class_sql .= $config['table_prefix_no_lang'] . "classlistingsdb.class_id = {$class}";
}
}
if (!empty($class_sql)) {
$class_sql = ' AND (' . $class_sql . ')';
}
}
//Lookup Field Type
$sql_browse_field_name = $misc->make_db_safe($browse_field_name);
$sql = "SELECT listingsformelements_field_type FROM " . $config['table_prefix'] . "listingsformelements WHERE listingsformelements_field_name = {$sql_browse_field_name}";
$rsStepLookup = $conn->Execute($sql);
if (!$rsStepLookup) {
$misc->log_error($sql);
}
$field_type = $rsStepLookup->fields['listingsformelements_field_type'];
unset($rsStepLookup);
$sortby = '';
$dateFormat = FALSE;
if ($field_type == 'date') {
$dateFormat = TRUE;
}
switch ($field_type) {
case 'decimal':
$sortby = 'ORDER BY listingsdbelements_field_value+0 ASC';
break;
case 'number':
global $db_type;
if ($db_type == 'mysql') {
$sortby = 'ORDER BY CAST(listingsdbelements_field_value as signed) ASC';
} else {
$sortby = 'ORDER BY CAST(listingsdbelements_field_value as int4) ASC';
}
break;
default:
$sortby = 'ORDER BY listingsdbelements_field_value ASC';
break;
}
if (!empty($class_sql)) {
if ($config['configured_show_count'] == 1) {
$sql = "SELECT listingsdbelements_field_value, count(listingsdbelements_field_value) AS num_type FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsdb," . $config['table_prefix_no_lang'] . "classlistingsdb WHERE listingsdbelements_field_name = '{$browse_field_name}' AND listingsdb_active = 'yes' AND listingsdbelements_field_value <> '' AND " . $config['table_prefix'] . "listingsdbelements.listingsdb_id = " . $config['table_prefix'] . "listingsdb.listingsdb_id AND " . $config['table_prefix'] . "listingsdb.listingsdb_id = " . $config['table_prefix_no_lang'] . "classlistingsdb.listingsdb_id {$class_sql}";
} else {
$sql = "SELECT listingsdbelements_field_value FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsdb," . $config['table_prefix_no_lang'] . "classlistingsdb WHERE listingsdbelements_field_name = '{$browse_field_name}' AND listingsdb_active = 'yes' AND listingsdbelements_field_value <> '' AND " . $config['table_prefix'] . "listingsdbelements.listingsdb_id = " . $config['table_prefix'] . "listingsdb.listingsdb_id AND " . $config['table_prefix'] . "listingsdb.listingsdb_id = " . $config['table_prefix_no_lang'] . "classlistingsdb.listingsdb_id {$class_sql}";
}
} else {
if ($config['configured_show_count'] == 1) {
$sql = "SELECT listingsdbelements_field_value, count(listingsdbelements_field_value) AS num_type FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsdb WHERE listingsdbelements_field_name = '{$browse_field_name}' AND listingsdb_active = 'yes' AND listingsdbelements_field_value <> '' AND " . $config['table_prefix'] . "listingsdbelements.listingsdb_id = " . $config['table_prefix'] . "listingsdb.listingsdb_id ";
} else {
$sql = "SELECT listingsdbelements_field_value FROM " . $config['table_prefix'] . "listingsdbelements, " . $config['table_prefix'] . "listingsdb WHERE listingsdbelements_field_name = '{$browse_field_name}' AND listingsdb_active = 'yes' AND listingsdbelements_field_value <> '' AND " . $config['table_prefix'] . "listingsdbelements.listingsdb_id = " . $config['table_prefix'] . "listingsdb.listingsdb_id ";
}
}
if ($config['use_expiration'] === "1") {
$sql .= " AND listingsdb_expiration > " . $conn->DBDate(time());
}
$sql .= "GROUP BY " . $config['table_prefix'] . "listingsdbelements.listingsdbelements_field_value {$sortby} ";
// echo $sql.'<br />';
$recordSet = $conn->Execute($sql);
if (!$recordSet) {
$misc->log_error($sql);
}
//Get Date Format Settins
if ($config['date_format'] == 1) {
$format = "m/d/Y";
} elseif ($config['date_format'] == 2) {
$format = "Y/d/m";
} elseif ($config['date_format'] == 3) {
$format = "d/m/Y";
}
switch ($searchbox_type) {
case 'ptext':
$display .= '<tr><td class="searchpage_field_caption">' . $browse_caption . '</td>';
$display .= '<td align="left"><input name="' . $browse_field_name . '[]" type="text"';
if (isset($_GET[$browse_field_name]) && $_GET[$browse_field_name] != '') {
$f = htmlspecialchars($_GET[$browse_field_name], ENT_COMPAT, $config['charset']);
$display .= 'value="' . $f . '"';
}
$display .= ' />';
$display .= '</td></tr>';
break;
//.........这里部分代码省略.........