diff --git a/.htaccess b/.htaccess index 3401bab..e95f46a 100644 --- a/.htaccess +++ b/.htaccess @@ -7,6 +7,8 @@ Allow from 127.0.0.1 RewriteEngine On +RewriteBase /ss/ssinstaller2_3 + RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ RewriteCond %{REQUEST_URI} ^(.*)$ diff --git a/mysite/_config.php b/mysite/_config.php index 229de66..e937ca1 100644 --- a/mysite/_config.php +++ b/mysite/_config.php @@ -4,7 +4,7 @@ global $project; $project = 'mysite'; global $database; -$database = ""; +$database = "SS_ssinstaller2_3"; require_once("conf/ConfigureFromEnv.php"); @@ -12,4 +12,8 @@ require_once("conf/ConfigureFromEnv.php"); // downloaded from http://www.silverstripe.com/themes/ SSViewer::set_theme('blackcandy'); +Mollom::setPublicKey("1819023dfcb10a667d10bd1578c5f39b"); +Mollom::setPrivateKey("2430fcbd65756ac6732a54a7c9ada116"); +SpamProtecterManager::set_spam_protecter('MollomSpamProtector') + ?> \ No newline at end of file diff --git a/mysite/code/Page.php b/mysite/code/Page.php index 7c6e187..018ec8b 100755 --- a/mysite/code/Page.php +++ b/mysite/code/Page.php @@ -50,6 +50,31 @@ class Page_Controller extends ContentController { return $this->customise($data)->renderWith(array('Page_results', 'Page')); } + function TestForm() { + + $fields = new FieldSet( + new TextField("Title", "Title"), + new TextareaField("Message", "Message") + ); + $actions = new FieldSet( + new FormAction('doTestForm', 'Submit') + ); + + $form = new Form($this, "TestForm", $fields, $actions); + + + + if(class_exists('SpamProtecterManager')) { + $protecter = SpamProtecterManager::update_form($form); + $protecter->setFieldMapping('Title', 'Message'); + } + + return $form; + } + + function doTestForm($data, $form) { + Director::redirectBack(); + } } ?> \ No newline at end of file