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

PHP url_title函数代码示例

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

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



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

示例1: comments

 public function comments($image_id)
 {
     $image = $this->db->select('title')->from('nf_gallery_images')->where('image_id', $image_id)->row();
     if ($image) {
         return array('title' => $image, 'url' => 'gallery/image/' . $image_id . '/' . url_title($image) . '.html');
     }
 }
开发者ID:nsystem1,项目名称:neofrag-cms,代码行数:7,代码来源:gallery.php


示例2: process_post

 /**
  * Process Post
  *
  * Process data that was not part of the 
  * initial streams call.
  *
  * @return 	void
  */
 public function process_post(&$post)
 {
     $this->load->helper('text');
     // Keywords array
     /*$keywords = Keywords::get($post->keywords);
     		$formatted_keywords = array();
     		$keywords_arr = array();
     
     		foreach ($keywords as $key)
     		{
     			$formatted_keywords[] 	= array('keyword' => $key->name);
     			$keywords_arr[] 		= $key->name;
     
     		}
     		$post->keywords = $formatted_keywords;
     		$post->keywords_arr = $keywords_arr;*/
     // Full URL for convenience.
     //$post->url = site_url('kasus/'.date('Y/m/d', $post->created_on).'/'.$post->slug);
     $slug = url_title($post->title, 'dash', TRUE);
     $post->url = site_url('kasus/' . date('Y/m/d', strtotime($post->created_on)) . '/' . $slug);
     // What is the preview? If there is a field called intro,
     // we will use that, otherwise we will cut down the news post itself.
     //$post->preview = (isset($post->intro)) ? $post->intro : $post->body;
     // Category
     /*if ($post->category_id > 0 and isset($this->categories[$post->category_id]))
     		{
     			$post->category = $this->categories[$post->category_id];
     		}*/
 }
开发者ID:blekedeg,项目名称:lbhpers,代码行数:37,代码来源:kasus_m.php


示例3: index

 /**
  * @author : Gede Lumbung
  * @web : http://gedelumbung.com
  **/
 function index($title = "", $uri = 0)
 {
     if ($this->session->userdata('logged_in') != "") {
         $id_param = $this->session->userdata("id_member");
         $d['left_top_menu'] = $this->app_global_web_model->generate_menu("kiri", "nav pull-left");
         $d['right_top_menu'] = $this->app_global_web_model->generate_menu("kanan", "nav pull-right");
         $d['center_bottom_menu'] = $this->app_global_web_model->generate_menu("footer");
         $d['combo_lokasi'] = $this->app_global_web_model->generate_combo_lokasi();
         $d['combo_kategori'] = $this->app_global_web_model->generate_combo_kategori();
         $d['list_kategori'] = $this->app_global_web_model->generate_list_kategori("nav nav-list");
         $d['left_artikel_hot'] = $this->app_global_web_model->generate_front_artikel($_SESSION['site_limit_artikel_hot'], 0, "counter", 1);
         $d['left_iklan_hot'] = $this->app_global_web_model->generate_list_iklan($_SESSION['site_limit_sidebar'], "counter");
         $d['left_iklan_new'] = $this->app_global_web_model->generate_list_iklan($_SESSION['site_limit_sidebar'], "id_iklan");
         $where['id_member'] = $id_param;
         $gen_menu = $this->db->get_where("dlmbg_member", $where);
         if ($gen_menu->num_rows() == 0) {
             redirect(base_url());
         }
         $menu_crumb = $gen_menu->row();
         $this->breadcrumb->append_crumb('BERANDA', base_url());
         $this->breadcrumb->append_crumb('DASHBOARD', base_url() . 'user/dashboard');
         $this->breadcrumb->append_crumb(strtoupper($menu_crumb->nama), base_url() . 'web/kategori/get/' . $id_param . '/' . url_title($menu_crumb->nama, '-', TRUE));
         $d['dt_retrieve'] = $this->app_user_web_model->generate_detail_member($id_param, $_SESSION['site_limit_iklan_kategori'], $uri);
         $this->load->view($_SESSION['site_theme'] . '/bg_header', $d);
         $this->load->view($_SESSION['site_theme'] . '/user/dashboard/bg_home');
         $this->load->view($_SESSION['site_theme'] . '/bg_left');
         $this->load->view($_SESSION['site_theme'] . '/bg_footer');
     } else {
         redirect(base_url());
     }
 }
