Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager
#1
IMPORTANT
This thread was for older versions of the News Manager plugin (2.2.4 and prior) which are no longer updated and maintained. Updated version available here

Please also look at the



This topic is about the GetSimple News Manager plugin, an easy to use plugin allowing you to publish posts/articles on your website.

Installation

You can download the latest version from here. Unzip the downloaded file and copy its contents to your plugins folder. The required data folder and configuration file should be created automatically when you first access the plugin.

Usage

To access the plugin, go to the News Manager submenu under the Pages tab. Once you're in the News Manager main admin panel, you will notice three buttons in the top-right corner: Settings, Create New Post and Filter. The Settings button allows you to change the behavior of the News Manager plugin, with the Create New Post button you can start writing new posts and the Filter button lets you search through long lists of posts.

Settings

The settings panel currently has 7 different options, each of which will be explained in more detail in the list below.
  • Page To Display Posts - Select the slug (url) of the page on which you want to display your posts. The original content of this page will be replaced with the posts that you have published.
  • Language used on News Page - This controls the language settings for things like 'Published on', 'Older/Newer Posts', etc on the news page. Note that it won't affect the settings for the admin section of the News Manager plugin, that follows the global setting.
  • Posts On News Page Are Shown As - You can choose for either Full Text or Excerpt. The first option will show each post as is, the second option displays an automatically created excerpt without html formatting for each post.
  • Excerpt Length - This number defines the length in characters of the automatically created excerpts.
  • Number Of Posts On News Page - This controls pagination. Whenever the total number of published posts exceeds the number entered here, a navigation menu will be shown at the bottom of the news page, allowing the user to navigate between pages with posts.
  • Number Of Recent Posts - This plugin comes with a few (optional) sidebar functions, one of which provides a list with titles of the most recent posts. The value entered here controls how many titles are shown at each time.
  • Use Fancy URLs for posts, archives, etc - If you enabled fancy URLs in the global GetSimple settings, you can enable them for the News Manager plugin too. When activated, you will have to update your .htaccess file because otherwise it will not work! If applicable, after you have saved your settings a notification will appear with a link to a page explaining you how to change your .htaccess file.

Writing Posts

Writing posts is more or less similar to writing pages: you can define a Post Title, and write the Post Content just as regular pages. Clicking on the Post Options button in the top-right corner reveals some extra options which are Slug/URL, Tags, Publication date and the ability to make a post Private. A page slug is a user- and SEO-friendly short text used in the post URL. In the Tags field you can enter whatever keywords you see fit, as long as they are single words and seperated by commas. The publication date speaks for itself and making a post private prevents it from being displayed on the front-end part of your website.

Sidebar Functions

A couple of optional sidebar functions are also availabe. They can be found in the file sidebar.php which is located in the /plugins/news_manager/inc/ folder. What follows is a short description of what each function does:
  • nm_list_recent - Shows a list with the titles of the most recent articles, each title links to the full article.
  • nm_list_archives - Creates a list with archives. Archives are ordered by month and each archive contains all posts that have been published in that specific month.
  • nm_list_tags - Shows all unique tags in a tag cloud. Frequently used tags are shown bigger than others.
  • nm_search - Provide a form to search articles based on keywords.

For example, to show a list of recently published articles in the sidebar, simply put the following code in you theme template:

Code:
<?php nm_list_recent(); ?>

Languages

There are multiple language files included, they can be found in the /plugins/news_manager/lang/ folder. You can create your own language file by translating any of the existing ones. Please contact me (via the GS forum topic or PM) when you have created a new language file and I will include it in the next release.

CSS

This plugin uses various CSS classes (title, date, content, etc), but you have to write your own CSS rules in order to apply a style of your liking. CSS code for the GetSimple Innovation theme is shown below.

Code:
.nm_post {
  padding: 0;
  margin-bottom: 50px;
}

.nm_post h3 {
  margin-bottom: 5px;
}

.nm_post p {
  margin-bottom: 10px;
}

.nm_post_title a {
  text-decoration: none;
}

.nm_post_title a:hover {
  text-decoration: underline;
}

.nm_post_date {
  color: #999;
  font-size: 11px;
}

.nm_post_content {
  margin-bottom: 20px;
}

.nm_post_meta {
  padding: 2px 5px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  font-size: 11px;
}

