Posts: 4
Threads: 0
Joined: Jun 2011
2011-07-03, 05:15:43
(This post was last modified: 2011-07-03, 05:18:05 by abdul.)
Hi,
the news manager works perfectly for me! thank you very much!
I'm working on a website where i use news manager for the news on the homepage. (ofcourse)
But beside that i'de like to use it for something else on the website. So i'de like to duplicate news manager.
I duplicated the directory "news_manager" and the php file: "news_manager"
So i thought: in al the php files i'll replace the words "news manager", "news_manager", "newsmanager", "nm" for something else in the same way. (with the _ and the space etc...)
It works almost! except that when i make a post, it shows in my news manager and in the duplicated news manager. Is there a simple way to solve this? It looks like both news manager still get there information out of the same database...
Posts: 161
Threads: 6
Joined: Jan 2010
I hadn't come across this being noted anywhere so thought it would be worth mention, if you have canonical redirects enabled in gsconfig.php this will break News Manager. Is there a patch for this or is it even possible to patch?
Posts: 3,491
Threads: 106
Joined: Mar 2010
2011-07-04, 06:52:49
(This post was last modified: 2011-07-04, 06:58:03 by fotothink.)
sal Wrote:I hadn't come across this being noted anywhere so thought it would be worth mention, if you have canonical redirects enabled in gsconfig.php this will break News Manager. Is there a patch for this or is it even possible to patch?
Enabling GS built-in canonical redirection will break any plugin that uses URL parameters (like NM). Nothing wrong about GetSimple, it's difficult (impossible?) to do for all cases. That's why GSCANONICAL is not enabled by default.
sal Wrote:Is there a patch for this or is it even possible to patch?
It'd be nice to have a canonical redirection plugin that allows excluding specified slugs.
For now, here's a quick solution. Insert this in your theme's functions.php file (create it if you don't have one):
Code: <?php
if ($url != 'news') {
if ($_SERVER['REQUEST_URI'] != find_url($url, $parent, 'relative')) {
redirect(find_url($url, $parent));
}
}
(Change 'news' to your NM slug name)
Edit: I forgot... you have to disable canonical redirects in gsconfig for this to work.
Posts: 25
Threads: 1
Joined: Jan 2011
hi,
whenever I add/edit a news, the plugin give me the chmod error even if I set data/backups to 0777.
I've tried to remove nm_update_cache() in this passage (plugins/news_manager/inc/posts.php):
Code: # write data to file
if (@XMLsave($xml, $file) && nm_update_cache())
nm_display_message(i18n_r('news_manager/SUCCESS_SAVE'), false, @$backup);
else
nm_display_message(i18n_r('news_manager/ERROR_SAVE'), true);
so I save and the success message appears.
but I have to manually refresh to see the modified content (so I can't see news added without refreshing the page).
this problem doesn't occurs on another GS installation, different domain.
I have no problems in adding/editing normal pages.
could you help me to find what's the problem with that? I believe it's something related with the cache functions..
Posts: 25
Threads: 7
Joined: May 2011
2011-07-11, 08:31:20
(This post was last modified: 2011-07-11, 08:49:13 by khan0000999563.)
Hello everyone
I've got strange results when tried to screw the External commenting plug-in into the News Manager. I found sourcefile Code: /plugins/news_manager/inc/site.php
and inserted the 129-th line like it was described in the External commenting plug-in's reference: Code: get_external_comments();
It seemed to work perfectly but the comments are the same to all the news posts. And there's absolutely no difference between them. I have no idea how to make independent Disqus comments for different news.
Can anyone help?
PS: when logged into Disqus dashboard I can really see all the comments are related to News page but not to distinct news posts. Is it possible to fix?
Hail to get-simple developers!
Posts: 39
Threads: 8
Joined: Jul 2011
2011-07-12, 00:14:05
(This post was last modified: 2011-07-12, 00:15:06 by u63aeo4.)
I get an error message on the post's (news post..) page:
Code: Warning: Invalid CRT parameters detected in*\plugins\news_manager\inc\functions.php on line 86 Warning: Invalid CRT parameters detected in *\plugins\news_manager\inc\functions.php on line 86 Warning: Invalid CRT parameters detected in *\plugins\news_manager\inc\functions.php on line 86 Warning: Invalid CRT parameters detected in *\plugins\news_manager\inc\functions.php on line 86 Warning: Invalid CRT parameters detected in *\plugins\news_manager\inc\functions.php on line 86
Referring to:
Code: function nm_get_date($format, $timestamp) {
global $NMLANG;
$locale = setlocale(LC_TIME, null);
setlocale(LC_TIME, $NMLANG);
$date = strftime($format, $timestamp); /* This Line... 86 */
setlocale(LC_TIME, $locale);
return $date;
}
Posts: 2,928
Threads: 195
Joined: Feb 2011
Updated german language file with german language format %d.%m.%Y is attached
Cheers, Connie
Posts: 2,928
Threads: 195
Joined: Feb 2011
TDT-Alpha,
check the language file if there is a date set at the end of the file:
Code: # date settings
"DATE_FORMAT" => "%d.%m.%Y"
or any other date format
Posts: 39
Threads: 8
Joined: Jul 2011
Connie Wrote:"DATE_FORMAT" => "%d.%m.%Y"
It was set to:
Code: "DATE_FORMAT" => "%b %e, %Y"
That's the default file...
Edited and it works now, thanks!!!
Posts: 2,928
Threads: 195
Joined: Feb 2011
yepp, the next stone rolled down the hill ;=)
Posts: 3,491
Threads: 106
Joined: Mar 2010
reff Wrote:I have no idea how to make independent Disqus comments for different news.
Can anyone help? Take a look at the External Comments forum thread, this post and next ones (fix by RobA).
Posts: 661
Threads: 52
Joined: Feb 2011
RSS Generation
My clients needed an RSS Feed of their blog so they can submit it to Facebook.
I will post the 2 simple changes I made to your news plugin for automatic rss generation.
Maybe it can give you a starting point on adding the functionality or help someone else out.
I added the following function to "plugins/news_manager/inc/admin.php" , above the nm_save_post" function:
Code: function rss_feed_generate()
{
global $SITEURL;
$dir = "../data/posts";
$RSSString = "";
$RSSString .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$RSSString .= "<rss version=\"2.0\">\n";
$RSSString .= "<channel>\n";
$RSSString .= "<title>$SITEURL - RSS Feed</title>\n";
$RSSString .= "<link>$SITEURL</link>\n";
$RSSString .= "<description>$SITEURL</description>\n";
$RSSString .= "<lastBuildDate>".date("D, j M Y H:i:s T")."</lastBuildDate>\n";
$RSSString .= "<language>en-us</language>\n";
$post_array = glob($dir . "/*.xml");
$limit = "5";
array_multisort(array_map('filemtime', $post_array), SORT_DESC, $post_array);
$post_array = array_slice($post_array, 0, $limit);
foreach($list as $file) {
include $file;
}
foreach ($post_array as $filename) {
$blog_post = simplexml_load_file($filename);
$RSSDate = $blog_post->date;
$RSSTitle = $blog_post->title;
$RSSBody = html_entity_decode($blog_post->content);
$RSSBody = str_replace(" ", " ", $RSSBody);
$RSSBody = substr(htmlspecialchars(strip_tags($RSSBody)),0,200)."...
";
$ID = str_replace("../data/posts/", "", $filename);
$ID = str_replace(".xml", "", $ID);
$RSSString .= "<item>\n";
$RSSString .= "\t <title>".$RSSTitle."</title>\n";
$RSSString .= "\t <link>http://$SITEURL/index.php?id=blog&post=".$ID."</link>\n";
$RSSString .= "\t <guid>http://$SITEURL/index.php?id=blog&post=".$ID."</guid>\n";
$RSSString .= "\t <description>".$RSSBody."</description>\n";
$RSSString .= "</item>\n";
}
$RSSString .= "</channel>\n";
$RSSString .= "</rss>\n";
if(!$fp = fopen("../rss.rss",'w')){
echo "Could not open the rss.rss file";
exit();
}
if(!fwrite($fp,$RSSString)){
echo "Could not write to rss.rss file";
exit();
}
fclose($fp);
}
Then I executed that function right at the end of the "nm_save_post" function. That way a new rss feed will be generated after each page save. Note the RSS feed has a limit of 5 posts (you can change that by changing the limit variable above). The RSS Feed is also sorted by date of edited/created posts.
Below is a snippet of where I exectuted the "rss_feed_generate()" function:
Code: # write data to file
if (!@XMLsave($xml, $file))
nm_display_message(i18n_r('news_manager/ERROR_SAVE_POST'), TRUE);
else
nm_display_message(i18n_r('news_manager/SUCCESS_SAVE_POST'));
}
rss_feed_generate();
}
Posts: 290
Threads: 26
Joined: Oct 2010
reff Wrote:Hello everyone
I've got strange results when tried to screw the External commenting plug-in into the News Manager. I found sourcefile Code: /plugins/news_manager/inc/site.php
and inserted the 129-th line like it was described in the External commenting plug-in's reference:Code: get_external_comments();
It seemed to work perfectly but the comments are the same to all the news posts. And there's absolutely no difference between them. I have no idea how to make independent Disqus comments for different news.
Can anyone help?
PS: when logged into Disqus dashboard I can really see all the comments are related to News page but not to distinct news posts. Is it possible to fix?
Already answered by Connie, but more specifically you need to add the parameters to the get_external_comments call.
-Rob A>
Posts: 11
Threads: 0
Joined: Jul 2011
I know there is a nm_list_recent function for sidebar, but, what if I'd like to have the extended version of latest news there? meaning: title and post's content in sidebar?
Posts: 16
Threads: 0
Joined: Jul 2011
2011-07-18, 16:23:13
(This post was last modified: 2011-07-18, 16:24:09 by isaacrg.)
hi,
thank you for your great extension. i love it.
just one little bug?:
.htaccess content -> there is a double "\\"
Code: # blocks direct access to the XML files - they hold all the data!
<Files ~ "\\.xml$">
Posts: 93
Threads: 7
Joined: Oct 2010
Hi all, I've been on vacation for a while and therefore wasn't able to reply.
@jarno1982: you're right that the duplicate plugin reads from the same DB. To fix this, change NMPOSTPATH, NMSETTINGS, etc. i.e., have them point to a different location/file.
@allienato: you shouldn't remove the line that updates the post cache. It will break NM functionality. It is better to remove the cache file itself and let NM generate a new one.
@mikeh: thanks a lot, good work! I will include that code as soon as I have time.
@lanooz: you'll have to modify the function nm_list_recent() in news_manager/inc/sidebar.php and make it print the post content (or part of it) too.
@chainsaw81: thanks for pointing that out, I've fixed it now.
Posts: 5
Threads: 0
Joined: Jun 2011
2011-07-24, 19:39:14
(This post was last modified: 2011-07-24, 19:40:15 by lau3344.)
Hi
Testing GS on a WAMP localhost, installed the News Manager plugin working great except one small thing, the top "Published On" comes with no date
Verified my server date and time and all is ok, tried published date previius to todays date, nothing gets it appearing, any ideas?
regards
John
Posts: 1,204
Threads: 30
Joined: Jun 2010
kidda media Wrote:Verified my server date and time and all is ok, tried published date previius to todays date, nothing gets it appearing, any ideas? http://get-simple.info/forum/post/14970/#p14970
Addons: blue business theme, Online Visitors, Notepad
Posts: 5
Threads: 0
Joined: Jun 2011
yojoe Wrote:kidda media Wrote:Verified my server date and time and all is ok, tried published date previius to todays date, nothing gets it appearing, any ideas? http://get-simple.info/forum/post/14970/#p14970
Thanks for taking the time to reply however that makes zero sense to me, any practical steps to follow to address this?
John
Posts: 1,204
Threads: 30
Joined: Jun 2010
kidda media Wrote:Thanks for taking the time to reply however that makes zero sense to me, any practical steps to follow to address this?
Add manually your timezone to for example gsconfig or your template file
Code: date_default_timezone_set('Europe/your_capital');
On your local WAMP date might not be shown, so move your development to LAMP or destination server.
Addons: blue business theme, Online Visitors, Notepad
Posts: 73
Threads: 7
Joined: Jul 2011
2011-07-26, 05:14:34
(This post was last modified: 2011-07-26, 05:44:30 by michael420.)
Hey guys, i really like get simple and the news manager plugin also, but i still miss a feature (or I didn't discover it )
I converted a html template to a getsimple template, it consists of the content and a static single news on the right of it,
when i try to embed a news published with the news manager using <?php nm_list_recent(); ?>
it only shows the headline, but i'd liked to have the whole news there
how do i have to edit the sidebar.php????????
as a workaround i could use the edit component feature, but the homepage is for a person who has absolutely no skills in html or css, and that would maybe too complicated for him
Posts: 524
Threads: 48
Joined: Mar 2011
I am currently trying to hack the page excerpt function to modify the [...] at the end of excerpts. I'd like the [...] string to be a link pointing to the full post version as the headline already does.
This should be easy to accomplish for someone with more PHP experience. Maybe you guys can give me a hint.
I looked around in other news manager related files and found the code which builds the URL for the headline ( /plugins/news_manager/inc/site.php), but I'm unable to recreate the functionality in the excerpt code.
/plugins/news_manager/inc/functions.php, around line 150:
Code: $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . ' [...]';
I modified it like this so far:
Code: $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . ' <a href="" title="">[weiterlesen …]</a>';
I tried inserting <?php echo $url; ?> (from site.php) which gets printed as-is, tried separating it by way of . <?php echo $url; ?> ., to no avail.
Help?
Posts: 661
Threads: 52
Joined: Feb 2011
polyfragmented Wrote:I am currently trying to hack the page excerpt function to modify the [...] at the end of excerpts. I'd like the [...] string to be a link pointing to the full post version as the headline already does.
This should be easy to accomplish for someone with more PHP experience. Maybe you guys can give me a hint.
I looked around in other news manager related files and found the code which builds the URL for the headline (/plugins/news_manager/inc/site.php), but I'm unable to recreate the functionality in the excerpt code.
/plugins/news_manager/inc/functions.php, around line 150:
Code: $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . ' [...]';
I modified it like this so far:
Code: $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . ' <a href="" title="">[weiterlesen …]</a>';
I tried inserting <?php echo $url; ?> (from site.php) which gets printed as-is, tried separating it by way of . <?php echo $url; ?> ., to no avail.
Help?
I just tested this out and accomplished it with 2 small edits to "news_manager/inc/functions.php" and "news_manager/inc/site.php". Below are my edits and the edited files are attatched to this post (ver: 2.2.4).
File: news_manager/inc/site.php : Around Line 99
Change
Code: if ($excerpt) $content = nm_create_excerpt($content);
to
Code: if ($excerpt) $content = nm_create_excerpt($content, $url);
File: news_manager/inc/functions.php : Around Line 151-153
Change
Code: $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . ' [...]';
else
$content = trim(substr($content, 0, $len)) . ' [...]';
to
Code: $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . '.. <a href="'.$url.'">Read More</a>';
else
$content = trim(substr($content, 0, $len)) . '.. <a href="'.$url.'">Read More</a>';
Posts: 524
Threads: 48
Joined: Mar 2011
Thanks a million, Mike! +1!
Posts: 184
Threads: 20
Joined: Apr 2010
1. When I use News Manager on my local Xampp server I do not get the Date on the post. But after uploading the same configuration to my live server the date appears automatically. How can I make it appear on my local server as well?
2. How and where can I edit the style for the post
|