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

PHP site类代码示例

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

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



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

示例1: createSite

/**
 * 
 * SITE
 */
function createSite($id = "site")
{
    $site = new site("reservoirlog CMS");
    $site->changeID($id);
    $site->layout = "default";
    $site->style = "default";
    $site->save();
    //$site->display();
    return $site;
}
开发者ID:raphael-betemps,项目名称:reservoirlog-php,代码行数:14,代码来源:install.php


示例2: get_site

 function get_site()
 {
     $site = new site();
     $site_array = $site::all();
     if (empty($site_array)) {
         $site_array = $site->set_default();
     } else {
         $site_array = $site_array[0];
     }
     return $site_array;
 }
开发者ID:hscale,项目名称:BlastPad,代码行数:11,代码来源:site_builder_class.php


示例3: created

 function created()
 {
     $site = new site();
     $site->name = $_POST['name'];
     $site->bonus_type = $_POST['bonus_type'];
     $site->bonus_max = $_POST['bonus_max'];
     $site->convert_rate = $_POST['convert_rate'];
     $site->affiliate_url = "";
     $site->url = "";
     $site->comment = $_POST['comment'];
     $site->create();
     header("location: index.php");
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:13,代码来源:sites_controller.php


示例4: __construct

 /**
  * Template loading and setup routine.
  */
 public function __construct()
 {
     parent::__construct();
     // checke request is ajax
     $this->ajax_request = request::is_ajax();
     // Load the template
     $this->template = new View($this->template);
     if ($this->auto_render == TRUE) {
         Event::add('system.post_controller', array($this, '_render'));
     }
     /**
      * 判断用户登录情况
      */
     if (isset($_REQUEST['session_id'])) {
         $session = Session::instance($_REQUEST['session_id']);
         $manager = role::get_manager($_REQUEST['session_id']);
     } else {
         $session = Session::instance();
         $manager = role::get_manager();
     }
     /* 当前请求的URL */
     $current_url = urlencode(url::current(TRUE));
     //当前用户管理的站点的ID
     $this->site_id = site::id();
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:28,代码来源:kc_template.php


示例5: cash

 public function cash()
 {
     $this->live_cash = 0;
     $this->played = 0;
     $this->cash = 0;
     $this->transactions = transaction::from_account($this->account_id);
     # här kommer transaktionerna
     foreach ($this->transactions as $transaction) {
         $transactions[] = $transaction;
         if ($transaction->type == "cash_in") {
             $this->cash += $transaction->amount;
         } elseif ($transaction->type == "bonus") {
             $this->cash += $transaction->amount;
         } elseif ($transaction->type == "cash_out") {
             $this->cash -= $transaction->amount;
         }
     }
     # här kommer betsen
     $this->bets = bet::from_account($this->account_id);
     foreach ($this->bets as $bet) {
         $bet->match = match::from_id($bet->match_id);
         $bet->account = account::from_id($bet->account_id);
         $bet->account->site = site::from_id($bet->account->site_id);
         $this->played += $bet->bet;
         if ($bet->match->result == "undecided") {
             $this->live_cash += $bet->bet;
             $this->cash -= $bet->bet;
         } else {
             $this->cash -= $bet->bet;
             $this->cash += $bet->result;
         }
     }
     return $this->cash;
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:34,代码来源:accounts_model.php


示例6: index

 public function index()
 {
     $route_data = Myroute::instance()->get();
     if ($_POST) {
         $site_next_flow = site::site_next_flow($this->current_flow);
         $submit_target = intval($this->input->post('submit_target'));
         if (Myroute::instance()->edit($_POST)) {
             //判断添加成功去向
             switch ($submit_target) {
                 case 2:
                     remind::set(Kohana::lang('o_global.update_success'), $site_next_flow['url'], 'success');
                 default:
                     remind::set(Kohana::lang('o_global.update_success'), 'site/route', 'success');
             }
         } else {
             remind::set(Kohana::lang('o_global.update_error'), 'site/route');
         }
     }
     $this->template->content = new View("site/route_edit");
     $this->template->content->is_modify = 0;
     if ($this->manager_is_admin == 1) {
         $this->template->content->is_modify = 1;
     }
     $this->template->content->data = $route_data;
     $this->template->content->site_id = $this->site_id;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:26,代码来源:route.php


示例7: get_member_list

 private function get_member_list()
 {
     // Call site settings for stored roster & member ranks to track
     $siteSettings = site::setting();
     // Decode JSON from stored roster data
     $roster = json_decode($siteSettings[0]['fullRoster'], true);
     $data = array();
     // Decode JSON from stored roster ranks
     $ranks = json_decode($siteSettings[0]['rosterRanks'], true);
     $filterRanks = array();
     // Ranks to track
     foreach ($ranks as $key => $value) {
         try {
             // echo $key . ' == ' . $value['track'] . '<br/>';
             if ($value['track']) {
                 $filterRanks[] = $key;
             }
         } catch (Exception $e) {
             //
         }
     }
     foreach ($roster['members'] as $key => $character) {
         // echo var_dump($character['character']);
         // echo $character['character']['name'];
         if (in_array($character['rank'], $filterRanks)) {
             $data[] = $character['character']['name'];
         }
     }
     json::resp(array('success' => true, 'data' => $data));
 }
开发者ID:TheDoxMedia,项目名称:pgs,代码行数:30,代码来源:attendance.worker.php


示例8: add

 public function add()
 {
     if ($_POST) {
         //标签过滤
         tool::filter_strip_tags($_POST, array('content'));
         $site_next_flow = site::site_next_flow($this->current_flow);
         $submit_target = intval($this->input->post('submit_target'));
         $faq = Myfaq::instance();
         if ($faq->add($_POST)) {
             //判断添加成功去向
             switch ($submit_target) {
                 case 1:
                     remind::set(Kohana::lang('o_global.add_success'), 'site/faq/add', 'success');
                 case 2:
                     remind::set(Kohana::lang('o_global.add_success'), $site_next_flow['url'], 'success');
                 default:
                     remind::set(Kohana::lang('o_global.add_success'), 'site/faq', 'success');
             }
         } else {
             remind::set(Kohana::lang('o_global.add_error'), 'site/faq/add');
         }
     }
     $this->template->content = new View("site/faq_add");
     $this->template->content->title = "site faq add";
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:25,代码来源:faq.php


示例9: check_streaks

 private function check_streaks()
 {
     $users = ORM::factory('User')->where('current_streak', '>', 0)->find_all();
     if ((bool) $users->count()) {
         foreach ($users as $user) {
             $last = $user->pages->where('type', '=', 'page')->find();
             if ($last->loaded()) {
                 $nextday = site::day_slug(strtotime('+1 day', strtotime($last->day)));
                 $today = site::day_slug($user->timestamp());
                 $tomorrow = site::day_slug(strtotime('+1 day', $user->timestamp()));
                 if ($nextday != $today && $nextday != $tomorrow) {
                     $user->current_streak = 0;
                     $user->validation_required(false)->save();
                     if ($user->doing_challenge()) {
                         $user->fail_challenge();
                     }
                 }
             } else {
                 if ($user->doing_challenge()) {
                     $start = $user->challenge->start;
                     if ($user->timestamp() - $start > 24 * 60 * 60) {
                         $user->fail_challenge();
                     }
                 }
             }
         }
     }
 }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:28,代码来源:Userstreaks.php


示例10: template

 public static function template($file = '')
 {
     $template = ZOTOP_PATH_THEMES . DS . site::theme() . DS . 'template';
     if (!empty($file)) {
         $template .= DS . str_replace('/', DS, trim($file, '/'));
     }
     return $template;
 }
开发者ID:dalinhuang,项目名称:zotop,代码行数:8,代码来源:site.php


示例11: __construct

 /**
  * 构造方法
  */
 public function __construct()
 {
     parent::__construct();
     if ($this->is_ajax_request()) {
         $this->template = new View('layout/default_json');
     }
     $this->site_id = site::id();
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:11,代码来源:sitemap.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $this->site_id = site::id();
     if ($this->site_id <= 0) {
         die(Kohana::lang('o_global.access_denied'));
     }
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:8,代码来源:update.php


示例13: success

 }
 public static function success($note, $redirect = false)
 {
     self::add('success', $note);
     if ($redirect) {
         site::redirect($redirect);
         die;
     }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:8,代码来源:notes.php


示例14: printOne

 public function printOne($sitePhone)
 {
     $siteName = site::GET($sitePhone->siteID)->name;
     $phoneName = phone::GET($sitePhone->phoneID)->name;
     echo "<table>";
     echo "<tr><td><b>\tСайт\t</b></td><td><a   href=\"/site/view/{$siteEmail->siteID}\">\t{$siteName}\t</a></td></tr>";
     echo "<tr><td><b>\tТелефон\t</b></td><td><a href=\"/phone/view/{$siteEmail->emailID}\">\t{$phoneName}\t</a></td></tr>";
     echo "</table>";
 }
开发者ID:Tacit007,项目名称:Tacit007-php-framework,代码行数:9,代码来源:sitePhone.php


示例15: GET

 public function GET($id)
 {
     if (!site::IFDELETED($id)) {
         $getQuery = "SELECT \r\n\t\t\t\t\tid, \r\n\t\t\t\t\tconvert(varchar(max), name) as name,\r\n\t\t\t\t\thostingID, \r\n\t\t\t\t\tmanagerID, \r\n\t\t\t\t\tregistratorID\r\n\t\t\t\tFROM \r\n\t\t\t\t\t[dbo].[site] \r\n\t\t\t\tWHERE \r\n\t\t\t\t\tid={$id};";
         $row = mssql_fetch_array(mssql_query($getQuery));
         $result = new site($row["id"], $row["name"], $row["hostingID"], $row["managerID"], $row["registratorID"]);
         return $result;
     }
 }
开发者ID:Tacit007,项目名称:Tacit007-php-framework,代码行数:9,代码来源:site.php


示例16: printOne

 public function printOne($siteEmail)
 {
     $siteName = site::GET($siteEmail->siteID)->name;
     $emailName = email::GET($siteEmail->emailID)->name;
     echo "<table>";
     echo "<tr><td><b>\tСайт:\t</b></td><td><a  href=\"/site/view/{$siteEmail->siteID}\">\t{$siteName}\t</a></td></tr>";
     echo "<tr><td><b>\temail:\t</b></td><td><a href=\"/email/view/{$siteEmail->emailID}\">\t{$emailName}\t</a></td></tr>";
     echo "</table>";
 }
开发者ID:Tacit007,项目名称:Tacit007-php-framework,代码行数:9,代码来源:siteEmail.php


示例17: action_twittercallback

 public function action_twittercallback()
 {
     if (arr::get($_GET, 'denied', false)) {
         notes::error('Seems like you didn\'t want to log in with Twitter anyway. Feel free to try again if it was a mistake!');
         site::redirect();
     }
     $token = arr::get($_GET, 'oauth_token', false);
     $verifier = arr::get($_GET, 'oauth_verifier', false);
     if (!$token || !$verifier) {
         notes::error('Something went wrong in the process, and we didn\'t get the expected data back from Twitter. Please try again');
         site::redirect();
     }
     $connection = new TwitterOAuth(arr::get($this->creds, 'key'), arr::get($this->creds, 'secret'), Session::instance()->get_once('twitter_oauth_token'), Session::instance()->get_once('twitter_oauth_token_secret'));
     $token = $connection->getAccessToken($verifier);
     $oauth_token = arr::get($token, 'oauth_token', '');
     $oauth_token_secret = arr::get($token, 'oauth_token_secret', '');
     $user_id = arr::get($token, 'user_id', '');
     $screen_name = arr::get($token, 'screen_name', '');
     $oauth = ORM::factory('Oauth')->where('type', '=', 'twitter')->where('token', '=', $oauth_token)->find();
     if ($oauth->loaded()) {
         try {
             $user = $oauth->user;
             user::force_login($user);
         } catch (exception $e) {
             if ($user->loaded()) {
                 if (user::logged()) {
                     // Random error, but user got logged in. We don't care, YOLO!
                 } else {
                     notes::error('Whoops! Something wen\'t wrong and we couldn\'t log you in. Please try again or send us a message if the problem persists.');
                     Kohana::$log->add(Log::ERROR, '1. Couldnt log user in: ' . $e->getMessage());
                 }
             }
         }
         site::redirect('write');
     } else {
         try {
             $user = ORM::factory('User');
             $user->username = $screen_name;
             $user->validation_required(false)->save();
             $user->add_role('login');
             $oauth = ORM::factory('Oauth');
             $oauth->user_id = $user->id;
             $oauth->type = 'twitter';
             $oauth->token = $oauth_token;
             $oauth->token_secret = $oauth_token_secret;
             $oauth->service_id = $user_id;
             $oauth->screen_name = $screen_name;
             $oauth->save();
             user::force_login($user);
         } catch (exception $e) {
             Kohana::$log->add(Log::ERROR, '2. Couldnt create user: ' . $e->getMessage());
             notes::error('Whoops! Something wen\'t wrong and we couldn\'t log you in. Please try again or send us a message if the problem persists.');
         }
         site::redirect('/write');
     }
 }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:56,代码来源:Auth.php


示例18: getAll

 public static function getAll()
 {
     $link = site::getLink();
     $sql = "SELECT `id` FROM `sites` ORDER BY `order` ASC";
     $data = site::db_query($sql);
     foreach ($data as &$site) {
         $site = new portfolio($site['id']);
     }
     return $data;
 }
开发者ID:swat30,项目名称:portfolio,代码行数:10,代码来源:portfolio.php


示例19: action_write

 public function action_write()
 {
     $errors = false;
     $page = false;
     if (user::logged()) {
         $page = $this->request->param('page');
         if ($_POST && strlen(arr::get($_POST, 'content', '')) > 0) {
             $content = arr::get($_POST, 'content', '');
             if ($page->type == 'page') {
                 $raw = $page->rawcontent();
                 if ($raw != "") {
                     $content = $raw . "\n" . $content;
                 }
             } else {
                 if ($page->type == 'autosave') {
                     $page->type = 'page';
                 }
             }
             try {
                 $page->wordcount = site::count_words($content);
                 $page->content = $content;
                 if ($page->wordcount >= 750 && !(bool) $page->counted) {
                     user::update_stats($page);
                     $page->counted = 1;
                 }
                 $page->duration = $page->duration + (time() - arr::get($_POST, 'start', 999));
                 $page->update();
                 $oldsaves = ORM::factory('Page')->where('type', '=', 'autosave')->where('user_id', '=', user::get()->id)->find_all();
                 if ((bool) $oldsaves->count()) {
                     foreach ($oldsaves as $old) {
                         $old->delete();
                     }
                 }
                 achievement::check_all(user::get());
                 notes::success('Your page has been saved!');
                 //site::redirect('write/'.$page->day);
             } catch (ORM_Validation_Exception $e) {
                 $errors = $e->errors('models');
             }
         }
     } else {
         if ($_POST) {
             notes::error('You must be logged in to save your page. Please log in and submit again.');
         }
     }
     $this->bind('errors', $errors);
     $this->bind('page', $page);
     $this->template->daystamp = $this->request->param('daystamp');
     $this->template->page = $page;
     seo::instance()->title("Write Your Morning Pages");
     seo::instance()->description("Morning Pages is about writing three pages of stream of consciousness thought every day. Become a better person by using MorninPages.net");
 }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:52,代码来源:Write.php


示例20: init

 public static function init($action = "news")
 {
     self::$routerData = Router::getParams();
     if (!isset(self::$routerData['clanid'])) {
         self::$routerData['clanid'] = 1;
     }
     if (!isset(self::$routerData['site'])) {
         self::$routerData['site'] = "news";
     }
     SiteData::siteExists(self::$routerData['clanid']);
     self::$clanData = SiteData::getSiteData(self::$routerData['clanid']);
     self::testTemplateType();
 }
开发者ID:homieforever,项目名称:MyClanKonto,代码行数:13,代码来源:site.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP site_object类代码示例发布时间:2022-05-23
下一篇:
PHP singleton类代码示例发布时间: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