.nm_post_back {
  margin-top: 20px;
  font-size: 11px;
}

.nm_post_back a {
  text-decoration: none;
}

.nm_post_back a:hover {
  text-decoration: underline;
}

.nm_page_nav .left {
  float:left;
  text-align:left;
}

.nm_page_nav .right {
  float:right;
  text-align:right;
}

aside .section a, aside .section a {
  text-decoration: none;
}

aside .section a:hover, aside .section a:hover {
  text-decoration: underline;
}

aside .section a.large {
  font-size: 22px;
}

That's it, I hope you will enjoy it!
Reply
#2
News Manager

The directory "GSDATAPATH/news" does not exist. It is required for this plugin to function properly. Please create it manually and make sure it is writable.

Made the directory writable but still...
Reply
#3
There is a news.php file, where we must put it? Because it's not in the plugins folder, when i do this, i have a blank page for all the site.

Moreover, i created the news folder in data, so the error message
Reply
#4
I accidentally included 2 files in the zipfile. Sorry, my mistake. There's just one now: news_manager.php, which should be placed in your plugins folder.

@El-Cherubin: removing the previous files and replacing them with the new news_manager.php probably solves your problem.

@Oleg06: I think you're getting those messages because you probably have DEBUG mode turned on. If so, it's safe to ignore them. About your second question, I don't really get it. Clicking on the title of an article in the admin section should bring up the edit screen.
Reply
#5
Are you able to make it display a set number per page? If you do that and fix the links in the titles for pretty urls, this shall be absolutely perfect as a basic news manager (in fact it'd be good to include with the Get-Simple installation even).
Reply
#6
Thanks Angryboy, good to hear.

Your first request should be easy, I'll try to do that in the nearby future. The second is a bit more difficult, it probably needs mod_rewrite rules (I guess?), but I'll see...
Reply
#7
I just installed and tested. If i insert one article its ok, but if i insert two the second doenst appears and so on, only the first i created. What should i do?
Reply
#8
Yeah, forget what I said about the second request - I was forced to do what you said after a plugin crashed my site and it now works Smile

I love this thing even more because each separate news article is compatible with the HTML Comments Box script, so they can have independent comments boxes integrated Big Grin Wonderful and compact work roog. Wonderful.

I've instead changed my request from asking to fix something that is not a problem to including a back button on the full article page (just so members can get back easily to the main page without deleted their comment in the comments box if they've posted). Do that and I can't criticise this plugin in the slightest.
Reply
#9
appears after clicking Create New Article
Code:
Notice: Trying to get property of non-object in /home/cp068800/public_html/neowebtime.ru/00/plugins/news.php on line 111

Notice: Trying to get property of non-object in /home/cp068800/public_html/neowebtime.ru/00/plugins/news.php on line 112
Reply
#10
Wonder why that is happening.....

