Posts: 12
Threads: 0
Joined: Dec 2009
seems solid and simple enough,
I added a truncate/except function - it's rough, but fits my immediate needs, might be helpful for someone else
function the_NM_excerpt() {
global $nm;
echo truncate($nm->the_NM_content(), 125,'...');
}
function truncate ($str, $length=10, $trailing='...')
{
$length-=mb_strlen($trailing);
if (mb_strlen($str)> $length)
{
// string exceeded length, truncate and add trailing dots
return mb_substr($str,0,$length).$trailing;
}
else
{
$res = $str;
}
return $res;
}
Posts: 12
Threads: 0
Joined: Dec 2009
Howdy;
Before I invest the time to write one myself (and possibly it already exists and I'm missing it) Is there a way to generate a permalink for a specific news item - I see that the create function accepts '$id,$date, $title, $event' and I'll assume the ids are unique - but I don't see a function to return that unique id to the front end, whereas we could concatenate a permalink (domain.com/news/unique-id)
Thoughts?
Posts: 4
Threads: 0
Joined: Jul 2010
Posts: 2
Threads: 0
Joined: Aug 2010
Hi all. Does anyone know how I can get excerpt of the most recent story or the title of all news articles and place either of these in a component. That has been my only issue with News Manager. Thanks
Posts: 2
Threads: 0
Joined: Aug 2010
sauldraws Wrote:seems solid and simple enough,
I added a truncate/except function - it's rough, but fits my immediate needs, might be helpful for someone else
function the_NM_excerpt() {
global $nm;
echo truncate($nm->the_NM_content(), 125,'...');
}
function truncate ($str, $length=10, $trailing='...')
{
$length-=mb_strlen($trailing);
if (mb_strlen($str)> $length)
{
// string exceeded length, truncate and add trailing dots
return mb_substr($str,0,$length).$trailing;
}
else
{
$res = $str;
}
return $res;
}
I think I would love this, but how do I use it? I tried inserting it into the new manager.php file, but it didn't work when I called the function in a component. I would really love to know how to use this in a component. Thanks
Posts: 407
Threads: 22
Joined: Aug 2010
For Version: 1.2
Hi there.. just want to post I added one line in code.. above
line 42 just after
Code:
function gestione_css()
I added this line
hope it helps
Stopped developing on GS Plugins. Anybody welcome to take the projects over. Thanks for all the support all.
Posts: 35
Threads: 8
Joined: Jan 2011
Hello!
I want to add a read more button.
I can create function to edit and save short and full text but i cant make the more button (link) to show the full article
Code:
function show_articles($n) {
$articles = get_articles();
if (isset($n) && $n > 0) {
$index = (isset($_GET['page'])) ? $_GET['page'] : 0;
$pages = array_chunk($articles, $n);
$articles = $pages[$index];
}
foreach ($articles as $article) {
$id = basename($article, ".xml");
show_single($id);
?>
<a href="WHAT TO PUT HERE?">more</a>
<?php
}
if (isset($n))
show_navigation($index, sizeof($pages));
}
I dont know what to put as link.
Posts: 105
Threads: 10
Joined: Dec 2009
Hello,
When I disabled the plugin, the news is always show on my page.
An improvement idea :
Control the plugin status. And don' show the news when it disabled.
Thanks.
Posts: 25
Threads: 2
Joined: Mar 2011
What should I do to the latest news appeared first? How do I change the order the withdrawal of news? Thank you.