cakeforum_0.1.1-beta/0000755001171500116310000000000011253743330013621 5ustar web91client26cakeforum_0.1.1-beta/app/0000755001171500116310000000000011253743333014404 5ustar web91client26cakeforum_0.1.1-beta/app/config/0000755001171500116310000000000011253743332015650 5ustar web91client26cakeforum_0.1.1-beta/app/config/core.php0000644001171500116310000001707111253743331017316 0ustar web91client26 * Copyright 2005-2008, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 * @version $Revision: 7690 $ * @modifiedby $LastChangedBy: nate $ * @lastmodified $Date: 2008-10-02 00:56:53 -0400 (Thu, 02 Oct 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** * CakePHP Debug Level: * * Production Mode: * 0: No error messages, errors, or warnings shown. Flash messages redirect. * * Development Mode: * 1: Errors and warnings shown, model caches refreshed, flash messages halted. * 2: As in 1, but also with full debug messages and SQL output. * 3: As in 2, but also with full controller dump. * * In production mode, flash messages redirect after a time interval. * In development mode, you need to click the flash message to continue. */ Configure::write('debug', 2); /** * Application wide charset encoding */ Configure::write('App.encoding', 'UTF-8'); /** * To configure CakePHP *not* to use mod_rewrite and to * use CakePHP pretty URLs, remove these .htaccess * files: * * /.htaccess * /app/.htaccess * /app/webroot/.htaccess * * And uncomment the App.baseUrl below: */ //Configure::write('App.baseUrl', env('SCRIPT_NAME')); /** * Uncomment the define below to use CakePHP admin routes. * * The value of the define determines the name of the route * and its associated controller actions: * * 'admin' -> admin_index() and /admin/controller/index * 'superuser' -> superuser_index() and /superuser/controller/index */ //Configure::write('Routing.admin', 'admin'); /** * Turn off all caching application-wide. * */ //Configure::write('Cache.disable', true); /** * Enable cache checking. * * If set to true, for view caching you must still use the controller * var $cacheAction inside your controllers to define caching settings. * You can either set it controller-wide by setting var $cacheAction = true, * or in each action using $this->cacheAction = true. * */ //Configure::write('Cache.check', true); /** * Defines the default error type when using the log() function. Used for * differentiating error logging and debugging. Currently PHP supports LOG_DEBUG. */ define('LOG_ERROR', 2); /** * The preferred session handling method. Valid values: * * 'php' Uses settings defined in your php.ini. * 'cake' Saves session files in CakePHP's /tmp directory. * 'database' Uses CakePHP's database sessions. * * To define a custom session handler, save it at /app/config/.php. * Set the value of 'Session.save' to to utilize it in CakePHP. * * To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql. * */ Configure::write('Session.save', 'database'); /** * The name of the table used to store CakePHP database sessions. * * 'Session.save' must be set to 'database' in order to utilize this constant. * * The table name set here should *not* include any table prefix defined elsewhere. */ Configure::write('Session.table', 'sessions'); /** * The DATABASE_CONFIG::$var to use for database session handling. * * 'Session.save' must be set to 'database' in order to utilize this constant. */ //Configure::write('Session.database', 'default'); /** * The name of CakePHP's session cookie. */ Configure::write('Session.cookie', 'CakeForum'); /** * Session time out time (in seconds). * Actual value depends on 'Security.level' setting. */ Configure::write('Session.timeout', '120'); /** * If set to false, sessions are not automatically started. */ Configure::write('Session.start', true); /** * When set to false, HTTP_USER_AGENT will not be checked * in the session */ Configure::write('Session.checkAgent', true); /** * The level of CakePHP security. The session timeout time defined * in 'Session.timeout' is multiplied according to the settings here. * Valid values: * * 'high' Session timeout in 'Session.timeout' x 10 * 'medium' Session timeout in 'Session.timeout' x 100 * 'low' Session timeout in 'Session.timeout' x 300 * * CakePHP session IDs are also regenerated between requests if * 'Security.level' is set to 'high'. */ Configure::write('Security.level', 'medium'); /** * A random string used in security hashing methods. */ Configure::write('Security.salt', 'okf45trz65v7-4568p66656m8g-f34f654gh841i'); /** * Compress CSS output by removing comments, whitespace, repeating tags, etc. * This requires a/var/cache directory to be writable by the web server for caching. * and /vendors/csspp/csspp.php * * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css(). */ //Configure::write('Asset.filter.css', 'css.php'); /** * Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the * output, and setting the config below to the name of the script. * * To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link(). */ //Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php'); /** * The classname and database used in CakePHP's * access control lists. */ Configure::write('Acl.classname', 'DbAcl'); Configure::write('Acl.database', 'default'); /** * * Cache Engine Configuration * Default settings provided below * * File storage engine. * * Cache::config('default', array( * 'engine' => 'File', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] * 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path * 'prefix' => 'cake_', //[optional] prefix every cache file with this string * 'lock' => false, //[optional] use file locking * 'serialize' => true, [optional] * )); * * * APC (http://pecl.php.net/package/APC) * * Cache::config('default', array( * 'engine' => 'Apc', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * )); * * Xcache (http://xcache.lighttpd.net/) * * Cache::config('default', array( * 'engine' => 'Xcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * 'user' => 'user', //user from xcache.admin.user settings * 'password' => 'password', //plaintext password (xcache.admin.pass) * )); * * * Memcache (http://www.danga.com/memcached/) * * Cache::config('default', array( * 'engine' => 'Memcache', //[required] * 'duration'=> 3600, //[optional] * 'probability'=> 100, //[optional] * 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string * 'servers' => array( * '127.0.0.1:11211' // localhost, default port 11211 * ), //[optional] * 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory) * )); * */ Cache::config('default', array('engine' => 'File')); ?> cakeforum_0.1.1-beta/app/config/database.php0000644001171500116310000000625211253743331020131 0ustar web91client26 * Copyright 2005-2008, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 * @version $Revision: 7690 $ * @modifiedby $LastChangedBy: nate $ * @lastmodified $Date: 2008-10-02 00:56:53 -0400 (Thu, 02 Oct 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** * In this file you set up your database connection details. * * @package cake * @subpackage cake.config */ /** * Database configuration class. * You can specify multiple configurations for production, development and testing. * * driver => The name of a supported driver; valid options are as follows: * mysql - MySQL 4 & 5, * mysqli - MySQL 4 & 5 Improved Interface (PHP5 only), * sqlite - SQLite (PHP5 only), * postgres - PostgreSQL 7 and higher, * mssql - Microsoft SQL Server 2000 and higher, * db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2) * oracle - Oracle 8 and higher * firebird - Firebird/Interbase * sybase - Sybase ASE * adodb-[drivername] - ADOdb interface wrapper (see below), * odbc - ODBC DBO driver * * You can add custom database drivers (or override existing drivers) by adding the * appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php', * where 'x' is the name of the database. * * persistent => true / false * Determines whether or not the database should use a persistent connection * * connect => * ADOdb set the connect to one of these * (http://phplens.com/adodb/supported.databases.html) and * append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent) * For all other databases, this setting is deprecated. * * host => * the host you connect to the database. To add a socket or port number, use 'port' => # * * prefix => * Uses the given prefix for all the tables in this database. This setting can be overridden * on a per-table basis with the Model::$tablePrefix property. * * schema => * For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to * 'public', DB2 defaults to empty. * * encoding => * For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the * database. Defaults to 'UTF-8' for DB2. Uses database default for all others. * */ class DATABASE_CONFIG { var $default = array( 'driver' => 'mysqli', 'persistent' => false, 'host' => 'localhost', 'login' => 'root', 'password' => '', 'database' => 'cakeforum', 'prefix' => '', ); } ?>cakeforum_0.1.1-beta/app/config/sql/0000755001171500116310000000000011253743333016450 5ustar web91client26cakeforum_0.1.1-beta/app/config/sql/cakeforum.sql0000644001171500116310000000740411253743333021152 0ustar web91client26-- ---------------------------- -- Table structure for forum_categories -- ---------------------------- DROP TABLE IF EXISTS `forum_categories`; CREATE TABLE `forum_categories` ( `id` mediumint(5) NOT NULL auto_increment, `name` varchar(100) collate utf8_unicode_ci NOT NULL, `description` varchar(255) collate utf8_unicode_ci NOT NULL, `topics` mediumint(8) NOT NULL, `posts` mediumint(8) NOT NULL, `order` tinyint(2) NOT NULL, `last_topic_id` mediumint(8) NOT NULL, `last_topic_subject` varchar(150) collate utf8_unicode_ci NOT NULL, `last_topic_created` datetime NOT NULL, `last_topic_user_id` mediumint(8) NOT NULL, `last_topic_username` varchar(64) collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- ---------------------------- -- Table structure for forum_posts -- ---------------------------- DROP TABLE IF EXISTS `forum_posts`; CREATE TABLE `forum_posts` ( `id` mediumint(8) NOT NULL auto_increment, `forum_category_id` mediumint(8) NOT NULL, `forum_topic_id` mediumint(8) NOT NULL, `user_id` mediumint(8) NOT NULL, `text` mediumtext collate utf8_unicode_ci NOT NULL, `topic` tinyint(1) NOT NULL, `created` datetime NOT NULL, PRIMARY KEY (`id`), KEY `cat_id` (`forum_category_id`), KEY `topic_id` (`forum_topic_id`), KEY `user_id` (`user_id`), FULLTEXT KEY `s` (`text`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- ---------------------------- -- Table structure for forum_topics -- ---------------------------- DROP TABLE IF EXISTS `forum_topics`; CREATE TABLE `forum_topics` ( `id` mediumint(8) NOT NULL auto_increment, `user_id` mediumint(8) NOT NULL, `forum_category_id` mediumint(8) NOT NULL, `subject` varchar(150) collate utf8_unicode_ci NOT NULL, `views` mediumint(8) NOT NULL, `replies` mediumint(8) NOT NULL, `created` datetime NOT NULL, `last_post_id` mediumint(8) NOT NULL, `last_post_page` mediumint(3) NOT NULL, `last_post_created` datetime NOT NULL, `last_post_user_id` mediumint(8) NOT NULL, `last_post_username` varchar(64) collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `cat_id` (`forum_category_id`), KEY `user_id` (`user_id`), FULLTEXT KEY `subject` (`subject`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- ---------------------------- -- Table structure for groups -- ---------------------------- DROP TABLE IF EXISTS `groups`; CREATE TABLE `groups` ( `id` int(7) unsigned NOT NULL auto_increment, `name` varchar(50) collate utf8_unicode_ci NOT NULL, `description` tinytext collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- ---------------------------- -- Table structure for sessions -- ---------------------------- DROP TABLE IF EXISTS `sessions`; CREATE TABLE `sessions` ( `id` varchar(255) collate utf8_unicode_ci NOT NULL, `data` text collate utf8_unicode_ci NOT NULL, `expires` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- ---------------------------- -- Table structure for users -- ---------------------------- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` smallint(8) NOT NULL auto_increment, `username` varchar(64) collate utf8_unicode_ci NOT NULL, `password` varchar(64) collate utf8_unicode_ci NOT NULL, `email` varchar(64) collate utf8_unicode_ci NOT NULL, `group_id` smallint(6) NOT NULL, `active` tinyint(1) NOT NULL default '0', `confirm` char(40) collate utf8_unicode_ci NOT NULL, `created` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uc` (`username`,`confirm`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;cakeforum_0.1.1-beta/app/config/sql/i18n.sql0000644001171500116310000000163111253743333017751 0ustar web91client26# $Id: i18n.sql 7118 2008-06-04 20:49:29Z gwoo $ # # Copyright 2005-2008, Cake Software Foundation, Inc. # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. # http://www.opensource.org/licenses/mit-license.php The MIT License CREATE TABLE i18n ( id int(10) NOT NULL auto_increment, locale varchar(6) NOT NULL, model varchar(255) NOT NULL, foreign_key int(10) NOT NULL, field varchar(255) NOT NULL, content mediumtext, PRIMARY KEY (id), # UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field), # INDEX I18N_LOCALE_ROW(locale, model, foreign_key), # INDEX I18N_LOCALE_MODEL(locale, model), # INDEX I18N_FIELD(model, foreign_key, field), # INDEX I18N_ROW(model, foreign_key), INDEX locale (locale), INDEX model (model), INDEX row_id (foreign_key), INDEX field (field) ); cakeforum_0.1.1-beta/app/config/sql/i18n.php0000644001171500116310000000411411253743333017740 0ustar web91client26 * Copyright 2005-2008, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 * @version $Revision: 7118 $ * @modifiedby $LastChangedBy: gwoo $ * @lastmodified $Date: 2008-06-04 16:49:29 -0400 (Wed, 04 Jun 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /* * * Using the Schema command line utility * cake schema run create i18n * */ class i18nSchema extends CakeSchema { var $name = 'i18n'; function before($event = array()) { return true; } function after($event = array()) { } var $i18n = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'), 'model' => array('type'=>'string', 'null' => false, 'key' => 'index'), 'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), 'field' => array('type'=>'string', 'null' => false, 'key' => 'index'), 'content' => array('type'=>'text', 'null' => true, 'default' => NULL), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0)) ); } ?>cakeforum_0.1.1-beta/app/config/sql/sessions.php0000644001171500116310000000315311253743333021031 0ustar web91client26 * Copyright 2005-2008, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 * @version $Revision: 6311 $ * @modifiedby $LastChangedBy: phpnut $ * @lastmodified $Date: 2008-01-02 01:33:52 -0500 (Wed, 02 Jan 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /* * * Using the Schema command line utility * cake schema run create Sessions * */ class SessionsSchema extends CakeSchema { var $name = 'Sessions'; function before($event = array()) { return true; } function after($event = array()) { } var $cake_sessions = array( 'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'), 'data' => array('type'=>'text', 'null' => true, 'default' => NULL), 'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); } ?>cakeforum_0.1.1-beta/app/config/sql/sessions.sql0000644001171500116310000000075711253743333021050 0ustar web91client26# $Id: sessions.sql 7118 2008-06-04 20:49:29Z gwoo $ # # Copyright 2005-2008, Cake Software Foundation, Inc. # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. # http://www.opensource.org/licenses/mit-license.php The MIT License CREATE TABLE cake_sessions ( id varchar(255) NOT NULL default '', data text, expires int(11) default NULL, PRIMARY KEY (id) );cakeforum_0.1.1-beta/app/config/sql/db_acl.php0000644001171500116310000000663711253743333020401 0ustar web91client26 * Copyright 2005-2008, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 * @version $Revision: 7118 $ * @modifiedby $LastChangedBy: gwoo $ * @lastmodified $Date: 2008-06-04 16:49:29 -0400 (Wed, 04 Jun 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /* * * Using the Schema command line utility * cake schema run create DbAcl * */ class DbAclSchema extends CakeSchema { var $name = 'DbAcl'; function before($event = array()) { return true; } function after($event = array()) { } var $acos = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'model' => array('type'=>'string', 'null' => true), 'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'alias' => array('type'=>'string', 'null' => true), 'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); var $aros = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'model' => array('type'=>'string', 'null' => true), 'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'alias' => array('type'=>'string', 'null' => true), 'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); var $aros_acos = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), 'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10), '_create' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), '_read' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), '_update' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), '_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1)) ); } ?>cakeforum_0.1.1-beta/app/config/sql/db_acl.sql0000644001171500116310000000243711253743333020403 0ustar web91client26# $Id: db_acl.sql 7118 2008-06-04 20:49:29Z gwoo $ # # Copyright 2005-2008, Cake Software Foundation, Inc. # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. # http://www.opensource.org/licenses/mit-license.php The MIT License CREATE TABLE acos ( id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, parent_id INTEGER(10) DEFAULT NULL, model VARCHAR(255) DEFAULT '', foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, alias VARCHAR(255) DEFAULT '', lft INTEGER(10) DEFAULT NULL, rght INTEGER(10) DEFAULT NULL, PRIMARY KEY (id) ); CREATE TABLE aros_acos ( id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, aro_id INTEGER(10) UNSIGNED NOT NULL, aco_id INTEGER(10) UNSIGNED NOT NULL, _create CHAR(2) NOT NULL DEFAULT 0, _read CHAR(2) NOT NULL DEFAULT 0, _update CHAR(2) NOT NULL DEFAULT 0, _delete CHAR(2) NOT NULL DEFAULT 0, PRIMARY KEY(id) ); CREATE TABLE aros ( id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, parent_id INTEGER(10) DEFAULT NULL, model VARCHAR(255) DEFAULT '', foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, alias VARCHAR(255) DEFAULT '', lft INTEGER(10) DEFAULT NULL, rght INTEGER(10) DEFAULT NULL, PRIMARY KEY (id) ); cakeforum_0.1.1-beta/app/config/bootstrap.php0000644001171500116310000000135511253743330020400 0ustar web91client26cakeforum_0.1.1-beta/app/config/routes.php0000644001171500116310000000246211253743330017704 0ustar web91client26 'forum', 'action' => 'index')); // Users Router::connect('/register', array('controller' => 'users', 'action' => 'register')); Router::connect('/registered', array('controller' => 'users', 'action' => 'registered')); Router::connect('/login', array('controller' => 'users', 'action' => 'login')); Router::connect('/logout', array('controller' => 'users', 'action' => 'logout')); Router::connect('/account', array('controller' => 'users', 'action' => 'account')); Router::connect('/lostpassword', array('controller' => 'users', 'action' => 'lostpassword')); Router::connect('/user/*', array('controller' => 'users', 'action' => 'profile')); // Forum Router::connect('/view/*', array('controller' => 'forum', 'action' => 'view')); Router::connect('/topic/*', array('controller' => 'forum', 'action' => 'topic')); Router::connect('/newtopic/*', array('controller' => 'forum', 'action' => 'newtopic')); Router::connect('/reply/*', array('controller' => 'forum', 'action' => 'reply')); Router::connect('/editpost/*', array('controller' => 'forum', 'action' => 'editpost')); Router::connect('/deletepost/*', array('controller' => 'forum', 'action' => 'deletepost')); Router::connect('/unanswered', array('controller' => 'forum', 'action' => 'unanswered')); ?>cakeforum_0.1.1-beta/app/config/inflections.php0000644001171500116310000000520611253743330020677 0ustar web91client26 * Copyright 2005-2008, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 1.0.0.2312 * @version $Revision: 6311 $ * @modifiedby $LastChangedBy: phpnut $ * @lastmodified $Date: 2008-01-02 01:33:52 -0500 (Wed, 02 Jan 2008) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** * This is a key => value array of regex used to match words. * If key matches then the value is returned. * * $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice'); */ $pluralRules = array(); /** * This is a key only array of plural words that should not be inflected. * Notice the last comma * * $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox'); */ $uninflectedPlural = array(); /** * This is a key => value array of plural irregular words. * If key matches then the value is returned. * * $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers') */ $irregularPlural = array(); /** * This is a key => value array of regex used to match words. * If key matches then the value is returned. * * $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i') */ $singularRules = array(); /** * This is a key only array of singular words that should not be inflected. * You should not have to change this value below if you do change it use same format * as the $uninflectedPlural above. */ $uninflectedSingular = $uninflectedPlural; /** * This is a key => value array of singular irregular words. * Most of the time this will be a reverse of the above $irregularPlural array * You should not have to change this value below if you do change it use same format * * $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother') */ $irregularSingular = array_flip($irregularPlural); ?>cakeforum_0.1.1-beta/app/config/acl.ini.php0000644001171500116310000000444011253743330017676 0ustar web91client26; ; SVN FILE: $Id: acl.ini.php 7690 2008-10-02 04:56:53Z nate $ ;/** ; * Short description for file. ; * ; * ; * PHP versions 4 and 5 ; * ; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/ ; * Copyright 2005-2008, Cake Software Foundation, Inc. ; * 1785 E. Sahara Avenue, Suite 490-204 ; * Las Vegas, Nevada 89104 ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * ; * @filesource ; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. ; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project ; * @package cake ; * @subpackage cake.app.config ; * @since CakePHP(tm) v 0.10.0.1076 ; * @version $Revision: 7690 $ ; * @modifiedby $LastChangedBy: nate $ ; * @lastmodified $Date: 2008-10-02 00:56:53 -0400 (Thu, 02 Oct 2008) $ ; * @license http://www.opensource.org/licenses/mit-license.php The MIT License ; */ ; acl.ini.php - Cake ACL Configuration ; --------------------------------------------------------------------- ; Use this file to specify user permissions. ; aco = access control object (something in your application) ; aro = access request object (something requesting access) ; ; User records are added as follows: ; ; [uid] ; groups = group1, group2, group3 ; allow = aco1, aco2, aco3 ; deny = aco4, aco5, aco6 ; ; Group records are added in a similar manner: ; ; [gid] ; allow = aco1, aco2, aco3 ; deny = aco4, aco5, aco6 ; ; The allow, deny, and groups sections are all optional. ; NOTE: groups names *cannot* ever be the same as usernames! ; ; ACL permissions are checked in the following order: ; 1. Check for user denies (and DENY if specified) ; 2. Check for user allows (and ALLOW if specified) ; 3. Gather user's groups ; 4. Check group denies (and DENY if specified) ; 5. Check group allows (and ALLOW if specified) ; 6. If no aro, aco, or group information is found, DENY ; ; --------------------------------------------------------------------- ;------------------------------------- ;Users ;------------------------------------- [username-goes-here] groups = group1, group2 deny = aco1, aco2 allow = aco3, aco4 ;------------------------------------- ;Groups ;------------------------------------- [groupname-goes-here] deny = aco5, aco6 allow = aco7, aco8cakeforum_0.1.1-beta/app/app_controller.php0000644001171500116310000000174211253743330020141 0ustar web91client26auth(); } private function auth() { if ($this->viewPath == 'pages') $this->Auth->allow('*'); else { $this->Auth->userScope = array('User.active' => '1'); $this->Auth->loginAction = '/login'; $this->Auth->logoutRedirect = '/'; $this->Auth->autoRedirect = true; } $this->userID = $this->Auth->user('id'); } } ?>cakeforum_0.1.1-beta/app/.htaccess0000644001171500116310000000021511253743330016175 0ustar web91client26 RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] cakeforum_0.1.1-beta/app/controllers/0000755001171500116310000000000011253743332016751 5ustar web91client26cakeforum_0.1.1-beta/app/controllers/forum_controller.php0000644001171500116310000002577611253743332023076 0ustar web91client26Auth->allowedActions = array('index', 'view', 'topic'); } /** * Forum index, show forum categories */ public function index() { $this->pageTitle = 'Index'; $forums = $this->ForumCategory->find('all', array( 'order' => 'order ASC', 'recursive' => -1 ) ); $this->set('categories', $forums); } /** * View forum * @param (int) forum ID */ public function view($id = null) { $forumName = $this->ForumCategory->getName($id); $this->pageTitle = $forumName; $this->ForumTopic->userID = $this->userID; // get topics $this->ForumTopic->unbindModel(array('hasMany' => array('ForumPost')), false); $this->paginate['ForumTopic'] = array( 'limit' => $this->numTopics, 'order' => 'ForumTopic.last_post_created DESC', 'recursive' => 1 ); $topics = $this->paginate('ForumTopic', array('ForumTopic.forum_category_id' => $id)); if (empty($topics)){ $topics = null; } $this->set('topics', $topics); $this->set('forumId', $id); $this->set('forumName', $forumName); } /** * View topic * @param (int) topic ID * @param (int) forum ID */ public function topic($topic_id = null, $forum_id = null) { // get forum name $forumName = $this->ForumCategory->getName($forum_id); // get topic $topic = $this->ForumTopic->find('first', array( 'conditions' => array('ForumTopic.id' => $topic_id), 'fields' => 'id, subject', 'recursive' => -1 ) ); // set page title $this->pageTitle = $forumName . ' » ' . $topic['ForumTopic']['subject']; // get posts $this->ForumPost->unbindModel(array('belongsTo' => array('ForumCategory', 'ForumTopic')), false); $this->paginate = array( 'ForumTopic' => array('limit' => $this->numPosts), 'ForumPost' => array('order' => array('ForumPost.id' => 'ASC')) ); $posts = $this->paginate('ForumPost', array('ForumPost.forum_topic_id' => $topic_id)); $this->ForumTopic->updateCounter('views', '+', $topic_id); $this->set(array( 'forumName' => $forumName, 'topic' => $topic, 'posts' => $posts, 'topicId' => $topic_id, 'forumId' => $forum_id ) ); } /** * Start new topic * @param (int) forum ID */ public function newtopic($forum_id = null) { // get forum name $forumName = $this->ForumCategory->getName($forum_id); // set page title $this->pageTitle = 'New topic'; if(!$forumName) { $this->redirect(array('controller' => 'forum', 'action' => 'index')); } if(!empty($this->data)) { $this->data['ForumTopic']['forum_category_id'] = $forum_id; $this->data['ForumTopic']['user_id'] = $this->userID; if($this->ForumTopic->save($this->data)) { $postData = array('ForumPost' => array( 'forum_topic_id' => $this->ForumTopic->getLastInsertID(), 'forum_category_id' => $forum_id, 'user_id' => $this->userID, 'text' => $this->data['ForumTopic']['text'], 'topic' => '1' ) ); $topic_id = $this->ForumTopic->getLastInsertID(); // save post $this->ForumPost->save($postData); // update last topic data in forum category $lastTopic = array( 'last_topic_id' => $topic_id, 'last_topic_subject' => strip_tags($this->data['ForumTopic']['subject']), 'last_topic_created' => date('Y-m-d H:m:s'), 'last_topic_user_id' => $this->userID, 'last_topic_username' => $this->Auth->user('username'), ); $this->ForumCategory->updateLastTopic($forum_id, $lastTopic); // save last post data $lastPost = array( 'last_post_id' => $this->ForumPost->getInsertID(), 'last_post_page' => 0, 'last_post_created' => date('Y-m-d H:i:s'), 'last_post_user_id' => $this->userID, 'last_post_username' => $this->Auth->user('username') ); $this->ForumTopic->updateLastPost($topic_id, $lastPost); // update counters $this->ForumCategory->updateCounter('topics', '+', $forum_id); $this->redirect(array('controller' => 'forum', 'action' => 'topic', $topic_id, $forum_id)); } } $this->set('forumName', $forumName); $this->set('forumId', $forum_id); } /** * Reply * @param (int) topic ID * @param (int) forum ID * @param (string) quote: 'quote' * @param (int) post ID */ public function reply($topic_id = null, $forum_id = null) { $topicExist = $this->ForumTopic->hasAny(array('id' => $topic_id)); if (!$topicExist) { $this->redirect(array('controller' => 'forum', 'action' => 'index')); } $this->pageTitle = 'Reply'; if(!empty($this->data)) { $this->data['ForumPost']['forum_topic_id'] = $topic_id; $this->data['ForumPost']['forum_category_id'] = $forum_id; $this->data['ForumPost']['user_id'] = $this->userID; if($this->ForumPost->save($this->data)) { // update counters $this->ForumCategory->updateCounter('posts', '+', $forum_id); $this->ForumTopic->updateCounter('replies', '+', $topic_id); // get last page number $numPage = $this->getLastPageNumber($topic_id); // update last post $lastPost = array( 'last_post_id' => $this->ForumPost->getInsertID(), 'last_post_page' => $numPage, 'last_post_created' => date('Y-m-d H:i:s'), 'last_post_user_id' => $this->userID, 'last_post_username' => $this->Auth->user('username') ); $this->ForumTopic->updateLastPost($topic_id, $lastPost); $this->redirect(array('controller' => 'forum', 'action' => 'topic', $topic_id, $forum_id, '/page:' . $numPage)); } } $this->getForumPath($forum_id, $topic_id); $this->set('topicId', $topic_id); $this->set('forumId', $forum_id); } /** * Edit post * only owner of post */ public function editpost($post_id = null, $topic_id = null, $forum_id = null) { $post = $this->ForumPost->find('first', array( 'conditions' => array('ForumPost.id' => $post_id, 'ForumPost.user_id' => $this->userID), 'recursive' => -1 ) ); if (empty($post)) { $this->redirect(array('controller' => 'forum', 'action' => 'index')); } if ($post['ForumPost']['topic']) { $topic = $this->ForumTopic->find('first', array( 'conditions' => array('ForumTopic.id' => $topic_id, 'ForumTopic.user_id' => $this->userID), 'fields' => 'id, subject', 'recursive' => -1 ) ); } if (empty($this->data)) { $this->data = $post; $this->data['ForumPost']['text'] = $this->br2nl($this->data['ForumPost']['text']); if ($post['ForumPost']['topic']) { $this->data['ForumTopic']['subject'] = $topic['ForumTopic']['subject']; } } else { if ($post['ForumPost']['topic']) { $this->data['ForumTopic']['id'] = $topic['ForumTopic']['id']; } $this->data['ForumPost']['id'] = $post['ForumPost']['id']; if ($this->ForumPost->saveAll($this->data)) { $this->ForumCategory->updateLastTopic($forum_id); $this->redirect(array('controller' => 'forum', 'action' => 'topic', $topic_id, $forum_id)); } } $this->getForumPath($forum_id, $topic_id); $this->set('postID', $post_id); $this->set('topicID', $topic_id); $this->set('forumID', $forum_id); if ($post['ForumPost']['topic']) { $this->render('edittopic'); } } /** * Delete post * only owner of post or admin/moderator */ public function deletepost($post_id = null, $topic_id = null, $forum_id = null) { $post = $this->ForumPost->find('first', array( 'conditions' => array('ForumPost.id' => $post_id, 'ForumPost.user_id' => $this->userID), 'fields' => 'id, topic', 'recursive' => -1 ) ); if (empty($post)) { $this->redirect(array('controller' => 'forum', 'action' => 'index')); } $topic = $this->ForumTopic->find('first', array( 'conditions' => array('ForumTopic.id' => $topic_id), 'fields' => 'replies', 'recursive' => -1 ) ); $numPosts = $topic['ForumTopic']['replies']; $isTopic = $post['ForumPost']['topic']; if ($isTopic == 1 && $numPosts == 0 || $isTopic == 0 && $numPosts == 0) { $this->deleteTopic($topic_id, $forum_id); } else { if($this->ForumPost->deletePost($post_id, $topic_id, $forum_id)) { $this->redirect(array('controller' => 'forum', 'action' => 'topic', $topic_id, $forum_id)); } } } /** * Delete topic * @param (int) topic ID * @param (int) forum ID */ private function deleteTopic($topic_id = null, $forum_id = null) { if ($this->ForumTopic->delete($topic_id)) { // update counters $this->ForumCategory->updateCounter('topics', '-', $forum_id); // update last topic data $this->ForumCategory->updateLastTopic($forum_id); $this->redirect(array('controller' => 'forum', 'action' => 'view', $forum_id)); } else { $this->redirect(array('controller' => 'forum', 'action' => 'index')); } } /** * Get forum path * forum name > topic name */ private function getForumPath($forum_id = null, $topic_id = null) { $this->set('topicSubject', $this->ForumTopic->getName($topic_id)); $this->set('forumName', $this->ForumCategory->getName($forum_id)); } /** * Get number of last page * @param topic ID */ public function getLastPageNumber($topic_id = null, $numPosts = null) { if (empty($numPosts)) { $this->ForumTopic->recursive = -1; $numPosts = $this->ForumTopic->read('replies', $topic_id); } if ($numPosts['ForumTopic']['replies'] <= $this->numPosts) { $numPage = 0; } else { if (($numPosts['ForumTopic']['replies'] % $this->numPosts) == 0) { $numPage = $numPosts['ForumTopic']['replies'] / $this->numPosts; } else { $numPage = floor($numPosts['ForumTopic']['replies'] / $this->numPosts) + 1; // page number for redirect } } return $numPage; } /** * Unanswered topics */ public function unanswered() { $this->pageTitle = 'Unanswered topics'; $this->ForumTopic->unbindModel(array('hasMany' => array('ForumPost')), false); $topics = $this->ForumTopic->find('all', array( 'conditions' =>array('ForumTopic.replies' => '0'), 'order' => 'ForumTopic.created DESC', 'limit' => $this->numTopics ) ); $this->set('topics', $topics); } /** * Convert
to nl */ private function br2nl($string) { return preg_replace('/\/i', "", $string); } } ?>cakeforum_0.1.1-beta/app/controllers/components/0000755001171500116310000000000011253743333021137 5ustar web91client26cakeforum_0.1.1-beta/app/controllers/components/cf_email.php0000644001171500116310000000072511253743333023413 0ustar web91client26Email->to = $to; $this->Email->subject = $subject; $this->Email->from = Configure::read('CfEmail') . '<' . Configure::read('CfEmail') . '>'; $this->Email->replyTo = Configure::read('CfEmail'); $this->Email->template = $template; $this->Email->sendAs = 'both'; return $this->Email->send(); } } ?>cakeforum_0.1.1-beta/app/controllers/users_controller.php0000644001171500116310000001315711253743331023074 0ustar web91client26Auth->allowedActions = array( 'register', 'registered', 'login', 'logout', 'lostpassword', 'confirm', 'reset', 'public_profile' ); // copy of form_password to password for auto hashing in Auth Component if (isset($this->data['User']['form_password']) && !empty($this->data['User']['form_password'])) { $this->data['User']['password'] = $this->data['User']['form_password']; } } /** * Public */ public function profile($username) { $this->pageTitle = $username; $this->User->unbindModel(array('belongsTo' => array('Group'))); $user = $this->User->find('first', array( 'conditions' =>array('User.username' => $username), 'fields' => array('User.id', 'User.username', 'User.email', 'User.created') )); $this->set('data', $user); } /** * Register */ public function register() { $this->pageTitle = 'Register'; if (empty($this->userID)) { if (!empty($this->data)) { $this->data['User']['group_id'] = 2; $this->data['User']['active'] = 1; // save user data if ($this->User->save($this->data)) { $this->redirect('/registered'); } else { $this->data['User']['form_password'] = ''; $this->data['User']['confirm_password'] = ''; } } } else { // if user logged in redirect to home page $this->redirect('/'); } } /** * Confirmation message after registration */ public function registered() { } /** * Login */ public function login() { $this->pageTitle = 'Login'; if (! empty($this->userID) && $this->Session->valid()) { $this->redirect('/'); } $this->set('error', false); if (! empty($this->data)) { if ($this->Auth->login()) { $this->redirect('/'); } else { $this->Session->setFlash("Wrong username or password."); } } } /** * Logout */ public function logout() { $this->Auth->logout(); $this->redirect('/'); } /** * Lost password */ public function lostpassword() { $this->pageTitle = 'Lost password'; if (!empty($this->data)) { $user = $this->User->find('first', array( 'conditions' => array('email' => $this->data['User']['email'], 'active' => '1'), 'fields' => array('User.id', 'User.username', 'User.email'), 'recursive' => -1 ) ); if(!empty($user)) { $user['User']['confirm'] = String::uuid(); // foolproof: check if the confirm string is unique while($this->User->find('count', array( 'conditions' => array('User.confirm' => $user['User']['confirm']), 'recursive' => -1 ) ) ) { $user['User']['confirm'] = String::uuid(); } $this->User->id = $user['User']['id']; if ($this->User->saveField('confirm', $user['User']['confirm'])) { // send confirmation mail $this->set('data', $user['User']); $this->set('host', $_SERVER['HTTP_HOST'] . '/' . Configure::read('CfFolder')); if( $this->CfEmail->send($user['User']['email'], 'CakeForum lost password', 'lostpassword') ) { $message = 'The confirmation email has been sent, please check your inbox.'; } else { $message = 'E-mail could not be sent at this time.'; } } } else { $message = 'User not found or not active'; } $this->Session->setFlash($message); $this->redirect('/lostpassword'); } } public function reset($string) { $user = $this->User->find('first', array( 'conditions' => array('confirm' => $string), 'fields' => array('User.id', 'User.username', 'User.email'), 'recursive' => -1 ) ); if (!empty($user)) { $password = $this->randomPassword(); $this->data['User']['id'] = $user['User']['id']; $this->data['User']['password'] = Security::hash($password, null, true); $this->data['User']['confirm'] = ''; if ( $this->User->save($this->data) ) { // send mail $this->set('data', $user['User']); $this->set('password', $password); $this->set('host', $_SERVER['HTTP_HOST']); if( $this->CfEmail->send($user['User']['email'], 'CakeForum new password', 'newpassword') ) { $message = 'E-mail with new password has been sent, please check your inbox.'; } else { $message = 'E-mail could not be sent at this time.'; } } } else { $message = 'Error.'; } $this->Session->setFlash($message); $this->redirect('/login'); } private function randomPassword() { return substr(md5(rand(123456, 98765402)), 10, 8); } public function account() { $this->pageTitle = 'Account'; if (empty($this->data)) { $this->data = $this->User->find('first', array( 'conditions' => array('id' => $this->userID), 'fields' => array('id', 'username', 'email'), 'recursive' => -1 ) ); } else { $this->data['User']['id'] = $this->userID; $fieldList = array('username', 'email', 'password', 'old_password', 'form_password', 'confirm_password'); if($this->User->save($this->data, true, $fieldList)) { $this->Session->setFlash("Account data has been saved."); $this->redirect('/account'); } } } } ?>cakeforum_0.1.1-beta/app/models/0000755001171500116310000000000011253743332015666 5ustar web91client26cakeforum_0.1.1-beta/app/models/group.php0000644001171500116310000000071411253743332017535 0ustar web91client26cakeforum_0.1.1-beta/app/models/forum_category.php0000644001171500116310000000434411253743332021431 0ustar web91client26 array( 'foreignKey' => 'forum_category_id', 'dependent' => true, ), 'ForumTopic' => array( 'foreignKey' => 'forum_category_id', 'dependent' => true, ) ); public function getName($id = null) { $forum = $this->find('first', array( 'conditions' => array('ForumCategory.id' => $id), 'fields' => array('name'), 'recursive' => -1 ) ); return $forum['ForumCategory']['name']; } /** * Update counter replies and views * @param type (replies / views) * @param prefix (+ / -) * @param forum_id * @param number of topics/views (default: 1) */ public function updateCounter($type = null, $prefix = null, $forum_id = null, $num = 1) { $this->recursive = -1; $conditions = array($type => $type . $prefix . $num); $this->updateAll($conditions, array('ForumCategory.id' => $forum_id)); } /** * Update last topic data * @param (int) forum ID *required * @param (array) data */ public function updateLastTopic($forum_id = null, $data = null) { if (empty($data)) { $this->ForumTopic->unbindModel(array('hasMany' => array('ForumPost'))); $lt = $this->ForumTopic->find('first', array( 'conditions' => array('ForumTopic.forum_category_id' => $forum_id), 'fields' => array('ForumTopic.id', 'ForumTopic.subject', 'ForumTopic.created', 'User.id', 'User.username'), 'order' => 'ForumTopic.created DESC', 'recursive' => 1 ) ); $data = array( 'last_topic_id' => $lt['ForumTopic']['id'], 'last_topic_subject' => $lt['ForumTopic']['subject'], 'last_topic_created' => $lt['ForumTopic']['created'], 'last_topic_user_id' => $lt['User']['id'], 'last_topic_username' => $lt['User']['username'], ); } $this->id = $forum_id; $this->save($data, false); } } ?>cakeforum_0.1.1-beta/app/models/user.php0000644001171500116310000000716611253743332017367 0ustar web91client26 array( 'checkunique' => array('rule' => array('checkUnique', 'username')), 'alphanumeric' => array('rule' => array('custom', '/^[a-zA-Z0-9_-]{3,25}$/')), //'alphanumeric' => array('rule' => 'alphaNumeric'), 'required' => array('rule' => 'notempty') ), 'email' => array( 'checkunique' => array('rule' => array('checkUnique', 'email')), 'validemail' => array('rule' => 'email'), 'required' => array('rule' => 'notempty') ), // copy of password field 'form_password' => array( 'required' => array( 'rule' => 'notempty', 'on' => 'create' ), 'lenght' => array( 'rule' => array('minLength', 3), 'allowEmpty' => true ), ), 'confirm_password' => array( 'confirm' => array('rule' => 'confirmPassword'), 'required' => array( 'rule' => 'notempty', 'on' => 'create' ), 'lenght' => array( 'rule' => array('minLength', 3), 'allowEmpty' => true ) ), 'old_password' => array( 'rule' => 'checkOldPassword', 'allowEmpty' => true ), // email for lost password 'lpemail' => array( 'checkunique' => array('rule' => array('lostPassword')), 'validemail' => array('rule' => 'email'), 'required' => array('rule' => 'notempty') ), ); /** * Associations */ public $belongsTo = array('Group'); /** * Callback */ public function beforeValidate() { if (!empty($this->data['User']['form_password'])) { $this->validate['old_password']['allowEmpty'] = false; } } /** * Check confim password * @return boolean */ public function confirmPassword($value) { if ($this->data['User']['form_password'] == $value['confirm_password']) { return true; } return false; } /** * Check if email exist in database * @return boolean */ public function lostPassword() { $count = $this->find('count', array( 'conditions' => array('User.email' => $this->data['User']['lpemail']), 'recursive' => -1 ) ); if ($count > 0) { return true; } else { return false; } } /** * Check is data unique * @param data * @param field name * @return boolean */ public function checkUnique($data, $fieldName) { if (isset($this->data['User']['id'])) { $num = $this->find('count', array( 'conditions' => array( 'User.' . $fieldName => $data[$fieldName], 'User.id <>' => $this->data['User']['id'] ), 'recursive' => -1 ) ); if ($num > 0) { return false; } else { return true; } } else { $valid = false; if (isset($fieldName) && $this->hasField($fieldName)) { $valid = $this->isUnique(array($fieldName => $data[$fieldName])); } return $valid; } } public function checkOldPassword($data) { $user = $this->find('first', array( 'conditions' => array('id' => $this->data['User']['id']), 'fields' => array('password'), 'recursive' => -1 ) ); if (Security::hash($data['old_password'], null, true) == $user['User']['password']) { return true; } else { return false; } } } ?>cakeforum_0.1.1-beta/app/models/forum_topic.php0000644001171500116310000000705111253743332020730 0ustar web91client26 array( 'lenght' => array('rule' => array('maxLength', 150)), 'required' => array('rule' => 'notempty') ), 'text' => array( 'required' => array('rule' => 'notempty') ), ); public $belongsTo = array( 'User' => array( 'foreignKey' => 'user_id', 'fields' => 'id, username' ) ); public $hasMany = array( 'ForumPost' => array( 'foreignKey' => 'forum_topic_id', 'dependent' => true ) ); /** * Callbacks */ public function beforeSave() { if(isset($this->data['ForumTopic']['subject']) && isset($this->data['ForumTopic']['text'])) { $this->data['ForumTopic']['subject'] = strip_tags($this->data['ForumTopic']['subject']); $this->data['ForumTopic']['text'] = nl2br(strip_tags($this->data['ForumTopic']['text'])); } return true; } /** * Get topic title * @param (int) topic ID * @return (string) topic subject */ public function getName($topic_id = null) { $t = $this->find('first', array( 'conditions' => array('ForumTopic.id' => $topic_id), 'fields' => array('ForumTopic.subject'), 'recursive' => -1 ) ); return $t['ForumTopic']['subject']; } /** * Update counter replies and views * @param type (replies / views) * @param prefix (+ / -) * @param topic_id * @param number */ public function updateCounter($type = null, $prefix = null, $topic_id = null, $num = 1) { $this->recursive = -1; $conditions = array($type => $type . $prefix . $num); $this->updateAll($conditions, array('ForumTopic.id' => $topic_id)); } /** * Search forum topic by subject * @param string query */ public function search($q = null) { $conditions = "MATCH (subject) AGAINST ('$q')"; $fields = "ForumTopic.id, ForumTopic.forum_category_id, ForumTopic.subject, ForumTopic.created, ForumTopic.views, ForumTopic.replies, User.id, User.username"; $topics = $this->find('all', array( 'conditions' => $conditions, 'fields' => $fields, 'order' => array('ForumTopic.created' => 'DESC'), 'recursive' => -1 ) ); return $topics; } /** * Update last post * @param (int) topic ID *required * @param (array) data */ public function updateLastPost($topic_id = null, $data = null) { if (empty($data)) { App::import('Contoller', 'Forum'); $forum = new ForumController(); $this->ForumPost->unbindModel(array('belongsTo' => array('Topic', 'Forum'))); $t = $this->ForumPost->find('first', array( 'conditions' => array('ForumPost.forum_topic_id' => $topic_id), 'order' => 'ForumPost.created DESC', 'recursive' => 1 ) ); $this->recursive = -1; $post = $this->read('replies', $topic_id); $data = array( 'last_post_id' => $t['ForumPost']['id'], 'last_post_page' => $forum->getLastPageNumber($topic_id, $post), 'last_post_created' => $t['ForumPost']['created'], 'last_post_user_id' => $t['User']['id'], 'last_post_username' => $t['User']['username'], ); } $this->id = $topic_id; $this->save($data, false); } } ?>cakeforum_0.1.1-beta/app/models/forum_post.php0000644001171500116310000000316711253743332020603 0ustar web91client26 array( 'rule' => 'notempty' ), ); public $belongsTo = array( 'ForumTopic' => array( 'foreignKey' => 'forum_topic_id' ), 'User' => array( 'foreignKey' => 'user_id', 'fields' => 'id, username' ), 'ForumCategory' => array( 'foreignKey' => 'forum_category_id' ) ); /** * Callbacks */ public function beforeSave() { if(!empty($this->data['ForumPost']['subject'])) { $this->data['ForumPost']['subject'] = strip_tags($this->data['ForumPost']['subject']); } $this->data['ForumPost']['text'] = nl2br(strip_tags($this->data['ForumPost']['text'])); return true; } /** * Delete post * @param post_id * @param topic_id * @param forum_id * @return bool */ public function deletePost($post_id = null, $topic_id = null, $forum_id = null) { if ($this->delete($post_id)) { // update last post $this->ForumTopic->updateLastPost($topic_id); // update forum counters $this->ForumTopic->updateCounter('replies', '-', $topic_id); $this->ForumCategory->updateCounter('posts', '-', $forum_id); return true; } return false; } } ?>cakeforum_0.1.1-beta/app/webroot/0000755001171500116310000000000011253743335016067 5ustar web91client26cakeforum_0.1.1-beta/app/webroot/index.php0000644001171500116310000000571711253743332017716 0ustar web91client26dispatch($url); } if (Configure::read() > 0) { echo ""; } ?>cakeforum_0.1.1-beta/app/webroot/css/0000755001171500116310000000000011253743335016657 5ustar web91client26cakeforum_0.1.1-beta/app/webroot/css/forum.css0000644001171500116310000001212111253743335020516 0ustar web91client26body { font-family: Tahoma, Geneva, sans-serif; font-size: 11px; color: #666; margin: 0px; padding: 0px; background-color: #F0F0F0; } a { font-family: Tahoma, Geneva, sans-serif; font-size: 11px; color: #3B5996; } a:hover { text-decoration: none; } .container { width: 780px; margin-right: auto; margin-left: auto; background-color: #FFF; padding-top: 10px; padding-right: 30px; padding-bottom: 20px; padding-left: 30px; } .header { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCC; } .nav { padding-top: 4px; padding-bottom: 4px; text-align: right; padding-right: 5px; background-color: #F9F9F9; padding-left: 5px; } .nav span { float: left; font-weight: bold; } .subnav { padding-top: 5px; padding-bottom: 4px; padding-right: 1px; padding-left: 1px; } .subnav a { text-decoration: none; color: #999; } .subnav a:hover { text-decoration: underline; } .forum-path { padding-top: 8px; font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCC; padding-bottom: 8px; } .forum-path a { color: #666; } .forum-index { } .forum-index table { border-top-width: 1px; border-left-width: 1px; border-top-style: solid; border-left-style: solid; border-top-color: #23567C; border-left-color: #23567C; width: 100%; } .forum-index table th { background-color: #3B5996; text-align: center; color: #FFF; padding: 6px; } .forum-index table tr td { padding: 4px; text-align: center; vertical-align: top; border-right-width: 1px; border-bottom-width: 1px; border-right-style: solid; border-bottom-style: solid; border-right-color: #3B5996; border-bottom-color: #3B5996; } .forum-index table tr.altrow td { background-color: #F8F8F8; } .forum-index table td.leftalign { text-align: left; padding-left: 5px; } .forum-index-title { font-size: 12px; } .forum-index-title a { font-size: 12px; font-weight: bold; text-decoration: none; } .forum-index-title a:hover { text-decoration: underline; } .forum-index-desc { margin-top: 2px; } .forum-topic-title { font-size: 14px; font-weight: bold; color: #3B5996; padding-top: 10px; padding-bottom: 5px; } .forum-topic-date { font-size: 10px; margin-top: 8px; text-align: right; margin-right: 4px; } .forum-topic-date span { float: left; color: #999; } .forum-topic-cp { text-align: right; margin-bottom: 2px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCC; padding-bottom: 3px; } .paging { text-align: left; padding-top: 5px; } .paging a { text-decoration: none; color: #3B5996; padding: 2px; font-weight: bold; } .paging a:hover { text-decoration: none; background-color: #F8F8F8; } .paging .current { color: #FF6701; font-weight: bold; padding: 2px; } .paging .disabled { padding-top: 3px; padding-right: 5px; padding-bottom: 3px; padding-left: 5px; border: 1px solid #FF6701; color: #FF6701; display: none; }.button-newtopic { text-align: right; } .button-newtopic a { font-size: 12px; font-weight: bold; text-decoration: none; background-color: #3B5996; color: #FFF; padding-top: 4px; padding-right: 15px; padding-bottom: 4px; padding-left: 15px; display: inline; text-align: center; margin-right: 2px; margin-left: 2px; width: 100px; } .button-newtopic a:hover { background-color: #2C4270; color: #FFF; } .field { padding-top: 10px; padding-right: 20px; padding-bottom: 10px; padding-left: 20px; } .field label { display: block; width: 100px; float: left; padding-top: 4px; padding-bottom: 3px; text-align: left; color: #3B5996; } .field input { width: 400px; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; font-weight: normal; color: #666; padding: 3px; border: 1px solid #3B5996; } .field textarea { width: 400px; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; font-weight: normal; color: #666; padding: 3px; border: 1px solid #3B5996; } .field select { border: 1px solid #417EA5; font-family: Verdana, Geneva, sans-serif; font-size: 12px; color: #154264; padding: 1px; } .field .error-message{ color: #C00; margin-left: 100px; margin-top: 2px; clear: both; font-weight: bold; } .button { padding-top: 10px; padding-bottom: 5px; border-top-width: 1px; border-top-style: solid; border-top-color: #CCC; text-align: right; } .button input { font-weight: bold; font-family: Tahoma, Geneva, sans-serif; font-size: 12px; color: #FFF; width: 157px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 5px; padding-bottom: 7px; background-color: #3B5996; } .forum-login { padding-right: 200px; padding-left: 200px; padding-top: 10px; padding-bottom: 10px; } .forum-login input { width: 200px; } .forum-login .button { border-top-width: 0px; } .forum-login .button input { padding: 4px; width: 100px; margin-right: 51px; } .footer { text-align: right; margin-top: 15px; color: #999; border-top-width: 1px; border-top-style: solid; border-top-color: #CCC; padding-top: 2px; } #flashMessage { color: #C00; text-align: center; font-weight: bold; padding: 5px; font-size: 12px; } cakeforum_0.1.1-beta/app/webroot/img/0000755001171500116310000000000011253743336016644 5ustar web91client26cakeforum_0.1.1-beta/app/webroot/img/logo.jpg0000644001171500116310000004416611253743336020321 0ustar web91client26JFIFHH2http://ns.adobe.com/xap/1.0/ Adobe Fireworks CS4 2009-07-24T00:56:53Z 2009-07-24T01:04:04Z image/jpeg CC> H ! "12A8Ba#%367QRquvw'5CFHbdE !1A"4Qaq5rs$3R#2%BCEFSc ?P @(P @(P @(P @(iڷci)&Y^W&:QIϐ~l7Tːr2hHȦBhJ;htR(9hUGEn NPE ".C S`z<xݷUvH5qvȊ@LA4ui݄ʹr˄]ÅeUE#1P1cDhPjG-uy V@pvʙ)2C(zzU =^G".kJ%.+Ui{M&[߲!-Dk+rH9V")Ж]B)~NXԪ]_q,Db#3fԙ(P @(P @D\uO 04b9|BN$]"HpMd"Fc*h覸Zos#N?%(Sr 0 J !@`Я-<{PJ}Y/OAb+Z1D6 6]m(yT&O^ۑ+$fT ;Nv! u&!@D~vJԙ|uIl-*q'yzPc&9 8.Dvhco?um<2cQ V̢Xd&yS8( YmdI'͓x IT S@@Emk {yXY]ak#R]!x"C25lLlZ9 Ԅ&5\EzR@p񢖴}oŻ5GHMPU@PC8W)nb](X2ϗcb"u_UWdh@)HP:,c 6L`)JSٶli gu"rM2^7K!_G%g<ܽHmpr{0~ytbiگhF޶{;ޙXZ9Hv &媐D()~B4e(TNb^a؏f2k6]nf\r0l*DeL `>qCb](R2F1k喌͟[.jy8gw~{ eɪWIٯ(QV>?/ۇfk*\Rʙm駪`"r~DMaswƾT÷<8yJ3ZSGkAܾ{[SܼO9hw;vs`XIFt5T?`*#0?3F%vs>멑'1&̜"Py~ѯ+&8\TUCş\\CZ:gPE;~r*QpVA`RAA!S!Q\[vk6"#]ɯ俪&TSJxP]75*yLlz6OC==~==${ӲP)͂"ú\2m#@aLˇ-ɛ.郈 լ*bd̙LݙL(7@8'g{TjOY/m1&P?@{Я-<{Pn%.m%ѫ$nDE )I54!I/gUsl=<,qwfVgŔt7*Q20ҀJ[4Eah_i9spEcm$QU3LFh*rYZӵg6> Xq2Xg $礟$JGl%.mPwISk`^A6r[2͈oEb&PR.˒j`RY)"Qb| ̅%FZCXM֙aMzz罳j֚F|+P;vrAI't:I%hDLugnYv4G>Z+]DHy"Eb}UC]Nj=gc l 3nﲯAA0zJv\n0~ڸRXuj'QUb+Z+m$E.4!'pUp8{KR*I‹NʺDmFfVSCk։ZKjtY]KTLxKDvYڄ!*.=o`]Uie]ȫWfS!e@vv8v!rHٺjdE52!@{4qǭqr!v/|$Oy[c쇵-p_g!x垷S}{5|})7i;85z{R!xwz'~:u(hƷͶdRmd&]r ;(8(c2z^ 9)ZaLD֨ӛv C(q1hzӐ&bLܘ?*JOLjmG-R7ţٗՐDX<b5Ԫ/\*2C#PTj575=טWy~W =\P ż⃼ʑVm  P11;政K %yF5IddWUM`*` 8( C+#n)sa/9m6cԧ[bϪa@{~4Ňи4TrCH\QIÔU FVP3r T*bP cu*vy._圇pv~Yi=٤f\V5#P$ƷȇSTǗkP`{>W|t2#k 7T tlq.) ?QVylT]6$]u\E:3Hd(a.mJc847νT2=H hg֝ H[2)3ⴎ,RRG9Wطbޑ/q}N>$7phQ.eRp޿KWXqOfQ)HHw+v*:aU^HJf}䡻V9avP*RJ"[ L7:R4v%~fkj ҷn B)xg@R Js3XȐ`֮UJyqr>2ur֥;{{T[u{; r9q߽с>_-̗߯9 mJܿH3`klo$5ܳSp/oz}o"t7CbqF'o:G*ݍOXu;[]_%?dcZYO?%izf'^"SȝݜߞW%] j].֖)d(?SΫ{ېg|f QOeA7DQ%Qȁ)A  .%$Wdt ˧( tϸlźc@|ξ-FGuOfH iNB6Aw6nA jO`) 1×Z~e_INE6 &إX~|Әwps7x[v{V'>Q I)f8XAvmt ,Q 'U m( Y`v|Ǐ<ᐈ<"(R7 \"U8oZCl%WI=nݹY Iکr}u&LK/{&<{7FUDNrf {%_E=vS]׻(-&v%myOItv PՇlijDW''*|Q$[5 䩡I^Yv2ll&vcRg*93Ģ9 _}pQwmwZ~ъdгщ0;q3#[:u$(sK!"EWGJH{i2cLcsb։hL,W?ZJY6Ckʦ2S pvۋP|I7u=tDh}䍷Y&,\- j=eF36ϊBs?kjfJE+sA*0UTʊR!EPQPɄywod9XaM 井?\';bn=ikM,lN\Es@=jL\rXÙBD'dC5 Rtf^<-Hr)vc #z܃T "j;:i1s667m.v?$tdnZeД)$%V^ 1V1\$ꞗ CZm\F?p  ;D*]~]UۗNnXbLT1*4Ԧ~'F=@Y+ݒVF8fຶة RJ:r^΋2L6M5ohd?3Ӡ3N%XHS {fqq-GJXZ0`9 tᧁ8GkRCR&{aX !弁a_.~k T@ hGw:uOy*pU)'*6MZ2eҟ"T!B(P @(P @(P @(P @(P @(P @(P @(P @cakeforum_0.1.1-beta/app/webroot/js/0000755001171500116310000000000011253743336016504 5ustar web91client26cakeforum_0.1.1-beta/app/webroot/js/vendors.php0000644001171500116310000000250611253743336020700 0ustar web91client26 * Copyright 2005-2007, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.js * @since CakePHP(tm) v 0.2.9 * @version $Revision: 5318 $ * @modifiedby $LastChangedBy: phpnut $ * @lastmodified $Date: 2007-06-20 04:01:21 -0500 (Wed, 20 Jun 2007) $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** * Enter description here... */ $file = $_GET['file']; $pos = strpos($file, '..'); if ($pos === false) { if (is_file('../../vendors/javascript/'.$file) && (preg_match('/(\/.+)\\.js/', $file))) { readfile('../../vendors/javascript/'.$file); } } else { header('HTTP/1.1 404 Not Found'); } ?>cakeforum_0.1.1-beta/app/webroot/css.php0000644001171500116310000000565011253743332017373 0ustar web91client26compress($data); $ratio = 100 - (round(strlen($output) / strlen($data), 3) * 100); $output = " /* file: $name, ratio: $ratio% */ " . $output; return $output; } /** * Enter description here... * * @param unknown_type $path * @param unknown_type $content * @return unknown */ function write_css_cache($path, $content) { if (!is_dir(dirname($path))) { mkdir(dirname($path)); } $cache = new File($path); return $cache->write($content); } if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) { die('Wrong file name.'); } $filename = 'css/' . $regs[1]; $filepath = CSS . $regs[1]; $cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]); if (!file_exists($filepath)) { die('Wrong file name.'); } if (file_exists($cachepath)) { $templateModified = filemtime($filepath); $cacheModified = filemtime($cachepath); if ($templateModified > $cacheModified) { $output = make_clean_css($filepath, $filename); write_css_cache($cachepath, $output); } else { $output = file_get_contents($cachepath); } } else { $output = make_clean_css($filepath, $filename); write_css_cache($cachepath, $output); $templateModified = time(); } header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT'); header("Content-Type: text/css"); header("Expires: " . gmdate("D, d M Y H:i:s", time() + DAY) . " GMT"); header("Cache-Control: max-age=86400, must-revalidate"); // HTTP/1.1 header("Pragma: cache"); // HTTP/1.0 print $output; ?>cakeforum_0.1.1-beta/app/webroot/.htaccess0000644001171500116310000000027111253743332017662 0ustar web91client26 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] cakeforum_0.1.1-beta/app/tmp/0000755001171500116310000000000011253743335015206 5ustar web91client26cakeforum_0.1.1-beta/app/tmp/logs/0000755001171500116310000000000011253743332016147 5ustar web91client26cakeforum_0.1.1-beta/app/tmp/cache/0000755001171500116310000000000011253743335016251 5ustar web91client26cakeforum_0.1.1-beta/app/tmp/cache/models/0000755001171500116310000000000011253743335017534 5ustar web91client26cakeforum_0.1.1-beta/app/tmp/cache/persistent/0000755001171500116310000000000011253743335020451 5ustar web91client26cakeforum_0.1.1-beta/app/views/0000755001171500116310000000000011253743335015543 5ustar web91client26cakeforum_0.1.1-beta/app/views/forum/0000755001171500116310000000000011253743334016672 5ustar web91client26cakeforum_0.1.1-beta/app/views/forum/newposts.php0000644001171500116310000000002711253743334021264 0ustar web91client26cakeforum_0.1.1-beta/app/views/forum/index.php0000644001171500116310000000313611253743334020515 0ustar web91client26
>
Forum Topics Posts Last topic
link($cat['ForumCategory']['name'], array('controller' => 'forum', 'action' => 'view', $cat['ForumCategory']['id'])); ?>
link($cat['ForumCategory']['last_topic_subject'], array('controller' => 'forum', 'action' => 'topic', $cat['ForumCategory']['last_topic_id'], $cat['ForumCategory']['id'])); ?>
format('d.m.Y H:i', $cat['ForumCategory']['last_topic_created']); ?> | link($cat['ForumCategory']['last_topic_username'], array('controller' => 'users', 'action' => 'profile', $cat['ForumCategory']['last_topic_username'])); ?>
cakeforum_0.1.1-beta/app/views/forum/reply.php0000644001171500116310000000151011253743334020533 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » link($forumName, array('controller' => 'forum', 'action' => 'view', $forumId)); ?> » link($topicSubject, array('controller' => 'forum', 'action' => 'topic', $topicId, $forumId)); ?>
Reply
hidden('ForumTopic.forum_category_id'); ?>
textarea('ForumPost.text', array('rows' => 10)); ?>
error('ForumPost.text', 'Message is required!'); ?>
cakeforum_0.1.1-beta/app/views/forum/newtopic.php0000644001171500116310000000200511253743334021230 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » link($forumName, array('controller' => 'forum', 'action' => 'view', $forumId)); ?>
Add new topic
create('ForumTopic'); ?>
text('ForumTopic.subject'); ?>
error('ForumTopic.subject', 'Subject is required!'); ?>
textarea('ForumTopic.text', array('rows' => 10)); ?>
error('ForumTopic.text', 'Message is required'); ?>
end('ForumTopic'); ?> cakeforum_0.1.1-beta/app/views/forum/topic.php0000644001171500116310000000427011253743334020524 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » link($forumName, array('controller' => 'forum', 'action' => 'view', $forumId)); ?>
Author Message
link($post['User']['username'], array('controller' => 'users', 'action' => 'profile', $post['User']['username'])); ?> id()): ?>
link('Edit', array('controller' => 'forum', 'action' => 'editpost', $post['ForumPost']['id'], $topicId, $forumId)); ?> | link('Delete', array('controller' => 'forum', 'action' => 'deletepost', $post['ForumPost']['id'], $topicId, $forumId)); ?>
ID: Date: format('d.m.Y H:i',$post['ForumPost']['created']); ?>
options(array('url' => $this->passedArgs,)); echo $paginator->prev("« back", array(), null, array('class'=>'disabled')); echo $paginator->numbers(array('before' => '', 'after' => '', 'separator' => '')); echo $paginator->next('forward »', array(), null, array('class'=>'disabled')); ?>
link('New topic', array('controller' => 'forum', 'action' => 'newtopic', $forumId)); ?> link('Post reply', array('controller' => 'forum', 'action' => 'reply', $topicId, $forumId)); ?>
cakeforum_0.1.1-beta/app/views/forum/unanswered.php0000644001171500116310000000343211253743334021560 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » Unanswered topics
>
Topic Author Replies Views Last post
link($topic['ForumTopic']['subject'], array('controller' => 'forum', 'action' => 'topic', $topic['ForumTopic']['id'], $topic['ForumTopic']['forum_category_id'])); ?> link($topic['User']['username'], array('controller' => 'users', 'action' => 'profile', $topic['User']['username'])); ?> link('»»»', array( 'controller' => 'forum', 'action' => 'topic', $topic['ForumTopic']['id'], $topic['ForumTopic']['forum_category_id'], 'page:' . $topic['ForumTopic']['last_post_page']. '#' . $topic['ForumTopic']['last_post_id'] ) ); ?>
format('d.m.Y H:i', $topic['ForumTopic']['last_post_created']); ?> | link($topic['ForumTopic']['last_post_username'], array('controller' => 'users', 'action' => 'profile', $topic['ForumTopic']['last_post_username'])); ?>
cakeforum_0.1.1-beta/app/views/forum/view.php0000644001171500116310000000445111253743334020361 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » link($forumName, array('controller' => 'forum', 'action' => 'view', $forumId)); ?>
>
Topic Author Replies Views Last post
link($topic['ForumTopic']['subject'], array('controller' => 'forum', 'action' => 'topic', $topic['ForumTopic']['id'], $forumId)); ?> link($topic['User']['username'], array('controller' => 'users', 'action' => 'profile', $topic['User']['username'])); ?> link('»»»', array( 'controller' => 'forum', 'action' => 'topic', $topic['ForumTopic']['id'], $forumId, 'page:' . $topic['ForumTopic']['last_post_page']. '#' . $topic['ForumTopic']['last_post_id'] ) ); ?>
format('d.m.Y H:i', $topic['ForumTopic']['last_post_created']); ?> | link($topic['ForumTopic']['last_post_username'], array('controller' => 'users', 'action' => 'profile', $topic['ForumTopic']['last_post_username'])); ?>
options(array( 'url' => $this->passedArgs, ) ); echo $paginator->prev("« back", array(), null, array('class'=>'disabled')); echo $paginator->numbers(array('before' => '', 'after' => '', 'separator' => '')); echo $paginator->next('forward »', array(), null, array('class'=>'disabled')); ?>
link('New topic', array('controller' => 'forum', 'action' => 'newtopic', $forumId)); ?>
cakeforum_0.1.1-beta/app/views/forum/editpost.php0000644001171500116310000000136411253743334021242 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » link($forumName, array('controller' => 'forum', 'action' => 'view', $forumID)); ?> » link($topicSubject, array('controller' => 'forum', 'action' => 'topic', $topicID, $forumID)); ?>
Edit post
textarea('ForumPost.text', array('rows' => 10)); ?>
error('ForumPost.text'); ?>
cakeforum_0.1.1-beta/app/views/forum/edittopic.php0000644001171500116310000000200611253743334021365 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » link($forumName, array('controller' => 'forum', 'action' => 'view', $forumID)); ?> » link($topicSubject, array('controller' => 'forum', 'action' => 'topic', $topicID, $forumID)); ?>
Edit topic
text('ForumTopic.subject', array('rows' => 10)); ?>
error('ForumTopic.subject', 'Topic subject is required!'); ?>
textarea('ForumPost.text', array('rows' => 10)); ?>
error('ForumPost.text', 'Message is required'); ?>
cakeforum_0.1.1-beta/app/views/helpers/0000755001171500116310000000000011253743334017204 5ustar web91client26cakeforum_0.1.1-beta/app/views/helpers/user.php0000644001171500116310000000211111253743334020666 0ustar web91client26Session->read('Auth'); if (isset($ses['User'][$arg])) { return $ses['User'][$arg]; } else { return false; } } /** * Get username */ public function username() { return $this->read('username'); } /** * Get user group id */ public function group() { return $this->read('group_id'); } /** * Is user logged in */ public function isLogged() { return $this->read('id'); } /** * Get user ID */ public function id() { return $this->read('id'); } } ?>cakeforum_0.1.1-beta/app/views/layouts/0000755001171500116310000000000011253743335017243 5ustar web91client26cakeforum_0.1.1-beta/app/views/layouts/blank.php0000644001171500116310000000004211253743335021037 0ustar web91client26cakeforum_0.1.1-beta/app/views/layouts/email/0000755001171500116310000000000011253743336020333 5ustar web91client26cakeforum_0.1.1-beta/app/views/layouts/email/html/0000755001171500116310000000000011253743336021277 5ustar web91client26cakeforum_0.1.1-beta/app/views/layouts/email/html/default.php0000644001171500116310000000004111253743336023427 0ustar web91client26cakeforum_0.1.1-beta/app/views/layouts/email/text/0000755001171500116310000000000011253743337021320 5ustar web91client26cakeforum_0.1.1-beta/app/views/layouts/email/text/default.php0000644001171500116310000000004111253743337023450 0ustar web91client26cakeforum_0.1.1-beta/app/views/layouts/default.php0000644001171500116310000000212011253743335021373 0ustar web91client26 CakeForum » <?php echo $title_for_layout?> css('forum');?>
image('logo.jpg', array('alt' => 'CakeForum'))?>
cakeforum_0.1.1-beta/app/views/users/0000755001171500116310000000000011253743335016704 5ustar web91client26cakeforum_0.1.1-beta/app/views/users/login.php0000644001171500116310000000135711253743335020533 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » Login
cakeforum_0.1.1-beta/app/views/users/profile.php0000644001171500116310000000051511253743335021056 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> »
User:
Joined: format('d.m.Y H:i', $data['User']['created']); ?>cakeforum_0.1.1-beta/app/views/users/register.php0000644001171500116310000000335211253743335021244 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » Register
cakeforum_0.1.1-beta/app/views/users/registered.php0000644001171500116310000000032111253743335021546 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » Registered

