本文整理汇总了PHP中front类的典型用法代码示例。如果您正苦于以下问题:PHP front类的具体用法?PHP front怎么用?PHP front使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了front类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vaild
function vaild() {
if (!front::post('name')) {
front::flash('请填写名称!');
return false;
}
return true;
}
示例2: check_mytable
private function check_mytable() {
if(!preg_match('/^my_.+/',front::post('name'))) {
front::flash('表名格式必须是是"my_abc"!');
return false;
}
return true;
}
示例3: respond
function respond() {
ini_set("display_errors","On");
$where = array('ologin_code'=>front::$get['ologin_code']);
$ologins = ologin::getInstance()->getrows($where);
$ologin = unserialize_config($ologins[0]['ologin_config']);
//var_dump($ologin);
$aliapy_config['partner'] = $ologin['alipaylogin_id'];
$aliapy_config['key'] = $ologin['alipaylogin_key'];
$aliapy_config['return_url'] = ologin::url(basename(__FILE__,'.php'));
$aliapy_config['sign_type'] = 'MD5';
$aliapy_config['input_charset']= 'utf-8';
$aliapy_config['transport'] = 'http';
$aliapy_config['cacert'] = getcwd().'/lib/plugins/alipayauth/cacert.pem';
//var_dump($aliapy_config);
unset($_GET['case']);unset($_GET['act']);unset($_GET['ologin_code']);unset($_GET['site']);
require_once("alipayauth/alipay_notify.class.php");
$alipayNotify = new AlipayNotify($aliapy_config);
//var_dump($alipayNotify);
$verify_result = $alipayNotify->verifyReturn();
//var_dump($verify_result);
if($verify_result) {//验证成功
$user_id = front::$get['user_id'];
$token = front::$get['token'];
session::set('access_token',$token);
session::set("openid",$user_id);
return array('nickname'=> front::get('real_name'));
}
else {
echo "验证失败";exit;
}
}
示例4: manage_action
function manage_action() {
if(!config::get('sms_username') || !config::get('sms_password')){
echo '<script>alert("您需要先设置用户名和密码才能使用短信管理功能!");window.location.href="'.url('config/system/set/sms').'";</script>';
exit;
}
include_once("phprpc/phprpc_client.php");
$client = new PHPRPC_Client();
$client->setProxy(NULL);
$client->useService('http://pay.cmseasy.cn/sms.php');
$client->setKeyLength(128);
$client->setEncryptMode(3);
$info = $client->getInfo(config::get('sms_username'),md5(config::get('sms_password')));
$info[0] = intval($info[0]);
$info[1] = intval($info[1]);
$this->view->info = $info;
if (front::post('submit')) {
if (front::post('act') == 'test') {
$rs = sendMsg(front::post('mobile'),'test');
if($rs->SendSMSResult == '0'){
front::flash('发送成功');
}else{
front::flash('发送失败,请检查用户名、密码或剩余条数');
}
}
}else{
if($info[0] < 50) front::flash('你的剩余短信不足50条,请及时充值');
}
}
示例5: savewysiwygAction
public function savewysiwygAction()
{
$db = front::og('db');
$alias = front::$_req['alias'];
// проверяем права (могут быть разные для разных страниц)
switch ($alias) {
default:
$permission = null;
}
if (!$permission || !hasPermissions($permission)) {
return;
}
$text = front::$_req['form']['n_text'];
$text = iconv('UTF-8', 'CP1251', $text);
$text = __paramValue('ckedit', $text);
$title = front::$_req['form']['title'];
$title = iconv('UTF-8', 'CP1251', $title);
$title = __paramValue('string', $title);
$save = array('title' => $title, 'n_text' => $text);
if ($alias) {
$aff = $db->update('UPDATE static_pages SET ?s WHERE (alias = ?)', $save, $alias);
if (!$aff) {
$save['alias'] = $alias;
$db->insert('static_pages', $save, false);
}
}
echo json_encode(array('success' => true, 'alias' => $alias));
}
示例6: getjs_action
function getjs_action() {
$lang=include ROOT.'/lang/'.config::get('lang_type').'/system.php';
$id=front::get('id');
if(preg_match('/select/i',$id)){
exit('非法参数');
}
$ballot=new ballot();
$option=new option();
$where=array('id'=>$id);
$arr=$ballot->getrow($where);
$row=$option->getrows(array('bid'=>$id),null,'num desc');
$this->view->arr=$arr;
$this->view->row=$row;
$this->view->lang=$lang;
/*$html='document.write(\'<form name="form1" method="post" action="'.url("ballot").'">\');';
$html .= 'document.write(\'<input type="hidden" name="bid" id="bid" value="'.$arr['id'].'" />\');';
$html .= 'document.write(\'<h5>\');';
$html .= 'document.write(\''.$arr['title']."</h5>');";
foreach ($row as $option) {
if ($arr['type'] == 'radio') {
$html .= 'document.write(\'<input type="radio" name="ballot" id="ballot" value="'.$option['id'].'" />\');';
}
else {
$html .= 'document.write(\'<input type="checkbox" name="ballot[]" id="ballot" value="'.$option['id'].'" />\');';
}
$html .= 'document.write(\' '.$option['name'].' ('.$option['num'].')<br>\');';
}
$html .= 'document.write(\'<input type="submit" name="submit" id="button" value=" '.$lang['vote'].'" /></form>\');';
echo $html;*/
}
示例7: getlistAction
function getlistAction()
{
$data[] = array("title" => "Контроллеры", "_is_leaf" => false, "testable" => false, "_parent" => null, "_id" => "1");
$data = $this->readMap(front::$map, $data);
$data[] = array("title" => "Модели", "_is_leaf" => false, "_parent" => null, "_id" => "2");
$dir = opendir(ROOT_DIR . "engine/models/");
while ($file = readdir($dir)) {
if ($file != "." && $file != ".." && $file != ".svn") {
$testable = true;
$class_name = array_shift(explode(".", $file));
$test_path = "tests/models/" . $class_name . ".model.test.php";
if (!file_exists(ROOT_DIR . "engine/" . $test_path)) {
$test_path = "<b>Нет " . $test_path . "</b>";
$testable = false;
}
$data[] = array("title" => $file, "path" => $test_path . "<i> для " . $file . "</i>", "testable" => $testable, "result" => $testable ? 0 : 4, "run_path" => "tests/models/" . $class_name . ".model.test.php", "_is_leaf" => true, "_parent" => "2", "_id" => "3:" . $class_name);
}
}
closedir($dir);
$data[] = array("title" => "Другие", "_is_leaf" => false, "_parent" => null, "_id" => "3");
$dir = opendir(ROOT_DIR . "engine/tests/");
while ($file = readdir($dir)) {
if ($file != "." && $file != ".." && is_file(ROOT_DIR . "engine/tests/" . $file)) {
$testable = true;
$data[] = array("title" => $file, "path" => $file, "testable" => $testable, "result" => $testable ? 0 : 4, "run_path" => "tests/" . $file, "_is_leaf" => true, "_parent" => "3", "_id" => "4:" . $file);
}
}
closedir($dir);
$data = front::toUtf($data);
echo json_encode(array("data" => $data));
}
示例8: getlistAction
public function getlistAction()
{
$data[] = array('title' => 'Контроллеры', '_is_leaf' => false, 'testable' => false, '_parent' => null, '_id' => '1');
$data = $this->readMap(front::$map, $data);
$data[] = array('title' => 'Модели', '_is_leaf' => false, '_parent' => null, '_id' => '2');
$dir = opendir(ROOT_DIR . 'engine/models/');
while ($file = readdir($dir)) {
if ($file != '.' && $file != '..' && $file != '.svn') {
$testable = true;
$class_name = array_shift(explode('.', $file));
$test_path = 'tests/models/' . $class_name . '.model.test.php';
if (!file_exists(ROOT_DIR . 'engine/' . $test_path)) {
$test_path = '<b>Нет ' . $test_path . '</b>';
$testable = false;
}
$data[] = array('title' => $file, 'path' => $test_path . '<i> для ' . $file . '</i>', 'testable' => $testable, 'result' => $testable ? 0 : 4, 'run_path' => 'tests/models/' . $class_name . '.model.test.php', '_is_leaf' => true, '_parent' => '2', '_id' => '3:' . $class_name);
}
}
closedir($dir);
$data[] = array('title' => 'Другие', '_is_leaf' => false, '_parent' => null, '_id' => '3');
$dir = opendir(ROOT_DIR . 'engine/tests/');
while ($file = readdir($dir)) {
if ($file != '.' && $file != '..' && is_file(ROOT_DIR . 'engine/tests/' . $file)) {
$testable = true;
$data[] = array('title' => $file, 'path' => $file, 'testable' => $testable, 'result' => $testable ? 0 : 4, 'run_path' => 'tests/' . $file, '_is_leaf' => true, '_parent' => '3', '_id' => '4:' . $file);
}
}
closedir($dir);
$data = front::toUtf($data);
echo json_encode(array('data' => $data));
}
示例9: show_action
function show_action() {
$this->view->page=front::get('page')?front::get('page'):1;
$this->pagesize=config::get('list_pagesize');
$limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize;
$special=new special();
$this->view->special=$special->getrow('spid='.front::get('spid'));
$this->view->archive['title'] = $this->view->special['title'];
$this->view->pages=true;
$archive=new archive();
$archives=$archive->getrows('spid='.front::get('spid'),$limit);
foreach($archives as $order=>$arc) {
$archives[$order]['url']=archive::url($arc);
$archives[$order]['catname']=category::name($arc['catid']);
$archives[$order]['caturl']=category::url($arc['catid']);
$archives[$order]['adddate']= sdate($arc['adddate']);
$archives[$order]['stitle']= strip_tags($arc['title']);
}
$this->view->archives=$archives;
$this->view->record_count=$archive->rec_count('spid='.front::get('spid'));
front::$record_count=$this->view->record_count;
$this->view->spid=front::get('spid');
if (front::get('t') == 'wap') {
$this->out('wap/special_show.html');
return;
}
}
示例10: savewysiwygAction
function savewysiwygAction()
{
$db = front::og("db");
$alias = front::$_req["alias"];
// проверяем права (могут быть разные для разных страниц)
switch ($alias) {
default:
$permission = null;
}
if (!$permission || !hasPermissions($permission)) {
return;
}
$text = front::$_req["form"]["n_text"];
$text = iconv('UTF-8', 'CP1251', $text);
$text = __paramValue('ckedit', $text);
$title = front::$_req["form"]["title"];
$title = iconv('UTF-8', 'CP1251', $title);
$title = __paramValue('string', $title);
$save = array("title" => $title, "n_text" => $text);
if ($alias) {
$aff = $db->update("UPDATE static_pages SET ?s WHERE (alias = ?)", $save, $alias);
if (!$aff) {
$save["alias"] = $alias;
$db->insert("static_pages", $save, false);
}
}
echo json_encode(array("success" => true, "alias" => $alias));
}
示例11: add_before
function add_before(act $act) {
front::$post['userid']=$act->view->user['userid'];
front::$post['username']=$act->view->user['username'];
front::$post['checked']=1;
front::$post['adddate']=date('Y-m-d H:i:s');
front::$post['ip']=front::ip();
}
示例12: manage_action
function manage_action() {
chkpw('func_data_adminlogs');
$where = null;
$ordre = '`id` DESC';
$limit = ((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize;
$this->view->data = $this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage'));
$this->view->record_count = $this->_table->record_count;
}
示例13: get
static function get($alias)
{
$res = front::og("db")->select("SELECT * FROM static_pages WHERE alias = ? LIMIT 1;", $alias)->fetchRow();
if (!$res) {
$res = array("alias" => $alias);
}
return $res;
}
示例14: comment_js_action
function comment_js_action() {
front::check_type(front::get('aid'));
$comment=new comment();
$this->view->comments=$comment->getrows('state=1 and aid='.front::get('aid'),20,'1');
$this->view->aid=front::get('aid');
echo tool::text_javascript($this->fetch());
exit;
}
示例15: get
public static function get($alias)
{
$res = front::og('db')->select('SELECT * FROM static_pages WHERE alias = ? LIMIT 1;', $alias)->fetchRow();
if (!$res) {
$res = array('alias' => $alias);
}
return $res;
}