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

PHP get_catname函数代码示例

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

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



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

示例1: _cat_row

function _cat_row($category, $level, $name_override = false)
{
    global $class;
    $pad = str_repeat('— ', $level);
    if (current_user_can('manage_categories')) {
        $edit = "<a href='categories.php?action=edit&amp;cat_ID={$category->term_id}' class='edit'>" . __('Edit') . "</a></td>";
        $default_cat_id = (int) get_option('default_category');
        if ($category->term_id != $default_cat_id) {
            $edit .= "<td><a href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID={$category->term_id}", 'delete-category_' . $category->term_id) . "' onclick=\"return deleteSomething( 'cat', {$category->term_id}, '" . js_escape(sprintf(__("You are about to delete the category '%s'.\nAll posts that were only assigned to this category will be assigned to the '%s' category.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop."), $category->name, get_catname($default_cat_id), get_catname($default_link_cat_id))) . "' );\" class='delete'>" . __('Delete') . "</a>";
        } else {
            $edit .= "<td style='text-align:center'>" . __("Default");
        }
    } else {
        $edit = '';
    }
    $class = defined('DOING_AJAX') && DOING_AJAX || " class='alternate'" == $class ? '' : " class='alternate'";
    $category->count = number_format_i18n($category->count);
    $posts_count = $category->count > 0 ? "<a href='edit.php?cat={$category->term_id}'>{$category->count}</a>" : $category->count;
    $output = "<tr id='cat-{$category->term_id}'{$class}>\n\t\t<th scope='row' style='text-align: center'>{$category->term_id}</th>\n\t\t<td>" . ($name_override ? $name_override : $pad . ' ' . $category->name) . "</td>\n\t\t<td>{$category->description}</td>\n\t\t<td align='center'>{$posts_count}</td>\n\t\t<td>{$edit}</td>\n\t</tr>\n";
    return apply_filters('cat_row', $output);
}
开发者ID:64kbytes,项目名称:stayinba,代码行数:21,代码来源:template.php


示例2: display_entry

function display_entry($post)
{
    $category = get_catname($post->category);
    ?>
	<h3><?php 
    echo $post->title;
    ?>
</h3>
	<a href="<?php 
    echo 'http://127.0.0.1/blog/show_cat.php?id=' . $post->category;
    ?>
"><p><?php 
    echo $category;
    ?>
</p></a>
	<p><?php 
    echo $post->body;
    ?>
</p>
<?php 
    echo "<hr>";
}
开发者ID:pyhale,项目名称:PHPblog,代码行数:22,代码来源:output_fns.php


示例3: getAllCats

 function getAllCats($force = false)
 {
     /*
      * gets all published site categories (same format as getAllTags)
      */
     if (is_null($this->_allcats) || $force) {
         global $wpdb;
         $q = "SELECT p2c.category_id AS cat_id, COUNT(p2c.rel_id) AS numposts,\r\n                    UNIX_TIMESTAMP(max(p.post_date_gmt)) + '" . get_option('gmt_offset') . "' AS last_post_date,\r\n                    UNIX_TIMESTAMP(max(p.post_date_gmt)) AS last_post_date_gmt\r\n                FROM {$wpdb->post2cat} p2c\r\n                INNER JOIN {$wpdb->posts} p ON p2c.post_id=p.id\r\n                WHERE (p.post_status='publish' OR p.post_status='static')\r\n                  AND p.post_date_gmt<='" . gmdate("Y-m-d H:i:s", time()) . "'\r\n                GROUP BY p2c.category_id\r\n                ORDER BY numposts DESC ";
         $results = $wpdb->get_results($q);
         $allcats = array();
         if (!is_null($results) && is_array($results)) {
             foreach ($results as $cat) {
                 $catname = get_catname($cat->cat_id);
                 $allcats[$catname] = array('name' => get_catname($cat->cat_id), 'count' => $cat->numposts, 'link' => get_category_link((int) $cat->cat_id));
             }
         }
         $this->_allcats =& $allcats;
     }
     return $this->_allcats;
 }