You Have Successfully Registered!

Now you can login...

cakeforum_0.1.1-beta/app/views/users/account.php0000644001171500116310000000427611253743335021062 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » Account
cakeforum_0.1.1-beta/app/views/users/lostpassword.php0000644001171500116310000000071411253743335022163 0ustar web91client26
link('Forum index', array('controller' => 'forum', 'action' => 'index')); ?> » Lost password
cakeforum_0.1.1-beta/app/views/elements/0000755001171500116310000000000011253743336017360 5ustar web91client26cakeforum_0.1.1-beta/app/views/elements/email/0000755001171500116310000000000011253743336020447 5ustar web91client26cakeforum_0.1.1-beta/app/views/elements/email/html/0000755001171500116310000000000011253743337021414 5ustar web91client26cakeforum_0.1.1-beta/app/views/elements/email/html/lostpassword.php0000644001171500116310000000050711253743337024673 0ustar web91client26

Hello ,
You made a request for lost password on CakeForum.
To reset your password please click on following link:
http:///users/reset/

cakeforum_0.1.1-beta/app/views/elements/email/html/newpassword.php0000644001171500116310000000036611253743337024506 0ustar web91client26

Hello ,
Your password on CakeForum has been reset.
Your new password is:
You can now login at: http://

cakeforum_0.1.1-beta/app/views/elements/email/text/0000755001171500116310000000000011253743337021434 5ustar web91client26cakeforum_0.1.1-beta/app/views/elements/email/text/lostpassword.php0000644001171500116310000000033111253743337024706 0ustar web91client26Hello , You made a request for lost password on CakeForum. To reset your password please click on following link: http:///users/reset/cakeforum_0.1.1-beta/app/views/elements/email/text/newpassword.php0000644001171500116310000000026311253743337024522 0ustar web91client26Hello , Your password on CakeForum has been reset. Your new password is: You can now login at: http://cakeforum_0.1.1-beta/app/index.php0000644001171500116310000000170311253743330016222 0ustar web91client26cakeforum_0.1.1-beta/VERSION.txt0000644001171500116310000000001211253743330015500 0ustar web91client260.1.1 betacakeforum_0.1.1-beta/INSTALL.txt0000644001171500116310000000061011253743330015465 0ustar web91client26 INSTALLATION INSTRUCTIONS 1. Download CakePHP v. 1.2.x (www.cakephp.org) 2. Extract CakePHP into your webserver then replace /app folder with /app folder from CakeForum 3. Import the cakeforum.sql from the /app/config/sql folder into your database 4. Edit database.php and bootstrap.php in 'app/config' 5. Edit table 'forum_categories' in database and add forum categories. 6. Run CakeForumcakeforum_0.1.1-beta/LICENSE.txt0000644001171500116310000000207111253743330015444 0ustar web91client26The MIT License CakeForum (http://cakeforum.inservio.ba) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.