开发者ID:mylinkedshare,项目名称:Advertising,代码行数:35,代码来源:dashboard.php


示例4: thread_notifier

 /**
  * New Comment Notification
  *
  * Javascript calls this every few seconds to check
  * on the existence of new comments
  *
  * @access	public
  * @param	int		thread id
  * @param	int		current number of comments
  * @return	void
  */
 function thread_notifier($thread_id = 0, $current_count = 0)
 {
     // make sure thread_id and current_count are integers
     $thread_id = (int) $thread_id;
     $current_count = (int) $current_count;
     // the typecasting above will convert non-integers to zero
     if ($thread_id === 0 || $current_count === 0) {
         return;
     }
     // find out how many comments are in the thread
     $thread_info = $this->thread_dal->comment_count_info($thread_id);
     $db_count = $thread_info->max_rows;
     // handle JSON, otherwise fail through to HTML output
     if ($this->is_request_json()) {
         return send_json($this->output, 200, array('thread_id' => $thread_id, 'comment_count' => $db_count, 'new_comment_count' => $db_count - $current_count));
     }
     // if the numbers dont match, throw out some html
     if ($db_count > $current_count) {
         // number of new posts
         $new_posts = $db_count - $current_count;
         $title = url_title($thread_info->subject, 'dash', TRUE);
         $shown = $this->session->userdata('comments_shown');
         if (!$shown) {
             $shown = 25;
         }
         $count = (ceil($db_count / $shown) - 1) * $shown;
         echo '<div id="notifier"><a id="notify" href="/thread/' . $thread_id . '/' . $title . '/p/' . $count . '/r' . mt_rand(10000, 99999) . '#bottom">' . $new_posts . ' new post' . ($new_posts === 1 ? '' : 's') . " added</a></div>";
     }
 }
开发者ID:notjosh,项目名称:seaforium,代码行数:40,代码来源:ajax.php


示例5: test_url_title_extra_dashes

 public function test_url_title_extra_dashes()
 {
     $words = array('_foo bar_' => 'foo_bar', '_What\'s wrong with CSS?_' => 'Whats_wrong_with_CSS');
     foreach ($words as $in => $out) {
         $this->assertEquals($out, url_title($in, 'underscore'));
     }
 }
开发者ID:DavBfr,项目名称:BlogMVC,代码行数:7,代码来源:url_helper_test.php


示例6: parse

 public function parse()
 {
     $tmpname = wp_unique_filename($this->targetDir, str_replace("sql", "xml", basename($this->_filename)));
     $this->xml_path = $this->targetDir . '/' . url_title($tmpname);
     $this->toXML();
     return $this->xml_path;
 }
开发者ID:rebeccayshen,项目名称:kitlist,代码行数:7,代码来源:XmlImportSQLParse.php


示例7: Create_url_title

	public function Create_url_title($tagdata = '')
	{
		$this->EE = get_instance();
		
		$this->EE->load->helper('url');
		
		$separator = NULL;
		
		if (in_array($this->EE->TMPL->fetch_param('separator'), array('dash', '-')))
		{
			$separator = 'dash';
		}
		elseif ($this->EE->TMPL->fetch_param('separator') == '_')
		{
			$separator = '_';
		}
		else
		{
			$separator = $this->EE->config->item('word_separator');
		}
		
		if (func_num_args() === 0)
		{
			$tagdata = $this->EE->TMPL->tagdata;
		}
		
		$this->return_data = url_title(
			trim($tagdata),
			$separator,
			(preg_match('/0|no|off|n/i', $this->EE->TMPL->fetch_param('lowercase'))) ? FALSE : TRUE
		);
	}
