simplerss more instances

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

simplerss more instances

Post by Tata » Sun Jul 31, 2011 2:14 pm

Hi, everybody!
I've got a request from a friend.
He needs tu use a simplerss plugin on his webpage like this:
Inserting the function on one subpage he needs to read one RSS source and show e.g. its 20 items.
Inserting the function in template he needs to show e.g. 5 other RSS sources with e.g. 5 items each.
The simplerss plugin configuration however doesn't allow such use.
Any hint how to use this plugin with 2 configurations?

Hallo an alle!
Ich habe bereits eine Bitte vom Friend bekommen.
Er braucht simplerss Plugin auf seiner Webseite nutzen etwa so:
Die Funktion auf einer Subseite soll eine RSS Quelle zeigen mit z.B. 20 Links.
Die Funktion in template.htm soll z.B. 5 andere RSS Quellen zeigen je mit z.B. 5 Links.
Die Konfiguration des Plugins erlaubt es ja nicht.
Eine Idee, wie das Plugin mit 2 verschiedenen Konfigurationen nutzen?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: simplerss more instances

Post by cmb » Sun Jul 31, 2011 2:47 pm

Hello Tata,

I've just looked at http://www.cycronic.de/dev/cmsimple/?si ... Change_Log, and downloaded the latest version.

I have not tested it, but it seems the desired functionality is already availble as:

Code: Select all

/**
 * Display a nummer of entries in a newsbox
 */
function fillnewsbox($iSource = 0, $iEntries = 3)
 
This should work in parallel with the existing showrss() call.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

oldnema
Posts: 265
Joined: Wed Jan 21, 2009 5:15 pm
Location: Czech Republic
Contact:

Re: simplerss more instances

Post by oldnema » Sun Jul 31, 2011 3:02 pm

Thanks for reply CMB
Please Tata translate:
Verzi kterou odkazuje Kryštof mám, potřeboval bych u funkce "fillnewsbox" zobrazit ještě "description" XY znaku.

Thanks Tata, thanks Kryštof :-)
Nobody knows how much time he has left ...
http://oldnema.compsys.cz/en/?Demo_templates

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: simplerss more instances

Post by Tata » Sun Jul 31, 2011 3:18 pm

oldnema wrote:Thanks for reply CMB
Please Tata translate:
Verzi kterou odkazuje Kryštof mám, potřeboval bych u funkce "fillnewsbox" zobrazit ještě "description" XY znaku.

Thanks Tata, thanks Kryštof :-)
OK, here it is:
I have the version recommended by Krystof. But I need to set e.g. xy chars for "filnewsbox" only.

My comment after discussion with oldnema:
Frankly the plugins has to be used twice on two different places with two different behaviors.
1. to show only one RSSsource with defined number of items and extend of description
2. to show more RSS sources with new defined number of items and new defined extend of description.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: simplerss more instances

Post by cmb » Sun Jul 31, 2011 3:49 pm

Hello Tata, hello oldnema,

sorry, it took a while to install and try the plugin. But it was necessary for me to see, what is possible with the plugin and the 2 different calls.

The difference between showrss() and fillnewsbox() is, that fillnewsbox() only shows the titles of the feeds. If I understand you correctly, that is not the desired behaviour.

It is possible to show any number of RSS-Feeds on a single page, by adding additional calls to showrss():

Code: Select all

#CMSimple $output .= showrss(0).showrss(1).showrss(2); #
Tata wrote: But I need to set e.g. xy chars for "filnewsbox" only.
Tata wrote: extend of description
I'm not sure if I understand you correctly. Do you want to limit the number of items of the RSS-Feed, or the length (number of characters) of a single item?

I guess you're looking for a function showrss($iSource = 0, $iEntries = 3), i.e a function that shows not only the titles but the whole feed, and that's limited to $iEntries. If that is the case, that's not possible now, but I guess it could be implemented without much effort. I'll have a look at it, if that's what you need.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: simplerss more instances

Post by Tata » Sun Jul 31, 2011 4:16 pm

cmb wrote: I'm not sure if I understand you correctly. Do you want to limit the number of items of the RSS-Feed, or the length (number of characters) of a single item?
What oldnema needs really is:
He has a box in his template and into this box he needs to read an external RSSsource and let it show 20 entries (it has to be e.g. a local club events list. There he wants to see the title and e.g. 150 characters of description.
He also has a box where he wants to place outputs of e.g. 5 different RSSsources showing titles and e.g. 200 characters of description.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: simplerss more instances

Post by Tata » Sun Jul 31, 2011 4:51 pm

I think I've found it:
1. To show Title - Content - Read_more_link in fillnewsbox() function the line #125 in index.php

Code: Select all

$page .= "<li class=\"entry ". $sRowType ."\"><a class=\"item\" href=\"$sHref\" target=\"_new\">$sTitle</a></li>\n";
shall be extended to

Code: Select all

$page .= "<li class=\"entry ". $sRowType ."\">
<a class=\"item\" href=\"$sHref\" target=\"_new\">$sTitle</a>
$sDesc
<div class=\"read_more\">[ <a href=\"".$sn."?".$su."&msg=".$iCount."&stcon=".$iStart."\">".$plugin_tx[$sPlugin]['read_more']."</a> ]</div></li>\n";
2. To set the number of items shown in the content set in config:

Code: Select all

$plugin_cf['simplerss']['item_count']="5";
and use in content:

Code: Select all

#CMSimple $output.=showrss("0");#
3. To show other RSSsources in template:

Code: Select all

<?php echo fillnewsbox($iSource = 0, $iEntries = 1).fillnewsbox($iSource = 1, $iEntries = 2).fillnewsbox($iSource = 2, $iEntries = 3);?>
Maybe some BReak tags shall be also used.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: simplerss more instances

Post by cmb » Sun Jul 31, 2011 4:51 pm

Hello Tata,

so oldnema needs a second parameter for showrss()! I've made the necessary changes to showrss(), but the function is too long, to be posted completely :(

E.g. use as

Code: Select all

#CMSimple $output .= showrss(0, 100).showrss(1, 200).showrss(2); #
If the second parameter is not given, than the default value of skip_description will be taken.

I'll send you the index.php by mail. I hope you can forward it easily to oldnema.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: simplerss more instances

Post by Tata » Sun Jul 31, 2011 5:19 pm

Thankx Chris,
I also tried to extend the fillbrowser function by $iChars_count variable and let read the skip_description value into it. But this did not work.
There are namely two functions available in this plugin:

showrss() and fillnewsbox()

So both could be used parallel - in this case the showrss function could be e.g. used in the content and the fillnewsbox could be used in template.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: simplerss more instances

Post by cmb » Sun Jul 31, 2011 5:26 pm

Hello Tata,

the fillnewsbox() function doesn't show a description at all, so I guess it is not what oldnema needs.
Tata wrote: What oldnema needs really is:
He has a box in his template and into this box he needs to read an external RSSsource and let it show 20 entries (it has to be e.g. a local club events list. There he wants to see the title and e.g. 150 characters of description.
He also has a box where he wants to place outputs of e.g. 5 different RSSsources showing titles and e.g. 200 characters of description.
So in his template oldnema should use

Code: Select all

<?php showrss(0, 150); ?>
and the other place

Code: Select all

#CMSimple showrss(1, 200).showrss(2, 200).showrss(3, 200).showrss(4, 200).showrss(5, 200); #
Or did I misunderstand you?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply