Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager
Raffee Wrote:
Connie Wrote:I tested Version 1.2.4 with GS 3.0
I managed somehow to create an article without title. This article still exists in the list of articles, but I cannot edit it anymore, I can only delete it.
On the other hand the article is not in the news-output, but an error message: "The requested article does not exist."
So I have to delete that article and rewrite it, but I never get it in the original sequence

PS: in the meantime, I have 3 articles without titles, which are not listed and cannot be edited

I've got the same, but I made some investigation and realized that it's up to localization/encoding/entities in the plugin. Whenever I've put non-ascii character, for example Polish 'ó' (oacute), into the title - article title completely disappeared. The XML file stayed here, but with the <title> tag empty. When I edit the physical file and put the title without non-english chars - article shows again and can be edited from admin panel.

I'm using GS 3.0,
News Manager v.1.2.4,
i18n plugin v.1.1.1 with Polish language files (pl_PL.php)
and Polish GS language file
with pl.js file for CKEditor.

Finally here's my current news_manager.php code (excerpts):
* in function article_overview()
Code:
$title = htmlspecialchars_decode($data->title, ENT_QUOTES);
instead of
Code:
$title = html_entity_decode($data->title, ENT_QUOTES, 'UTF-8');

* in function edit_article($id) in CKEDITOR.replace parameters
Code:
entities : false,
instead of
Code:
entities : true,

* in function save_article()
Code:
$title = htmlspecialchars($_POST['post-title'], ENT_QUOTES, 'UTF-8', false);
     $content = htmlspecialchars($_POST['post-content'], ENT_QUOTES, 'UTF-8', false);
     $excerpt = htmlspecialchars($_POST['post-excerpt'], ENT_QUOTES, 'UTF-8', false);
instead of
Code:
$title = htmlentities($_POST['post-title'], ENT_QUOTES, 'UTF-8');
     $content = htmlentities($_POST['post-content'], ENT_QUOTES, 'UTF-8');
     $excerpt = htmlentities($_POST['post-excerpt'], ENT_QUOTES, 'UTF-8');

My GSCONFIG.PHP file got
Code:
# WYSIWYG editor language (default en)
  define('GSEDITORLANG', 'pl');
and
Code:
# Set PHP locale
  # [url]http://php.net/manual/en/function.setlocale.php[/url]
  setlocale(LC_ALL, 'pl_PL');
but I'm not sure if it does matters

Now my news_manager plugin works as I wanted.

I'm pretty new in GetSimple and PHP (especially with security risk) so tell me if I am wrong with this changes.

Thanks for this tips! I have copy/pasted that code into the news-plugin, and it finally shows the post with special characters in the admin-site. But I still have some strange problems. When I am uploading this plugin to my site, the whole site get an internal error (500). When I delete the file from the webserver, the site is back up and running again instantly. I am running GetSimple 3, I updated just a couple of hours ago.

Another strange thing is that to test this, I installed GetSimple 3 on one of my other webservers, and uploaded the same confiruged file. No internal error this time, but the page where I am supposed to show the news doesnt show me other then the title, and when I press "Save/Update article", all text/photos in "Content" and in "Excerpt" disappear.

Any thougts on this? All help is very much appreciated.
Reply
chberge: try with version I posted on earlier page.
It has a bit different approach, and whole plug is translated to polish language.
Don't forget to delete all news file before you install this version for test purposes.
Addons: getsimple theme, Online Visitors, Notepad
Reply
yojoe Wrote:chberge: try with version I posted on earlier page.
It has a bit different approach, and whole plug is translated to polish language.
Don't forget to delete all news file before you install this version for test purposes.

Thank you for your answear. I fixed my problem with deleting the whole site, downloading and uploading GetSimple 3.0, and installed News Manager again. Then the script over worked perfectly! So no I am running Get Simple 3.0 and with News Manager that works perfect Smile
Reply
Here's an updated fix for the problem with special chars (swedish chars: åäö, polish chars and so on). It's inspired from Raffee's fix (thanks!) but with the advantage that it also to store the XML the exakt same way as GetSimple does (with CDATA, safe_slash_html and so on). I borrowed most of it from the GetSimple core code.

Simply replace the function save_article with the following:

