Posts: 83
Threads: 21
Joined: Sep 2011
2011-10-11, 04:21:37
(This post was last modified: 2011-10-11, 04:28:33 by pracawdomu.)
I have a little problem with the NM plug-in, it works fine up to the point of the Links for recent articles and archives in the sidebar.
None of these links actually point to the articles or news items. I get a 404 error when clicking them.
This is vital for my site when I eventually make the switch from Xoops to GS
Forget the above, I just worked it out, I had clicked the fancy urls and clearly I have got those set right or whatever
sorry to bother you
Posts: 39
Threads: 8
Joined: Jul 2011
I duplicated the plugin 2 times for two different news categories, change the values from NM,nm,News,news, posts/ to the ones I needed and the first duplicate worked perfectly but the second one was ruined:
In the settings and in the New Post - The "Save Settings" button became a text field (textbox) and I cannot make changes in the settings or to add a post (I changed settings manually through the FTP so it will show 4 posts and stuff like that.)
What should I do? What could make that problem appear?
Posts: 11
Threads: 1
Joined: Sep 2011
Is the News Manager incompatible with the I18N Gallery?
When i want to include a Gallery in a Newspost with
Code: (% gallery name=myGallery %)
the Gallery doesnt appear, but the String
(% gallery name=myGallery %)
appears in the text.
Posts: 47
Threads: 7
Joined: Oct 2011
Niedes Wrote:Is the News Manager incompatible with the I18N Gallery?
When i want to include a Gallery in a Newspost with
Code: (% gallery name=myGallery %)
the Gallery doesnt appear, but the String
(% gallery name=myGallery %)
appears in the text.
Same problem... Can't include gallery to posts.
Exec PHP messes up I18N Gallery, so that's not an option.
What to do?
Posts: 2,094
Threads: 54
Joined: Jan 2011
vasitellapahki Wrote:Niedes Wrote:Is the News Manager incompatible with the I18N Gallery?
When i want to include a Gallery in a Newspost with
Code: (% gallery name=myGallery %)
the Gallery doesnt appear, but the String
(% gallery name=myGallery %)
appears in the text.
Same problem... Can't include gallery to posts.
Exec PHP messes up I18N Gallery, so that's not an option.
What to do?
I18N Gallery only works, if included in the content of normal pages, because I18N Gallery needs to know already in the header, which gallery is to be included for additional scripts and styles to be included. On the news page the content is empty - thus no substitution takes part.
Posts: 18
Threads: 1
Joined: Dec 2010
It's a pity, that roog disappeared
Site temporarily closed too.
But bugs are alive
I have ru_RU locale and when creating news with title in Russian WITHOUT setting number/slug it generates .xml file (without name) wich cannot be edited or deleted through panel nor opened on site.
I think it will be better to automatically set filenames as 1.xml, 2.xml etc if no #/slug manually set.
Can anybody tell where can I do this?
Also, name of plugin (News Manager) is set in news_manager.php so even if it translated in language file, translated name don't appear.
Posts: 1,928
Threads: 88
Joined: Apr 2010
2011-10-26, 19:59:02
(This post was last modified: 2011-10-27, 01:30:43 by jhondavis.)
make image displayed in Excerpt
Posts: 18
Threads: 1
Joined: Dec 2010
2011-10-26, 23:59:03
(This post was last modified: 2011-10-28, 15:06:39 by ganga0.)
SlavaP Wrote:I have ru_RU locale and when creating news with title in Russian WITHOUT setting number/slug it generates .xml file (without name) wich cannot be edited or deleted through panel nor opened on site.
I think it will be better to automatically set filenames as 1.xml, 2.xml etc if no #/slug manually set.
Found and fixed - I guess this is more simple and automatic. If somebody want the same, here is the code:
Open the file "\plugins\news_manager\inc\posts.php"
In the function
Code: function nm_save_post()
after the comment line
Code: # set initial slug and filename
replace this block
Code: if (!empty($_POST['post-slug']))
$slug = nm_create_slug($_POST['post-slug']);
else
$slug = nm_create_slug($_POST['post-title']);
to this block
Code: $countfile = NMDATAPATH . "count.xml";
if (file_exists($countfile)){
$xml = simplexml_load_file($countfile);
$slug = $xml->count;
$slug = $slug + 1;
$xml->count = $slug;
}
else {
$xml = @new SimpleXMLElement('<main></main>');
$slug = 1;
$xml->addChild('count', $slug);
}
$xml->asXML($countfile);
How it works:
1. You BETTER must NOT have any news cause after turning this code on your news automatically will be named "1", "2", and so on.
2. If count file don't exist (there's no file on the first run except you made it with hands) it wiil be created in \data\other\news_manager\ with increment "1" and first news will be "1.xml"
3. Autoprocess will go on
Attention: with this change you will not be able to name news manually even if you put something to the field "Slug/URL:" (so I mean the name of the file , NOT the title).
Posts: 37
Threads: 5
Joined: Mar 2011
2011-10-27, 00:29:16
(This post was last modified: 2011-10-27, 00:29:32 by rolandv40.)
Uhm this seems a really ugly solution... I'll look into it for you…
Posts: 18
Threads: 1
Joined: Dec 2010
ePirat Wrote:Uhm this seems a really ugly solution... I'll look into it for you… I agree with you - post updated with xml routine
Posts: 37
Threads: 5
Joined: Mar 2011
SlavaP Wrote:ePirat Wrote:Uhm this seems a really ugly solution... I'll look into it for you… I agree with you - post updated with xml routine You may want to take a look at this:
http://neo22s.com/slug/
The problem seems that of course filenames can't contain characters like çãôõ and so on... So you may want to use the function on the page above to replace them with non-accent equivalent.
(you may have to add characters of russian language)
Posts: 18
Threads: 1
Joined: Dec 2010
ePirat Wrote:SlavaP Wrote:ePirat Wrote:Uhm this seems a really ugly solution... I'll look into it for you… I agree with you - post updated with xml routine You may want to take a look at this:
http://neo22s.com/slug/
The problem seems that of course filenames can't contain characters like çãôõ and so on... So you may want to use the function on the page above to replace them with non-accent equivalent.
(you may have to add characters of russian language) Thank you for useful link.
Posts: 47
Threads: 7
Joined: Oct 2011
mvlcek Wrote:I18N Gallery only works, if included in the content of normal pages, because I18N Gallery needs to know already in the header, which gallery is to be included for additional scripts and styles to be included. On the news page the content is empty - thus no substitution takes part.
Thank you.
Any suggestions what extension (or other solution) to use for gallery in news postings?
I like I18N gallery, I'd prefer that, but if it's not possible, well I guess then I must install another gallery extension for galleries in news postings... or is it possible at all to add galleries to news postings with extension?
Posts: 2,928
Threads: 195
Joined: Feb 2011
please do not include on and on the postings before ... that makes the postings hard to read ;=(
Posts: 47
Threads: 7
Joined: Oct 2011
Connie Wrote:please do not include on and on the postings before ... that makes the postings hard to read ;=(
Ok, sorry, edited my prev post...
Posts: 11
Threads: 3
Joined: Sep 2011
Hi all,
Does anybody know how (if possible) I can add social sharing buttons such as twitter and facebook to the bottom of each news item? Thanks to anybody who can help.
Posts: 2,094
Threads: 54
Joined: Jan 2011
vasitellapahki Wrote:mvlcek Wrote:I18N Gallery only works, if included in the content of normal pages, because I18N Gallery needs to know already in the header, which gallery is to be included for additional scripts and styles to be included. On the news page the content is empty - thus no substitution takes part.
Thank you.
Any suggestions what extension (or other solution) to use for gallery in news postings?
I like I18N gallery, I'd prefer that, but if it's not possible, well I guess then I must install another gallery extension for galleries in news postings... or is it possible at all to add galleries to news postings with extension?
If News Manager offers a function to get the content of the news item as string, you can use the attached I18N Gallery plugin together with the following code in the template in the HTML head:
Code: <?php
if (return_page_slug() == ...) { # check, if we are on the news page and a single news item is displayed
$newscontent = ...; # get news content as string
get_i18n_gallery_header_from_content($newscontent);
}
?>
As I don't use the News Manager, I don't know which functions to call.
(I'm creating normal pages for news items and tagging them with _news - for the display I use the I18N Search plugin)
Posts: 47
Threads: 7
Joined: Oct 2011
mvlcek Wrote:If News Manager offers a function to get the content of the news item as string, you can use the attached I18N Gallery plugin together with the following code in the template in the HTML head:
Code: <?php
if (return_page_slug() == ...) { # check, if we are on the news page and a single news item is displayed
$newscontent = ...; # get news content as string
get_i18n_gallery_header_from_content($newscontent);
}
?>
As I don't use the News Manager, I don't know which functions to call.
(I'm creating normal pages for news items and tagging them with _news - for the display I use the I18N Search plugin)
Got me slightly baffled, I'm no good in php... can someone who is familiar with News Manager functions help with this, please?
Posts: 184
Threads: 20
Joined: Apr 2010
mikeh Wrote:andyash Wrote:Any idea when can News Manager support categories so I can segregate my entries into Blog, News etc?
If you want I can post or send my modifications allowing a full category manager. Hi Mikeh,
Could you please send me your modification? It's been long and I'm still waiting.
Posts: 25
Threads: 1
Joined: Jan 2011
2011-11-08, 07:45:06
(This post was last modified: 2011-11-08, 07:54:29 by leaames.)
mvlcek Wrote:vasitellapahki Wrote:mvlcek Wrote:I18N Gallery only works, if included in the content of normal pages, because I18N Gallery needs to know already in the header, which gallery is to be included for additional scripts and styles to be included. On the news page the content is empty - thus no substitution takes part.
Thank you.
Any suggestions what extension (or other solution) to use for gallery in news postings?
I like I18N gallery, I'd prefer that, but if it's not possible, well I guess then I must install another gallery extension for galleries in news postings... or is it possible at all to add galleries to news postings with extension?
If News Manager offers a function to get the content of the news item as string, you can use the attached I18N Gallery plugin together with the following code in the template in the HTML head:
Code: <?php
if (return_page_slug() == ...) { # check, if we are on the news page and a single news item is displayed
$newscontent = ...; # get news content as string
get_i18n_gallery_header_from_content($newscontent);
}
?>
As I don't use the News Manager, I don't know which functions to call.
(I'm creating normal pages for news items and tagging them with _news - for the display I use the I18N Search plugin)
I'm able to get the news content and the related gallery header appears correctly (it loads related js and css), but the substitution still doesn't takes part. is something missing?
basically:
- plugins/news_manager/inc/site.php
added this function
Code: function nm_get_post($slug, $excerpt=false) {
$file = NMPOSTPATH . "$slug.xml";
$post = @getXML($file);
if (!empty($post) && $post->private != 'Y') {
$content = strip_decode($post->content);
return $content;
}
}
- theme/yourtheme/header.php
added before </head>, to see if works with a specified gallery
Code: <?php
$page = return_page_slug();
if($page == 'news') {
$newscontent = nm_get_post('gallery-something');
get_i18n_gallery_header_from_content($newscontent);
}
?>
- in the news content
some text, bla bla
(% GALLERY NAME=GALLERY-SOMETHING %)
Posts: 2,094
Threads: 54
Joined: Jan 2011
allienato Wrote:(% GALLERY NAME=GALLERY-SOMETHING %)
The substitution is case sensitive: it should be (% gallery name=something %)
I was assuming that the news manager calls the content filter and only I18N gallery doesn't work. But I just downloaded the latest version and it doesn't seem to do so. From a quick view at the code I think you need to add the following 'else' in site.php/nm_show_post:
Code: if ($excerpt) $content = nm_create_excerpt($content); else $content = exec_filter('content',array($content));
Posts: 25
Threads: 1
Joined: Jan 2011
mvlcek Wrote:allienato Wrote:(% GALLERY NAME=GALLERY-SOMETHING %)
The substitution is case sensitive: it should be (% gallery name=something %)
I was assuming that the news manager calls the content filter and only I18N gallery doesn't work. But I just downloaded the latest version and it doesn't seem to do so. From a quick view at the code I think you need to add the following 'else' in site.php/nm_show_post:
Code: if ($excerpt) $content = nm_create_excerpt($content); else $content = exec_filter('content',array($content));
yes sorry, I've pasted that string from the site I'm developing, which have text-transform:uppercase property applied.
adding your last code produce this error
Code: FATAL ERROR: ALLOWED MEMORY SIZE OF 33554432 BYTES EXHAUSTED (TRIED TO ALLOCATE 40961 BYTES) IN .../PLUGINS/I18N_GALLERY.PHP ON LINE 154
Posts: 25
Threads: 1
Joined: Jan 2011
no luck even if I increase memory limit up to 64/128M, maximum execution time always exceed :\
Posts: 2,094
Threads: 54
Joined: Jan 2011
allienato Wrote:no luck even if I increase memory limit up to 64/128M, maximum execution time always exceed :\
Just tried it myself - this produced an infinite recursion :-(
If you are lucky and I18N Gallery executes after News Manager, it should work without the described patch.
But if you want to make sure:
The line in site.php/nm_show_post should be:
Code: if ($excerpt) $content = nm_create_excerpt($content); else $content = exec_filter('content',$content);
The additional function nm_get_post as described in your post must be added to site.php, too.
Additionally add the following lines to the beginning of news_manager.php/nm_site to prevent recursion:
Code: global $nm_in_filter;
if (@$nm_in_filter) return $content;
$nm_in_filter = true;
The code in the template should be:
Code: <?php
$page = return_page_slug();
if($page == 'nm' && isset($_GET['post'])) {
$newscontent = nm_get_post(@$_GET['post']);
get_i18n_gallery_header_from_content($newscontent);
}
?>
That's it, quick and dirty.
Posts: 45
Threads: 5
Joined: Feb 2011
Has anyone been able to have 2 versions of this plugin run simultaneously on one site? I've got two sections of a website that need different news - one in a public area and one in a customer support area. I'm thinking I could rename a bunch of items across the plugin, but was curious to see if someone has implemented this already.
|