开发者ID:rsanchez,项目名称:create_url_title,代码行数:32,代码来源:pi.create_url_title.php


示例8: getfrom404

 public function getfrom404()
 {
     $istem = parse_url($_SERVER['REQUEST_URI']);
     $this->output->set_header("HTTP/1.0 200 OK");
     $this->output->set_header("HTTP/1.1 200 OK");
     $istem = parse_url($_SERVER['REQUEST_URI']);
     $i = $istem['path'];
     $flag404 = TRUE;
     $d = explode("/", $i, -1);
     $id = '';
     foreach ($d as $k) {
         if (strlen($k) > 2) {
             redirect();
         }
         //Direkt ID ile içerik çekilmesi engelleniyor. Parçalar 2 şer harften büyük olamaz.
         if ($k == '') {
             continue;
         }
         $k = is_numeric($k) ? $k : '00';
         $id .= $k;
     }
     if ($id < 1) {
         redirect();
     }
     $person = $this->db->select('id,name')->from('liste')->where('id', $id)->limit('1')->get()->row();
     if (!isset($person->id) || $person->id < 1) {
         redirect();
     }
     redirect(base_url() . 'face/get/' . genid_from_id($person->id) . '/' . url_title($person->name), 'location', 301);
 }
开发者ID:berkantaydin,项目名称:reversefacebook,代码行数:30,代码来源:stats.php


