Ejemplo n.º 1
0
function meta_title()
{
    if (is_single()) {
        single_post_title();
        echo ' | ';
        bloginfo('name');
    } elseif (is_home() || is_front_page()) {
        bloginfo('name');
        if (get_bloginfo('description')) {
            echo ' | ';
            bloginfo('description');
            get_page_number();
        }
    } elseif (is_page()) {
        single_post_title('');
        echo ' | ';
        bloginfo('name');
    } elseif (is_search()) {
        printf(__('有关 %s 的搜索结果:'), '"' . get_search_query() . '"');
        get_page_number();
        echo ' | ';
        bloginfo('name');
    } elseif (is_404()) {
        _e('404 Not Found', 'Arnold');
        echo ' | ';
        bloginfo('name');
    } else {
        wp_title('');
        echo ' | ';
        bloginfo('name');
        get_page_number();
    }
}
Ejemplo n.º 2
0
function cargopress_title() {
  if ( is_single() ) { single_post_title(); }
  elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }
  elseif ( is_page() ) { single_post_title(''); }
  elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); }
  elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; }
  else { bloginfo('name'); wp_title('|'); get_page_number(); }
}
Ejemplo n.º 3
0
 /**
  * The default landing page. Show a list of all the posts, including the inactive ones.
  */
 public function index()
 {
     if ($this->session->userdata('confirmation')) {
         $this->session->unset_userdata('confirmation');
     }
     // the parameter 'all' is used to also display inactive posts in the posts section of the dashboard
     $posts = $this->post_model->get_posts('all');
     if ($posts['count'] == 0) {
         // if there are no posts we don't want to load the regular posts view file or we'll get an error
         $data['view_file'] = 'posts/no-posts';
     } else {
         $data['posts'] = $posts['list'];
         $data['posts_count'] = $posts['count'];
         // ------------------------------------------------------------------------
         // Pagination
         // ------------------------------------------------------------------------
         // config for the pagination of the content (posts)
         $data['posts_per_page'] = 10;
         $data['offset'] = $this->uri->segment(4);
         // If the offset is invalid or NULL (in which case the user goes back to the first page anyway)
         // the user is sent back to the first page and a feedback message is displayed
         if ((!is_valid_number($data['offset']) || !array_key_exists($data['offset'], $data['posts'])) && !empty($data['offset'])) {
             $this->session->set_flashdata('notice', 'Invalid Request');
             redirect('admin/posts/index/0');
         }
         $this->load->library('pagination');
         $config['base_url'] = site_url('/admin/posts/index');
         $config['total_rows'] = $posts['count'];
         $config['per_page'] = $data['posts_per_page'];
         $config['num_links'] = 10;
         $config['uri_segment'] = 4;
         $config['full_tag_open'] = '<div class="pagination-links">';
         $config['full_tag_close'] = '</div>';
         $this->pagination->initialize($config);
         $data['pagination_links'] = $this->pagination->create_links();
         // Dynamically generate the posts pagination everytime the user clicks on a pagination link
         $data['posts'] = paginate($posts['list'], $data['posts_count'], $data['posts_per_page'], $data['offset']);
         // ------------------------------------------------------------------------
         // ------------------------------------------------------------------------
         // Breadcrumbs
         // ------------------------------------------------------------------------
         // the page number segment of the breadcrumbs will only appear if there is at least two pages
         if ($posts['count'] > $config['per_page']) {
             $_seg_title = 'page ' . get_page_number($data['offset'], $data['posts_per_page']);
             $_seg_url = 'admin/posts/index/' . $data['offset'];
             $breadcrumbs = $this->azbraz->new_segment($_seg_title, $_seg_url);
         } else {
             $breadcrumbs = '';
         }
         $data['breadcrumbs'] = $this->azbraz->generate($breadcrumbs);
         // ------------------------------------------------------------------------
         $data['view_file'] = 'admin/posts/index';
     }
     $this->load->view($this->main_admin_view, $data);
 }
