Thread Rating:
  • 6 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager (updated)
#26
better course after the title and date
Reply
#27
Carlos, good as you thought, the next version of the page numbering and lettering not older / newer at the bottom Smile

how nice to be able to throw the pictures into a separate box Smile I actually glue finished pieces of text;-)
Reply
#28
Sorry PiN, I don't understand what you mean (both sentences).
Reply
#29
1)
now
Quote:← Older Posts Newer Posts →
better
Quote:<< [1] [2] [3] >>

2) What I meant was that it was nice to be able to attach pictures in a different way than manually add <img src="obrazek.jpg"> the content of news.

I'm sorry, but my English is poor. Rolleyes
Reply
#30
Ok I got it. Thanks for the suggestion.

I intend to extend NM. But first of all I intended to fix as much issues as I can.

Anyway I will probably be slow, so here there are some alternatives:

http://get-simple.info/wiki/plugins:guide#blog_news
- GS Blog plugin (post image support)
- I18N Search and/or I18N Special Pages (<< < 1 2 3 > >>)
- Pages & Comments plugin (both)
Reply
#31
[Image: blog.jpg]

PHP Code:
<div class="nm_post_image"><a href="[POST-TITLE]"><img src="[POST-IMAGE]" /></a></div>

Does this code working?

I want something lie the picture!
Reply
#32
(2012-12-26, 16:57:42)kazu Wrote: <div class="nm_post_image"><a href="[POST-TITLE]"><img src="[POST-IMAGE]" /></a></div>

Does this code working?

No, it was just an example.
(anyway it was wrong, incomplete...)

(2012-12-26, 16:57:42)kazu Wrote: I want something lie the picture!

News Manager does not currently support post thumbnails.
Reply
#33
Here is a simple script I wrote to change GS Blog entries into News Manager entries. I thought someone else might find it useful.

PHP Code:
<?php

if ($handle opendir('/path/to/data/blog')) {
      echo 
"Directory handle: $handle\n";
          echo 
"Entries:<br/>";
$entries=array();
          
/* This is the correct way to loop over the directory. */
          
while (false !== ($entry readdir($handle))) {
            echo 
$entry."<br/>";
            if (
strpos($entry".") != 0){
$entries [] = $entry;
            }
          }

      
closedir($handle);
      echo 
"<br/><br/><b>".count($entries)." Entries</b>"

      
date_default_timezone_set('America/New_York');
      foreach (
$entries as $filename){
        if (
$file file_get_contents("/full/path/to/data/blog/".$filename)){
          echo 
"<br/>Got ".$filename."!<br/>";
          
$newfile='<?xml version="1.0" encoding="UTF-8"?><item>';
          
$titleStart strpos($file,"<title>");
          
$titleEnd strpos($file,"</title>");
          
$titleEnd $titleEnd $titleStart 8;
          
$title substr($file$titleStart$titleEnd);
          
$newfile .= $title;
          
$dateStart strpos($file,"<date>");
          
$dateStart $dateStart 15;
          
$dateEnd strpos($file,"</date>");
          
$dateEnd $dateEnd $dateStart 3;
          
$oldDate substr($file$dateStart$dateEnd);
          echo 
"<br/>".$oldDate."<br/>";
          
$oDate = new DateTime($oldDate);
          
$date "<date><![CDATA[".date_format($oDate'D, d M Y G:i:s O')."]]></date>";
          
$newfile .= $date;
          
$tagsStart strpos($file,"<tags>");
          
$tagsEnd strpos($file,"</tags>");
          
$tagsEnd $tagsEnd $tagsStart 7;
          
$tags substr($file$tagsStart$tagsEnd);
          
$newfile .= $tags;
          
$privateStart strpos($file,"<private");
          
$privateEnd strpos($file,"</private>");
          
$privateEnd $privateEnd $privateStart 10;
          
$private substr($file$privateStart$privateEnd);
          
$newfile .= $private;
          
$contentStart strpos($file"<content>");
          
$contentEnd strpos($file"</content>");
          
$contentEnd $contentEnd $contentStart 10;
          
$content substr($file$contentStart$contentEnd);
          
$newfile .= $content;
          
$newfile .= "</item>";
          
file_put_contents("/full/path/to/data/posts/".$filename$newfile);
        }
      }
}

?>
Reply
#34
I found another issue with NM 2.2.x and GS 3.1.x: http://get-simple.info/forums/showthread...0#pid31500

I'll fix this in next NM(u) release.



@stevenjaycohen

Thanks for sharing your script!

It would be nice to have another one that does the same but the other way (NM->GS Blog)

Somewhat related to this, I intend to let NM import automatically normal GS pages (by just uploading/copying the page xml files to /data/posts). Right now it works except for the date.
Reply
#35
Carlos whether it would be possible to generate rss news?
Reply
#36
There's a plugin: http://get-simple.info/extend/plugin/new...r-rss/221/ (I haven't tried it).

Anyway, I intend to add RSS or Atom feed.
Reply
#37
I use that plugin. You can see how it works at http://sjc.sdf.org/feed/

(2012-12-30, 03:39:10)Carlos Wrote: There's a plugin: http://get-simple.info/extend/plugin/new...r-rss/221/ (I haven't tried it).

Anyway, I intend to add RSS or Atom feed.

It is harder to go from NM to GS Blog since GS Blog puts more into the metadata of the xml.

I think your design is cleaner.

