當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Base_module_model類代碼示例

本文整理匯總了PHP中Base_module_model的典型用法代碼示例。如果您正苦於以下問題:PHP Base_module_model類的具體用法?PHP Base_module_model怎麽用?PHP Base_module_model使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Base_module_model類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $fields['last_modified']['type'] = 'hidden';
     $fields['date_added']['type'] = 'hidden';
     return $fields;
 }
開發者ID:goutamwms,項目名稱:newsletter-module-fuel-cms,代碼行數:7,代碼來源:newsletter_drafts_model.php

示例2: PasswordHash

 function on_before_validate($values)
 {
     if ($values['username'] == "" || $values['username'] == NULL) {
         $this->password_in_clear = $password = $this->random_password();
         $ci = CI_Controller::get_instance();
         $ci->load->helper('url');
         $ci->load->library('session');
         $ci->load->library('extemplate');
         $ci->load->library("email");
         $ci->load->config('tank_auth', TRUE);
         $hasher = new PasswordHash($ci->config->item('phpass_hash_strength', 'tank_auth'), $ci->config->item('phpass_hash_portable', 'tank_auth'));
         $hashed_password = $hasher->HashPassword($password);
         $values["password"] = $hashed_password;
         $values["created"] = datetime_now();
         $values['username'] = trim($values['email']);
         $values["last_ip"] = $_SERVER['REMOTE_ADDR'];
         $data = $values;
         $data['site_name'] = 'http://www.ressphere.com';
         $data['password'] = $this->password_in_clear;
         if ($ci->config->item('email_account_details')) {
             base::_begin_send_email('Welcome to', $data['email'], $data, $ci);
         }
     }
     return parent::on_before_validate($values);
 }
開發者ID:ressphere,項目名稱:cb_iloveproperty,代碼行數:25,代碼來源:users_model.php

示例3: array

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $fields['video_name']['required'] = TRUE;
     $fields['video_path']['required'] = TRUE;
     return $fields;
 }
開發者ID:ressphere,項目名稱:cb_iloveproperty,代碼行數:7,代碼來源:home_video_model.php

示例4: __construct

 /**
  * Constructor.
  *
  * @access	public
  * @return	void
  */
 public function __construct()
 {
     $CI =& get_instance();
     $tables = $CI->config->item('tables', 'fuel');
     parent::__construct($tables['fuel_navigation_groups']);
     $this->add_validation('name', array(&$this, 'valid_name'), lang('error_requires_string_value'));
 }
開發者ID:ressphere,項目名稱:cb_iloveproperty,代碼行數:13,代碼來源:fuel_navigation_groups_model.php

示例5: list_items

 /**
  * Lists the log items
  *
  * @access	public
  * @param	int The limit value for the list data (optional)
  * @param	int The offset value for the list data (optional)
  * @param	string The field name to order by (optional)
  * @param	string The sorting order (optional)
  * @param	boolean Determines whether the result is just an integer of the number of records or an array of data (optional)
  * @return	mixed If $just_count is true it will return an integer value. Otherwise it will return an array of data (optional)
  */
 public function list_items($limit = NULL, $offset = NULL, $col = 'entry_date', $order = 'desc', $just_count = FALSE)
 {
     $this->db->select($this->_logs_table . '.id, entry_date, CONCAT(' . $this->_tables['fuel_users'] . '.first_name, " ", ' . $this->_tables['fuel_users'] . '.last_name) as name, message, type', FALSE);
     $this->db->join($this->_tables['fuel_users'], $this->_logs_table . '.user_id = ' . $this->_tables['fuel_users'] . '.id', 'left');
     $data = parent::list_items($limit, $offset, $col, $order, $just_count);
     return $data;
 }
開發者ID:huayuxian,項目名稱:FUEL-CMS,代碼行數:18,代碼來源:fuel_logs_model.php

