(2013-02-10, 06:44:33)czk Wrote: Are you by any chance planning to implement post commenting in your plugin?
I don't plan to add a commenting system to News Manager - I'd like to keep it simple by default.
However I intend to make some changes so that it is extensible by other plugins, that could add support for a comment system, be it external (disqus/intensedebate/facebook/blogger/...) or local (maybe some existing one adapted to NM, like [AR]Guestbook, Pages&Comments...; and/or integrating some other script like NoNonsenseForum)
But... not in the short term. There are some other things I want to do before. Sorry.
2013-02-10, 23:39:06 (This post was last modified: 2013-02-10, 23:40:28 by czk.)
(2013-02-10, 21:46:45)Carlos Wrote: (...)I intend to make some changes so that it is extensible by other plugins, that could add support for a comment system(...)
But... not in the short term. There are some other things I want to do before. Sorry.
No problem. I also wanted to verify if I'm not doubling (better) efforts.
2013-02-11, 06:17:15 (This post was last modified: 2013-02-11, 06:56:12 by D.O..)
Carlos, you simply rock!
Now NM is complete!
You made a great work for this community and as far I'm concerned NM should be included in GS!
I will test it later and I will let you know how works!
THANKS!
Oh I tested it and it works greatly!
Thanks! But I suggest this small change:
In this way the date appears before the title of the news, just like a weblog.
Finally now with your "addon" GS has nothing to envy to wordpress.
Gracias for your great support, Hermano!
Trying to talk to NM from P&C, I used a function which returns an NM post slug. If it's not just me who thinks it's handy, maybe something as follows (based on nm_post_title) could be added to site.php?:
PHP Code:
function nm_post_slug($echo=true) { global $NMPAGEURL; $slug = false; if (isset($_GET['post']) && strval(get_page_slug(false)) == $NMPAGEURL) { $file = NMPOSTPATH . $_GET['post'] . '.xml'; if (dirname(realpath($file)) == realpath(NMPOSTPATH)) { // no path traversal $post = @getXML($file); if (!empty($post) && $post->private != 'Y') { $slug = basename($file, '.xml'); if ($echo) echo $slug; } } } return $slug; }
BTW - I used basename in the example above, because I couldn't understand why code:
PHP Code:
$slug = $post->slug;
returned an empty string. Why do "->date", "->title" extract the expected string from posts.xml, but not "->slug"?
No need to read the post file to get the current slug. It could be like this:
PHP Code:
function nm_post_slug($echo=true) { global $NMPAGEURL; $slug = false; if (isset($_GET['post']) && strval(get_page_slug(false)) == $NMPAGEURL) { $file = NMPOSTPATH . $_GET['post'] . '.xml'; if (dirname(realpath($file)) == realpath(NMPOSTPATH)) { // no path traversal $slug = $_GET['post']; if ($echo) echo $slug; } } return $slug; }
(It may be even easier... it's just a quickie without thinking too much)
posts.xml contains the slug for every post, but the post files themselves don't have it, because the file name (without the .xml suffix) is the post slug.
Is there any way to add a small excerpts to the list of recent news in the sidebar?
So far I have only this
<?php nm_list_recent(); ?>
showing me the news titles.
Thanks. This works well. I just wish I could set the number of characters I needed for the excerpt. I need shorter excerpts in sidebar and longer ones in the News page.
2013-02-15, 07:12:59 (This post was last modified: 2013-02-15, 07:13:37 by Carlos.)
Try this:
I'll assume you have en_US selected as Language used on News Page in settings.
- Make a copy of en_US.php (in plugins/news_manager/lang)
- Rename the copy to hr_HR.php
- Select hr_HR in News Manager settings.