本文整理汇总了PHP中CI::library方法的典型用法代码示例。如果您正苦于以下问题:PHP CI::library方法的具体用法?PHP CI::library怎么用?PHP CI::library使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CI
的用法示例。
在下文中一共展示了CI::library方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
$data = array();
$data['is_moderated'] = 'n';
$form_values = CI::model('comments')->commentsGet($data);
$this->template['new_comments'] = $form_values;
$this->load->vars($this->template);
$data = array();
$data['is_moderated'] = 'y';
$limit[0] = 0;
$limit[1] = 100;
$form_values = CI::model('comments')->commentsGet($data);
$this->template['old_comments'] = $form_values;
$this->load->vars($this->template);
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('admin/comments/index', true, true);
//$secondarycontent = CI::view ( 'admin/content/sidebar', true, true );
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例2: load
function load()
{
$plugin_name = $this->uri->segment(4);
$this->template['functionName'] = strtolower(__FUNCTION__);
$this->template['pluginName'] = $plugin_name;
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$plugindata = CI::model('core')->plugins_getPluginConfig($plugin_name);
//
//print PLUGINS_DIRNAME . $dirname .$plugin_name.'/'.$plugindata['plugin_admin_dir']. '/controller.php' ;
if (is_file(PLUGINS_DIRNAME . $dirname . $plugin_name . '/' . $plugindata['plugin_admin_dir'] . '/controller.php') == true) {
$firecms = get_instance();
define('THIS_PLUGIN_URL', site_url('admin/plugins/load') . '/' . $plugin_name . '/');
define('THIS_PLUGIN_DIRNAME', PLUGINS_DIRNAME . $dirname . $plugin_name . '/');
define('THIS_PLUGIN_DIRNAME_ADMIN', PLUGINS_DIRNAME . $dirname . $plugin_name . '/' . $plugindata['plugin_admin_dir'] . '/');
require_once PLUGINS_DIRNAME . $dirname . $plugin_name . '/' . $plugindata['plugin_admin_dir'] . '/controller.php';
}
//$primarycontent = CI::view ( 'admin/comments/index', true, true );
//$secondarycontent = CI::view ( 'admin/content/sidebar', true, true );
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例3: edit
function edit()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
$this->load->vars($this->template);
if ($_POST) {
$save = $this->cacaomail_model->saveMailAccounts($_POST);
redirect('mailaccounts');
}
$segs = $this->uri->segment_array();
$the_id = false;
foreach ($segs as $segment) {
if (stristr($segment, 'id:') == true) {
$the_id = $segment;
$the_id = substr($the_id, 3, strlen($the_id));
}
}
if (intval($the_id) != 0) {
$form_values = $this->cacaomail_model->getMailAccounts(array('id' => $the_id), 1);
$form_values = $form_values[0];
$this->template['form_values'] = $form_values;
} else {
//$this->template ['form_values'] = false;
}
$this->template['form_values']['account_groups'] = $this->cacaomail_model->getMailAccountsGroups();
$this->load->vars($this->template);
$layout = CI::view('layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('mailaccounts/edit', true, true);
$secondarycontent = CI::view('mailaccounts/sidebar', true, true);
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例4: register
function register()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
$rules['username'] = "trim|required|xss_clean|callback_username_check";
$rules['password'] = "trim|required|matches[passconf]";
$rules['passconf'] = "trim|required";
$rules['email'] = "trim|required|valid_email|xss_clean|callback_useremail_check";
$rules['accept'] = "callback_acceptterms_check|required|xss_clean";
$rules['captcha'] = "callback_captcha_check|required|xss_clean";
$this->validation->set_rules($rules);
$fields['username'] = 'Username';
$fields['password'] = 'Password';
$fields['passconf'] = 'Password Confirmation';
$fields['email'] = 'Email Address';
//$fields ['accept'] = 'Please accept the Terms and Conditions';
$this->validation->set_fields($fields);
$this->validation->set_error_delimiters('<div class="error">', '</div>');
if ($this->validation->run() == FALSE) {
$primarycontent = CI::view('me/register', true, true);
} else {
$register = array();
$register['username'] = $this->input->post('username');
$register['password'] = $this->input->post('password');
$register['email'] = $this->input->post('email');
$register['is_active'] = 1;
CI::model('users')->saveUser($register);
$primarycontent = CI::view('me/register_done', true, true);
}
$this->load->vars($this->template);
$layout = CI::view('layout', true, true);
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
CI::library('output')->set_output($layout);
}
示例5: index
function index()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
$tags = CI::model('core')->getParamFromURL('tags');
$data = array();
$this->template['search_by_keyword'] = '';
if ($tags) {
$data['search_by_keyword'] = $tags;
$this->template['search_by_keyword'] = $tags;
}
$results_count = CI::model('comments')->commentsGet($data, false, true);
$items_per_page = CI::model('core')->optionsGetByKey('admin_default_items_per_page');
$content_pages_count = ceil($results_count / $items_per_page);
$curent_page = CI::model('core')->getParamFromURL('curent_page');
if (intval($curent_page) < 1 || intval($curent_page) > $content_pages_count) {
$curent_page = 1;
}
$page_start = ($curent_page - 1) * $items_per_page;
$page_end = $page_start + $items_per_page;
//$data ['is_moderated'] = 'n';
$form_values = CI::model('comments')->commentsGet($data, array($page_start, $page_end), false);
$new_comments = array();
$old_comments = array();
for ($i = 0; $i < count($form_values); $i++) {
if ($form_values[$i]['is_moderated'] == 'n') {
$new_comments[] = $form_values[$i];
} else {
$old_comments[] = $form_values[$i];
}
}
$this->template['content_pages_count'] = $content_pages_count;
//var_dump($content_pages_count);
$this->template['content_pages_curent_page'] = $curent_page;
//get paging urls
$content_pages = CI::model('content')->pagingPrepareUrls(false, $content_pages_count);
$this->template['content_pages_links'] = $content_pages;
$this->template['new_comments'] = $new_comments;
$this->load->vars($this->template);
/*
$data = array ( );
$data ['is_moderated'] = 'y';
$limit [0] = 0;
$limit [1] = 100;
$form_values = CI::model('comments')->commentsGet ( $data );
*/
$this->template['old_comments'] = $old_comments;
$this->load->vars($this->template);
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('admin/comments/index', true, true);
//$secondarycontent = CI::view ( 'admin/content/sidebar', true, true );
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例6: edit
function edit()
{
//CI::library ( 'session' )->set_userdata ( 'editmode', false );
$is_admin = is_admin();
if ($is_admin == false) {
$go = site_url('login');
safe_redirect($go);
}
$layout = CI::view('admin/iframe', true, true);
$layout = CI::model('template')->parseMicrwoberTags($layout);
//$layout = CI::model('template')->parseMicrwoberTags ( $layout );
CI::library('output')->set_output($layout);
}
示例7: stylesList
function stylesList()
{
$data = CI::model('template')->stylesList(trim($_REQUEST['layout']));
$active = trim($_REQUEST['active_style']);
$this->template['active'] = $active;
$view = TEMPLATES_DIR . 'layouts/styles_list.php';
$this->template['data'] = $data;
if (is_readable($view) == true) {
$this->load->vars($this->template);
$layout = $this->load->file($view, true);
$layout = CI::model('content')->applyGlobalTemplateReplaceables($layout, $global_template_replaceables = false);
CI::library('output')->set_output($layout);
} else {
exit("Error: the file {$view} is not readable or does not exist.");
}
}
示例8: index
function index()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
if (CI::library('session')->userdata('user') == false) {
//redirect ( 'index' );
}
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('admin/index', true, true);
//$layout = str_ireplace ( '{primarycontent }', $primarycontent, $layout );
//$layout = str_ireplace ( '{secondarycontent}', $secondarycontent, $layout );
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例9: login
function login()
{
$back_to = CI::model('core')->getParamFromURL('back_to');
global $cms_db_tables;
$table = $cms_db_tables['table_users'];
$username = $this->input->post('username', TRUE);
$password = $this->input->post('password', TRUE);
$user_action = $this->input->post('user_action', TRUE);
if ($user_action == 'register') {
$q = "select username from " . $table . " where username='{$username}' ";
$query = CI::db()->query($q);
$query = $query->row_array();
$query = array_values($query);
$username = $query[0];
if ($username != '') {
$this->template['message'] = 'This user exists, try another one!';
} else {
$data = array('updated_on' => date("Y-m-d h:i:s"), 'is_active' => 0, 'username' => $username, 'password' => $password);
$this->db->insert($table, $data);
$this->template['message'] = 'Success, try login now!';
}
} else {
$q = "select * from " . $table . " where username='{$username}' and password='{$password}' and is_active=1";
$query = CI::db()->query($q);
$query = $query->row_array();
if (empty($query)) {
$this->template['message'] = 'Wrong username or password, or user is disabled!';
} else {
CI::library('session')->set_userdata('user', $query);
if ($back_to == false) {
redirect('dashboard');
} else {
redirect(base64_decode($back_to));
}
}
}
$this->load->vars($this->template);
$layout = CI::view('layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('login', true, true);
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
//CI::library('output')->set_output ( $layout );
}
示例10: edit
function edit()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
$this->load->vars($this->template);
if ($_POST) {
$save = $this->cacaomail_model->saveMailCampaigns($_POST);
redirect('mailcampaigns');
}
$segs = $this->uri->segment_array();
$the_id = false;
foreach ($segs as $segment) {
if (stristr($segment, 'id:') == true) {
$the_id = $segment;
$the_id = substr($the_id, 3, strlen($the_id));
}
}
if (intval($the_id) != 0) {
$form_values = $this->cacaomail_model->getMailCampaigns(array('id' => $the_id), 1);
$form_values = $form_values[0];
$this->template['form_values'] = $form_values;
//$mailist_groups_titles = $this->cacaomail_model->getMailAccountsGroups();
//$this->template ['form_values']['mailist_groups_titles'] = $mailist_groups_titles;
}
$mailist_account_groups = $this->cacaomail_model->getMailAccountsGroups();
$this->template['form_values']['mail_accounts_groups'] = $mailist_account_groups;
$mailist_account_single = $this->cacaomail_model->getMailAccounts();
$this->template['form_values']['mail_accounts_singles'] = $mailist_account_single;
$temp = $this->cacaomail_model->getJobfeedsGroups();
$this->template['form_values']['mail_lists_groups'] = $temp;
$temp = $this->cacaomail_model->getJobfeeds();
$this->template['form_values']['mail_lists_singles'] = $temp;
//`mailists_groups_ids` text,
//`mailists_single_id` int(11) default NULL,
$this->load->vars($this->template);
$layout = CI::view('layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('mailcampaigns/edit', true, true);
$secondarycontent = CI::view('mailcampaigns/sidebar', true, true);
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例11: index
function index()
{
$gogo = site_url('admin/content/posts_manage') . $togo_categories . $togo_tags;
$gogo = reduce_double_slashes($gogo);
header("Location: {$gogo} ");
//var_dump ( $gogo );
exit;
//http://test3.ooyes.net/admin
$this->template['functionName'] = strtolower(__FUNCTION__);
if (CI::library('session')->userdata('user') == false) {
//redirect ( 'index' );
}
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('admin/index', true, true);
//$layout = str_ireplace ( '{primarycontent }', $primarycontent, $layout );
//$layout = str_ireplace ( '{secondarycontent}', $secondarycontent, $layout );
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例12: index
function index()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
$data = array();
$reports_for = CI::model('core')->getParamFromURL('t');
if ($reports_for != false) {
// $data['to_table'] = $reports_for;
$data[] = array('to_table', $reports_for);
}
$reports = CI::model('reports')->reportsGet($data, false);
$this->template['reports'] = $reports;
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('admin/reports/index', true, true);
//$secondarycontent = CI::view ( 'admin/content/sidebar', true, true );
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例13: add
function add()
{
$this->template['functionName'] = strtolower(__FUNCTION__);
if ($_POST) {
CI::model('core')->cacheDelete('cache_group', 'options');
CI::model('core')->optionsSave($_POST);
redirect('admin/options/index');
}
$all_options = CI::model('core')->optionsGet(false);
$this->template['all_options'] = $all_options;
$this->load->vars($this->template);
$layout = CI::view('admin/layout', true, true);
$primarycontent = '';
$secondarycontent = '';
$primarycontent = CI::view('admin/options/add', true, true);
$nav = CI::view('admin/options/subnav', true, true);
$primarycontent = $nav . $primarycontent;
// $secondarycontent = CI::view ( 'admin/content/sidebar', true, true );
$layout = str_ireplace('{primarycontent}', $primarycontent, $layout);
$layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout);
//CI::view('welcome_message');
CI::library('output')->set_output($layout);
}
示例14: str_ireplace
$layout = $this->load->file($the_active_site_template_dir . 'users/layout.php', true);
}
}
} else {
$layout = '{content}';
}
if (trim($content['content_filename']) != '') {
if (is_readable($the_active_site_template_dir . $content['content_filename']) == true) {
$this->load->vars($this->template);
$content_filename = $this->load->file($the_active_site_template_dir . $content['content_filename'], true);
$layout = str_ireplace('{content}', $content_filename, $layout);
// $layout = str_ireplace ( '{content}', $content_filename_pre, $layout );
}
}
if (trim($content['content_body']) != '') {
$this->load->vars($this->template);
$layout = str_ireplace('{content}', $content['content_body'], $layout);
}
if (trim($taxonomy_data) != '') {
$this->load->vars($this->template);
$layout = str_ireplace('{content}', $taxonomy_data, $layout);
}
$layout = CI::model('content')->applyGlobalTemplateReplaceables($layout, $global_template_replaceables = false);
//var_dump($layout);
$opts = array();
$opts['no_microwber_tags'] = false;
$opts['no_remove_div'] = false;
//$opts = array ();
$layout = CI::model('template')->parseMicrwoberTags($layout, $opts);
CI::library('output')->set_output($layout);
示例15: strtolower
//p($subdomain_user);
//$this->template ['created_by'] = false;
}
/*
* Make some initializations - constants, libraries, template variables
*/
//$this->load->library ( 'form_validation' );
$this->template['className'] = strtolower(get_class());
//$this->template ['cache_queries_count'] = CI::model('core')->cacheGetCount ();
//$this->template ['cache_size'] = CI::model('core')->cacheGetSize ();
$this->template['cms_db_tables'] = $cms_db_tables;
$this->template['__GET'] = $_GET;
$this->template['__POST'] = $_POST;
$this->template['__REQUEST'] = $_REQUEST;
$this->load->vars($this->template);
$user_session = CI::library('session')->userdata('user_session');
$this->template['user_session'] = $user_session;
$this->template['user_id'] = CI::model('core')->userId();
$the_active_site_template = CI::model('core')->optionsGetByKey('curent_template');
$the_active_site_template_dir = TEMPLATEFILES . $the_active_site_template . '/';
if (defined('ACTIVE_TEMPLATE_DIR') == false) {
define('ACTIVE_TEMPLATE_DIR', $the_active_site_template_dir);
}
if (defined('TEMPLATES_DIR') == false) {
define('TEMPLATES_DIR', $the_active_site_template_dir);
}
if (defined('TEMPLATE_DIR') == false) {
define('TEMPLATE_DIR', $the_active_site_template_dir);
}
if (defined('DEFAULT_TEMPLATE_DIR') == false) {
define('DEFAULT_TEMPLATE_DIR', TEMPLATEFILES . 'default/');