• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP times函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: str_date

     $prefix = $prefix_arr[$row->prefix]['value'];
     $showprefix = true;
 } else {
     $prefix = '';
 }
 if (is_id($row->name) && isset($memberdata[$row->name])) {
     $row->mid = $row->name;
     $row->name = $memberdata[$row->name];
 } else {
     $row->mid = FALSE;
 }
 if (is_id($row->last_name) && isset($memberdata[$row->last_name])) {
     $row->last_name = $memberdata[$row->last_name];
 }
 $rstart = str_date('d.m.Y H:i', times($row->date));
 $rlast = str_date('d.m.Y H:i', times($row->last));
 if ($row->status == '2') {
     $pref .= $lang->phrase('forum_moved');
 } else {
     if (empty($row->mark) && !empty($info['auto_status'])) {
         $row->mark = $info['auto_status'];
     }
     if ($row->mark == 'n') {
         $pref .= 'News: ';
     } elseif ($row->mark == 'a') {
         $pref .= 'Artcle: ';
     } elseif ($row->mark == 'b') {
         $pref .= 'Bad: ';
     } elseif ($row->mark == 'g') {
         $pref .= 'Good: ';
     }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:posts.php


示例17: str_date

        $row['name'] = $row['gname'];
        $row['mid'] = 0;
        $row['groups'] = GROUP_GUEST;
    }
    $row['date'] = str_date($lang->phrase('dformat1'), times($row['date']));
    $edit = array();
    if (!empty($row['edit'])) {
        $edits = explode("\n", $row['edit']);
        $i = 0;
        foreach ($edits as $e) {
            $e = trim($e);
            if (empty($e)) {
                continue;
            }
            $data = explode("\t", $e);
            $edit[$i] = array('date' => str_date($lang->phrase('dformat1'), times($data[1])), 'reason' => @iif(empty($data[2]), $lang->phrase('post_editinfo_na'), $data[2]), 'name' => $data[0], 'ip' => @iif(isset($data[3]), $data[3]));
            ($code = $plugins->load('popup_edithistory_entry_prepared')) ? eval($code) : null;
            $i++;
        }
    }
    ($code = $plugins->load('popup_edithistory_prepared')) ? eval($code) : null;
    echo $tpl->parse("popup/edithistory");
    ($code = $plugins->load('popup_edithistory_end')) ? eval($code) : null;
} elseif ($_GET['action'] == "postrating") {
    $rtg = $gpc->get('rating', int);
    ($code = $plugins->load('popup_postrating_start')) ? eval($code) : null;
    if ($my->vlogin) {
        $result = $db->query("SELECT * FROM {$db->pre}replies WHERE id = '{$_GET['id']}'", __LINE__, __FILE__);
        $post = $db->fetch_assoc($result);
        if ($post['name'] == $my->id) {
            $error = $lang->phrase('postrating_you_posted');
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:popup.php


示例18: setlang

 function setlang($l1, $l2)
 {
     global $my;
     if (!$my->vlogin) {
         $my->name = $l1;
     }
     if (date('I', times()) == 1) {
         $my->timezonestr .= $l2;
     }
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:10,代码来源:class.permissions.php


示例19: banish

/**
 * Bans a user.
 *
 * After calling the function exit() is called and script ends.
 * Connection to database is closed. Template 'banned' will be shown.
 * This is not shown in the AdminCP!
 */
function banish($reason = null, $until = null) {
	global $config, $db, $phpdoc, $lang, $plugins, $tpl, $my, $breadcrumb;

	if (substr($reason, 0, 6) == 'lang->') {
		$key = substr($reason, 6);
		$reason = $lang->phrase($key);
	}
	if ($reason == null) {
		$reason = $lang->phrase('banned_no_reason');
	}
	else {
		$reason = htmlspecialchars($reason);
	}
	if ($until > 0) {
		$until = gmdate($lang->phrase('dformat1'), times($until));
	}
	else {
		$until = $lang->phrase('banned_left_never');
	}

	($code = $plugins->load('permissions_banish')) ? eval($code) : null;

	$tpl->globalvars(compact('reason', 'until'));
	echo $tpl->parse("banned");

	$phpdoc->Out();
	$db->close();
	exit();
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:36,代码来源:class.permissions.php


示例20: showContent

 function showContent($print = true)
 {
     global $lang;
     $dir_list = $file_list = $subdir_size_list = array();
     $total_dir_size = 0;
     if (($dir_handle = opendir($this->path)) === false) {
         error('admin.php?action=explorer', $lang->phrase('admin_explorer_could_not_open_dir') . realpath($this->path));
     }
     while (($file = @readdir($dir_handle)) !== false) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         if (is_dir($this->path . $file)) {
             $dir_list[] = $file;
             if ($this->show_subfolders_size) {
                 $stack = array($this->path . $file . '/');
                 $size = 0;
                 while (count($stack) > 0) {
                     $subdir = array_shift($stack);
                     $subdir_handle = @opendir($subdir);
                     while (($subdir_file = @readdir($subdir_handle)) !== false) {
                         if ($subdir_file == '.' || $subdir_file == '..') {
                             continue;
                         }
                         if ($this->show_subfolders_size) {
                             if (is_dir($subdir . $subdir_file)) {
                                 array_push($stack, $subdir . $subdir_file . '/');
                             }
                         }
                         $size += @filesize($subdir . $subdir_file);
                     }
                     @closedir($subdir_handle);
                 }
                 $subdir_size_list[$file] = $size;
                 $total_dir_size += $size;
             }
         } else {
             $file_list[] = $file;
             $total_dir_size += @filesize($this->path . $file);
         }
     }
     @closedir($dir_handle);
     natcasesort($dir_list);
     natcasesort($file_list);
     $total_files = count($dir_list) + count($file_list);
     $total_size = $this->formatSize($total_dir_size);
     $print_spacer = count($file_list) > 0 && count($dir_list) > 0 ? true : false;
     $page_link = $this->realPath(dirname($this->script_file) . '/' . $this->path);
     $rp = realpath($this->path);
     $root = extract_dir($this->root);
     $rp = str_replace($root, '', $rp);
     $heading_path = $this->realPath($rp);
     $heading_path_parts = explode("/", $heading_path);
     $levels = count($heading_path_parts) - 2;
     for ($heading_path = ""; $levels > -1; $levels--) {
         for ($i = 0, $path = ""; $i < $levels; $i++) {
             $path .= "../";
         }
         $link = '&amp;path=' . urlencode($this->realPath($this->path . $path));
         $heading_path .= '<a href="' . $this->script_file . $link . '">' . array_shift($heading_path_parts) . '</a>' . DIRECTORY_SEPARATOR;
     }
     $newdir = $this->script_file . '&amp;path=' . urlencode(str_replace('/\\', '/', $this->path));
     $newdir_html = '<span style="float: right;"><a class="button" href="' . $newdir . '&job=newdir">' . $lang->phrase('admin_explorer_create_new_directory') . '</a></span>';
     $html = '	   <table cellpadding="4" cellspacing="0" class="border">';
     $html .= "\n" . '		 <tr>';
     $html .= "\n" . '		   <td class="obox"><span style="float: right;"><a class="button" href="admin.php?action=explorer&amp;job=all_chmod">' . $lang->phrase('admin_explorer_check_chmod') . '</a></span>' . iif(count($dir_list) == 0, $newdir_html) . $lang->phrase('admin_explorer_filemanager') . '</td>';
     $html .= "\n" . '		 </tr>';
     $html .= "\n" . '		 <tr>';
     $html .= "\n" . '		   <td class="ubox">' . $lang->phrase('admin_explorer_directory_x') . extract_dir($this->root) . $heading_path . '</td>';
     $html .= "\n" . '		 </tr>';
     $html .= "\n" . '	   </table><br />';
     $html .= "\n" . '	   <table cellpadding="4" cellspacing="0" class="border">';
     if (count($dir_list) > 0) {
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="obox" colspan="5">' . $newdir_html . $lang->phrase('admin_explorer_directories') . '</td>';
         $html .= "\n" . '		 </tr>';
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="ubox" width="30%">' . $lang->phrase('admin_explorer_directory') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="9%">' . $lang->phrase('admin_explorer_size') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="20%">' . $lang->phrase('admin_explorer_created_on') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="8%">' . $lang->phrase('admin_explorer_chmod') . '</td>';
         $html .= "\n" . '		   <td class="ubox" width="33%">' . $lang->phrase('admin_explorer_action') . '</td>';
         $html .= "\n" . '		 </tr>';
     }
     while (($dir = array_shift($dir_list)) !== NULL) {
         $path_url = '&amp;path=' . urlencode(str_replace('/\\', '/', $this->path) . $dir . '/');
         $link = $this->script_file . $path_url;
         $size = $this->show_subfolders_size ? $this->formatSize($subdir_size_list[$dir]) : "&nbsp;";
         $chmod = get_chmod($this->path . $dir);
         $icon = $this->icons('directory');
         $html .= "\n" . '		 <tr>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 <a href="' . $link . '" target="Main">' . $icon . $dir . '</a>';
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox" align="right">';
         $html .= "\n" . '			 ' . $size;
         $html .= "\n" . '		   </td>';
         $html .= "\n" . '		   <td class="mbox">';
         $html .= "\n" . '			 ' . gmdate("d.m.y, H:i", times(filectime($this->path . $dir)));
         $html .= "\n" . '		   </td>';
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:101,代码来源:class.servernavigator.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP timespan函数代码示例发布时间:2022-05-23
下一篇:
PHP timer_stop函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap