[imc-sf-coders] CVS update of sf-active/sf-active/sitename/scripts
(cli_initialise.php)
Bart M
pseudopunk at codecoop.org
Tue Dec 27 15:16:14 PST 2005
Date: Wednesday, December 28, 2005 @ 00:16:14
Author: pseudopunk
Path: /cvsroot/sf-active/sf-active/sf-active/sitename/scripts
Added: cli_initialise.php
script to initialize a site. far from finished
Index: sf-active/sf-active/sitename/scripts/cli_initialise.php
diff -u /dev/null sf-active/sf-active/sitename/scripts/cli_initialise.php:1.1
--- /dev/null Wed Dec 28 00:16:14 2005
+++ sf-active/sf-active/sitename/scripts/cli_initialise.php Wed Dec 28 00:16:14 2005
@@ -0,0 +1,45 @@
+<?
+/**
+ * This script should give you a useable static site just after install.
+ *
+ * @pacakge install
+ */
+
+// include the config
+include_once('cli.cfg');
+require_once(SF_CLASS_PATH . '/producer_class.inc');
+include_once(SF_CLASS_PATH.'/category_class.inc');
+include_once(SF_CLASS_PATH.'/gallery_class.inc');
+include_once(SF_CLASS_PATH.'/newswire_class.inc');
+global $prod_obj;
+
+// cache all the includes
+$prod_obj->run('all_includes');
+
+// setup some basic pages
+$prod_obj->run('static_page', 'index.tpl');
+$prod_obj->run('static_page', 'comment_latest.tpl');
+$prod_obj->run_rule('static_page', 'media__index.tpl');
+
+// cache article & newswire stuff
+$gal = new Gallery;
+$gal->set_year(date('Y'));
+$gal->render_year_index();
+$gal->render_months_in_year();
+
+
+$prod_obj->run_rule('static_page', 'news__index.tpl');
+$news = new Newswire;
+$news->set_year(date('Y'));
+$news->render_year_index();
+$news->render_months_in_year();
+$news->render_days_in_month(date('Y'), date('m'));
+
+$cat = new Category;
+$categorydata = $cat->get_category_fields(1);
+$news->render_summary($categorydata);
+$news->make_newswire_rss(1, 'production');
+
+if(is_array($prod_obj->get_error())) Cache::dump($prod_obj->get_error());
+
+?>
More information about the imc-sf-coders
mailing list