开发者ID:laiello,项目名称:cartonbank,代码行数:20,代码来源:jeromes-keywords.php


示例4: get_catname

case 'delete-page' :
	$id = (int) $_POST['id'];
	if ( !current_user_can('edit_post', $id) )	{
		die('-1');
	}

	if ( wp_delete_post($id) ) {
		die('1');
	} else	die('0');
	break;
case 'delete-cat' :
	if ( !current_user_can('manage_categories') )
		die ('-1');

	$id = (int) $_POST['id'];
	$cat_name = get_catname($cat_ID);

	if ( wp_delete_category($id) )
		die('1');
	else	die('0');
	break;
case 'delete-comment' :
	$id = (int) $_POST['id'];

	if ( !$comment = get_comment($id) )
		die('0');
	if ( !current_user_can('edit_post', $comment->comment_post_ID) )	
		die('-1');

	if ( wp_delete_comment($comment->comment_ID) ) {
		die('1');
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:list-manipulation.php


示例5: cfgp_clone_post_on_publish

function cfgp_clone_post_on_publish($post_id, $post)
{
    global $wpdb;
    /* Allow for draft, pending, trash as well as publish - a published post can transition into these */
    if (!in_array($post->post_status, array('publish', 'draft', 'pending', 'trash'))) {
        return;
    }
    /* Get the Shadow Blog's ID */
    $cfgp_blog_id = cfgp_get_shadow_blog_id();
    /* Get the current blog's id */
    $current_blog_id = $wpdb->blogid;
    /* Check to see if we're inserting the post, or updating an existing */
    $clone_post_id = cfgp_are_we_inserting($post->ID);
    /* Get all the post_meta for current post */
    $all_post_meta = get_post_custom($post->ID);
    /* Grab the Permalink of the post, so the shadow blog knows how to get back to the post */
    $permalink = get_permalink($post->ID);
    switch_to_blog($cfgp_blog_id);
    /************
     * POST WORK *
     ************/
    $old_post_id = $post->ID;
    $clone_id = cfgp_do_the_post($post, $clone_post_id);
    $post->ID = $old_post_id;
    /****************
     * CATEGORY WORK *
     ****************/
    /* Grab category names that the current post belongs to. */
    if (isset($_POST['post_category']) && is_array($_POST['post_category']) && count($_POST['post_category']) > 0) {
        /* Post has categories */
        $cur_cats = $_POST['post_category'];
    } else {
        /* Post doesn't have any categories, assign to 'Uncategorized' */
        $cur_cats = array(get_cat_ID('Uncategorized'));
    }
    /* We have id's, now get the names */
    foreach ($cur_cats as $cat) {
        $cur_cats_names[] = get_catname($cat);
    }
    /* Add categories to clone post */
    $cat_results = cfgp_do_categories($clone_id, $cur_cats_names);
    /***********
     * TAG WORK *
     ***********/
    /* tags changed in 2.8, so we need to see if we're >= 2.8 */
    global $wp_version;
    if (version_compare($wp_version, '2.8', '>=')) {
        $tags = $_POST['tax_input']['post_tag'];
    } else {
        $tags = $_POST['tags_input'];
    }
    /* Add tags to clone post */
    $tag_results = cfgp_do_tags($clone_id, $tags);
    /******************
     * MORE TAXONOMIES *
     ******************/
    do_action('cfgp_clone_post_taxonomies', compact('clone_id', 'post'));
    /*****************
     * POST META WORK *
     *****************/
    /* Add original post's postmeta to clone post */
    $post_meta_results = apply_filters('cfgp_do_post_meta', array(), $clone_id, $current_blog_id, $all_post_meta, $permalink, $old_post_id);
    restore_current_blog();
    /* Add post_meta to the original
     * 	post of the clone's post id */
    update_post_meta($post->ID, '_cfgp_clone_id', $clone_id);
    /* This is a handy array of results, for troubleshooting
     * 	they're not returned on post publish, but can be put
     * 	out to the error log */
    $single_post_results[] = array('original_post' => $post->ID, 'clone_id' => $clone_id, 'cat_results' => $cat_results, 'tag_results' => $tag_results, 'post_meta_results' => $post_meta_results);
}
开发者ID:bigdawggi,项目名称:wp-cf-global-posts,代码行数:71,代码来源:cf-global-posts.php


示例6: archive_header

function archive_header($before = '', $after = '')
{
    global $post, $orderby, $month, $previous, $siteurl, $blogfilename, $archiveheadstart, $archiveheadend, $category_name;
    $orderby = explode(' ', $orderby);
    $orderby = $orderby[0];
    if ('date' == $orderby || empty($orderby)) {
        $thismonth = mysql2date('m', $post->post_date);
        $thisyear = mysql2date('Y', $post->post_date);
        $thisdate = $thisyear . $thismonth;
        if ($thisdate != $previous) {
            $thismonth = mysql2date('m', $post->post_date);
            $output .= '<strong><br/><a href="' . get_month_link($thisyear, $thismonth) . '">' . $thisyear . '年' . $month[$thismonth] . '</a></strong>';
        }
        $previous = $thisdate;
    } elseif ('title' == $orderby) {
        $thisletter = ucfirst(mb_substr($post->yomi, 0, 1, $GLOBALS['blog_charset']));
        if ($thisletter > "ん") {
            $thisletter = "漢字";
        }
        if ($thisletter != $previous) {
            $output .= "<br/>" . $thisletter;
        }
        $previous = $thisletter;
    } elseif ('category' == $orderby) {
        $thiscategory = $category_name;
        if ($thiscategory != $previous) {
            $output .= '<br/><strong><a href="' . get_category_link(false, $thiscategory) . '">' . get_catname($thiscategory) . '</a></strong>';
        }
        $previous = $thiscategory;
    }
    if (!empty($output)) {
        $output = $before . $output . $after . NL;
        echo $output;
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:35,代码来源:nkarchives.php


示例7: get_all_category_ids

}
$cats = get_all_category_ids();
if (!$cats) {
    echo "<p align='center'><strong>No Categories Found</strong></p>";
    return;
}
?>
<fieldset class='move_options'>
  <table width="100%" cellpadding="3" cellspacing="3" style="text-align: left; vertical-align: top;">
  <form method='POST'>
  <tr class="alternate"><th width="75%">Category</th><th width="25%">Destination</th></tr>
<input type='hidden' name='wpadp_move_options' value='update'>
  <?php 
foreach ($cats as $i => $value) {
    echo "<tr>";
    $catname = get_catname($cats[$i]);
    if ($cats[$i] == $selCat) {
        $preMod = "<strong>";
        $postMod = "</strong>";
        $checked = "checked='checked'";
    } else {
        $preMod = "";
        $postMod = "";
        $checked = "";
    }
    echo "<td>{$preMod}{$catname}{$postMod}</td>";
    echo "<td><input type='radio' name='{$inputName}' value='{$cats[$i]}' {$checked}></td>";
    echo "</tr>";
}
?>
<tr><td align='right' colspan='2'><input type='submit' 	name='submit' value='Update Options'></td></tr>
开发者ID:alphaomegahost,项目名称:FIN,代码行数:31,代码来源:auto-delete-posts.move.php


示例8: archive_header

function archive_header($before = '', $after = '')
{
    $GLOBALS['orderby'] = explode(' ', $GLOBALS['orderby']);
    $GLOBALS['orderby'] = $GLOBALS['orderby'][0];
    if ('date' == $GLOBALS['orderby'] || empty($GLOBALS['orderby'])) {
        $thismonth = mysql2date('m', $GLOBALS['post']->post_date);
        $thisyear = mysql2date('Y', $GLOBALS['post']->post_date);
        $thisdate = $thisyear . $thismonth;
        if ($thisdate != $GLOBALS['previous']) {
            $thismonth = mysql2date('m', $GLOBALS['post']->post_date);
            $monthstr = ereg_replace('%MONTH', $GLOBALS['month'][zeroise($thismonth, 2)], $GLOBALS['wp_month_format']);
            $monthstr = ereg_replace('%YEAR', sprintf("%d", $thisyear), $monthstr);
            $output = '<strong><br/><a href="' . get_month_link($thisyear, $thismonth) . '">' . $monthstr . '</a></strong>';
        }
        $GLOBALS['previous'] = $thisdate;
    } elseif ('title' == $GLOBALS['orderby']) {
        if (_LANGCODE == 'ja') {
            $thisletter = ucfirst(mb_substr($GLOBALS['post']->yomi, 0, 1, $GLOBALS['blog_charset']));
            if ($thisletter > "ん") {
                $thisletter = "漢字";
            }
        } else {
            $thisletter = ucfirst(substr($GLOBALS['post']->yomi, 0, 1));
        }
        if (empty($GLOBALS['previous']) || $thisletter != $GLOBALS['previous']) {
            $output = "<br/>" . $thisletter;
        }
        $GLOBALS['previous'] = $thisletter;
    } elseif ('category' == $GLOBALS['orderby']) {
        $thiscategory = $GLOBALS['category_name'];
        if ($thiscategory != $GLOBALS['previous']) {
            $output = '<br/><strong><a href="' . get_category_link(false, $thiscategory) . '">' . get_catname($thiscategory) . '</a></strong>';
        }
        $GLOBALS['previous'] = $thiscategory;
    }
    if (!empty($output)) {
        $output = $before . $output . $after . NL;
        echo $output;
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:40,代码来源:nkarchives.php


示例9: bm_caticons_adminicons

/**
 * Display the icons panel in Icons tab
 * @author Brahim MACHKOURI
 */
function bm_caticons_adminicons()
{
    // I took some of the code from categories.php of WordPress 2.5 and modified it a little
    global $wpdb;
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
    if (isset($_GET['deleteit']) && isset($_GET['delete'])) {
        $action = 'bulk-delete';
    }
    switch ($action) {
        case 'update-category-icon':
            $cat_ID = (int) $_GET['cat_ID'];
            $priority = $_REQUEST['ig_priority'];
            $icon = $_REQUEST['ig_icon'];
            $small_icon = $_REQUEST['ig_small_icon'];
            if ($wpdb->get_var($wpdb->prepare("SELECT cat_id FROM {$wpdb->ig_caticons} WHERE cat_id='{$cat_ID}'"))) {
                $wpdb->query($wpdb->prepare("UPDATE {$wpdb->ig_caticons} SET priority='{$priority}', icon='{$icon}', small_icon='{$small_icon}' WHERE cat_id='{$cat_ID}'"));
            } else {
                $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->ig_caticons} (cat_id, priority, icon, small_icon) VALUES ('{$cat_ID}', '{$priority}', '{$icon}', '{$small_icon}')"));
            }
            break;
        case 'delete':
            $cat_ID = (int) $_GET['cat_ID'];
            if (!is_admin() || !current_user_can('manage_categories')) {
                wp_die(__('Are you trying to cheat ?', 'category_icons'));
            }
            $cat_name = get_catname($cat_ID);
            $request = "DELETE FROM {$wpdb->ig_caticons} WHERE cat_id='{$cat_ID}'";
            if (false === $wpdb->query($wpdb->prepare($request))) {
                wp_die(__('Error in Category Icons', 'category_icons') . ' : ' . $request);
            }
            break;
        case 'bulk-delete':
            if (!is_admin() || !current_user_can('manage_categories')) {
                wp_die(__('You are not allowed to delete category icons.', 'category_icons'));
            }
            foreach ((array) $_GET['delete'] as $cat_ID) {
                $cat_name = get_catname($cat_ID);
                $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->ig_caticons} WHERE cat_id='{$cat_ID}'"));
            }
            break;
    }
    switch ($action) {
        case 'edit':
            $cat_ID = (int) $_GET['cat_ID'];
            $category = get_category_to_edit($cat_ID);
            list($priority, $icon, $small_icon) = bm_caticons_get_icons($cat_ID);
            ?>
		<div class="wrap">
		<h2><?php 
            _e('Select Category Icons', 'category_icons');
            ?>
</h2>
		<form method="post" name="caticons-form1" action="">
		  <?php 
            wp_nonce_field('caticons-nonce');
            ?>
			<input type="hidden" name="ig_module" value="caticons" />
			<input type="hidden" name="ig_tab" value="icons" />
			<input type="hidden" name="action" value="update-category-icon" />
            <table  border="0" class="form-table">
                <tr>
                    <th scope="row" style="vertical-align:text-top;"><?php 
            _e('Category ID', 'category_icons');
            ?>
</th>
                    <td colspan="2" ><?php 
            echo $cat_ID;
            ?>
</td>
                </tr>
                <tr>
                    <th scope="row" style="vertical-align:text-top;"><?php 
            _e('Name', 'category_icons');
            ?>
</th>
                    <td colspan="2"><?php 
            echo $category->name;
            ?>
</td>
                </tr>
                <tr>
                    <th scope="row" class="num" style="vertical-align:text-top;"><?php 
            _e('Priority', 'category_icons');
            ?>
</th>
                    <td colspan="2">
                        <input type="text" name="ig_priority" size="5" value="<?php 
            echo $priority;
            ?>
" />
                    </td>
                </tr>
                <tr>
                    <th scope="row" style="vertical-align:text-top;"><?php 
            _e('Icon', 'category_icons');
            ?>
//.........这里部分代码省略.........
开发者ID:SayenkoDesign,项目名称:gogo-racing.com,代码行数:101,代码来源:category_icons.php


示例10: archive_header

function archive_header(&$post, $before = '', $after = '')
{
    static $previous = '';
    if (test_param('orderby')) {
        $orderby = explode(' ', get_param('orderby'));
        $orderby = $orderby[0];
    } else {
        $orderby = '';
    }
    switch ($orderby) {
        case 'title':
            if (_LANGCODE == 'ja') {
                $thisletter = ucfirst(mb_substring($post->yomi, 0, 1, $GLOBALS['blog_charset']));
                if ($thisletter > "¤ó") {
                    $thisletter = "´Á»ú";
                }
            } else {
                $thisletter = ucfirst(substr($post->yomi, 0, 1));
            }
            if ($thisletter == "") {
                $thisletter = _WP_POST_NOTITLE;
            }
            if ($previous === '' || $thisletter !== $previous) {
                $output = "<br/>" . $thisletter;
            }
            $previous = $thisletter;
            break;
        case 'category':
            $thiscategory = $post->cat_ID;
            if ($thiscategory != $previous) {
                $output = '<br/><strong><a href="' . get_category_link(false, $thiscategory) . '">' . get_catname($thiscategory) . '</a></strong>';
            }
            $previous = $thiscategory;
            break;
        case 'author':
            $thisauthor = $post->post_author;
            if ($thisauthor != $previous) {
                $output = '<br/><strong><a href="' . get_author_link(false, $thisauthor) . '">' . the_author('', false) . '</a></strong>';
            }
            $previous = $thisauthor;
            break;
        case 'date':
        case '':
            $thismonth = mysql2date('m', $post->post_date);
            $thisyear = mysql2date('Y', $post->post_date);
            $thisdate = $thisyear . $thismonth;
            if ($thisdate != $previous) {
                $monthstr = format_month(sprintf("%d", $thisyear), $GLOBALS['month'][zeroise($thismonth, 2)]);
                $output = '<strong><br/><a href="' . get_month_link($thisyear, $thismonth) . '">' . $monthstr . '</a></strong>';
            }
            $previous = $thisdate;
            break;
    }
    if (!empty($output)) {
        $output = $before . $output . $after . "\n";
        echo $output;
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:58,代码来源:nkarchives.php


示例11: get_catname

                                    <dl>
                                        <dd><a target="_blank" href="<?php 
        echo $v['url'];
        ?>
">
                                            <img src="<?php 
        echo $v['thumb'];
        ?>
" alt="<?php 
        echo $v['title'];
        ?>
" style="opacity: 1;"><?php 
        echo $v['title'];
        ?>
</a><span><?php 
        echo get_catname($v[catid]);
        ?>
</span>
                                        </dd>
                                    </dl>
                                    <?php 
        $n++;
    }
}
unset($n);
?>
                                    <!------content------>

                                </div>
                            </div>
                        </div>
开发者ID:hw18708118867,项目名称:htmlmoban,代码行数:31,代码来源:category_code.php


示例12: cat_rows

</th>
	</tr>
	</thead>
	<tbody id="the-list">
<?php 
        cat_rows();
        ?>
	</tbody>
</table>

</div>

<?php 
        if (current_user_can('manage_categories')) {
            ?>
<div class="wrap">
<p><?php 
            printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts and links in that category.  Instead, posts in the deleted category are set to the category <strong>%s</strong> and links are set to <strong>%s</strong>.'), get_catname(get_option('default_category')), get_catname(get_option('default_link_category')));
            ?>
</p>
</div>

<?php 
            include 'edit-category-form.php';
        }
        ?>

<?php 
        break;
}
include 'admin-footer.php';
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:categories.php


示例13: pp_admin_projects

function pp_admin_projects()
{
    global $user_identity;
    $title = __('Edit Projects', 'prologue-projects');
    if (!($project_category_id = pp_get_category_id('projects'))) {
        ?>
<div class="wrap nosubsub">
<?php 
        screen_icon();
        ?>
	<h2>
<?php 
        echo wp_specialchars($title);
        ?>
	</h2>
	<div id="message" class="updated"><p><?php 
        _e('You must <a href="admin.php?page=prologue-projects-settings">assign an existing category</a> as the container for all projects.', 'prologue-projects');
        ?>
</p></div>
</div>
<?php 
        return;
    }
    global $action;
    wp_reset_vars(array('action'));
    if (isset($_GET['action']) && isset($_GET['delete']) && ('delete' == $_GET['action'] || 'delete' == $_GET['action2'])) {
        $action = 'bulk-delete';
    }
    switch ($action) {
        case 'addproject':
            check_admin_referer('add-project');
            if (!current_user_can('manage_categories')) {
                wp_die(__('Cheatin&#8217; uh?', 'prologue-projects'));
            }
            if (pp_insert_project($_POST)) {
                wp_redirect('admin.php?page=prologue-projects&message=1#addproject');
            } else {
                wp_redirect('admin.php?page=prologue-projects&message=4#addproject');
            }
            exit;
            break;
        case 'delete':
            $project_ID = (int) $_GET['project_ID'];
            check_admin_referer('delete-project_' . $project_ID);
            if (!current_user_can('manage_categories')) {
                wp_die(__('Cheatin&#8217; uh?', 'prologue-projects'));
            }
            $project_name = get_catname($project_ID);
            // Don't delete the default cats.
            if ($project_ID == get_option('default_category')) {
                wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one", 'prologue-projects'), $cat_name));
            }
            pp_delete_project($project_ID);
            wp_redirect('admin.php?page=prologue-projects&message=2');
            exit;
            break;
        case 'bulk-delete':
            check_admin_referer('bulk-projects');
            echo 1;
            if (!current_user_can('manage_categories')) {
                wp_die(__('You are not allowed to delete projects.', 'prologue-projects'));
            }
            foreach ((array) $_GET['delete'] as $project_ID) {
                $project_name = get_catname($project_ID);
                // Don't delete the default cats.
                if ($project_ID == get_option('default_category')) {
                    wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one", 'prologue-projects'), $cat_name));
                }
                pp_delete_project($project_ID);
            }
            $sendback = wp_get_referer();
            wp_redirect($sendback);
            exit;
            break;
        case 'edit':
            if (!current_user_can('manage_categories')) {
                wp_die(__('You are not allowed to edit projects.', 'prologue-projects'));
            }
            $title = __('Edit Project', 'prologue-projects');
            require_once 'admin-header.php';
            $project_ID = (int) $_GET['project_ID'];
            $project = pp_get_project_data($project_ID, 'all', 'editing');
            ?>

<div class="wrap nosubsub">
<?php 
            screen_icon();
            ?>

	<h2><?php 
            echo wp_specialchars($title);
            ?>
</h2>

<?php 
            if (isset($_GET['message']) && ($msg = (int) $_GET['message'])) {
                ?>

	<div id="message" class="updated fade"><p><?php 
                echo $messages[$msg];
//.........这里部分代码省略.........
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:101,代码来源:functions-admin.php


示例14: import_cat_select_before_each

 function import_cat_select_before_each($cat_ID, $level)
 {
     // callback to display sublist element
     global $current_blog_ID, $blog, $cat, $postdata, $default_main_cat, $action, $tabindex;
     echo '<li>';
     if (get_allow_cross_posting() >= 1) {
         // We allow cross posting, display checkbox:
         echo '<input type="checkbox" name="post_extracats[]" class="checkbox" title="', T_('Select as an additionnal category'), '" value="', $cat_ID, '"';
         echo ' />';
     }
     // Radio for main cat:
     if ($current_blog_ID == $blog) {
         if ($default_main_cat == 0 && $action == 'post') {
             // Assign default cat for new post
             $default_main_cat = $cat_ID;
         }
         echo ' <input type="radio" name="post_category" class="checkbox" title="', T_('Select as MAIN category'), '" value="', $cat_ID, '"';
         if ($cat_ID == $postdata["Category"] || $cat_ID == $default_main_cat) {
             echo ' checked="checked"';
         }
         echo ' />';
     }
     echo ' ' . htmlspecialchars(get_catname($cat_ID));
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:24,代码来源:mtimport.ctrl.php


示例15: _e

        <th scope="col"><?php _e('Description') ?></th>
        <th scope="col"><?php _e('# Posts') ?></th>
        <th colspan="2"><?php _e('Action') ?></th>
	</tr>
<?php
cat_rows();
?>
</table>

</div>

<?php if ( $user_level > 3 ) : ?>
<div class="wrap">
    <p><?php printf(__('<strong>Note:</strong><br />
Deleting a category does not delete posts from that category, it will just
set them back to the default category <strong>%s</strong>.'), get_catname(1)) ?>
  </p>
</div>

<div class="wrap">
    <h2><?php _e('Add New Category') ?></h2>
    <form name="addcat" id="addcat" action="categories.php" method="post">
        
        <p><?php _e('Name:') ?><br />
        <input type="text" name="cat_name" value="" /></p>
        <p><?php _e('Category parent:') ?><br />
        <select name='cat' class='postform'>
        <option value='0'><?php _e('None') ?></option>
        <?php wp_dropdown_cats(0); ?>
        </select></p>
        <p><?php _e('Description: (optional)') ?> <br />
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:categories.php


示例16: filter_category_list_item

 /**
  * Filter the category items and/or shows padlock
  *
  * @uses $capa_protect_show_private_categories
  * @uses $capa_protect_show_padlock_on_private_categories
  * @uses $current_user
  * @uses $wpc_siteurl
  *
  * @uses trailingslashit()
  * @uses capa_protect::user_can_access()
  *
  * @param string $text
  *
  * @return string
  */
 function filter_category_list_item($text, $category = null)
 {
     global $capa_protect_show_private_categories, $capa_protect_show_padlock_on_private_categories;
     global $current_user, $wpc_siteurl, $wp_version;
     if ($current_user && isset($current_user->allcaps['manage_categories']) && !isset($current_user->caps['editor'])) {
         return $text;
     }
     $all_category_ids = capa_protect::_get_taxonomy_ids();
     $all_category_ids = $all_category_ids['category'];
     # Make the changes
     $site_root = parse_url($wpc_siteurl);
     $site_root = trailingslashit($site_root['path']);
     if ($capa_protect_show_private_categories) {
         if ($capa_protect_show_padlock_on_private_categories) {
             foreach ($all_category_ids as $taxo_id => $term_id) {
                 if (!capa_protect::user_can_access($term_id, $current_user, 'cat')) {
                     $tmp_catname = (int) $wp_version < 2.8 ? get_catname($term_id) : get_cat_name($term_id);
                     $search[$taxo_id] = "#>" . $tmp_catname . "<#";
                     $replace[$taxo_id] = '><img src="' . $site_root . 'wp-content/plugins/capa/img/padlock.gif" height="10" width="10" valign="center" border="0"/> ' . $tmp_catname . '<';
                 }
             }
             // In the case user see all categories but padlock is active
             // $search will be empty
             return count($search) > 0 ? preg_replace($search, $replace, $text) : $text;
         }
         return $text;
     }
     return $text;
 }
开发者ID:DarussalamTech,项目名称:aims_prj,代码行数:44,代码来源:capa.php


示例17: _cat_row

function _cat_row( $category, $level, $name_override = false ) {
	global $class;

	$pad = str_repeat( '&#8212; ', $level );
	if ( current_user_can( 'manage_categories' ) ) {
		$edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__( 'Edit' )."</a></td>";
		$default_cat_id = (int) get_option( 'default_category' );
		$default_link_cat_id = (int) get_option( 'default_link_category' );

		if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) )
			$edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->cat_ID", 'delete-category_' . $category->cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . js_escape(sprintf( __("You are about to delete the category '%s'.\nAll posts that were only assigned to this category will be assigned to the '%s' category.\nAll links that were only assigned to this category will be assigned to the '%s' category.\n'OK' to delete, 'Cancel' to stop." ), $category->cat_name, get_catname( $default_cat_id ), get_catname( $default_link_cat_id ) )) . "' );\" class='delete'>".__( 'Delete' )."</a>";
		else
			$edit .= "<td style='text-align:center'>".__( "Default" );
	} else
		$edit = '';

	$class = ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || " class='alternate'" == $class ) ? '' : " class='alternate'";

	$category->category_count = number_format( $category->category_count );
	$category->link_count = number_format( $category->link_count );
	$posts_count = ( $category->category_count > 0 ) ? "<a href='edit.php?cat=$category->cat_ID'>$category->category_count</a>" : $category->category_count;
	return "<tr id='cat-$category->cat_ID'$class>
		<th scope='row' style='text-align: center'>$category->cat_ID</th>
		<td>" . ( $name_override ? $name_override : $pad . ' ' . $category->cat_name ) . "</td>
		<td>$category->category_description</td>
		<td align='center'>$posts_count</td>
		<td align='center'>$category->link_count</td>
		<td>$edit</td>\n\t</tr>\n";
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:29,代码来源:admin-functions.php


示例18: get_catname

<br />
		<input type="text" name="cat_name" value="" /></p>
		<p><?php 
        echo _LANG_C_NAME_CATDESC;
        ?>
 (optional) <br />
		<textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
		<p><input type="hidden" name="action" value="addcat" /><input type="submit" name="submit" value="<?php 
        echo _LANG_C_NAME_ADD;
        ?>
" /></p>
	</form>
</div>


<div class="wrap">
<h2>Note : </h2>
  <p><?php 
        echo _LANG_C_NOTE_CATEGORY;
        ?>
 &rsaquo;&rsaquo; <strong><?php 
        echo get_catname(1);
        ?>
</strong></p>
</div>

	<?php 
        break;
}
/* </Categories> */
include 'admin-footer.php';
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:categories.php


示例19: _e

        _e('Apply');
        ?>
" name="doaction2" id="doaction2" class="button-secondary action" />
<?php 
        wp_nonce_field('bulk-categories');
        ?>
</div>

<br class="clear" />
</div>

</form>

<div class="form-wrap">
<p><?php 
        printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category'))));
        ?>
</p>
<p><?php 
        printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag');
        ?>
</p>
</div>

</div>
</div><!-- /col-right -->

<div id="col-left">
<div class="col-wrap">

<?php 
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:categories.php


示例20: session_start

<?php

include 'functions.php';
session_start();
check_valid_user();
$catid = $_GET['id'];
$catname = get_catname($catid);
do_html_header($catname);
$post = get_cate_post($catid);
display_entries($post);
do_html_url('blog', 'Home');
do_html_footer();
开发者ID:pyhale,项目名称:PHPblog,代码行数:12,代码来源:show_cat.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_cats函数代码示例发布时间:2022-05-15
下一篇:
PHP get_category_to_edit函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap