Make WordPress Core

Changeset 665


Ignore:
Timestamp:
12/30/2003 10:48:06 AM (23 years ago)
Author:
saxmatt
Message:

edit_this_post() from Ryan Boren. Cleaned up function and integrated into default template.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r652 r665  
    3939<div class="post">
    4040         <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    41         <div class="meta">Filed under: <?php the_category() ?> &#8212; <?php the_author() ?> @ <?php the_time() ?></div>
     41        <div class="meta">Filed under: <?php the_category() ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
    4242       
    4343        <div class="storycontent">
  • trunk/wp-includes/template-functions.php

    r663 r665  
    542542}
    543543
     544function edit_post_link($link = 'Edit This', $before = '', $after = '') {
     545        global $user_level, $post, $siteurl;
     546
     547        get_currentuserinfo();
     548
     549        if ($user_level > 0) {
     550                $authordata = get_userdata($post->post_author);
     551                if ($user_level < $authordata->user_level) {
     552                        return;
     553                }
     554        } else {
     555                return;
     556        }
     557
     558        $location = "$siteurl/wp-admin/post.php?action=edit&post=$post->ID";
     559        echo "$before <a href='$location'>$link</a> $after";
     560}
     561
    544562/***** Date/Time tags *****/
    545563
     
    551569
    552570function the_date($d='', $before='', $after='', $echo = true) {
    553         global $id, $post, $dateday, $previousday, $dateformat, $newday;
     571        global $id, $post, $day, $previousday, $dateformat, $newday;
    554572        $the_date = '';
    555         $dateday = mysql2date('Yd', $post->post_date);
    556         if ($dateday != $previousday) {
     573        if ($day != $previousday) {
    557574                $the_date .= $before;
    558575                if ($d=='') {
     
    562579                }
    563580                $the_date .= $after;
    564                 $previousday = $dateday;
     581                $previousday = $day;
    565582        }
    566583        $the_date = apply_filters('the_date', $the_date);
     
    16891706        $comment_text = convert_bbcode($comment_text);
    16901707        $comment_text = convert_gmcode($comment_text);
     1708        $comment_text = convert_smilies($comment_text);
    16911709        $comment_text = make_clickable($comment_text);
    16921710        $comment_text = balanceTags($comment_text,1);
    16931711        $comment_text = apply_filters('comment_text', $comment_text);
    1694         $comment_text = convert_smilies($comment_text);
    16951712        echo $comment_text;
    16961713}
Note: See TracChangeset for help on using the changeset viewer.