On another note, fixing the earlier request that turned out to be unnecessary -- if you give the Mod Rewrite rule:
Code:
RewriteEngine On
RewriteRule ^news/([^/]*)\.html$ /index.php?article=$1 [L]
In the root .htaccess file with 'news' being any directory that you desire, the urls can look more search engine friendly (essentially optimising the pretty urls for this plugin if the news.php file is altered to allow it, though it doesn't really need it). Just thought I'd contribute a little.
Reply
#11
@fmcr: That's weird. You mean they don't show up in the admin panel of the news manager? Can you check whether new files are created in the GSDATAPATH/articles directory? For each article there should be a single xml file, like 4cbd90d5a68da.xml.

@Oleg06: Like I said before, you see those messages because you have DEBUG mode turned on. Anyway, I've updated the plugin, so you can download the new version to get rid of those messages.

@Angryboy: Thanks for your help! I'm a bit busy right now, but I'll try to make a settings page where you can configure those rewrite rules, limit the number of articles per page, etc.
Reply
#12
Hi!
I'm pretty new to this, but I really like GetSimple and this news manager. How ever I have a tiny issue. I changed my site from good old html to get simple. So when I added my old news, the sort order of the news was changed. I tried to modify the date in the xml file, but that didn't sort the problem.
How can I change the sort order of the news I have registered?
Reply
#13
Messages are sorted not by date but based on their filename. New filenames are generated using php's uniqid() function, which generates a unique identifier based on the current time in microseconds. So if you want to change the order of your articles, you have to rename the xml files with id's generated with uniqid() that ensure a correct ordering. I suggest you write a simple script to fix it.

- roog
Reply
#14
How do I access this plugin? How do I create a news item?

Thanks.

Don
Reply
#15
[Image: 8b7024f366fb.png]
Please, sorry for my English ^^
Reply
#16
Wow! Couldn't have explained it better!
Reply
#17
Hi i installed this plugin, but have little problem. In /admin/load.php?id=news are listed articles. I wanna change article date (10 Dec 2010) to (2010 12 10). Edited news.php (changed date format to (Y m d) , but nothing changed. Please help Big Grin
Reply
#18
Hello, first of all thanks for this great plugin. On a sidenote I would like to point out that the krsort performed at the end of the get_articles() function is actually the wrong one.

The function I use looks as follows


Code:
function get_articles() {
  $articles = array();
  $files = getFiles(GSDATANEWSPATH);
  foreach ($files as $file) {
    if (is_file(GSDATANEWSPATH . $file) && preg_match("/.xml$/", $file)) {
      $articles[] = $file;
    }
  }
  sort($articles);
  return array_reverse($articles);
}

Also it would be easy to add a parameter to only select and return the most recent entries.
Reply
#19
Made some rework of your script.
My version makes preview of the article on the main page if the article is more then number of words set at the beginning of the script with "...more" link to full article.
Also fixed the issue when date was updated after editing the article - it's senceless when you fix some error in the 'news' article and new article's posting time appeared.
Reply
#20
Hello friends,

The news is not saved if the title has special characters.
My language is portuguese.
Please, help!
Reply
#21
julianojc Wrote:Hello friends,

The news is not saved if the title has special characters.
My language is portuguese.
Please, help!
Use Martin's plugin to convert special to ASCII characters in the link.
Or create a news, and reedit it, changing special chars to ASCII like.
Addons: blue business theme, Online Visitors, Notepad
Reply
#22
I've updated the news plugin a little:
  • Publish dates are now no longer altered when the article content is changed (thanks to SlavaP)
  • Article sorting is now done as NeXuS suggested
  • For aesthetic reasons I changed ARTICLEDATA to /path/to/getsimple/data/articles

You can download the updated file above or from the Extend section on the GS main site.

There are still a bunch of enhancements that should be taken care of, the problem however is in the very nature of plugins themselves. It's hard to include functionality that won't need very specific setups/settings (hard links to certain pages for example), i.e., enhancements that work fine in my setup could break or disrupt the plugin's functioning for other people. I guess I should create a settings panel wherein all these things could be taken care of, but that might take a while...
Reply
#23
Oleg06 Wrote:appears after clicking Create New Article
Code:
Notice: Trying to get property of non-object in /home/cp068800/public_html/neowebtime.ru/00/plugins/news.php on line 111
Notice: Trying to get property of non-object in /home/cp068800/public_html/neowebtime.ru/00/plugins/news.php on line 112
While creating a new article the code is trying to read the saved version that doesn't yet exist. Adding a check for the object and fields not being empty eliminates the warnings...
Code:
diff ~/public_html/GetSimple/plugins/n
ews.php.orig ~/public_html/GetSimple/plugins/news.php
109,112c109,116
<   $file = GSDATANEWSPATH . $id . '.xml';
<   $data = @getXML($file);
<   $title = stripslashes($data->title);
<   $content = stripslashes($data->content);
---
>       $file = GSDATANEWSPATH . $id . '.xml';
>       $data = @getXML($file);
>       $title = '';
>       if (!empty($data) && !empty($data->title))
>               $title = stripslashes($data->title);
>       $content = '';
>       if (!empty($data) && !empty($data->content))
>               $content = stripslashes($data->content);
Reply
#24
I wonder why you are getting those messages though. On my default/standard getsimple installation nothing gets printed at all. Maybe you have some kind of debugging mode turned on?
Reply
#25
roog Wrote:I wonder why you are getting those messages though. On my default/standard getsimple installation nothing gets printed at all. Maybe you have some kind of debugging mode turned on?
Yes, error reporting should always be cranked right up during development for anything and is here. Just because something is flagged as just a warning doesn't mean it can or should be ignored, if it really doesn't matter then there won't be any kind of message.
Reply




Users browsing this thread: 7 Guest(s)