当前位置: 首页>>代码示例>>PHP>>正文


PHP get_title函数代码示例

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


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

示例1: get_head

    function get_head()
    {
        global $page;
        global $key;
        global $desc;
        $_TITLE = get_title();
        if (isset($_REQUEST['id'])) {
            $desc = print_article("meta_description");
            $key = print_article("meta_key_words");
        } elseif ($page == 'static') {
            $desc = print_static("meta_description");
            $key = print_static("meta_key_words");
        }
        if ($page == 'crt_artcl' || $page == 'game_redactor' || $page == 'admin') {
            $ckeditor = '<script type="text/javascript" src="' . ENGINE_URL . '/lib/ckeditor/ckeditor.js"></script>';
        } else {
            $ckeditor = '';
        }
        $_TITLE = array_reverse($_TITLE);
        $title = implode(' | ', $_TITLE);
        $r = '
                            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                            <meta name="description" content="' . $desc . '" />
                            <meta name="keywords" content="' . $key . '" />
                            <meta name="generator" content="Tractor Engine">
                            <meta name="htotutunas" content="' . ENGINE_URL . '">
                            <title>' . $title . '</title>
                            <link href="' . ENGINE_URL . '/lib/geshi/code_style.css" rel="stylesheet" type="text/css" media="all" />
                            <link title="' . my_lang('feed_desc') . '" href="' . SITE_RSS . '" type=application/rss+xml rel=alternate>
                            <link rel="icon" href="' . SITE_URL . '/favicon.png" type="image/x-icon" /> 

            ' . $ckeditor;
        return $r;
    }
开发者ID:noisywiz,项目名称:tractor,代码行数:34,代码来源:view.php

示例2: get_crumbs

 function get_crumbs()
 {
     global $page;
     $_TITLE = get_title();
     //массив заголовков
     if ($page == 'main') {
         $crumbs = '';
     } else {
         foreach ($_TITLE as $k => $v) {
             switch ($k) {
                 //case 0: $crumbs = $crumbs . '<a href="'.get_link('main').'">'.$v.'</a>'; break;
                 case 1:
                     if ($page == 'static') {
                         $crumbs = $crumbs . ' <span>:: ' . $v . '</span>';
                     } else {
                         $crumbs = $crumbs . ' <span>:: </span><a href="' . get_link('page') . '">' . $v . '</a>';
                     }
                     break;
                 case 2:
                     $crumbs = $crumbs . ' <span>:: </span><a href="' . get_link('category') . '">' . $v . '</a>';
                     break;
                 case 3:
                     $crumbs = $crumbs . ' <span>:: ' . $v . '</span>';
                     break;
             }
         }
     }
     return $crumbs;
 }
开发者ID:noisywiz,项目名称:tractor,代码行数:29,代码来源:view.php

示例3: programmatically_create_post

function programmatically_create_post()
{
    $url = 'http://widgets.pinterest.com/v3/pidgets/boards/bradleyblose/my-stuff/pins/';
    $json_O = json_decode(file_get_contents($url), true);
    $id = $json_O['data']['pins'][0]['id'];
    $titlelink = 'https://www.pinterest.com/pin/' . $id . '/';
    $title = get_title($titlelink);
    var_dump($title);
    $original = $json_O['data']['pins'][0]['images']['237x']['url'];
    $image_url = preg_replace('/237x/', '736x', $original);
    $description = $json_O['data']['pins'][0]['description'];
    // Initialize the page ID to -1. This indicates no action has been taken.
    $post_id = -1;
    // Setup the author, slug, and title for the post
    $author_id = 1;
    $mytitle = get_page_by_title($title, OBJECT, 'post');
    var_dump($mytitle);
    // If the page doesn't already exist, then create it
    if (NULL == get_page_by_title($title, OBJECT, 'post')) {
        // Set the post ID so that we know the post was created successfully
        $post_id = wp_insert_post(array('comment_status' => 'closed', 'ping_status' => 'closed', 'post_author' => $author_id, 'post_name' => $title, 'post_title' => $title, 'post_content' => $description, 'post_status' => 'publish', 'post_type' => 'post'));
        //upload featured image
        $upload_dir = wp_upload_dir();
        $image_data = file_get_contents($image_url);
        $filename = basename($image_url);
        if (wp_mkdir_p($upload_dir['path'])) {
            $file = $upload_dir['path'] . '/' . $filename;
            $path = $upload_dir['path'] . '/';
        } else {
            $file = $upload_dir['basedir'] . '/' . $filename;
            $path = $upload_dir['basedir'] . '/';
        }
        file_put_contents($file, $image_data);
        //edit featured image to correct specs to fit theme
        $pngfilename = $filename . '.png';
        $targetThumb = $path . '/' . $pngfilename;
        $img = new Imagick($file);
        $img->scaleImage(250, 250, true);
        $img->setImageBackgroundColor('None');
        $w = $img->getImageWidth();
        $h = $img->getImageHeight();
        $img->extentImage(250, 250, ($w - 250) / 2, ($h - 250) / 2);
        $img->writeImage($targetThumb);
        unlink($file);
        //Attach featured image
        $wp_filetype = wp_check_filetype($pngfilename, null);
        $attachment = array('post_mime_type' => $wp_filetype['type'], 'post_title' => sanitize_file_name($pngfilename), 'post_content' => '', 'post_status' => 'inherit');
        $attach_id = wp_insert_attachment($attachment, $targetThumb, $post_id);
        require_once ABSPATH . 'wp-admin/includes/image.php';
        $attach_data = wp_generate_attachment_metadata($attach_id, $targetThumb);
        wp_update_attachment_metadata($attach_id, $attach_data);
        set_post_thumbnail($post_id, $attach_id);
        // Otherwise, we'll stop
    } else {
        // Arbitrarily use -2 to indicate that the page with the title already exists
        $post_id = -2;
    }
    // end if
}
开发者ID:TehRawrz,项目名称:PinterestPoster,代码行数:59,代码来源:pinterestposter.php

示例4: template_history