示例6:

 function list_items($limit = NULL, $offset = NULL, $col = 'id', $order = 'asc')
 {
     $this->db->join('wa_items', 'wa_items.id = wa_market_prices.item_id', 'left');
     $this->db->select('wa_market_prices.id, wa_market_prices.item_id, wa_market_prices.quantity, wa_market_prices.price, wa_items.name AS name, wa_items.damage AS damage', FALSE);
     $data = parent::list_items($limit, $offset, $col, $order);
     return $data;
 }
開發者ID:roliandra,項目名稱:WebInterface-Fuel,代碼行數:7,代碼來源:market_model.php

示例7: array

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->module_model(BLOG_FOLDER, 'blog_users_model');
     $CI->load->module_model(BLOG_FOLDER, 'blog_posts_model');
     $post_title = '';
     $post_options = $CI->blog_posts_model->options_list('id', 'title', array(), 'date_added desc');
     if (empty($post_options)) {
         return lang('blog_error_no_posts_to_comment');
     }
     $fields['post_id'] = array('type' => 'select', 'options' => $post_options, 'label' => 'Post');
     if (!empty($values['id'])) {
         $post = $CI->blog_posts_model->find_by_key($values['post_id']);
         $post_title = $post->title;
         if (!$post->is_published()) {
             add_error(lang('blog_post_is_not_published'));
         }
         $fields['post_id'] = array('type' => 'hidden', 'value' => $post_title, 'displayonly' => TRUE);
         $fields['post_title'] = array('label' => 'Post', 'value' => $post_title, 'order' => 1);
         $fields['post_title']['displayonly'] = TRUE;
         $fields['post_published']['displayonly'] = TRUE;
         $fields['author_email']['displayonly'] = TRUE;
         $fields['author_name']['displayonly'] = TRUE;
         $fields['post_title']['displayonly'] = TRUE;
         $fields['author_website']['displayonly'] = TRUE;
         $fields['ip_host']['displayonly'] = TRUE;
         $fields['date_submitted'] = array('displayonly' => TRUE, 'value' => english_date($values['date_added'], TRUE));
         $ip_host = !empty($values['author_ip']) ? gethostbyaddr($values['author_ip']) . ' (' . $values['author_ip'] . ')' : '';
         $fields['ip_host'] = array('label' => 'IP/Host', 'value' => $ip_host, 'order' => 5, 'displayonly' => TRUE);
         $fields['Reply to this Comment'] = array('type' => 'section');
         $replies = $this->find_all_array(array('parent_id' => $values['id']));
         $reply_arr = array();
         foreach ($replies as $r) {
             $reply_arr[] = $r['content'];
         }
         $fields['replies'] = array('label' => 'Replies', 'displayonly' => TRUE, 'value' => implode('<br /><br />', $reply_arr));
         if ($values['author_id'] == $CI->fuel_auth->user_data('id') or $CI->fuel_auth->is_super_admin()) {
             $fields['reply'] = array('label' => 'Reply', 'type' => 'textarea');
             $notify_options = array('Commentor' => lang('blog_comment_notify_option2'), 'All' => lang('blog_comment_notify_option1'), 'None' => lang('blog_comment_notify_option3'));
             $fields['reply_notify'] = array('label' => 'Notfiy', 'type' => 'enum', 'options' => $notify_options);
         }
         // hidden
         $fields['author_ip'] = array('type' => 'hidden');
     } else {
         $fields['author_ip'] = array('type' => 'hidden', 'value' => $_SERVER['REMOTE_ADDR'], 'label' => 'Author IP Address');
         $fields['is_spam'] = array('type' => 'hidden');
         $fields['date_added']['type'] = 'hidden';
         // so it will auto add
         $fields['last_modified']['type'] = 'hidden';
         // so it will auto add
     }
     // set author to current fuel user
     if (empty($fields['author_id']) and $CI->fuel_auth->user_data('id')) {
         $fields['author_id'] = array('value' => $CI->fuel_auth->user_data('id'));
     }
     $fields['author_id'] = array('type' => 'hidden');
     return $fields;
 }
開發者ID:kieranklaassen,項目名稱:FUEL-CMS,代碼行數:59,代碼來源:blog_comments_model.php

示例8:

 function list_items($limit = NULL, $offset = NULL, $col = 'id', $order = 'asc')
 {
     $this->db->join('wa_items', 'wa_items.id = wa_auctions.item_id', 'left');
     $this->db->join('wa_users', 'wa_users.id = wa_auctions.seller', 'left');
     $this->db->select('wa_auctions.id, wa_auctions.item_id, wa_users.username AS seller, wa_auctions.price, wa_items.name AS name, wa_items.damage AS damage, wa_auctions.quantity, wa_auctions.started', FALSE);
     $data = parent::list_items($limit, $offset, $col, $order);
     return $data;
 }
開發者ID:roliandra,項目名稱:WebInterface-Fuel,代碼行數:8,代碼來源:auctions_model.php

示例9: form_fields

 public function form_fields()
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->helper('directory');
     $CI->load->helper('file');
     return $fields;
 }
開發者ID:randombrad,項目名稱:FUEL-CMS,代碼行數:8,代碼來源:blocks_model.php

示例10: array

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $upload_path = assets_server_path('authors/', 'images');
     $fields['avatar_upload'] = array('type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE);
     $fields['published']['order'] = 1000;
     return $fields;
 }
開發者ID:rudyondolan,項目名稱:FUEL-CMS-User-Guide-Module,代碼行數:8,代碼來源:authors_model.php

示例11: array

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     //$fields['published']['order'] = 1000;
     $upload_path = ltrim(assets_server_path('i_property/', 'images'), "/");
     $fields['Property_info_image'] = array('type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE, 'xss_clean' => TRUE, 'allowed_types' => 'jpg|jpeg|bmp|png|gif');
     return $fields;
 }
開發者ID:ressphere,項目名稱:cb_iloveproperty,代碼行數:8,代碼來源:property_info_model.php

示例12: array

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     foreach ($fields as &$f) {
         $f['displayonly'] = true;
     }
     return $fields;
 }
開發者ID:goutamwms,項目名稱:newsletter-module-fuel-cms,代碼行數:8,代碼來源:newsletter_historic_model.php

示例13: array

 function form_fields($values = array(), $related = array())
 {
     $fields = parent::form_fields($values, $related);
     // ******************* ADD CUSTOM FORM STUFF HERE *******************
     $fields['content']['img_folder'] = 'articles/';
     $fields['image']['folder'] = 'images/articles/';
     $fields['thumb_image']['folder'] = 'images/articles/thumbs/';
     return $fields;
 }
開發者ID:huayuxian,項目名稱:FUEL-CMS,代碼行數:9,代碼來源:articles_model.php

示例14: array

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $upload_path = assets_server_path('i_property/', 'images');
     $fields['category']['required'] = TRUE;
     $fields['category_path']['required'] = TRUE;
     $fields['category_icon'] = array('required' => TRUE, 'type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE, 'xss_clean' => TRUE, 'is_image' => TRUE, 'allowed_types' => 'jpg|jpeg|bmp|png|gif');
     $fields['category_mo_icon'] = array('required' => TRUE, 'type' => 'file', 'upload_path' => $upload_path, 'overwrite' => TRUE, 'xss_clean' => TRUE, 'is_image' => TRUE, 'allowed_types' => 'jpg|jpeg|bmp|png|gif');
     return $fields;
 }
開發者ID:ressphere,項目名稱:cb_iloveproperty,代碼行數:10,代碼來源:home_category_model.php

示例15: __construct

 public function __construct($table_name)
 {
     // Main entries table
     parent::__construct($table_name);
     // Align record model name
     // Define the record class name, rather for it to when crazy
     $this->record_class = $table_name . "_record";
     // 1. For benchmark (profiler) to keep track total execute time
     //    Able to disable through "application/config/MY_config.php"
     // 2. For Error switching purpose
     //$this->CI =& get_instance();
     //$this->CI->config->load("MY_config");
     $this->config->load("MY_config");
 }
開發者ID:ressphere,項目名稱:cb_iloveproperty,代碼行數:14,代碼來源:cb_base_module_model.php


注:本文中的Base_module_model類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。