Ejemplo n.º 1
0
 static function __install()
 {
     $sql = SQL::current();
     $sql->query("CREATE TABLE IF NOT EXISTS __types (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             name VARCHAR(100) DEFAULT '',\n                             description TEXT,\n                             color VARCHAR(6) DEFAULT '0A0A0A'\n                             clean VARCHAR(100) DEFAULT '',\n                             url VARCHAR(100) DEFAULT '',\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __extensions (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             name VARCHAR(100) DEFAULT '',\n                             clean VARCHAR(100) DEFAULT '',\n                             url VARCHAR(100) DEFAULT '',\n                             type_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __versions (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             number VARCHAR(100) DEFAULT '',\n                             description TEXT,\n                             compatible TEXT,\n                             tags TEXT,\n                             filename VARCHAR(100) DEFAULT '',\n                             image VARCHAR(100) DEFAULT '',\n                             loves INTEGER DEFAULT 0,\n                             downloads INTEGER DEFAULT 0,\n                             extension_id INTEGER DEFAULT 0,\n                             created_at DATETIME DEFAULT '0000-00-00 00:00:00',\n                             updated_at DATETIME DEFAULT '0000-00-00 00:00:00'\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __loves (\n                             version_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0,\n                             PRIMARY KEY (version_id, user_id)\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __notes (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             body LONGTEXT,\n                             version_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0,\n                             created_at DATETIME DEFAULT '0000-00-00 00:00:00',\n                             updated_at DATETIME DEFAULT '0000-00-00 00:00:00'\n                         ) DEFAULT CHARSET=utf8");
     Group::add_permission("add_type", "Add Type");
     Group::add_permission("add_extension", "Add Extension");
     Group::add_permission("add_note", "Add Note");
     Group::add_permission("edit_type", "Edit Type");
     Group::add_permission("edit_extension", "Edit Extension");
     Group::add_permission("edit_note", "Edit Note");
     Group::add_permission("edit_own_extension", "Edit Own Extension");
     Group::add_permission("edit_own_note", "Edit Own Note");
     Group::add_permission("delete_type", "Delete Type");
     Group::add_permission("delete_extension", "Delete Extension");
     Group::add_permission("delete_note", "Delete Note");
     Group::add_permission("delete_own_extension", "Delete Own Extension");
     Group::add_permission("delete_own_note", "Delete Own Note");
     Group::add_permission("code_in_extensions", "Can Use HTML In Extensions");
     Group::add_permission("code_in_notes", "Can Use HTML In Notes");
     Group::add_permission("love_extension", "Love Extensions");
 }
Ejemplo n.º 2
0
 static function __install()
 {
     $config = Config::current();
     $config->set("last_aggregation", 0);
     $config->set("aggregate_every", 30);
     $config->set("disable_aggregation", false);
     $config->set("aggregates", array());
     Group::add_permission("add_aggregate", "Add Aggregate");
     Group::add_permission("edit_aggregate", "Edit Aggregate");
     Group::add_permission("delete_aggregate", "Delete Aggregate");
 }
Ejemplo n.º 3
0
 static function __install()
 {
     $sql = SQL::current();
     $sql->query("CREATE TABLE IF NOT EXISTS __comments (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             body LONGTEXT,\n                             author VARCHAR(250) DEFAULT '',\n                             author_url VARCHAR(128) DEFAULT '',\n                             author_email VARCHAR(128) DEFAULT '',\n                             author_ip INTEGER DEFAULT '0',\n                             author_agent VARCHAR(255) DEFAULT '',\n                             status VARCHAR(32) default 'denied',\n                             signature VARCHAR(32) DEFAULT '',\n                             post_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0,\n                             created_at DATETIME DEFAULT NULL,\n                             updated_at DATETIME DEFAULT NULL\n                         ) DEFAULT CHARSET=utf8");
     $config = Config::current();
     $config->set("default_comment_status", "denied");
     $config->set("allowed_comment_html", array("strong", "em", "blockquote", "code", "pre", "a"));
     $config->set("comments_per_page", 25);
     $config->set("defensio_api_key", null);
     $config->set("auto_reload_comments", 30);
     $config->set("enable_reload_comments", false);
     Group::add_permission("add_comment", "Add Comments");
     Group::add_permission("add_comment_private", "Add Comments to Private Posts");
     Group::add_permission("edit_comment", "Edit Comments");
     Group::add_permission("edit_own_comment", "Edit Own Comments");
     Group::add_permission("delete_comment", "Delete Comments");
     Group::add_permission("delete_own_comment", "Delete Own Comments");
     Group::add_permission("code_in_comments", "Can Use HTML In Comments");
 }
Ejemplo n.º 4
0
 static function __install()
 {
     $sql = SQL::current();
     $sql->query("CREATE TABLE IF NOT EXISTS __milestones (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             name VARCHAR(100) DEFAULT '',\n                             description TEXT,\n                             due DATETIME DEFAULT '0000-00-00 00:00:00'\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __tickets (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             title VARCHAR(100) DEFAULT '',\n                             description LONGTEXT,\n                             state VARCHAR(100) DEFAULT 'new',\n                             clean VARCHAR(100) DEFAULT '',\n                             url VARCHAR(100) DEFAULT '',\n                             milestone_id INTEGER DEFAULT 0,\n                             owner_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0,\n                             created_at DATETIME DEFAULT '0000-00-00 00:00:00',\n                             updated_at DATETIME DEFAULT '0000-00-00 00:00:00'\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __revisions (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             body LONGTEXT,\n                             changes TEXT,\n                             ticket_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0,\n                             created_at DATETIME DEFAULT '0000-00-00 00:00:00',\n                             updated_at DATETIME DEFAULT '0000-00-00 00:00:00'\n                         ) DEFAULT CHARSET=utf8");
     Group::add_permission("add_milestone", "Add Milestone");
     Group::add_permission("add_ticket", "Add Ticket");
     Group::add_permission("add_revision", "Add Revision");
     Group::add_permission("edit_milestone", "Edit Milestone");
     Group::add_permission("edit_ticket", "Edit Ticket");
     Group::add_permission("edit_revision", "Edit Revision");
     Group::add_permission("edit_own_ticket", "Edit Own Ticket");
     Group::add_permission("edit_own_revision", "Edit Own Revision");
     Group::add_permission("delete_milestone", "Delete Milestone");
     Group::add_permission("delete_ticket", "Delete Ticket");
     Group::add_permission("delete_revision", "Delete Revision");
     Group::add_permission("delete_own_ticket", "Delete Own Ticket");
     Group::add_permission("delete_own_revision", "Delete Own Revision");
     Group::add_permission("code_in_revisions", "Can Use HTML In Revisions");
 }
Ejemplo n.º 5
0
 static function __install()
 {
     $sql = SQL::current();
     $sql->query("CREATE TABLE IF NOT EXISTS __forums (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             name VARCHAR(100) DEFAULT '',\n                             description TEXT,\n                             `order` INTEGER DEFAULT 0,\n                             clean VARCHAR(100) DEFAULT '',\n                             url VARCHAR(100) DEFAULT ''\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __messages (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             body LONGTEXT,\n                             topic_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0,\n                             created_at DATETIME DEFAULT '0000-00-00 00:00:00',\n                             updated_at DATETIME DEFAULT '0000-00-00 00:00:00'\n                         ) DEFAULT CHARSET=utf8");
     $sql->query("CREATE TABLE IF NOT EXISTS __topics (\n                             id INTEGER PRIMARY KEY AUTO_INCREMENT,\n                             title VARCHAR(100) DEFAULT '',\n                             description LONGTEXT,\n                             clean VARCHAR(100) DEFAULT '',\n                             url VARCHAR(100) DEFAULT '',\n                             view_count INTEGER DEFAULT 0,\n                             forum_id INTEGER DEFAULT 0,\n                             user_id INTEGER DEFAULT 0,\n                             created_at DATETIME DEFAULT '0000-00-00 00:00:00',\n                             updated_at DATETIME DEFAULT '0000-00-00 00:00:00'\n                         ) DEFAULT CHARSET=utf8");
     Group::add_permission("add_forum", "Add Forum");
     Group::add_permission("add_topic", "Add Topic");
     Group::add_permission("add_message", "Add Message");
     Group::add_permission("edit_forum", "Edit Forum");
     Group::add_permission("edit_topic", "Edit Topic");
     Group::add_permission("edit_message", "Edit Message");
     Group::add_permission("edit_own_topic", "Edit Own Topic");
     Group::add_permission("edit_own_message", "Edit Own Message");
     Group::add_permission("delete_forum", "Delete Forum");
     Group::add_permission("delete_topic", "Delete Topic");
     Group::add_permission("delete_message", "Delete Message");
     Group::add_permission("delete_own_topic", "Delete Own Topic");
     Group::add_permission("delete_own_message", "Delete Own Message");
     Group::add_permission("code_in_topics", "Can Use HTML In Topics");
     Group::add_permission("code_in_messages", "Can Use HTML In Messages");
 }
Ejemplo n.º 6
0
 static function __install()
 {
     Category::installCategorize();
     Group::add_permission("manage_categorize", "Manage Categories");
     Route::current()->add("category/(name)/", "category");
 }
Ejemplo n.º 7
0
 static function __install()
 {
     Group::add_permission("submit_article", "Submit Aritcles");
     Route::current()->add("submit/", "submit");
 }
Ejemplo n.º 8
0
 static function install()
 {
     SQL::current()->query("CREATE TABLE IF NOT EXISTS __likes (\n                                     id INTEGER(10) NOT NULL AUTO_INCREMENT,\n                                     post_id INTEGER NOT NULL,\n                                     user_id INTEGER NOT NULL,\n                                     timestamp DATETIME DEFAULT NULL,\n                                     session_hash VARCHAR(32) NOT NULL,\n                                     PRIMARY KEY (id),\n                                     KEY key_post_id (post_id),\n                                     UNIQUE key_post_id_sh_pair (post_id, session_hash)\n                                   ) DEFAULT CHARSET=utf8");
     Group::add_permission("like_post", "Like Posts");
     Group::add_permission("unlike_post", "Unlike Posts");
     $likeText = array(0 => "You like this.", 1 => "You and 1 other like this.", 2 => "You and %NUM% other like this.", 3 => "Be the first to like.", 4 => "1 person likes this.", 5 => "%NUM% people like this.", 6 => "Like", 7 => "Unlike");
     $config = Config::current();
     $set = array($config->set("module_like", array("showOnFront" => true, "likeWithText" => false, "likeImage" => $config->chyrp_url . "/modules/likes/images/like.png", "likeText" => $likeText)));
 }