Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager
@roog: Great plugin!

Some suggestions:
- Make Post options visible by default, hidden if javascript enabled. (That's how GetSimple Page Manager does.)
- Don't (or give the option not to) display posts older than now. That way, posts could be scheduled for future publishing.
Reply
Carlos Wrote:@roog: Great plugin!

Some suggestions:
- Don't (or give the option not to) display posts older than now. That way, posts could be scheduled for future publishing.
I think it's possible now by tweaking with (future) postdate and Private check.
Reply
Thanks Raffee, but I mean automatic publishing of posts. You set a future post date, then this post will not be listed until that date is reached. (Though if you know the post URL you would be able to view it.)

I have done some experiment with this...
Reply
I have just installed news-manager, and it seems to work perfect - but when I submit a post it don't count up (always display 0 posts) - what happens? Smile
Reply
Did anyone test NM 2.2.1 with latest gs.3.1bleeding ?
I can't find the function responsible for link creation, thus after setting up a page for displaying excerpts, links seems to lack a slash.
e.g.: articlespost/this-is-a-test-news should point to articles/post/this-is-a-test-news.
Same thig happens with tag links.

Publication date also doesn't show up :/

btw. where should I look to change default names of: tag, post, page, archive used in links, to my own captions ?




edit / note to myself: plugins using strftime() instead of date() format had to have a different date formatting, along with setting somewhere a default timezone as a fallback

otherwise date won't be shown, or it will be a complete mess
Addons: blue business theme, Online Visitors, Notepad
Reply
@Carlos: future publishing now works properly. Posts won't be shown on public page until their publication date is reached. See version 2.2.2. About this metadata toggle, News Manager uses the same code/javascript as the Page Manager does, so I don't understand why it doesn't work the same. I'll check it out later.

@kristho: I don't what's happening there. Turn on DEBUG mode in gsconfig.php, maybe it gives more information.

@yojoe: see the function nm_get_url() in news_manager/functions.php.
Reply
@roog I love this plugin. Is there a way to have page titles include the post title? This would be an excellent addition that would benefit SEO.

If anyone else has the answer please let me know.

Thanks!
Reply
roog Wrote:@yojoe: see the function nm_get_url() in news_manager/functions.php.
There's something odd going on with functions.php -> L. 102 -> $url .= $query . '/';
To have a working url with website/page/posts/slug instead of website/pageposts/slug I have to change it to $url .= '/';
Using rewrite rules I wasn't able to fix mine problem.
You should add a conditional, to add $query only on index page, while showing slugs on other pages shouldn't have it.
Maybe it's only me, so I can't be sure if it happens to other people.

btw. I want to show news on a "NEWS" page, while on index page I'd like to show last news excerpt (or even 3 in a newsticker box). Basically below function added to sidebar.php is working:
Code:
function nm_list_recent_excerpt() {
  global $NMRECENTPOSTS, $NMSHOWEXCERPT;
  $posts = nm_get_posts();
  if (!empty($posts)) {
    $posts = array_slice($posts, 0, $NMRECENTPOSTS, true);
    foreach ($posts as $post) {
      nm_show_post($post->slug, $NMSHOWEXCERPT == 'Y');
      }
  }
}

But I'd like to get a bit shorter excerpts, than the value set in options, and I don't know how to override $NMEXCERPTLENGTH variable



btw. I always experience a strange behaviour of this plugin on localhost. Sometimes I delete a news, and afterpage refresh I get a duplicated version of last news, or deleted news appear again (isn't deleted at all).
Would you consider a consistency check between physically existing news files, and their entries in data/other/news_manager/posts.xml file ?
Addons: blue business theme, Online Visitors, Notepad
Reply
Just upped a new version of News Manager plugin. Instead of pagination of posts in the admin panel, you can now filter posts just like Pages and/or Backups.

@robkellas: The page title is set by your theme template so unfortunately the NM plugin has no control over that. But you can always create a separate template for your posts/news page to fix it.

@yojoe: I'll start testing NM with GS 3.1 soon. If anyone else has found bugs or things that GS 3.1 breaks, please report them.
Reply
roog Wrote:Just upped a new version of News Manager plugin. Instead of pagination of posts in the admin panel, you can now filter posts just like Pages and/or Backups.

@yojoe: I'll start testing NM with GS 3.1 soon. If anyone else has found bugs or things that GS 3.1 breaks, please report them.

Do you have a publicly available svn ?
I'd like to patch only needed changes to get filtering, and I lost recognitions of changes I made in files to make NM html5 ready.

btw. is there a way to make Mvlcek's search plugin working also with news ?
Addons: blue business theme, Online Visitors, Notepad
Reply
Hello,

Nice plugin! In my case/config (fresh GS install on Apache Windows), one post with accents in its title was enough to make the whole list of posts disappear. The following correction solved the problem:

In inc/cache.php, replaced this:
Code:
function nm_cache_to_xml($posts) {
  $xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
  foreach ($posts as $post) {
    $elem = $xml->addChild('item');
    $elem->addChild('slug', $post['slug']);
    $elem->addChild('title', $post['title']);
    $elem->addChild('date', $post['date']);
    $elem->addChild('tags', $post['tags']);
    $elem->addChild('private', $post['private']);
  }
  return @XMLsave($xml, NMPOSTCACHE);
}
by this:
Code:
function nm_cache_to_xml($posts) {
  $xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
  foreach ($posts as $post) {
    $item = $xml->addChild('item');
    $elem = $item->addChild('slug');
    $elem->addCData($post['slug']);
    $elem = $item->addChild('title');
    $elem->addCData($post['title']);
    $elem = $item->addChild('date');
    $elem->addCData($post['date']);
    $elem = $item->addChild('tags');
    $elem->addCData($post['tags']);
    $elem = $item->addChild('private');
    $elem->addCData($post['private']);
  }
  return @XMLsave($xml, NMPOSTCACHE);
}
Just in case it helps anyone. Cheers
Reply
by saying "accents" do you mean language specific characters ?

This could solve the problem I stepped once into.
But only if it is related with special chars in title.
Addons: blue business theme, Online Visitors, Notepad
Reply
@kofkof: Thanks, I've fixed the problem.

@yojoe: No, there's no public svn. What do you mean with filtering? The most recent version has post filtering just like regular pages. Finally, about mvlcek's search plugin being compatible with NM, I doubt it. He probably only indexes the default GS data dirs. However, you can probably easily change his code to search /data/posts as well.
Reply
robkellas Wrote:Is there a way to have page titles include the post title? This would be an excellent addition that would benefit SEO.

If anyone else has the answer please let me know.

Quick patch:

Create a functions.php in your theme folder, with this (if file exists, insert the function into it):
Code:
<?php
function nm_echo_title() {
    global $NMPAGEURL;
    $url = strval(get_page_slug(false));
    if ($url == $NMPAGEURL) {
        if (isset($_GET['post'])) {
            $slug = str_replace('..','',str_replace('/','',$_GET['post']));
            $file = NMPOSTPATH . $slug . '.xml';
            $post = @getXML($file);
            if (!empty($post) && $post->private != 'Y') {
                echo strip_tags(strip_decode($post->title)),' - '; // ' - ' is the separator
            }
        }
    }
}

Now edit your theme: look for your <title>...</title> tag in your template.php (or header.php if using Innovation theme) file, and insert this call just after the opening <title> tag:
Code:
<?php nm_echo_title(); ?>

Example (based on Cardinal theme):
Code:
<title><?php nm_echo_title(); ?><?php get_page_clean_title(); ?> &lt; <?php get_site_name(); ?></title>

That's it.
Post titles will now be like: This is the post title - News page < My site name
Reply
roog Wrote:@kofkof: Thanks, I've fixed the problem.

@yojoe: No, there's no public svn. What do you mean with filtering? The most recent version has post filtering just like regular pages. Finally, about mvlcek's search plugin being compatible with NM, I doubt it. He probably only indexes the default GS data dirs. However, you can probably easily change his code to search /data/posts as well.
I'll try to look at it when I get some more spare time.
But I doubt "easily" will be that easy as I wished it was.

As it goes about filtering addon: could you list the changes or files you edited ?
Maintaining a small changelog in extend would be very appreciated.

Carlos Wrote:Quick patch:

Create a functions.php in your theme folder, with this (if file exists, insert the function into it):


Example (based on Cardinal theme):
Code:
<title><?php nm_echo_title(); ?><?php get_page_clean_title(); ?> < <?php get_site_name(); ?></title>

That's it.
Post titles will now be like: This is the post title - News page < My site name

Is it a beta code, or ready to go on spec ? Wink
I see It would be clever to add an exception to show news clean title only when visitors enter news page,.
But when seeing a news, get_page_clean_title() of the parent news page shouldn't be shown.

hmmm... moving get_page_clean_title() from theme to this function will do the thing.
But I would gladly see this feature in NM core.
Addons: blue business theme, Online Visitors, Notepad
Reply
yojoe Wrote:I see It would be clever to add an exception to show news clean title only when visitors enter news page,.
But when seeing a news, get_page_clean_title() of the parent news page shouldn't be shown.
I think that's a matter of taste or style... Some would prefer to have the news parent title there (or even af the beginning). Anyway that's only an example... you can insert your usual if (return_page_slug()==... there.

Note that this solution is not very efficient: the post xml file will be read twice (once for rendering the <title>, another later to display the post). The better one would involve some changes in NM core (reading the file before rendering anything, making the data global...)
Reply
Hi
I use this function Smile thanks. Great addon, but as we see some parts are missed.
I have few difficulties with .htaccess but I solve them as follow:

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

where NEWS is a name of page created for plugin. I hope this help another users to find working solution.
Reply
eline Wrote:RewriteRule ^news/post/([^/.]+)/?$ index.php?id=news&post=$1 [L]

:-?
News Manager has a built-in .htaccess generator, and that's one of the lines it adds (among others)
Reply
hmm ... how to use this bulid in generator?
I just install this plugin and switch off/on friendly urls - nothing happend Wink
Reply
eline Wrote:hmm ... how to use this bulid in generator?
I just install this plugin and switch off/on friendly urls - nothing happend Wink

Have you seen that .HTACCESS link at the left of the SETTINGS link?
Visit that page before enabling fancy url's. There you'll see what to do to make them work.
Reply
Roog,

the link to the demo page does not work: http://rxgr.nl/getsimple/news/
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
http://rxgr.nl/newsmanager/news
Reply
Carlos: did you ever mess with title field to make it compatible with transliteration plugin (which is also builtinto 3.1) during file creation process ?
Addons: blue business theme, Online Visitors, Notepad
Reply
yojoe Wrote:Carlos: did you ever mess with title field to make it compatible with transliteration plugin (which is also builtinto 3.1) during file creation process ?

No, I'm not using NM...
But it doesn't seem difficult, try this:

Edit newsmanager/inc/functions.php, around line 133 in NM 2.2.3:
Replace this:
Code:
function nm_create_slug($str) {
  $str = to7bit($str, 'UTF-8');
  $str = clean_url($str);
  return $str;
}

by this:
Code:
function nm_create_slug($str) {
  global $i18n;
  if (isset($i18n['TRANSLITERATION']) && is_array($translit=$i18n['TRANSLITERATION']) && count($translit>0)) {
    $str = str_replace(array_keys($translit),array_values($translit),$str);
  }
  $str = to7bit($str, 'UTF-8');
  $str = clean_url($str);
  return $str;
}

Let me know if it works, I have not tested (still not using transliteration)
Reply
Carlos Wrote:Let me know if it works, I have not tested (still not using transliteration)


Works nicely.
Chuck Norris approves Wink
Addons: blue business theme, Online Visitors, Notepad
Reply




Users browsing this thread: 3 Guest(s)