2012-07-07, 07:30:57
Carlos Wrote:maybe this:
Code:foreach (array_reverse($data->item,TRUE) as $item) {
Unfortunately that too renders all the posts invisble. This is quite a puzzle...I think I'm going to be at this all night
Carlos Wrote:maybe this:
Code:foreach (array_reverse($data->item,TRUE) as $item) {
function nm_list_recent() {
global $NMRECENTPOSTS;
$posts = nm_get_posts();
if (!empty($posts)) {
echo ' ';
$posts = array_slice($posts, 0, $NMRECENTPOSTS, true);
foreach ($posts as $post) {
$url = nm_get_url('post') . $post->slug;
$title = strip_tags(strip_decode($post->title));
$postDate = date('d.m.Y', strtotime($post->date));
echo "<p><span class='news_date'>$postDate</span></p>
<p><div class='news_title_colon'><a href=\"$url\">$title</a></div></p><br />";
}
echo ' ';
}
}
UksusoFF Wrote:hello!
How to display intro of content in Sidebar?
<?php
if (return_page_slug()!='blog') {
echo '<div class="section">';
echo '<h2>News!</h2>';
nm_list_recent();
echo '</div>';
} else {
echo '<div class="section">';
echo '<h2>News!</h2>';
nm_list_recent();
echo '</div>';
echo '<div class="section">';
echo '<h2>Blog-Archiv</h2>';
nm_list_archives();
echo '</div>';
}
?>
Connie Wrote:well, we did it at www.get-simple.de that way:sorry but i can't see content of news in this sample.
Quote:GetSimple 3.1.2: BugFix-Releasebut i need this:
Neu! E-Book: Open Source CMS im Vergleich …
GetSimple 3.1.1B Bugfix-Release
Quote:GetSimple 3.1.2: BugFix-Release
Diese Version ist ein BugFix, es wurde ein Problem beim Hochladen mehrerer Dateien in Unterordner behoben:
Neu! E-Book: Open Source CMS im Vergleich …
und GetSimple ist natürlich dabei.
GetSimple 3.1.1B Bugfix-Release
GetSimple 3.1.1Beta ist ein Release, welches ausschließlich Bugs bereinigt.
islander Wrote:Having a strange problem, if I edit a post and save it, it is saving the edited post as a new one.
I tried to delete the duplicate, but it just re-appears.
return $posts;
return array_reverse($posts);
Carlos Wrote:Do your post titles have non-English characters?
Does your /data/posts folder have the same file permissions/ownership as /data/pages?
Carlos Wrote:Have you tried to enable GS debug mode to see if you get any errors?
Also, are you able to do a new fresh install in the same server/host (on another folder maybe), both GS and NM, and test this?
});
</script>
// BOF: Let's have that extra submit button in the sidebar (same as with the page editor)
$('.submit').clone().appendTo('#sidebar');
$('#sidebar .submit').css({'margin-left': '14px'}).click(function() { $('form#edit.largeform input.submit').trigger('click'); });
// EOF: Let's have that extra submit button in the sidebar (same as with the page editor)
/**
* Takes a block of text/HTML and trims it's length to $NMEXCERPTLENGTH, but will
* only trim at a whitespace character.
* If a $url is supplied, then a "read more" link will be appended to the snippet.
*
* @param text/HTML $snippet The text/HTML to trim.
* @param text $url The "read more" URL.
* @return text The trimmed text, stripped of HTML.
*
*/
function trim_snippet($snippet, $url = false) {
global $NMEXCERPTLENGTH;
$cutOff = intval($NMEXCERPTLENGTH);
$snippet = strip_tags($snippet);
if (strlen($snippet) > $cutOff) {
$whole_words = explode(' ', $snippet);
$return_snippet = '';
$test_return_snippet = '';
foreach ($whole_words as $word) {
$test_return_snippet = $return_snippet . ' ' . $word . ' …' . ($url ? ' [<a href="' . $url .'">read more</a>]' : '');
if (strlen($test_return_snippet) <= $cutOff) {
$return_snippet = $return_snippet . ' ' . $word;
} else {
$return_snippet = $return_snippet . ' …' . ($url ? ' [<a href="' . $url .'">read more</a>]' : '');
break;
}
}
$snippet = $return_snippet;
}
return $snippet;
}
if ($excerpt) $content = nm_create_excerpt($content);
if ($excerpt) $content = '<p>' . trim_snippet($content, $url) . '</p>';
# show "go back" link, if required
if (strstr($_SERVER['QUERY_STRING'], "post=$slug")) {
echo '<p class="nm_post_back"><a href="javascript:history.back()"><< ';
i18n('news_manager/GO_BACK');
echo '</a></p>';
}
// BOF: Previous & Next article links
if ( !$excerpt && ($post->private != 'Y') ) {
echo '<div id="pagerBottom">';
$articleIndex = nm_get_posts();
$articleDirectory = array();
foreach ($articleIndex as $article) $articleDirectory[strtotime($article->date)] = $article->title . '|' . nm_get_url('post') . $article->slug;
unset($articleIndex);
ksort($articleDirectory);
$current = strtotime($post->date);
reset($articleDirectory);
while (key($articleDirectory) !== $current) next($articleDirectory);
prev($articleDirectory);
$previous = key($articleDirectory);
if ( ($previous !== $current) && $previous ) {
$prevTemp = explode('|', $articleDirectory[$previous]);
echo '<div class="prevLink"><a href="' . $prevTemp[1] . '" title="read: ' . $prevTemp[0] . ' (dated: ' . date('l jS \of F Y h:i:s A', $previous) . ')"><span class="button">← Previous Post</span></a></div>';
next($articleDirectory);
} elseif (!$previous) {
reset($articleDirectory);
}
next($articleDirectory);
$next = key($articleDirectory);
if ( ($next !== $current) && $next ){
$nextTemp = explode('|', $articleDirectory[$next]);
echo '<div class="nextLink"><a href="' . $nextTemp[1] . '" title="read: ' . $nextTemp[0] . ' (dated: ' . date('l jS \of F Y h:i:s A', $next) . ')"><span class="button">Next Post →</span></a></div>';
}
unset($articleDirectory);
echo '</div>';
}
// EOF: Previous & Next article links
darkblue Wrote:Paste this code into /admin/inc/theme_functions.phpI think it would be better to put that function in the "News Manager mod" instead of patching GetSimple core (what should be avoided if possible because of upgrades). Maybe in news_manager/inc/site.php ...
Carlos Wrote:I think it would be better to put that function in the "News Manager mod" instead of patching GetSimple core (what should be avoided if possible because of upgrades). Maybe in news_manager/inc/site.php ...
"DATE_FORMAT" => "%b %e, %Y"
"DATE_FORMAT" => "%b %#d, %Y"
"DATE_FORMAT" => "%Y.%m.%d - %H:%M"
<noscript><style>#metadata_window {display:block !important} </style></noscript>
<div style="display:none;" id="metadata_window">