(2012-12-29, 01:03:27)Carlos Wrote: It would be nice to have another one that does the same but the other way (NM->GS Blog)
Reply
#38
(2012-12-30, 05:25:46)stevenjaycohen Wrote: I use that plugin. You can see how it works at http://sjc.sdf.org/feed/

Nice to know it works. Thanks.

(2012-12-30, 05:25:46)stevenjaycohen Wrote:
It is harder to go from NM to GS Blog since GS Blog puts more into the metadata of the xml.

Yes, some default values (for category, etc.) should be set in that script.

(2012-12-30, 05:25:46)stevenjaycohen Wrote: I think your design is cleaner.

Not my design. This plugin was created by roog, I'm just trying to update and maintain it.
Reply
#39
In the next News Manager release, post titles will no longer be treated as html code, but as text. This will avoid some problems (mainly with titles like If a<b then..., The importance of the <title> tag, ...)

If someone still wants html in post titles, let me know. I may make this optional.



News Manager lets you edit your posts' date and time. The date field uses the m-d-Y (American/old English) date format, but this can be confusing, many countries use d-m-Y instead.
In some next NM release I want to change it to the less ambiguous Y-m-d (dateISO) format. This would be only for the admin panel (backend). The public site (frontend) part will not be affected by this change.

I'd like to know if someone wants to keep using m-d-Y. If so, I can make this an option (maybe with a gsconfig setting).

PS: Yes, I'm also thinking about an optional date/time picker.
Reply
#40
Right now if you don't select fancy URLs in NM, by default a post has an URL like:

SITE/index.php?id=news&post=title

I'm going to change this default permalink structure: NM will use the one defined in GS, so that you can have slightly better URLs without having to change the .htaccess file, like:

SITE/news/?post=title
SITE/news?post=title

(I'm using posts as an example, but this is also applicable to ?archive=, ?tag= ...)

Now my question to current NM users:
Is anyone interested in having a setting to force using old-style default permalinks, independent of the structure defined in GS? (maybe for existing sites that want to keep it because of SEO)
Reply
#41
If we could get News Articles to be the page titles, that would be more helpful.

Google Webmaster Tools complains that the news posts are all on pages with the same title.

(2012-12-30, 21:23:56)Carlos Wrote: Right now if you don't select fancy URLs in NM, by default a post has an URL like:

SITE/index.php?id=news&post=title

I'm going to change this default permalink structure: NM will use the one defined in GS, so that you can have slightly better URLs without having to change the .htaccess file, like:

SITE/news/?post=title
SITE/news?post=title

(I'm using posts as an example, but this is also applicable to ?archive=, ?tag= ...)

Now my question to current NM users:
Is anyone interested in having a setting to force using old-style default permalinks, independent of the structure defined in GS? (maybe for existing sites that want to keep it because of SEO)
Reply
#42
(2012-12-31, 05:22:13)stevenjaycohen Wrote: If we could get News Articles to be the page titles, that would be more helpful.

It's on the to-do list. Of course that's the most important issue for SEO.

In the meantime you can use something like this:
http://get-simple.info/forums/showthread...5#pid14215

(2012-12-31, 05:22:13)stevenjaycohen Wrote: Google Webmaster Tools complains that the news posts are all on pages with the same title.

BTW meta descriptions are duplicate too. Also in the to-do list.

Any comments about those 3 changes I want to do?
Reply
#43
Carlos, if I can be of any help let me know. I just migrated to GS from my own CMS called GaSP.

The front-end of GaSP is JavaScript rendered by Google Web Toolkit, and the backend is in PHP.

If any of my php code would be helpful, I would gladly donate it to the News Manager plugin.

Is there an official repository/site where I could look through your roadmap? Maybe I can knock off a few issues for you?

Steven
Reply
#44
GitHub repository: https://github.com/cnb/News_Manager-getsimplecms/
Reply
#45
I've created a small plugin to make it easy to have the post title in the <title> tag: News Manager Title

Anyway NM 2.3 will have a function for use as template tag in the <title> tag (if you prefer to do it this way), like:
PHP Code:
<title><?php nm_post_title() or get_page_clean_title(); ?> ...</title> 

Already done in development version (code)
Reply
#46
Carlos, is it - http://get-simple.info/extend/plugin/new...r-rss/221/ - news adds to my site with rss feeds and generate rss feed from news that are on my website?

Thanks Smile
Reply
#47
I (still) haven't tried that plugin, but AFAIK it generates a feed for your News Manager posts.
Reply
#48
Hi Carlos,

Thanks for this plugin, which is light and easy to use.

I'm having few troubles with character encoding. My site's default language is french and for a post published on 02/03/2012, the plugin should write "Publié le 3 févr. 2013", but I instead have "Publié le 3 f�vr. 2013". HTML code is :

Code:
<p class="nm_post_date">Publi&eacute; le  3 f�vr. 2013</p>

Do you have any idea about how to solve this ?

Thanks a lot !
Reply
#49
It might be that your theme's template doesn't define a character set, that should be utf-8 in GS.

Try inserting:

Code:
<meta charset="utf-8">

in the header.
Reply
#50
This functions perfectly! Thank you!

(2013-01-02, 03:44:18)Carlos Wrote: I've created a small plugin to make it easy to have the post title in the <title> tag: News Manager Title

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.

So, I see no reason for you to re-implement the RSS within the main plugin, if the external plugin works well.
Reply




Users browsing this thread: 11 Guest(s)