Posts: 3,491
Threads: 106
Joined: Mar 2010
2013-01-07, 01:25:12
(This post was last modified: 2013-01-07, 01:43:03 by Carlos.)
(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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
News Manager 2.3.0 (available for download in Extend
Changes/additions: - 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
Fixes: - 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
Languages: - added es_ES
- added hu_HU (@szrudi)
Posts: 3,491
Threads: 106
Joined: Mar 2010
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)
Examples:
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.
Posts: 45
Threads: 5
Joined: Feb 2011
2013-01-08, 07:26:06
(This post was last modified: 2013-01-08, 07:27:12 by patriotmedia.)
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?
Posts: 1,928
Threads: 88
Joined: Apr 2010
in settings in the field Custom Permalink Structure write %parent%/%slug% without a slash at the end
Posts: 3,491
Threads: 106
Joined: Mar 2010
2013-01-08, 08:45:32
(This post was last modified: 2013-01-08, 08:56:14 by Carlos.)
@patriotmedia
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:
https://github.com/cnb/News_Manager-gets.../downloads
http://get-simple.info/extend/plugin/new...dated/541/ (end of page)
Posts: 49
Threads: 6
Joined: Jun 2010
(2013-01-06, 11:33:08)Carlos Wrote: Try inserting:
Code: <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 :
Code: Publié le 3 f�vr. 2013
Posts: 3,491
Threads: 106
Joined: Mar 2010
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)
Posts: 3,491
Threads: 106
Joined: Mar 2010
@filmpl
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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
2013-01-11, 08:55:16
(This post was last modified: 2013-01-11, 08:55:43 by Carlos.)
@filmpl
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 # http://php.net/manual/en/function.setlocale.php #setlocale(LC_ALL, 'en_US');
If you had not edited it, it should be like that.
Just below, insert this:
PHP Code: setlocale(LC_TIME, 'fr_FR.UTF8', 'fr.UTF8', 'fr_FR.UTF-8', 'fr.UTF-8');
And check if you now get févr.
Posts: 49
Threads: 6
Joined: Jun 2010
@Carlos
Here it is :
Code: Feb, February - February, Feb, Feb
Strange, isn't it ?
Posts: 3,491
Threads: 106
Joined: Mar 2010
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...)
Posts: 49
Threads: 6
Joined: Jun 2010
(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):
02/03/2013
Posts: 3,491
Threads: 106
Joined: Mar 2010
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.
Posts: 49
Threads: 6
Joined: Jun 2010
@Carlos
Code: C
f�vrier, f�vr., f�vr.- février, févr., févr.
Posts: 3,491
Threads: 106
Joined: Mar 2010
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.
Posts: 49
Threads: 6
Joined: Jun 2010
@Carlos
You got it ! Thanks a lot !
It's weird that my server returns non-UTF8 format although my .htaccess says "AddDefaultCharset UTF-8".
Posts: 19
Threads: 1
Joined: Dec 2012
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?
Posts: 3,491
Threads: 106
Joined: Mar 2010
2013-01-13, 06:45:38
(This post was last modified: 2013-01-17, 05:08:40 by Carlos.)
@stevenjaycohen
Here's a small plugin that adds a "Create new post" link in Pages' sidebar.
PHP Code: <?php
$thisfile = basename(__FILE__, ".php");
register_plugin( $thisfile, 'Create Post shortcut (News Manager)', '0.2', 'Carlos Navarro', '#', 'Adds shortcut link for creating News Manager posts in Page Management sidebar', 'pages', '' );
add_action('pages-sidebar', 'sidebar_nm_createpost');
function sidebar_nm_createpost() { ?> <li id="sb_nm_createpost" ><a href="load.php?id=news_manager&edit"><?php i18n('news_manager/NEW_POST'); ?></a></li> <?php }
// end
Save as news_manager_createpost.php in your plugins folder.
Posts: 3,491
Threads: 106
Joined: Mar 2010
@filmpl
What's your server software and OS?
I had the same UTF-8 problems with my XAMPP (WinXP) test server.
Posts: 19
Threads: 1
Joined: Dec 2012
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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
I've updated it to display the link in the user language.
Posts: 19
Threads: 1
Joined: Dec 2012
2013-01-13, 23:32:38
(This post was last modified: 2013-01-13, 23:48:44 by stevenjaycohen.)
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.
http://sjc.sdf.org/post/blog-this-bookma...r-drupal-6
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.
Code: javascript:u=document.location.href;t=document.title;s=
''''+window.getSelection()+'''';
pre=''From <a target="_blank"
href="''+escape(u)+''">''+escape(t) + escape(''</a>:
'');void(window.open(''
http://sjc.sdf.org/admin/load.php?id=news_manager&edit&
edit[title]=''+escape(''Link: ''+t)+''
&edit[body_field][body]=''+pre+escape(s)
+escape(''<a href="''+u+''" target="_blank">Link</a>'')));
This version launches in a sized popup window:
Code: javascript:u=document.location.href;t=document.title;
s=''''+window.getSelection()+'''';
pre=''From <a target="_blank"
href="''+escape(u)+''">''+escape(t) + escape
(''</a>:<br /> '');void(window.open
(''http://sjc.sdf.org/admin/load.php?id=news_manager&edit&
edit[title]=''+escape(''Link: ''+t)+''&edit[body_field]
[body]=''+pre+escape(s)+escape(''
<a href="''+u+''" target="_blank">Link</a>''),
''_blank'',''width=710,height=500,status=yes,
resizable=yes,scrollbars=yes''));
Posts: 3,491
Threads: 106
Joined: Mar 2010
(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.
Posts: 49
Threads: 6
Joined: Jun 2010
(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) : http://www.ovh.com/fr/hebergement_mutual...hnique.xml
If you tell me how to give you more information, I would do it with pleasure.
|