Ejemplo n.º 4
0
function bb_quote_link($link_text = 'Quote')
{
    global $bb, $page, $topic, $forum, $bb_post;
    $add = topic_pages_add();
    if (!topic_is_open($bb_post->topic_id) || !bb_is_user_logged_in()) {
        return;
    }
    $post_id = get_post_id();
    $last_page = get_page_number($topic->topic_posts + $add);
    echo '<a href="' . get_topic_link(0, $last_page) . '&quote=' . $post_id . '#postform" id="quote_' . $post_id . '">' . __($link_text) . '</a>';
}
Ejemplo n.º 5
0
    print ' | ';
    bloginfo('description');
    get_page_number();
} elseif (is_page()) {
    single_post_title('');
} elseif (is_search()) {
    bloginfo('name');
    print ' | Search results for ' . wp_specialchars($s);
    get_page_number();
} elseif (is_404()) {
    bloginfo('name');
    print ' | Not Found';
} else {
    bloginfo('name');
    wp_title('|');
    get_page_number();
}
?>
</title>
 
    <meta http-equiv="content-type" content="<?php 
bloginfo('html_type');
?>
; charset=<?php 
bloginfo('charset');
?>
" />
 
    <link rel="stylesheet" type="text/css" href="<?php 
bloginfo('stylesheet_url');
?>
Ejemplo n.º 6
0
    } else {
        $mime_type = get_lang('No mime-type available');
    }
    // Display image
    $out .= '<p style="text-align: center;">' . '<a href="#"><img id="mainImage" src="' . claro_htmlspecialchars(Url::Contextualize($doc_url)) . '" alt="' . $fileName . '" /></a>' . '</p>' . "\n" . '<p style="text-align: center;">' . '<a href="' . claro_htmlspecialchars(Url::Contextualize($doc_url)) . '">' . get_lang('Direct link to image') . '</a>' . '</p>' . "\n";
    // Display image info (title, size, color depth, mime-type)
    $out .= '<br />' . '<small>[ Info : ' . $imgTitle . ' - ' . $width . 'x' . $height . ' - ' . format_file_size($fileList[$imgKey]['size']) . ' - ' . $depth . 'bits' . ' - ' . $mime_type . ' ]</small>' . "\n";
} elseif ($docView == 'thumbnails') {
    // intialize page number
    $page = 1;
    // if not set, set to first page
    if (isset($_REQUEST['page'])) {
        $page = $_REQUEST['page'];
    }
    if (isset($_REQUEST['offset'])) {
        $page = get_page_number($_REQUEST['offset']);
    }
    $searchCmdUrl = "";
    if (isset($_REQUEST['searchPattern'])) {
        $searchCmdUrl = '&amp;cmd=exSearch&amp;searchPattern=' . rawurlencode($_REQUEST['searchPattern']);
    }
    // compute column width
    $colWidth = round(100 / get_conf('numberOfCols', 3));
    // display table
    $out .= "\n" . '<table class="claroTable" width="100%">' . "\n";
    // View Mode Bar
    if ($cmd == 'exSearch') {
        $curDirLine = get_lang('Search result');
    } elseif ($curDirName) {
        $curDirLine = '<img src="' . get_icon_url('opendir') . '" alt="" />' . "\n" . $dspCurDirName . "\n";
    } else {
Ejemplo n.º 7
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
    <title><?php
        if ( is_single() ) { single_post_title(); }       
        elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); get_page_number(); }
        elseif ( is_page() ) { single_post_title(''); }
        elseif ( is_search() ) { bloginfo('name'); print ' | Search results for ' . wp_specialchars($s); get_page_number(); }
        elseif ( is_404() ) { bloginfo('name'); print ' | Not Found'; }
        else { bloginfo('name'); wp_title('|'); get_page_number(); }
    ?></title>
	
	<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
	
	<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
	
	<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
	
	<?php wp_head(); ?>
	
	<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf( __( '%s latest posts', 'uthili' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
	<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php printf( __( '%s latest comments', 'uthili' ), wp_specialchars( get_bloginfo('name'), 1 ) ); ?>" />
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
        <link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold|Droid+Sans+Mono" />
</head>

<body <?php body_class(); ?>>
<div id="wrapper" class="hfeed">

	<div id="header">
		<div id="masthead">
Ejemplo n.º 8
0
 public function index($status = NULL)
 {
     // by default we want to display the ham only
     if ($status !== 'ham' && $status !== 'spam') {
         if (!empty($status)) {
             $data['notice'] = 'Invalid Request';
         }
         $status = 'ham';
     }
     // get either the ham or the spam depending on the location of the user
     if ($status === 'ham' || $status === 'spam') {
         $data['section_title'] = ucfirst($status);
         $comments = $this->comment_model->get_comments('', $status);
     }
     // if there are no comments, we load a different view so that we don't get an error
     if ($comments['count'] == 0) {
         $data['comments'] = 'No ' . $status . ' comments have been posted yet...';
         $data['view_file'] = 'comments/no-comments';
     } else {
         $data['view_file'] = 'admin/comments/index';
         // isolate the comments count and the comments list in seperate variables
         $data['comments_count'] = $comments['count'];
         $data['comments'] = $comments['list'];
         // ------------------------------------------------------------------------
         // Pagination
         // ------------------------------------------------------------------------
         // configuration of the comments pagination
         $data['comments_per_page'] = 10;
         $data['offset'] = $this->uri->segment(5);
         // If the offset is invalid or NULL (in which case the user goes back to the first page anyway)
         // the user is sent back to the first page and a feedback message is displayed
         if ((!is_valid_number($data['offset']) || !array_key_exists($data['offset'], $data['comments'])) && !empty($data['offset'])) {
             $this->session->set_flashdata('notice', 'Invalid Request');
             redirect('admin/comments/index/' . $status . '/0');
         }
         // load the pagination library
         $this->load->library('pagination');
         // configuration of the pagination links
         $config['base_url'] = site_url('/admin/comments/index/' . $status);
         $config['total_rows'] = $data['comments_count'];
         $config['per_page'] = $data['comments_per_page'];
         $config['num_links'] = 10;
         $config['uri_segment'] = 5;
         $config['full_tag_open'] = '<div class="pagination_links"';
         $config['full_tag_close'] = '</div>';
         // initialize pagination with the configuration array above
         $this->pagination->initialize($config);
         // create pagination links and store them in an array
         $data['pagination_links'] = $this->pagination->create_links();
         // dynamically generate the posts pagination everytime the user clicks on a pagination link
         $data['comments'] = paginate($comments['list'], $data['comments_count'], $data['comments_per_page'], $data['offset']);
         // ------------------------------------------------------------------------
         // ------------------------------------------------------------------------
         // Breadcrumbs
         // ------------------------------------------------------------------------
         $_seg_title = 'page ' . get_page_number($data['offset'], $data['comments_per_page']);
         $_seg_url = 'admin/comments/index/' . $data['offset'];
         $breadcrumbs = $this->azbraz->new_segment($_seg_title, $_seg_url);
         $_seg_title = ucfirst($status);
         $_seg_url = 'admin/comments/' . $status;
         $breadcrumbs = $this->azbraz->new_segment($_seg_title, $_seg_url);
         $data['breadcrumbs'] = $this->azbraz->generate($breadcrumbs);
         // ------------------------------------------------------------------------
     }
     $this->load->view($this->main_admin_view, $data);
 }
Ejemplo n.º 9
0
function mass_edit_get_post_link($post_id = 0)
{
    // to do, get proper page link for delete posts based on complete post count, not position
    $bb_post = bb_get_post(get_post_id($post_id));
    $page = get_page_number($bb_post->post_position);
    $link = get_topic_link($bb_post->topic_id, $page) . "#post-{$bb_post->post_id}";
    if ($bb_post->post_status) {
        $link = add_query_arg('view', 'all', $link);
    }
    return $link;
    // apply_filters( 'get_post_link', $link, $bb_post->post_id );
}