Exemplo n.º 1
0
$check_file_url = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '1';
//if(strstr($check_file_url,"admin") || strstr($check_file_url,"manage")) die("为了保证你后台的安全,请更改管理后台文件夹(默认为admin的目录)名称后再登陆,新目录名不能包含 admin 和 manage 这两个敏感单词");
$time_start = helper::getmicrotime();
//开始时间
/**
 * 页面动作 model 分支选择
 *     动作函数写在文件末尾,全部以前缀 m__ 开头
 */
$_GET['m'] = isset($_GET['m']) ? $_GET['m'] : 'list';
/*初始化对象*/
$a_obj = new Admin();
$l_obj = new Logs();
if (function_exists("m__" . $_GET['m'])) {
    call_user_func("m__" . $_GET['m']);
}
$time_end = helper::getmicrotime();
//主程序执行时间,如果要包含模板的输出时间,则可以调用该静态时间方法单独计算
$page['data_fill_time'] = $time_end - $time_start;
//执行时间
/**
 * 模板载入选择
 *     模板页面为PHP+HTML混合编写,如果模板页面中也有区块函数,模板函数以 tpl__ 为前缀
 */
//判断终端,然后选择需要的模板
$template = "pc";
//自动判断是否为手机端,不是都到pc端
$template = helper::from_mobile() ? 'wap' : 'pc';
$tpl_filename = str_replace('\\', '', str_replace(dirname(__FILE__), '', __FILE__));
$tpl_filename = str_replace('/', '', $tpl_filename);
require dirname(__FILE__) . '/' . $template . '/tpl_' . $tpl_filename;
function m__login()
Exemplo n.º 2
0
<?php

define('CRANE_CMS', true);
require_once dirname(__FILE__) . "/core/init.php";
$time_start = helper::getmicrotime();
//开始时间
$dbm = new db_mysql();
//数据库类实例
$c = new common($dbm);
// 动作函数
$_GET['m'] = isset($_GET['m']) ? $_GET['m'] : '';
if (function_exists("m__" . $_GET['m'])) {
    call_user_func("m__" . $_GET['m']);
}
/**
 * 
 */
/*生成验证码
*/
function m__vcode()
{
    require_once dirname(__FILE__) . "/core/imgcode.class.php";
    $name = !isset($_GET['c']) || $_GET['c'] == '' ? 'login' : $_GET['c'];
    $w = !isset($_GET['w']) || $_GET['w'] == '' ? '60' : $_GET['w'];
    $h = !isset($_GET['h']) || $_GET['h'] == '' ? '24' : $_GET['h'];
    if ($name == 'login' || $name == 'reg' || $name == 'feedback' || $name == 'tougao') {
        Image::buildImageVerify(5, 2, 'png', $w, $h, $name);
    }
}
Exemplo n.º 3
0
 /**
  * 执行更新、删除操作
  */
 public function query_update($sql)
 {
     $_start = helper::getmicrotime();
     mysql_query($sql);
     $this->query_count++;
     $querys = array('sql' => $sql, 'error' => mysql_error(), 'sql_time' => helper::getmicrotime() - $_start);
     if (defined('SQL_ERR_LOG') && SQL_ERR_LOG == '1' && $querys['error'] != '') {
         helper::logs('sql_error', $querys['error'] . $querys['sql']);
     }
     if (defined('SQL_LOG') && SQL_LOG == '1') {
         helper::logs('sql', $querys['sql']);
     }
     return $querys;
 }
Exemplo n.º 4
0
                <br>
                <?php 
$i = 0;
foreach ($c->categories as $k => $v) {
    if ($v['parent_id'] == 0) {
        if ($i > 0) {
            echo ' - ';
        }
        echo '<a href="' . $v['surl'] . '">' . $v['cname'] . '</a>';
        $i++;
    }
}
?>
<br/>
                <?php 
echo 'Processed in ' . number_format(helper::getmicrotime() - $time_start, 2, '.', '') . ' MilliSeconds ';
?>
&nbsp;&nbsp;<?php 
if (defined('COUNT_CODE')) {
    echo html_entity_decode(COUNT_CODE);
}
?>
            </div>
        </div>
    </div>
    <?php 
require_once dirname(__FILE__) . "/../../../plugins/gov.qqservice/qqservice_html.php";
?>
    <?php 
$msg_show_opacty = 1;
//是否半透明层:1为半透明层显示,0为直接显示,半透明层显示需要调用 show_message() JS函数
Exemplo n.º 5
0
 /**
  * 执行更新、删除操作
  */
 public function query_update($sql)
 {
     $_start = helper::getmicrotime();
     mysql_query($sql);
     $this->query_count++;
     $querys = array('sql' => $sql, 'error' => mysql_error(), 'sql_time' => helper::getmicrotime() - $_start);
     return $querys;
 }
Exemplo n.º 6
0
<!-- 底部版权开始 -->
<div class="mbody mfoot" style="clear:both;"> 
    <div class="l">
        &copy; 2013 &nbsp;&nbsp;掌易科技
    </div>
    <div class="r">
        <?php 
echo 'Processed in ' . number_format(helper::getmicrotime() - $time_start, 2, '.', '') . ' MilliSecond ' . $dbm->query_count . ' Queries ';
?>
&nbsp;&nbsp;
    </div>
</div> <!-- 底部版权结束 -->
<!-- 编辑密码,全部页面公用 -->
<div id="edit_my_pass" style="display:none;">
    <table class="tb3">
        <tr><td>旧 密 码:</td><td><input type="password" id="upassnew" class="ipt" value="" style="width:200px;"></td><td>&nbsp;<span id="upass_tips"></span></td></tr>
        <tr><td>新 密 码:</td><td><input type="password" id="new_upass" class="ipt" value="" style="width:200px;"></td><td>&nbsp;<span id="upass_tips"></span></td></tr>
        <tr><td>确认密码:</td><td><input type="password" id="re_upass" class="ipt" value="" style="width:200px;"></td><td>&nbsp;<span id="upass_tips"></span></td></tr>
        <tr><td></td><td colspan="2"><a href="javascript:void(0);" id="btn_edit_pass" onClick="edit_my_pass();" class="but2">修改密码</a>&nbsp;&nbsp;<span class="div_alert"></span></td></tr>
    </table>
</div>