Code:
/*******************************************************
* @function save_article
* @action write $_POST data to a file
*/
function save_article() {
  $id = $_POST['id'];
  $file = ARTICLEDATA . $id . '.xml';
  
  if(isset($_POST['post-title']))             {    $title = safe_slash_html($_POST['post-title']);    }
  if(isset($_POST['post-content']))         {    $content = safe_slash_html($_POST['post-content']);    }
  if(isset($_POST['post-excerpt']))         {    $excerpt = safe_slash_html($_POST['post-excerpt']);    }
  
  if (!file_exists($file)) {
    $date = date('j M Y');
  } else {
    $data = @getXML($file);
    $date = $data->date;
  }
  
  $xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>');
  
  $note = $xml->addChild('title');
  $note->addCData(empty($title) ? '(no title)' : $title);
  
  $note = $xml->addChild('date');
  $note->addCData($date);
  
  $note = $xml->addChild('content');
  $note->addCData($content);
  
  $note = $xml->addChild('excerpt');
  $note->addCData($excerpt);
  
  exec_action('changedata-save');

  XMLsave($xml, $file);

  if (!is_writable($file))
    echo '<div class="error">Unable to write article data to file</div>';
  else
    echo '<div class="updated">The article has been succesfully saved</div>';

  article_overview();
}

Note: If you add this patch, your old news will probably be unreadable since this format the XML in another way. You will have to resubmit them.
Reply
Hello all,

It's been a while since I last worked on this plugin. Until now :-).

I've fixed some of the most important bugs and released version 1.2.5. This release mainly addresses the localisation issues (special characters) and also makes this plugin GS 3.0 compliant.

That's not all however: I'm also working on a new major release, which should be due somewhere in the near future. I try to implement as much of the requests here in the forum as possible, plus some new ideas of my own. So, you can expect lots of new functionality! Stay tuned...
Reply
roog Wrote:So, you can expect lots of new functionality! Stay tuned...

Roog,

this is good news, I am waiting (impatiently) as I need this functionality

Cheers, Connie
|--
Die deutsche GetSimple-Webseite: http://www.Get-Simple.de = the german Get-Simple-Website!
Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
Hello All.

Dear roog,
could You add function show_articleslist() with and without parameter that will be display article list - title as link to article.

Thanks for advance.
Reply
It would be great if you can add an archive of the articles (by month/year).

If you want I can give you coding to accomplish this.
Reply
can i use news manager plugin for two different pages, because i intend to make 2 language in this site, anyone can help me?
Reply
renovera Wrote:can i use this plugin for two different pages, because i intend to make 2 language in this site, anyone can help me?

You mean you want to use this plugin in connection with the multilanguage-plugin?

Why not check it out?
|--
Die deutsche GetSimple-Webseite: http://www.Get-Simple.de = the german Get-Simple-Website!
Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
Connie Wrote:
renovera Wrote:can i use news manager plugin for two different pages, because i intend to make 2 language in this site, anyone can help me?

You mean you want to use this plugin in connection with the multilanguage-plugin?

Why not check it out?

i have 2 languages in my site which mean i must have 2 news pages, main language and second language, but i don't use multiple language plugin, can news manager do that?, i pretty desperate on this...
Reply
renovera Wrote:i have 2 languages in my site which mean i must have 2 news pages, main language and second language, but i don't use multiple language plugin, can news manager do that?, i pretty desperate on this...
You'd have to duplicate this plugin and change some variables and paths in duplicated instance.
For multiple languages use Mvlcek's search plugin, as it offers also a news functionality, although it's a bit advanced.
Refer to his website for manuals.
Addons: getsimple theme, Online Visitors, Notepad
Reply
yojoe Wrote:
renovera Wrote:i have 2 languages in my site which mean i must have 2 news pages, main language and second language, but i don't use multiple language plugin, can news manager do that?, i pretty desperate on this...
You'd have to duplicate this plugin and change some variables and paths in duplicated instance.
For multiple languages use Mvlcek's search plugin, as it offers also a news functionality, although it's a bit advanced.
Refer to his website for manuals.

i tried to duplicate the plugin and change some variables, but when i refreshed the page it's blank, no error messages just white spaces page, Sad
Reply
Hi

I know this question is kind of stupid, but anyway...

How I can put those news only one page? Now those news showing every page.
Reply
artzii Wrote:Hi

I know this question is kind of stupid, but anyway...

How I can put those news only one page? Now those news showing every page.


Use a special template for that, which you set for only one page
so all other pages use the standard template and one page with special template shows the news as well
|--
Die deutsche GetSimple-Webseite: http://www.Get-Simple.de = the german Get-Simple-Website!
Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
artzii Wrote:How I can put those news only one page? Now those news showing every page.

Another way: insert the function call (in your template) like this:

Code:
<?php if (return_page_slug() == 'newspageslug') { show_articleslist();} ?>
(Change newspageslug to your news page's slug ;-))

And another way could be using the DynPages plugin: you create a new component with <?php show_articleslist(); ?>, then call it in your news page body. This has the advantage that it works even if you change your theme.
Reply
hi guys i wanna ask something, do you know how i can showing the news separately..
example: i have 2 pages, the A page showing all about the A news, and B page showing only B news.

thanks.

Regards,
SaYNo.Inc
Reply
I never met a company posting in a forum thread ;=)

