[New Plugin] "News"

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

Moderator: Tata

Phrax
Posts: 37
Joined: Mon Apr 18, 2011 11:55 am
Location: Aachen, Germany
Contact:

[New Plugin] "News"

Post by Phrax » Fri Feb 24, 2012 11:14 pm

Hi all,

the past few weeks I worked on a new CMSimple plugin for managing and publishing news. Some of the features:

- Publish news in different categories.
- Call news of one or more categories on your pages.
- JQuery based newsticker.

See the documentation for getting started and installation instructions. Feedback is welcome!
Sourceforge project: http://sourceforge.net/projects/cmsimplenews/

regards,
David

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

Re: [New Plugin] "News"

Post by cmb » Sat Feb 25, 2012 11:05 am

Hi David,

a very nice and useful plugin! :)

You should consider to use jQuery4CMSimple to avoid possible clashes with other CMSimple plugins using jquery. Developer documentation on how to use it, is included in the download.

An idea: it might be useful to be able to call newsticker() from the template.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Phrax
Posts: 37
Joined: Mon Apr 18, 2011 11:55 am
Location: Aachen, Germany
Contact:

Re: [New Plugin] "News"

Post by Phrax » Sat Feb 25, 2012 8:25 pm

Hi Christoph,

Not thought about that before, will update the plugin with JQuery4CMSimple compability.

Is there a trick enabling the plugins functionality for use in templates? Currently the scripts are not included correctly when I call plugins in the template.

David

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

Re: [New Plugin] "News"

Post by cmb » Sun Feb 26, 2012 1:37 am

Hi David,
Phrax wrote:Currently the scripts are not included correctly when I call plugins in the template.
The problem is, that typically scripts are written to $hjs. But this will already be emitted in the <head> section of the template. So for any plugin call that happens later, $hjs will be ignored.

The solution is simple: just write to $hjs always by doing it in the global scope of index.php (or calling a function from the global scope). As this will cause some overhead even if the plugin is not called from the template, you can add a config option (say, enable_myplugin).

For my latest plugin I required the user to put an additional function call into the template before head() is called, so that the plugin works. As I see it now, that's nonsense :oops: A config option has exactly the same effect, but could be handled more easily.

Well, there's another approach to solve the problem, without any config option or additional function: scanning the template for the plugin call. But I doubt, that the advantage of this automatic approach will rectify its overhead.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Phrax
Posts: 37
Joined: Mon Apr 18, 2011 11:55 am
Location: Aachen, Germany
Contact:

Re: [New Plugin] "News"

Post by Phrax » Sun Feb 26, 2012 4:09 pm

Hi Christoph,

Thanks for the advice, I think I would prefer the config option solution. I will see if I get it working that way ;)

regards,
David

avangers
Posts: 5
Joined: Wed May 09, 2012 4:15 am

Re: [New Plugin] "News"

Post by avangers » Wed Jun 13, 2012 2:37 pm

Hai Phrax....
That's a wonderful plugin 2 thumbs for your job....
I just installed on my cmsimple_xh, running good on my localhost but after I tried to installed on my hosting I found a little problem.
When I added image or link text and save it, the result never show correctly , an image url or link text always include enclosure csv like \"./images/some-image.jpg\" that bring on my image or link text never show correctly.
Could you help me how to fix it?

regards,
avangers

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

Re: [New Plugin] "News"

Post by cmb » Wed Jun 13, 2012 9:43 pm

Hi avangers,

is magic_quotes_runtime enabled on the server? If so, you have to turn it off, as it might cause more such problems (with other plugins and even the core).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

avangers
Posts: 5
Joined: Wed May 09, 2012 4:15 am

Re: [New Plugin] "News"

Post by avangers » Thu Jun 14, 2012 2:47 am

Hi Christoph

Thank You for your advice....
I have tried to setting off magic_quotes_runtime and my problem solved...
Add Code in .htaccess

Code: Select all

# Disable magic_quotes_gpc
php_flag magic_quotes_gpc off
Best Regards
Avangers

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

Re: [New Plugin] "News"

Post by cmb » Thu Jun 14, 2012 12:02 pm

Hi Avengers, hi David,

ah, it was magic_quotes_gpc! That's not the same as magic_quotes_runtime. I guess no CMSimple component will run cleanly with the latter enabled, but the former can be handled easily by calling stripslashes() on all GPC parameters. There's even a function provided in CMSimple that does this only when magic_quotes_gpc is on: stsl().

But anyway: IMHO the magic_quotes_* ini settings were no good idea in the first place and forunately they have been deprecated in PHP 5.3 and already have been removed in PHP 5.4.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Phrax
Posts: 37
Joined: Mon Apr 18, 2011 11:55 am
Location: Aachen, Germany
Contact:

Re: [New Plugin] "News"

Post by Phrax » Mon Jun 18, 2012 5:46 pm

Hi Avengers, Hi CHristoph,

sorry for the late reply on your problem, Avengers...

I did not understand the whole problem, so just to be up to date, are there some mistakes in the code or is it just about PHP/Server configuration?

Regards,
David

Post Reply