Page 1 of 1

Site down front and admin !!!

Posted: Wed Feb 01, 2006 11:15 pm
by geraud
Hi

I experienced something very strange :

My cmsms site went down (front site + admin) after trying develop a new plugin.
I have a blank page whatever I do (even admin can't be accessed anymore).

It happened twice.
The first time, I reinstalled from scratch without really knowing what did happen. But now I have to know why and how to recover.

I tried to erase files in cache directories and I even reinstall the DB with the initial settings without any change.

Any idea ?

Thanks
Geraud

Re: Site down front and admin !!!

Posted: Wed Feb 01, 2006 11:35 pm
by geraud
I have the answer :

I erased the plugin file (function.myplugin.php) from the plugin directory and everything went back to normal.

Could someone explain what happened ?

Thanks
Geraud

Re: Site down front and admin !!!

Posted: Thu Feb 02, 2006 2:19 am
by Ted
Where did myplugin.php come from?

Re: Site down front and admin !!!

Posted: Thu Feb 02, 2006 10:33 am
by geraud
Hi,

Actually, I copied a frame from another plugin and used it to develop my own plugin.
I want to read a rss feed with magpierss class.
Here is the code:

function smarty_cms_function_rss($params, &$smarty)
{
global $gCms;

define('MAGPIE_DIR', '/home/francetr/www/rss/');
define('MAGPIE_CACHE_DIR', '/home/francetr/www/rss/cache');
define('MAGPIE_CACHE_ON', true);
require_once(MAGPIE_DIR.'rss_fetch.inc');

$url = $params['url'];

if ( $url ) {
$rss = fetch_rss( $url );
$output = "Channel: " . $rss->channel['title'] . "";
$output .= "";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$output .= "".$title."";
}
$output .= "";
}

$gallery = "Gallery";
$gallery.= $output;

return $gallery;

}

And I call it like this :
{rss url='http://www.site.com/rss'}

Regards
Geraud

Re: Site down front and admin !!!

Posted: Thu Feb 02, 2006 10:57 am
by Ted
There is an RSS module that does the same exact thing (including using magpie).  http://dev.cmsmadesimple.org/projects/rssmodule/

Also, if you are going to be developing plugins, you should run CMSMS with debug mode on (in config.php), but since that causes all kinds of stuff to be printed to the screen, it shouldn't be done on a production system.

Re: Site down front and admin !!!

Posted: Thu Feb 02, 2006 11:23 am
by geraud
Thanks for your answer.

But a few more points :
- I know that a rss plugin exists but I want to do something very specific that a 'standard' plugin doesn't do (the code above is just a start). And by the way, it is written in the doc that the rss plugin is in the basic install and I did't find it (do you have any url where I can download it ?)
- I really want to use MagpieRSS for my project (because it is the best for managing rss feeds !).
- As I want to write other plugins for this cms, I really want to understand the do's and dont's (do you have any plugin developer guide ?)

So do you have any explanation to my problem ?
Is it because I make a "require" in a plugin and it is forbidden ? Is there something you can do with php that is forbidden in a plugin function ?

And in conclusion I want to add that this CMSMS is a great tool !!!
I used several CMS frameworks in the past :
Phpnuke (when I was a newbie) : easy to understand and quite complete but too heavy (too many db accesses), security holes...
Then I developed several projects using only smarty and a few classes (but too much programming. I am so lazy...)
Then I tried to use Typo3 (too complicated)
Then I found EZPublish (much easier and very complete but quite heavy to handle in a day to day use)

Then recently I saw a post in my feeds talking about CMSMS and I had a look.
I think you made a killer app !
Not a killer app in the sense it is very complete and do papa mama
A killer app in the sense it fits the needs of the multitude : from newbies to developers.
It is very easy to handle (it took me days to understand how typo3 and Ezpublish work but only few minutes to handle CMSMS). And it is very open : tags and HTMLBlobs are great. Using smarty (which is a standard) is also great.

Good job !

Re: Site down front and admin !!!

Posted: Thu Feb 02, 2006 1:00 pm
by Ted
Thanks for the kind words.

Well, since you've done smarty stuff before, you're in luck.  CMS plugins(tags) are just smarty plugins.  The only difference is that the output doesn't cache.

The only thing that's going wrong here is that without debug turned on in config.php, smarty errors are displaying the 404 message instead of showing something useful.  This has been changed in svn...

It could've been anything really that was causing the error.  Also, keep in mind that function (smarty_cms_function_rss) should match filename (function.rss.php).