Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
(2013-01-07, 00:28:36)stevenjaycohen Wrote: I, personally, like the idea of having many small plugins providing their own bits of the functionality, instead of rolling more functionality into the one plugin.

I think it give people more flexibility.

Yes, I like that too.
I have in mind adding some hooks or filters to allow other plugins to extend NM's functionality.

(2013-01-07, 00:28:36)stevenjaycohen Wrote: So, I see no reason for you to re-implement the RSS within the main plugin, if the external plugin works well.

No hurry for this if that plugin does well.

[about extending News Manager] But I don't want to create expectations. Step by step.
News Manager 2.3.0 (available for download in Extend

  • new function nm_post_title() for use in template <title> tag
  • post titles are now treated as text, not html
  • better default permalinks
  • changed post date edit format to yyyy-mm-dd (dateISO) instead of mm/dd/yyyy
  • undo delete post (available again for GS 3.1+)
  • minor UI fixes (filter, delete post link, cursor focus when editing page)
  • minor (non-critical) frontend path traversal issue fixed
  • added es_ES
  • added hu_HU (@szrudi)
News Manager 2.3 has a new function, nm_post_title, to be used as template tag to make it possible to put the post title in the <title>...</title> tag instead of (or besides) the page title, for better SEO.

It can accept these 3 optional parameters:
- Text to place before the title. Defaults to ''
- Text to place after the title. Defaults to ''
- Display (true) or return (false)


PHP Code:
<title><?php nm_post_title() or get_page_clean_title(); ?> ...</title> 
post title instead of the page title.

PHP Code:
<title><?php nm_post_title('News: ') or get_page_clean_title(); ?> ...</title> 
post title instead of the page title, prefixed by that string:
News: This is the post title

PHP Code:
<title><?php nm_post_title('',' - News') or get_page_clean_title(); ?> ...</title> 
post title instead of the page title, with that string as suffix:
This is the post title - News

PHP Code:
<title><?php nm_post_title('',' - '); get_page_clean_title(); ?> ...</title> 
post title AND page title (separated by a dash)
This is the post title - Page title

PHP Code:
<?php $myVar nm_post_title('','',false); ?>
stores the post title in a variable without echoing.
I'm getting double slashes ( news//post/post-title-here ) before each of the sections. However, my htaccess file doesn't show that way... see below. I am on 2.3.0.

RewriteRule ^news/tag/([^/.]+)/?$ index.php?id=news&tag=$1 [L]
RewriteRule ^news/post/([^/.]+)/?$ index.php?id=news&post=$1 [L]
RewriteRule ^news/page/([^/.]+)/?$ index.php?id=news&page=$1 [L]
RewriteRule ^news/archive/([^/.]+)/?$ index.php?id=news&archive=$1 [L]

Any idea what might be causing this?
in settings in the field Custom Permalink Structure write %parent%/%slug% without a slash at the end
Sorry, looks like a bug. I thought I had tested it enough, but it seems I didn't.
I'll try to release a bugfix ASAP.

Meanwhile you can use Oleg06's tip, but that will remove the trailing slash in your normal GS pages.

Another way is going back to 2.2.6. You can download it here: (end of page)
(2013-01-06, 11:33:08)Carlos Wrote: Try inserting:

<meta charset="utf-8">

in the header.

Thanks for your reply Carlos. The <meta charset="utf-8"> was already in the header… I think the problem is in the date function of the plugin because, as you see in the HTML code, the string "Publié le" is ok :
Publi&eacute; le  3 f�vr. 2013
News Manager 2.3.1 (available for download in Extend)

Bug fix release (double slash in fancy url, @patriotmedia)

(There's another issue with the htaccess info page, but only with certain GS custom permalink structures - will fix in a future release)

Please try inserting this somewhere in your template or in a (sidebar or whatever) component:

PHP Code:
<?php echo date('M, F',strtotime('Thu, 10 Feb 2013 10:02:13 +0100')); ?> 
<?php echo strftime('%B, %b, %h',strtotime('Thu, 10 Feb 2013 10:02:13 +0100')); ?>

and paste what you get on your site.

Could you also please try inserting this somewhere in your template or component:

PHP Code:
<?php echo 'setlocale: ',setlocale(LC_ALL,''),'<br />; ?>

and paste what you're getting there.

After that, try this, I'm not sure but it may fix your issue:
Edit your site root gsconfig.php file and find this:

PHP Code:
# Set PHP locale
#setlocale(LC_ALL, 'en_US'); 

If you had not edited it, it should be like that.
Just below, insert this:

PHP Code:

And check if you now get févr.

Here it is :
Feb, February - February, Feb, Feb

Strange, isn't it ?
How are months displayed in the admin panel? Both in GS and NM, pages/posts list (date column) and page/post edit (Dernière sauvegarde...)
(2013-01-11, 17:13:04)Carlos Wrote: How are months displayed in the admin panel? Both in GS and NM, pages/posts list (date column) and page/post edit (Dernière sauvegarde...)

In GS (Sauvegardes) :
Quote:Date:3 Jan 2013 - 19:59

In NM (Pages>News Manager>Post):
Quote:Publish date (mm/dd/yyyy):
Ok. Another test, again insert somewhere in template or visible component:

PHP Code:
<?php echo setlocale(LC_ALL,''); ?>
<br />
<?php echo nm_get_date('%B, %b, %h',strtotime('Thu, 10 Feb 2013 10:02:13 +0100')); ?>
<?php echo utf8_encode(nm_get_date('%B, %b, %h',strtotime('Thu, 10 Feb 2013 10:02:13 +0100'))); ?>

and paste what you get.

f�vrier, f�vr., f�vr.- février, févr., févr.
Ok, we've got it. Your server is returning date strings in a non-UTF8 format.

A patch for News Manager could be:
edit news_manager/inc/functions.php, at line 86 you'll find:

PHP Code:
$date strftime($format$timestamp); 

Change it to:

PHP Code:
$date utf8_encode(strftime($format$timestamp)); 

This should fix your issue.

I'll probably do this or a similar patch for next NM release.

You got it ! Thanks a lot !

It's weird that my server returns non-UTF8 format although my .htaccess says "AddDefaultCharset UTF-8".
I have over 400 entries in News Manager, so loading the New Post page can take some time while it parses everything.

Would it be possible to put a direct link to New Post somewhere in the UI, so I could skip that parsing step?

Here's a small plugin that adds a "Create new post" link in Pages' sidebar.

PHP Code:


'Create Post shortcut (News Manager)',     
'Carlos Navarro',
'Adds shortcut link for creating News Manager posts in Page Management sidebar',


sidebar_nm_createpost() { ?>
    <li id="sb_nm_createpost" ><a href="load.php?id=news_manager&amp;edit"><?php i18n('news_manager/NEW_POST'); ?></a></li>
<?php }

// end 

Save as news_manager_createpost.php in your plugins folder.

What's your server software and OS?

I had the same UTF-8 problems with my XAMPP (WinXP) test server.
Thank you!

(2013-01-13, 06:45:38)Carlos Wrote: @stevenjaycohen

Here's a small plugin that adds a "Create new post" link in Pages' sidebar.
I've updated it to display the link in the user language.
May I suggest that you name it news_manager_createpost.php instead?

That way, it groups with the other plugins in the plugins folder.

(2013-01-13, 06:45:38)Carlos Wrote: Save as nm_createpost.php in your plugins folder.

I am trying to port some code I wrote for Drupal 6 to News Manager.

If you are browsing the Web and see something that you would like to post about. You can click the bookmarklet and it will make a new post and quote the web page for you.

I haven't gotten it working yet, but I thought if I posted it here. Someone might be able to help out.

pre=''From <a target="_blank"
href="''+escape(u)+''">''+escape(t) + escape(''</a>:
edit[title]=''+escape(''Link: ''+t)+''
+escape(''<a href="''+u+''" target="_blank">Link</a>'')));
This version launches in a sized popup window:
pre=''From <a target="_blank"
href="''+escape(u)+''">''+escape(t) + escape
(''</a>:<br /> '');void(
edit[title]=''+escape(''Link: ''+t)+''&edit[body_field]
<a href="''+u+''" target="_blank">Link</a>''),
(2013-01-13, 23:32:38)stevenjaycohen Wrote: May I suggest that you name it news_manager_createpost.php instead?

Agreed. I've edited the post. Thanks.
(2013-01-13, 08:59:06)Carlos Wrote: What's your server software and OS?

I don't know what my server OS is ; all I know is that it's a PHP/MySQL platform. I'm using this (sorry, it's in french) :

If you tell me how to give you more information, I would do it with pleasure.

Users browsing this thread: 1 Guest(s)