Page 1 of 1

plugin - please help

Posted: Sun Feb 20, 2005 12:12 pm
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?

A little more specific

Posted: Sun Feb 20, 2005 2:20 pm
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?

Re: A little more specific

Posted: Sun Feb 20, 2005 2:40 pm
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.

Thanks - But...

Posted: Sun Feb 20, 2005 3:00 pm
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?

Found the bug :-)

Posted: Sun Feb 20, 2005 3:44 pm
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:

Re: Thanks - But...

Posted: Sun Feb 20, 2005 4:05 pm
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.

plugin - please help

Posted: Sun Feb 20, 2005 9:40 pm
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