plugin - please help

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
esmann

plugin - please help

Post by esmann »

Hi.

I am new to CMS made simple. I have this problem:

When I try to insert a new plugin i get the error: "Wrong Code" I have tried different functions i have downloaded from the "Wiki" but get the same error with them all - Why?


Sincerrely

Jimmy - DK

Oh. By the way. Do anyone have an "easy walkthrough" to implement modules?
Anonymous

A little more specific

Post by Anonymous »

Sorry. I was mayby a liitle hasty when I asked the question. Therefore I here give a more presice description of my problem:

When I download a plugin from ex. CMS Wiki. I take a copy of the program code and paste it into the code field in "Add User Defined Tag" and then I give the tag a name. But when I submit the code I get the error "Wrong Code".

Why? I have triede different functions I have downloaded all with the same result.


Please help - Am I just too stupid to use this fine CMS system?
100rk

Re: A little more specific

Post by 100rk »

User CONTRIBUTED plugins from wiki are NOT user DEFINED plugins from plugin management. There are 2 ways how to work with plugins:
a) USER DEFINED plugin is code (without chars) which You can add and edit by textarea by click to 'edit' icon (if You have rights to do this)
b) User contributed plugin from wiki is regular PHP file and You have to copy it into Your plugins directory by hand. THEN this new plugin apperars in list of plugins in Your plugin management.

NOTE: If downloaded plugin has name like 'function.random_image.php.txt', You have to rename it like 'function.random_image.php'. So, if it is zipped, You have to unzip it.
esmann

Thanks - But...

Post by esmann »

Thanks 100rk.

I actually started by copying the function to the plugin folder but then I got several errors and therefore i believed that I did it wrong.

If I copy a funtion to the plugin folder I get several lines of errors like this:

Warning: Cannot modify header information - headers already sent by (output started at /customers/esmann.info/esmann.info/httpd.www/cms/cms2/plugins/function.hitcounter.php:96) in /customers/esmann.info/esmann.info/httpd.www/cms/cms2/admin/header.php on line 13


Why do I get these errors?
esmann

Found the bug :-)

Post by esmann »

I found the bug :o

The lines:

#Hitcounter. A plugin for CMS - CMS Made Simple
#Copyright (c) 2004 by Robert Campbell
#

Was missing in the top of the plugin :twisted:
100rk

Re: Thanks - But...

Post by 100rk »

esmann wrote:Why do I get these errors?
Those lines are comments only :-))))

I am not pretty sure because I don't use this plugin, but Your err message is very strange - CMSMS uses output buffering, so this error is really weird... So, I was take a look into code of this plugin and there is no header() function (which usually generates this error)....

By the way, it seems like this plugin counts ONLY unique IPs, not real hints from unique IPs, as it announced in help. Another thing: if You want to run this plugin, You have to create its data file by hand - this plugin has no initialization part and I don't believe there is chance open nonexisted file by this PHP construction...

SOLUTION: in case of small websites I recommend to You using some free hit-counter services - just search term 'free hit counter' by google and choose whatever You like.
esmann

plugin - please help

Post by esmann »

Hi 100rk.

Yes it's only comments but the error was gone when I inserted them :?:

And you are totally right. This counter plugin is not very usefull. I go and pick one of the free counter services instead.

But thanx anyway :P
Locked

Return to “CMSMS Core”