function template_history($args)
{
    global $DiffScript;
    //echo "<p>template_history(".print_r($args,True).")</p>";
    template_common_prologue(array('norobots' => 1, 'title' => lang('History of') . ' ' . get_title($args['page']), 'heading' => lang('History of') . ' ', 'headlink' => $args['page'], 'headsufx' => '', 'toolbar' => 1));
    ?>
<div id="body">
  <form method="get" action="<?php 
    print $DiffScript;
    ?>
">
  <div class="form">
    <input type="hidden" name="action" value="diff" />
    <input type="hidden" name="page" value="<?php 
    print $args['page']['name'];
    ?>
" />
    <input type="hidden" name="lang" value="<?php 
    print $args['page']['lang'];
    ?>
" />
<table border="0">
  <tr><td><strong><?php 
    echo lang('Older');
    ?>
</strong></td>
      <td><strong><?php 
    echo lang('Newer');
    ?>
</strong></td><td></td></tr>
<?php 
    print $args['history'];
    ?>
  <tr><td colspan="3">
    <input type="submit" value="<?php 
    echo lang('Compute Difference');
    ?>
" /></td></tr>
</table>
  </div>
  </form>
<hr /><br />

<strong><?php 
    echo lang('Changes by last author');
    ?>
:</strong><br /><br />

<?php 
    print $args['diff'];
    ?>
</div>
<?php 
    template_common_epilogue(array('twin' => $args['page'], 'edit' => '', 'editver' => 0, 'history' => '', 'timestamp' => '', 'nosearch' => 0));
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:55,代码来源:history.php

示例5: load_page

 /**
  *
  * Load the apropriate page acording the given parametar
  *
  * @param name of the page
  *
  * @param page_arguments object
  *
  * @return Send the page to browser
  *
  *
  */
 public function load_page($page_name, $args)
 {
     $page = $this->page_handler->load_page($page_name);
     $shortcodes = $this->shortcodes;
     if ($page == FALSE) {
         show_404();
     } else {
         $page->content = $shortcodes->do_shortcode($page->content);
         $data['page'] = $page;
     }
     if (isset($page->category)) {
         $this->load->library('post_handler');
         if ($page_name == 'home' or $page->category == 1) {
             $this->load->library('user_agent');
             $data['browser'] = $this->agent->is_browser();
             $data['pages'] = $this->page_handler->load_pages($page->category, 'temi');
         } else {
             $data['posts'] = $this->post_handler->load_posts($page->category);
         }
     }
     set_active_page($page->name);
     set_title($page->title);
     foreach ($args as $key => $value) {
         $data[$key] = $value;
     }
     if ($data['ajax']) {
         if ($page_name == 'news' && isset($args[0])) {
             $data['post'] = $this->post_handler->load_post($args[0]);
             $data_json = array('body' => $this->load->view('templates/single', $data, true), 'title' => $data['post']->title);
             $this->output->set_output(json_encode($data_json));
         } else {
             if (file_exists(APPPATH . "views/templates/" . $page->template) && isset($page->template) && $page->template != 'default') {
                 $data_json = array('body' => $this->load->view('templates/' . $page->template, $data, true), 'title' => get_title());
                 $this->output->set_output(json_encode($data_json));
             } else {
                 $page->content = $shortcodes->do_shortcode($page->content);
                 $data_json = array('body' => $this->load->view('templates/page', $data, true), 'title' => get_title());
                 $this->output->set_output(json_encode($data_json));
             }
         }
     } else {
         if ($page_name == 'news' && isset($args[0])) {
             $data['post'] = $this->post_handler->load_post($args[0]);
             set_title($data['post']->title);
             $this->load->view('templates/single', $data);
         } else {
             if (file_exists(APPPATH . "views/templates/" . $page->template) && isset($page->template) && $page->template != 'default') {
                 $this->load->view('templates/' . $page->template, $data);
             } else {
                 $this->load->view('templates/page', $data);
             }
         }
     }
 }
开发者ID:borka-s,项目名称:e-learning,代码行数:66,代码来源:Pages.php

示例6: create_headings

/** Luo HTML alaotsikoille
 * @param $question_id integer
 * @return string
 */
function create_headings($question_id)
{
    $title = get_title($question_id);
    /*
     * $title string
     */
    echo "<div id='top_header_main'>";
    // To print the header of the question
    create_question_title($title, $question_id);
    echo "</div>";
    // to end question_title block
}
开发者ID:vilsu,项目名称:codes,代码行数:16,代码来源:fetch_a_question.php

示例7: goods_export

 protected function goods_export($goods_list = array())
 {
     //print_r($goods_list);exit;
     $goods_list = $goods_list;
     $data = array();
     foreach ($goods_list as $k => $goods_info) {
         $data[$k][id] = $goods_info['id'];
         $data[$k][title] = $goods_info['title'];
         $data[$k][PNO] = $goods_info['PNO'];
         $data[$k][old_PNO] = $goods_info['old_PNO'];
         $data[$k][price] = $goods_info['price'];
         $data[$k][brand_id] = get_title('brand', $goods_info['brand_id']);
         $data[$k][category_id] = get_title('category', $goods_info['category_id']);
         $data[$k][type_ids] = get_type_title($goods_info['id']);
         $data[$k][add_time] = $goods_info['add_time'];
     }
     //print_r($goods_list);
     //print_r($data);exit;
     foreach ($data as $field => $v) {
         if ($field == 'id') {
             $headArr[] = '产品ID';
         }
         if ($field == 'title') {
             $headArr[] = '产品名称';
         }
         if ($field == 'PNO') {
             $headArr[] = '零件号';
         }
         if ($field == 'old_PNO') {
             $headArr[] = '原厂参考零件号';
         }
         if ($field == 'price') {
             $headArr[] = '原厂参考面价';
         }
         if ($field == 'type_ids') {
             $headArr[] = '品牌';
         }
         if ($field == 'brand_id') {
             $headArr[] = '类别';
         }
         if ($field == 'category_id') {
             $headArr[] = '适用机型';
         }
         if ($field == 'add_time') {
             $headArr[] = '添加时间';
         }
     }
     $filename = "goods_list";
     $this->getExcel($filename, $headArr, $data);
 }
开发者ID:Aaron-zh,项目名称:ThinkPHPFull,代码行数:50,代码来源:GoodsController.class.php

示例8: index

 public function index()
 {
     set_active_page('wastemap');
     $page = $this->page_handler->load_page('wastemap');
     set_title($page->title);
     $ajax = $this->input->is_ajax_request();
     $data['ajax'] = $ajax;
     if ($ajax) {
         $data_json = array('body' => $this->load->view('main_pages/wastemap' . $page->template, $data, true), 'title' => get_title());
         $this->output->set_output(json_encode($data_json));
     } else {
         $this->load->view('main_pages/wastemap', $data, FALSE);
     }
 }
开发者ID:borka-s,项目名称:ajde_makedonija,代码行数:14,代码来源:wastemap.php

示例9: index

 public function index($slug)
 {
     $this->load->library('user_agent');
     $this->load->helper('meta');
     $data = $this->mongo_db->page->findOne(array('slug' => $slug));
     if (!isset($data['slug'])) {
         $this->redirect($slug, NULL, NULL, 'page/index/');
         show_404(uri_string(), FALSE);
     }
     if (!$this->agent->is_robot()) {
         $this->mongo_db->page->update(array('_id' => new MongoId($data['_id'])), array('$set' => array('counter' => ++$data['counter'])));
     }
     $this->template->set_keyword(get_keyword($data))->set_description(get_description($data))->set_title(get_title($data))->view('index', $data)->render();
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:14,代码来源:page.php

示例10: join_am

 public function join_am()
 {
     set_active_page('join');
     set_title(t('title_join_am'));
     $ajax = $this->input->is_ajax_request();
     $data['ajax'] = $ajax;
     if ($ajax) {
         $data_json = array('body' => $this->load->view('main_pages/join_am', $data, true), 'title' => get_title());
         $this->output->set_output(json_encode($data_json));
     } else {
         // $data['post'] = $this->post_handler->load_post($args[0]);
         $this->load->view('main_pages/join_am', $data, FALSE);
     }
 }
开发者ID:borka-s,项目名称:e-learning,代码行数:14,代码来源:User.php

示例11: validate_page

function validate_page($page)
{
    global $FlgChr;
    $page = get_title($page);
    $p = parse_wikiname($page, 1);
    if (preg_match('/^' . $FlgChr . '\\d+' . $FlgChr . '$/', $p)) {
        return 1;
    }
    $p = parse_freelink('((' . $page . '))', 1);
    if (preg_match('/^' . $FlgChr . '\\d+' . $FlgChr . '$/', $p)) {
        return 2;
    }
    //echo "<p>parse/transforms::validdate_page('$page')==0</p>\n";
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:15,代码来源:transforms.php

示例12: FixURLsData

function FixURLsData($data)
{
    //echo $data;
    $MyAllWords = explode(" ", $data);
    foreach ($MyAllWords as $key => $value) {
        if (strpos($MyAllWords[$key], 'http') !== false || strpos($MyAllWords[$key], 'www.') !== false) {
            $FirstLetterIsFound = 0;
            $IndexOfLastLetter = 0;
            for ($counter = strlen($MyAllWords[$key]) - 1; $counter > 0; $counter--) {
                if ($FirstLetterIsFound == 0) {
                    $char = $MyAllWords[$key][$counter];
                    //echo "<p>";
                    if (preg_match('/[a-zA-Z1-9]/', $char)) {
                        $IndexOfLastLetter = $counter + 1;
                        $FirstLetterIsFound = 1;
                        //echo $char.' is a letter';
                    } else {
                        //echo $char.' isn\'t a letter';
                    }
                    //echo "</p>";
                }
            }
            //echo "<p>IndexOfLastLetter - ".$IndexOfLastLetter."</p>";
            $MyDoneURL = mb_substr($MyAllWords[$key], 0, $IndexOfLastLetter);
            $TitleOfPage = get_title($MyDoneURL);
            if (strlen($TitleOfPage) <= 0) {
                $TitleOfPage = "link";
            }
            $MyTextAfterURL = mb_substr($MyAllWords[$key], $IndexOfLastLetter, strlen($MyAllWords[$key]) - 1);
            $MyAllWords[$key] = '<a id = "MyDataURL" target = "blank" href = "' . $MyDoneURL . '">' . $TitleOfPage . "</a>" . $MyTextAfterURL;
        }
    }
    unset($value);
    unset($key);
    $DoneText = "";
    $ForFirstTime = 1;
    foreach ($MyAllWords as $value) {
        if ($ForFirstTime == 1) {
            $ForFirstTime = 0;
            $Space = "";
        } else {
            $Space = " ";
        }
        $DoneText .= $Space . $value;
    }
    unset($value);
    return $DoneText;
}
开发者ID:Hideyoshi1,项目名称:DYH,代码行数:48,代码来源:FixURLLinks.php

示例13: index

 public function index()
 {
     $this->load->library('user_agent');
     $this->load->helper('meta');
     $slug = $this->uri->uri_string();
     $data = $this->mongo_db->post->findOne(array('slug' => $slug, 'status' => 'publish'));
     if (!isset($data['slug'])) {
         $this->redirect($slug, NULL, NULL, 'post/index/');
         $this->show_404();
         return;
     }
     if (!$this->agent->is_robot()) {
         $this->mongo_db->post->update(array('_id' => new MongoId($data['_id'])), array('$set' => array('counter' => ++$data['counter'])));
     }
     $related = $this->mongo_db->post->find(array('_id' => array('$ne' => $data['_id']), 'tags' => array('$in' => $data['tags'])))->limit(3);
     $data['related'] = iterator_to_array($related);
     $this->template->set_keyword(get_keyword($data))->set_description(get_description($data))->set_title(get_title($data))->view('index', $data)->render();
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:18,代码来源:post.php

示例14: generalshow

function generalshow()
{
    global $gbl, $login, $ghtml;
    $title = get_title();
    $gbl->setSessionV("redirect_to", "/display.php?frm_action=show");
    ?>
	<head>
	<title> <?php 
    echo $title;
    ?>
 </title>
	<FRAMESET frameborder=0 rows="98,*" border=0>
	<FRAME name=top src="/header.php" scrolling=no border=0> 
	<FRAME name=mainframe src="/display.php?frm_action=update&frm_subaction=general&frm_ev_list=frm_emailid&frm_emessage=set_emailid">
	</FRAMESET>
	</head>
	<?php 
}
开发者ID:zseand,项目名称:kloxo,代码行数:18,代码来源:index.php

示例15: initialize

 function initialize($page, $condition = FALSE, $id = NULL)
 {
     $username = $this->get_username();
     $this->redirect_for_capability($username);
     $this->add_pageview($username, uri_string());
     $return['username'] = $username;
     $return['fullname'] = get_fullname($username, FALSE);
     $return['pageid'] = uri_string();
     $return['placeholder'] = 'Quizzes';
     $return['fileid'] = $page;
     $return['status'] = '';
     $return['page_type'] = '';
     $return['oel'] = FALSE;
     $return['session'] = $username == '' ? FALSE : TRUE;
     if ($page == 'About' || $page == 'FAQ' || $page == 'tour' || $page == 'business') {
         $return['oel'] = TRUE;
     }
     if ($page == "people" || $page == "find") {
         $return['content_type'] = $page;
         if ($page == "find") {
             $page = "quizzes";
         }
         $return['title'] = ucfirst($page);
     } elseif ($condition == FALSE) {
         $return['content_type'] = $page;
         $return['title'] = ucfirst($page);
         $return['userid'] = $username;
     } else {
         if (is_numeric($id)) {
             $return['content_type'] = "quiz";
             $return['title'] = get_title($id, FALSE);
             $return['quizid'] = $id;
         } else {
             $return['content_type'] = "user";
             $return['title'] = get_fullname($id, FALSE);
             $return['userid'] = $id;
         }
     }
     $return['sidebar_type'] = $return['content_type'];
     return $return;
 }
开发者ID:stephenou,项目名称:OneExtraLap,代码行数:41,代码来源:global_function.php


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