well, you want categories.
This is not supported.
|--
Die deutsche GetSimple-Webseite: http://www.Get-Simple.de = the german Get-Simple-Website!
Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
SaYNo.Inc Wrote:hi guys i wanna ask something, do you know how i can showing the news separately..
example: i have 2 pages, the A page showing all about the A news, and B page showing only B news.

Instead of the News Manager plugin you can use the I18N Search plugin to display news as described here. Just give each news item tags/keywords "news, A" or "news, B" and then display the search results using
Code:
(% searchresults tags:news,A numWords:-1 %)
(or news,B)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I have a problem with news manager on xtreemhost hosting,when i click on create new article the editor doesn't appear.What is the cause?

P.S: on others hosting it works normally
My Site: The Harad's Forge
Do you want a guestbook on pages or on news manager articles?Download my GS plugin: ARGuestbook
Reply
Connie Wrote:I never met a company posting in a forum thread ;=)

well, you want categories.
This is not supported.
LOL. this is my username in all forums Wink

mvlcek Wrote:
SaYNo.Inc Wrote:hi guys i wanna ask something, do you know how i can showing the news separately..
example: i have 2 pages, the A page showing all about the A news, and B page showing only B news.

Instead of the News Manager plugin you can use the I18N Search plugin to display news as described here. Just give each news item tags/keywords "news, A" or "news, B" and then display the search results using
Code:
(% searchresults tags:news,A numWords:-1 %)
(or news,B)

thanks mvlcek, great plugin you've there Smile
i have a question for you in your support thread Smile
Reply
Hello,

I have a little problem with this plugin... I write a news and I save it. I'm redirected on this page :

[Image: screenshotnews.png]

And the news is not saved.

I use GS 2.03.1 (and I can't upgrade) and "articles" directory is writable.

Thanks for help Smile
Reply
gimx Wrote:I use GS 2.03.1 (and I can't upgrade) and "articles" directory is writable.

Thanks for help Smile

well, I strongly suggest the upgrade. Why can't you?

Read the WIKI how to upgrade: http://get-simple.info/wiki/installation:upgrade
|--
Die deutsche GetSimple-Webseite: http://www.Get-Simple.de = the german Get-Simple-Website!
Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
Because it's not my site, I have helped a friend and he want keep GS 2.

Connie, any idea to resolve my problem ?
Reply
Well then, version 2.0 is out.

I rewrote most of the code and added a lot more functionality, hence the bump to 2.0. The list of new features and changes is quite long but the most noteworthy are:
  • Settings can now be easily configured, you no longer have to tweak the code
  • Multilanguage support
  • Automatically generated excerpts
  • Private posts (similar to pages)
  • Tags
  • Archives
  • Keyword search
  • Several sidebar functions, such as recent articles, archives and a tag cloud
  • Human readable post id's (1, 2, ...)
  • CKEditor now follows global settings

You can see a demo on this page.

I have done my best to make version 2.0 backwards compatible, so you should be able to migrate your previous articles although it will require manual intervention. To do so, copy your /data/aricles folder to /data/posts, retaining permissions (since this plugin is moving towards a blog, I decided to rename articles to posts). Starting from version 2.0, post id's are now in a human readable format (1, 2, ... instead of "4d774dfa37a1d") so the best thing would be to rename your old articles, although it should also work without renaming them. You can run the following python script from within your posts/articles folder to rename your previous articles:

Code:
#!/usr/bin/python

import os, glob

posts = sorted(glob.glob('*.xml'))
for i, post in enumerate(posts):
  os.rename(post, '%d.xml' % (i+1))

The one request I haven't been able to fix yet is fancy url compatibility. I'm not very familiar with mod_rewrite rules and I have managed to create some rules that for instance rewrite http://yoursite.com/post/1/ to http://yoursite.com/index.php?post=1, but they break other parts of GS. An example of the rule I have just described is:

Code:
RewriteRule ^post/([^/.]+)/?$ index.php?post=$1 [L]

So, if anyone can help me out here, it is much appreciated!

Also, since this plugin now has i18n support, you can create your own language files by translating the existing ones in /plugins/news_manager/lang. And if you do, please let me know so that I can include your translation in the next release.

I expect that there will be new bugs introduced with this new version. Let me know when you find any and I'll try to fix them asap.

Cheers,
roog

PS) For those interested, the legacy 1.x version (last release is 1.2.6) of this plugin is still available here.
Reply




Users browsing this thread: 2 Guest(s)
Free HDTV Channels Residential Solar Panels