2011-11-10, 07:16:56
mvlcek Wrote: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:
The additional function nm_get_post as described in your post must be added to site.php, too.Code:if ($excerpt) $content = nm_create_excerpt($content); else $content = exec_filter('content',$content);
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.
thank you, it works!
even if the news title now shows under the content, along with other elements like date and back button (including .nm_post div and so forth).
I guess I should build another function to get those values.
Or maybe return them within nm_get_post custom function?
* meanwhile I found an alternative way, that works (in my case) also in general news page, without 'post' variable:
- in nm_show_post
Code:
<div class="nm_post_content">
<?php echo $content; ?>
<?php if (file_exists(GSDATAPATH . 'i18n_gallery/' . $slug . '.xml')) {
get_i18n_gallery($slug);
echo '<br/>';
}
?>
</div>
- in the template
Code:
<?php if($page == 'news') {
$newscontent = nm_get_post(@$_GET['post']);
get_i18n_gallery_header_from_content($newscontent);
?>
note: gallery always shows up after the content, as you can see