示例9: add

 public function add($id = NULL)
 {
     $data = array();
     if ($id !== NULL) {
         $data = $this->mongo_db->page->findOne(array('_id' => new MongoID($id)));
         if (!count($data)) {
             show_404();
         }
     }
     $this->load->library(array('form_validation'));
     $this->form_validation->set_rules('title', 'Sayfa Başlığı', 'trim|required');
     $this->form_validation->set_rules('content', 'Sayfa İçeriği', 'required');
     if ($this->form_validation->run()) {
         $sql_data = array('slug' => url_title($this->form_validation->set_value('title')), 'author' => $this->session->userdata('user_id'), 'title' => $this->form_validation->set_value('title'), 'content' => $this->form_validation->set_value('content'), 'meta_title' => $this->input->post('meta_title'), 'meta_description' => $this->input->post('meta_description'), 'meta_keyword' => $this->input->post('meta_keyword'), 'created_at' => isset($data['created_at']) ? $data['created_at'] : new MongoDate(), 'updated_at' => new MongoDate());
         if ($id !== NULL) {
             $sql_data['_id'] = new MongoID($id);
         }
         $sql_data = array_merge($data, $sql_data);
         $this->mongo_db->page->ensureIndex('slug');
         $this->mongo_db->page->save($sql_data);
         if (isset($data['slug']) && $data['slug'] != $sql_data['slug']) {
             $redirect = array('old_slug' => $data['slug'], 'new_slug' => $sql_data['slug'], 'module' => 'page');
             $this->mongo_db->redirect->save($redirect);
         }
         if ($id === NULL) {
             flash_message('success', 'Sayfa başarıyla eklendi.');
         } else {
             flash_message('success', 'Sayfa başarıyla düzenlendi.');
         }
         redirect('admin/page/index');
     }
     $this->template->view('admin/add', $data)->render();
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:33,代码来源:admin.php


示例10: main_form

 /**
  *  Admin CRUD
  */
 public function main_form($form_type, $url = null)
 {
     if ($this->input->post('url')) {
         $_POST['url'] = url_title($this->input->post('url'), 'dash', TRUE);
     }
     $this->load->helper(array('form', 'url'));
     $this->load->library('form_validation');
     if ($form_type == 'edit_sidebar') {
         $this->form_validation->set_rules('title', 'Title', 'trim|required|callback_be_unique');
     } else {
         $this->form_validation->set_rules('title', 'Title', 'trim|required');
     }
     $this->form_validation->set_rules('url', 'URL', 'trim|required|callback_be_unique');
     $this->form_validation->set_error_delimiters('<li>', '</li>');
     if ($this->form_validation->run() == FALSE) {
         return false;
     } else {
         if ($form_type == 'new') {
             //                $this->new_user();
         }
         if ($form_type == 'edit' || $form_type == 'edit_sidebar') {
             $this->update_page($url);
         }
         return true;
     }
 }
开发者ID:RCDawson,项目名称:bhp,代码行数:29,代码来源:settings_model.php


示例11: get

 function get($id_param, $title = "", $uri = 0)
 {
     $d['left_top_menu'] = $this->app_global_web_model->generate_menu("kiri", "nav pull-left");
     $d['right_top_menu'] = $this->app_global_web_model->generate_menu("kanan", "nav pull-right");
     $d['center_bottom_menu'] = $this->app_global_web_model->generate_menu("footer");
     $d['combo_lokasi'] = $this->app_global_web_model->generate_combo_lokasi();
     $d['combo_kategori'] = $this->app_global_web_model->generate_combo_kategori();
     $d['list_kategori'] = $this->app_global_web_model->generate_list_kategori("nav nav-list");
     $d['left_artikel_hot'] = $this->app_global_web_model->generate_front_artikel($_SESSION['site_limit_artikel_hot'], 0, "counter", 1);
     $d['left_iklan_hot'] = $this->app_global_web_model->generate_list_iklan($_SESSION['site_limit_sidebar'], "counter");
     $d['left_iklan_new'] = $this->app_global_web_model->generate_list_iklan($_SESSION['site_limit_sidebar'], "id_iklan");
     $where['id_kategori'] = $id_param;
     $gen_menu = $this->db->get_where("dlmbg_kategori", $where);
     if ($gen_menu->num_rows() == 0) {
         redirect(base_url());
     }
     $menu_crumb = $gen_menu->row();
     $this->breadcrumb->append_crumb('BERANDA', base_url());
     $this->breadcrumb->append_crumb('KATEGORI', base_url() . 'web/kategori');
     $this->breadcrumb->append_crumb(strtoupper($menu_crumb->kategori), base_url() . 'web/kategori/get/' . $id_param . '/' . url_title($menu_crumb->kategori, '-', TRUE));
     $d['dt_retrieve'] = $this->app_global_web_model->generate_indexs_iklan_kategori($id_param, $_SESSION['site_limit_iklan_kategori'], $uri);
     $d['kategori_title'] = strtoupper($menu_crumb->kategori);
     $this->load->view($_SESSION['site_theme'] . '/bg_header', $d);
     $this->load->view($_SESSION['site_theme'] . '/kategori/bg_detail');
     $this->load->view($_SESSION['site_theme'] . '/bg_left');
     $this->load->view($_SESSION['site_theme'] . '/bg_footer');
 }
开发者ID:mylinkedshare,项目名称:Advertising,代码行数:27,代码来源:kategori.php


示例12: get_comments

 /**
  * Get a count of all the comments for a given thread id
  *
  * @param	int
  * @param	int
  */
 private function get_comments($thread_id)
 {
     $sql = "SELECT\n\t\t\t\tSQL_CALC_FOUND_ROWS\n\t      comments.comment_id,\n\t      comments.content,\n\t      comments.original_content,\n\t      comments.created,\n\t      comments.deleted,\n\t      comments.user_id AS author_id,\n\t      users.username AS author_name,\n\t      users.banned AS author_banned,\n\t      users.emoticon,\n\t      IFNULL(acquaintances.type, 0) AS author_acquaintance_type\n\t    FROM comments\n\t    LEFT JOIN users\n\t      ON comments.user_id = users.id\n\t    LEFT JOIN acquaintances\n\t      ON acquaintances.acq_user_id = users.id\n\t      AND acquaintances.user_id = ?\n\t    WHERE comments.thread_id = ?\n\t    ORDER BY comments.created\n\t    LIMIT ?, ?";
     $result = $this->db->query($sql, array($this->meta['user_id'], $thread_id, $this->page, $this->meta['comments_shown']));
     if (!$result->num_rows()) {
         return NULL;
     } else {
         $return = array();
         $i = 0;
         foreach ($result->result() as $row) {
             if ($row->deleted == '0') {
                 $return[$i] = (object) array('comment_id' => $row->comment_id, 'content' => $row->content, 'created' => strtotime($row->created), 'deleted' => 0, 'author_id' => (int) $row->author_id, 'author_name' => $row->author_name, 'author_banned' => (bool) $row->author_banned, 'url_safe_author_name' => url_title($row->author_name, 'dash'), 'emoticon' => (bool) $row->emoticon, 'author_acquaintance_type' => (int) $row->author_acquaintance_type, 'author_acquaintance_name' => $row->author_acquaintance_type == 1 ? 'buddy' : ($row->author_acquaintance_type == 2 ? 'enemy' : NULL), 'owner' => $this->meta['user_id'] == $row->author_id, 'editable' => $this->meta['user_id'] == $row->author_id && $row->created < time() - 60 * 60 * 24, 'show_controls' => $this->page == 0 && $this->meta['user_id'] == $row->author_id && !$i);
                 // update comments if the content doesnt match original
                 if ($row->content === '' && $row->content == _process_post($row->original_content)) {
                     $return[$i]->content = _process_post($row->original_content);
                     $this->db->query("UPDATE comments SET content = ? WHERE comment_id = ?", array($return[$i]->content, $row->comment_id));
                 }
                 if ($return[$i]->author_acquaintance_type == 2) {
                     ++$this->return->information->enemies;
                 }
             } else {
                 $return[$i] = (object) array('comment_id' => (int) $row->comment_id, 'created' => $row->created, 'deleted' => 1);
             }
             ++$i;
         }
         return $return;
     }
 }
开发者ID:notjosh,项目名称:seaforium,代码行数:34,代码来源:thread_model.php


示例13: update_cms

 public function update_cms($array)
 {
     if (isset($array['cms_name'])) {
         $this->db->set('cms_name', $array['cms_name']);
         // prepend the section if it is entered (added this way for backwards compatability)
         if (isset($array['site_section'])) {
             $this->db->set('cms_url', url_title($array['site_section']) . "_" . url_title($array['cms_name']));
         } else {
             $this->db->set('cms_url', url_title($array['cms_name']));
         }
     }
     if (isset($array['cms_text'])) {
         $this->db->set('cms_text', $array['cms_text']);
     }
     if (isset($array['custom_1'])) {
         $this->db->set('custom_1', $array['custom_1']);
     }
     if (isset($array['custom_2'])) {
         $this->db->set('custom_2', $array['custom_2']);
     }
     if (isset($array['site_section'])) {
         $this->db->set('site_section', $array['site_section']);
     }
     $this->db->where('cms_id', $array['cms_id']);
     $this->db->update('cms');
     log_message('debug', "updateCMS:" . trim($this->db->last_query()));
     return $this->db->affected_rows();
 }
开发者ID:holsinger,项目名称:openfloor,代码行数:28,代码来源:cms_model.php


示例14: edit

 function edit($id = 0)
 {
     if (!$id) {
         redirect('admin/news/index');
     }
     $this->load->library('validation');
     $this->validation->set_rules($this->rules);
     $this->validation->set_fields();
     $article = $this->news_m->getArticle($id, 'all');
     if ($this->validation->run()) {
         if ($this->news_m->updateArticle($_POST, $id)) {
             $this->session->set_flashdata(array('success' => 'The article "' . $this->input->post('title') . '" was updated.'));
             // The twitter module is here, and enabled!
             if ($this->settings->item('twitter_news') == 1 && ($article->status != 'live' && $this->input->post('status') == 'live')) {
                 $url = shorten_url('news/' . $this->input->post('created_on_year') . '/' . str_pad($this->input->post('created_on_month'), 2, '0', STR_PAD_LEFT) . '/' . url_title($this->input->post('title')));
                 $this->load->module_model('twitter', 'twitter_m');
                 $this->twitter_m->update(sprintf('Posted "%s" %s', $this->input->post('title'), $url));
             }
             // End twitter code
         } else {
             $this->session->set_flashdata(array('error' => 'An error occurred.'));
         }
         redirect('admin/news/index');
     }
     // Go through all the known fields and get the post values
     foreach (array_keys($this->rules) as $field) {
         if (isset($_POST[$field])) {
             $article->{$field} = $this->validation->{$field};
         }
     }
     $this->data->article =& $article;
     // Load WYSIWYG editor
     $this->layout->extra_head($this->load->view('fragments/wysiwyg', $this->data, TRUE));
     $this->layout->create('admin/form', $this->data);
 }
开发者ID:BenneX,项目名称:pyrocms,代码行数:35,代码来源:admin.php


示例15: insert_event_form

 function insert_event_form()
 {
     if (isset($_POST['event_name'])) {
         $this->db->set('event_name', $_POST['event_name']);
         $this->db->set('event_url_name', url_title($_POST['event_name']));
     }
     if (isset($_POST['event_desc'])) {
         $this->db->set('event_desc', $_POST['event_desc']);
     }
     if (isset($_POST['event_desc_brief'])) {
         $this->db->set('event_desc_brief', $_POST['event_desc_brief']);
     }
     if (isset($_POST['event_type'])) {
         $this->db->set('event_type', $_POST['event_type']);
     }
     if (isset($_POST['event_avatar'])) {
         $this->db->set('event_avatar', $_POST['event_avatar']);
     }
     if (isset($_POST['event_date'])) {
         $this->db->set('event_date', $_POST['event_date']);
     }
     if (isset($_POST['location'])) {
         $this->db->set('location', $_POST['location']);
     }
     $this->db->insert('cn_events');
     log_message('debug', "EVENT:insertEvent:" . trim($this->db->last_query()));
     $event_id = $this->db->insert_id();
     return $event_id;
 }
开发者ID:holsinger,项目名称:openfloor,代码行数:29,代码来源:event_model.php


示例16: on_before_clean

 function on_before_clean($values)
 {
     if (empty($value['slug'])) {
         $values['slug'] = url_title($values['name'], 'dash', TRUE);
     }
     return $values;
 }
开发者ID:ressphere,项目名称:cb_iloveproperty,代码行数:7,代码来源:events_model.php


示例17: update

 function update()
 {
     // var_dump($this->input->post('dtanggal_lahir'));
     // exit();
     $config = array('allowed_types' => 'jpg|jpeg|gif|png', 'upload_path' => $this->gallery_path, 'max_size' => 2000, 'file_name' => url_title($this->input->post('userfile')));
     $this->load->library('upload', $config);
     $this->upload->initialize($config);
     //meng set config yang sudah di atur
     if (!$this->upload->do_upload('userfile')) {
         $id_admin = $this->input->post('id_admin');
         $data = array('username' => $this->input->post('dusername'), 'password' => $this->input->post('dpassword'), 'nama_depan' => $this->input->post('dnama_depan'), 'nama_belakang' => $this->input->post('dnama_belakang'), 'nama_panggilan' => $this->input->post('dnama_panggilan'), 'jk' => $this->input->post('djk'), 'agama' => $this->input->post('dagama'), 'tempat_lahir' => $this->input->post('dtempat_lahir'), 'tanggal_lahir' => $this->input->post('dtanggal_lahir'), 'email' => $this->input->post('demail'), 'no_hp' => $this->input->post('dno_hp'), 'alamat' => $this->input->post('dalamat'));
         $this->m_profile_admin->update($id_admin, $data);
         echo "<script>alert('Data berhasil di ubah!');</script>";
         redirect('admin/c_profile_admin', 'refresh');
     } else {
         $id_guru = $this->input->post('did_guru');
         $map = $_SERVER['DOCUMENT_ROOT'];
         $path = $map . '/pengolahannilai/images/';
         $nama_photo = $this->input->post('gambar_dlt');
         $image = $path . $nama_photo;
         //hapus image
         unlink($image);
         $data = array('username' => $this->input->post('dusername'), 'password' => $this->input->post('dpassword'), 'nama_depan' => $this->input->post('dnama_depan'), 'nama_belakang' => $this->input->post('dnama_belakang'), 'nama_panggilan' => $this->input->post('dnama_panggilan'), 'jk' => $this->input->post('djk'), 'agama' => $this->input->post('dagama'), 'tempat_lahir' => $this->input->post('dtempat_lahir'), 'tanggal_lahir' => $this->input->post('dtanggal_lahir'), 'email' => $this->input->post('demail'), 'no_hp' => $this->input->post('dno_hp'), 'alamat' => $this->input->post('dalamat'), 'photo' => $this->upload->file_name);
         $this->m_profile_admin->update($id_guru, $data);
         echo "<script>alert('Data berhasil di ubah!');</script>";
         redirect('admin/c_profile_admin', 'refresh');
     }
 }
开发者ID:FahmiAchmadF,项目名称:dinamik,代码行数:28,代码来源:c_profile_admin.php


示例18: on_before_clean

 function on_before_clean($values)
 {
     if (empty($values['permalink']) && !empty($values['name'])) {
         $values['permalink'] = url_title($values['name'], 'dash', TRUE);
     }
     return $values;
 }
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:7,代码来源:blog_categories_model.php


示例19: addpage_

 function addpage_()
 {
     $data['headingtop'] = 'CMS > Manage Pages > Add Page';
     $data['title'] = 'Add Page';
     $this->load->library('form_validation');
     // field name, error message, validation rules
     $this->form_validation->set_rules('title', 'Title', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         $this->load->library('ckeditor', base_url() . 'system/plugins/ckeditor/');
         $this->ckeditor->basePath = base_url() . 'system/plugins/ckeditor/';
         $this->ckeditor->ToolbarSet = 'Basic';
         $data['errormess'] = '1';
         $data['main_content'] = 'admin/cms/addpage';
         $this->load->view('admin/template', $data);
     } else {
         $title = addslashes($this->input->post('title'));
         $content = addslashes($this->input->post('editor1'));
         $url = url_title($title);
         $query = $this->db->query("Select * From tblpages WHERE pagename = '{$url}'");
         if ($query->num_rows() != 0) {
             $hash = rand(1, 1000);
             $url = $url . $hash;
         }
         $data['errormess'] = '';
         $data = array('title' => $title, 'parent' => $this->input->post('parent'), 'position' => $this->input->post('position'), 'isActive' => $this->input->post('isactive'), 'ispublic' => $this->input->post('ispublic'), 'seqno' => $this->input->post('seqno'), 'content' => $content, 'pagename' => $url, 'meta_title' => addslashes($this->input->post('meta_title')), 'meta_keywords' => addslashes($this->input->post('meta_keywords')), 'meta_decrip' => addslashes($this->input->post('meta_decrip')));
         $this->db->insert('tblpages', $data);
         redirect(base_url() . 'admin/cms/', 'refresh');
     }
 }
开发者ID:affanus,项目名称:new_app,代码行数:29,代码来源:cms.php


示例20: update

 function update($id)
 {
     $data = array('title' => $this->input->post('title'), 'permalink' => url_title(strtolower($this->input->post('title'))), 'body' => $this->input->post('body'), 'status' => $this->input->post('status'), 'modified' => date('Y-m-d H:i:s'));
     $this->db->where('id', $id);
     $this->db->update($this->table, $data);
     return TRUE;
 }
开发者ID:noczero,项目名称:Zero-Inside,代码行数:7,代码来源:page.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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