Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
(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.
Reply
(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.
Reply
@Carlos:

I agree with you about an extension by other plugins. And Pages&Comments could be the perfect choice.

I would advise a small change: to add the date (mm/dd/yyyy) close to the title of the news when you print "nm_list_recent".

What do you think ?
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
@D.O.

Download News Manager Addons plugin, 0.1 beta:
https://raw.github.com/cnb/News_Manager_...addons.php
(and upload to your plugins folder)

Right now it only has a sidebar function/template tag, nm_list_recent_with_date
Usage (examples):

PHP Code:
<?php nm_list_recent_with_date(); ?>
or
PHP Code:
<?php nm_list_recent_with_date(' - %d/%m/%Y'); ?>

I will add some other functions to customize the recent posts list.
Reply
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:
PHP Code:
echo "<li>$date<a href=\"$url\">$title</a></li>"
and...
PHP Code:
<?php nm_list_recent_with_date('%d/%m/%Y &raquo; '); ?>
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!
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
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"?
Reply
@czk

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.
Reply
I've done a small update to NM Addons. 0.1.1 beta lets you display the date before the title, like:
PHP Code:
<?php nm_list_recent_with_date('%d/%m/%Y &raquo; 'true); ?>

Anyway I'll soon add a couple more customizable functions.
Reply
I tested your update and it works perfectly. Even better, thank you!
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
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.
Reply
@Timbow (reply to this post)

NM 2.3.x has a new template tag/function (nm_post_title) that you may use along with title functions (GS's own or others).

With ePirat's Custom Title plugin it may be something like (not tested):
PHP Code:
<title><?php if (!nm_post_title()) echo get_custom_title_tag(); ?></title> 

"Normal" usage with GS get_page_clean_title:
http://get-simple.info/forums/showthread...1#pid31721
(BTW it should also work with others like e.g. I18N's get_i18n_page_title)

As you can see in that link, you can pass parameters to display some text before or after the post title.
Reply
(2013-02-12, 22:40:58)andyash Wrote: Is there any way to add a small excerpts to the list of recent news in the sidebar?

With News Manager Addons plugin 0.2 beta you can do like this:

PHP Code:
<?php 
nm_set_custom_date
('%d/%m/%Y');
nm_custom_list_recent('
<a href="{{ post_link }}">{{ post_title }}</a><br />
<em>{{ post_date }}</em><br />
{{ post_excerpt }}
'
);
?>
(No need to use nm_set_custom_date if you're not going to display the date.)

I'm still working on this plugin, it's in beta. But it's usable so if you want to test...

(To-do: limit number of posts and excerpt length. Right now it uses the defaults in NM settings.)
Reply
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.
Reply
News Manager Addons 0.3 beta now has a couple new functions, one of them for overriding the excerpt length defined in settings.
Example: insert this
PHP Code:
<?php
nm_set_custom_excerpt
(100); 
before calling nm_custom_list_recent(...)
Reply
How to repair name of month now is velja?a I need veljača thx


Attached Files Thumbnail(s)
   
Reply
What versions of GetSimple and News Manager are you using?
Does your template have utf-8 charset?
Reply
I now have 3.1.2 GS and news manager (update) all files in new manager have utf-8
Reply
Latest News Manager? (2.3.2)

What theme are you using? Does the template have a line like this?

<meta charset="utf-8">
Reply
Yes 2.3.4 manager i'm put utf-8 charset but don't work Big Grin I'm using http://get-simple.info/extend/theme/tech...theme/377/ This template

And this is my code

<head>
<!-- Site Title -->
<title><?php get_page_clean_title(); ?> &lt; <?php get_site_name(); ?></title>
<?php get_header(); ?>
<meta name="robots" content="index, follow" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?php get_theme_url(); ?>/style.css" media="all" />
<script src="<?php get_theme_url(); ?>/js/cufon-yui.js" type="text/javascript"></script>
<script src="<?php get_theme_url(); ?>/js/cufon-replace.js" type="text/javascript"></script>
<script src="<?php get_theme_url(); ?>/js/Myriad_Pro_300.font.js" type="text/javascript"></script>
<!--[if lt IE 7]>
<script type="text/javascript" src="<?php get_theme_url(); ?>/js/ie_png.js"></script>
<script type="text/javascript">
ie_png.fix('.png, #header .row-2 ul li a, #content, .list li');
</script>
<![endif]-->
</head>
Reply
Have you tried with another theme, like e.g. Innovation? (Cardinal required inserting the meta charset line until GS 3.2.0)
Reply
Don't work with http://get-simple.info/extend/theme/my-r...y-cpi/461/
http://get-simple.info/extend/theme/gsunwritten/549/


For me don't work with Innovation
Reply
Slovenian?
Do you have a sl_SL language file in News Manager?
Reply
Croatian Big Grin
Reply
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.
Reply
Yes i'm make but don't work

How i can make to view 3 letter like this Vel 2013 ??
Reply




Users browsing this thread: 21 Guest(s)