Ninja RSS dolžina descriptiona (besede v črke)
1 naročnik
1 naročnik
Pozdravljeni!
Ali kdo od vas tu uporablja komponento Ninja RSS Syndicator na Joomli 1.5? Ta komponenta namreč omogoča nastavitev dolžine opisa RSS feeda, vendar samo v številu besed, jaz pa potrebujem omejitev na 250 črk. Malce sem brskal po fajlih komponente in v \tmpl\default.php fajlu našel tole dvoje:
//if type is Summaries then get numwords from db
$numWords = $this->numWords > 0 ? $this->numWords: 10000; // numWord == 0 represents ALL
/* Testing Case statement below. If it works, remove this code- D
$words = $row->itext;
if ($this->fulltext == 2) {
$words .= $row->mtext;
} */
switch ($this->fulltext) {
case 0:
$words = ($row->introtext) ? $row->introtext : ((str_word_count(trim($row->fulltext)) > $numWords) ? word_limiter($row->fulltext, $numWords) : $row->fulltext);
case 1:
$words = ($row->introtext) ? $row->introtext : ((str_word_count(trim($row->fulltext)) > $numWords) ? word_limiter($row->fulltext, $numWords) : $row->fulltext);
break;
case 2:
$words = $row->introtext.$row->fulltext;
break;
case 3:
$words = ($row->fulltext) ? $row->fulltext : $row->introtext;
break;
}
// Check if $words is larger then the $numWords
// Add some extra words because characters are count as words (20% extra)
if (str_word_count(trim($words)) > $numWords)
{
$AddReadMoreLink = true;
$words = word_limiter($words, $numWords);
}
if($this->fulltext == 0)
{
$AddReadMoreLink = false;
}
if ($this->fulltext == 1 or $AddReadMoreLink) {
if (strlen(trim($row->mtext)) > 0 or $AddReadMoreLink)
$words .= "\n<p><a href=\"" . $item->link . "\">" . JText::sprintf('Read more...') . "</a></p>";
}
if (!intval($this->renderHTML)) {
//Remove HTML tags if told not to render them
$words = noHTML ($words);
} else {
//Remove images if told not to render them
//Images will also get remove with HTML tags above
if (!intval($this->renderImages)) {
$words = delImagesFromHTML($words);
}
}
/* Convert relative urls to absolute */
$words = addAbsoluteURL($words);
$item->description = $words;
$item->descriptionHtmlSyndicated = true;
Zanima me, če ima kdo kakšno idejo kako to najlažje spremeniti iz besed v število črk pa prosim povejte čimbolj po domače, ker nimam pojma o programiranju :)
Hvala vsem za pomoč!