2013-05-22, 06:14:17
(2013-05-20, 05:38:33)D.O. Wrote: Meanwhile you could send me this patch,
Edit news_manager/inc/posts.php, find this:
Code:
$obj = $xml->addChild('content');
$obj->addCData($content);
Code:
// patch (author)
if (isset($_POST['author'])) {
$author = safe_slash_html($_POST['author']);
} else {
global $USR;
if ($USR) $author = $USR;
}
if (isset($author)) {
$obj = $xml->addChild('author');
$obj->addCData($author);
}
// end patch (author)
Now edit news_manager/inc/site.php, find this:
Code:
if ($excerpt) $content = nm_create_excerpt($content);
Code:
$author = isset($post->author) ? stripslashes($post->author) : 'default_author'; // patch (author)
And also in site.php, some lines below, insert <?php echo $author; ?> to display the user name.
For example, you could replace this:
Code:
<p class="nm_post_date"><?php echo i18n_r('news_manager/PUBLISHED') . " $date"; ?></p>
Code:
<p class="nm_post_date"><?php echo i18n_r('news_manager/PUBLISHED') . " $date"; ?> by <?php echo $author; ?></p>
As always, you'll have to re-do these patches when/if you upgrade the plugin.
The most important is the first one (posts.php) - if you don't do it and update some existing post, its author field will be lost.