Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager
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
Reply
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?
http://Blog.TDT-Alpha.com/
(Website will be replaced soon, with an image database made with GS)
Reply
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.
Reply
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?
Reply
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.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
It's a pity, that roog disappeared Sad
Site temporarily closed too.

But bugs are alive Smile

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.
Reply
make image displayed in Excerpt
Reply
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 Smile

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).
Reply
Uhm this seems a really ugly solution... I'll look into it for you…
Reply
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 Smile
Reply
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 Smile
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)
Reply
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 Smile
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.
Reply
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?
Reply
please do not include on and on the postings before ... that makes the postings hard to read ;=(
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
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...
Reply
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. Smile
Reply
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)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
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?
Reply
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. Sad
Reply
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 %)
Reply
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));
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
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
Reply
no luck even if I increase memory limit up to 64/128M, maximum execution time always exceed :\
Reply
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.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
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.
Reply




Users browsing this thread: 10 Guest(s)