Beispiel #1
0
 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $counters = array();
     foreach (glob("ext/home/counters/*") as $counter_dirname) {
         $name = str_replace("ext/home/counters/", "", $counter_dirname);
         $counters[ucfirst($name)] = $name;
     }
     $sb = new SetupBlock("Home Page");
     $sb->add_longtext_option("home_links", 'Page Links (Use BBCode, leave blank for defaults)');
     $sb->add_longtext_option("home_text", "<br>Page Text:<br>");
     $sb->add_choice_option("home_counter", $counters, "<br>Counter: ");
     $event->panel->add_block($sb);
 }
Beispiel #2
0
 public function onSetupBuilding($event)
 {
     $counters = array();
     foreach (glob("ext/home/counters/*") as $counter_dirname) {
         $name = str_replace("ext/home/counters/", "", $counter_dirname);
         $counters[ucfirst($name)] = $name;
     }
     $sb = new SetupBlock("Home Page");
     $sb->add_longtext_option("home_links", 'Page Links - Example: [/post/list|Posts]<br>');
     $sb->add_longtext_option("home_text", "<br>Page Text:<br>");
     $sb->add_choice_option("home_counter", $counters, "<br>Counter: ");
     $event->panel->add_block($sb);
 }
Beispiel #3
0
 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Word Filter");
     $sb->add_longtext_option("word_filter");
     $sb->add_label("<br>(each line should be search term and replace term, separated by a comma)");
     $event->panel->add_block($sb);
 }
Beispiel #4
0
 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Banned Phrases");
     $sb->add_label("One per line, lines that start with slashes are treated as regex<br/>");
     $sb->add_longtext_option("banned_words");
     $event->panel->add_block($sb);
 }
Beispiel #5
0
 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("Blocks");
     $sb->add_label("See <a href='" . make_link("ext_doc/blocks") . "'>the docs</a> for formatting");
     $sb->add_longtext_option("blocks_text");
     $event->panel->add_block($sb);
 }
Beispiel #6
0
 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Downtime");
     $sb->add_bool_option("downtime", "Disable non-admin access: ");
     $sb->add_longtext_option("downtime_message", "<br>");
     $event->panel->add_block($sb);
 }
Beispiel #7
0
 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Custom HTML Headers");
     // custom headers
     $sb->add_longtext_option("custom_html_headers", "HTML Code to place within &lt;head&gt;&lt;/head&gt; on all pages<br>");
     // modified title
     $sb->add_choice_option("sitename_in_title", array("none" => 0, "as prefix" => 1, "as suffix" => 2), "<br>Add website name in title");
     $event->panel->add_block($sb);
 }
Beispiel #8
0
 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Mailing Options");
     $sb->add_text_option("mail_sub", "Subject prefix: ");
     $sb->add_text_option("mail_img", "<br>Banner Image URL: ");
     $sb->add_text_option("mail_style", "<br>Style URL: ");
     $sb->add_longtext_option("mail_fot", "<br>Footer (Use HTML)");
     $sb->add_label("<br><i>Should measure 550x110px. Use an absolute URL</i>");
     $event->panel->add_block($sb);
 }
Beispiel #9
0
 public function receive_event(Event $event)
 {
     if ($event instanceof TextFormattingEvent) {
         $event->formatted = $this->filter($event->formatted);
         $event->stripped = $this->filter($event->stripped);
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Word Filter");
         $sb->add_longtext_option("word_filter");
         $sb->add_label("<br>(each line should be search term and replace term, separated by a comma)");
         $event->panel->add_block($sb);
     }
 }
Beispiel #10
0
 public function onSetupBuilding(SetupBuildingEvent $event)
 {
     $sb = new SetupBlock("Banned Phrases");
     $sb->add_label("One per line, lines that start with slashes are treated as regex<br/>");
     $sb->add_longtext_option("banned_words");
     $failed = array();
     foreach ($this->get_words() as $word) {
         if ($word[0] == '/') {
             if (preg_match($word, "") === false) {
                 $failed[] = $word;
             }
         }
     }
     if ($failed) {
         $sb->add_label("Failed regexes: " . join(", ", $failed));
     }
     $event->panel->add_block($sb);
 }
Beispiel #11
0
 public function receive_event(Event $event)
 {
     global $config, $database, $page, $user;
     if (is_null($this->theme)) {
         $this->theme = get_theme_object($this);
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Downtime");
         $sb->add_bool_option("downtime", "Disable non-admin access: ");
         $sb->add_longtext_option("downtime_message", "<br>");
         $event->panel->add_block($sb);
     }
     if ($event instanceof PageRequestEvent) {
         if ($config->get_bool("downtime")) {
             $this->check_downtime($event);
             $this->theme->display_notification($page);
         }
     }
 }
Beispiel #12
0
 public function receive_event(Event $event)
 {
     if ($event instanceof InitExtEvent) {
         global $config;
         $config->set_default_string('banned_words', "\nviagra\nporn\n\t\t\t");
     }
     if ($event instanceof CommentPostingEvent) {
         global $config;
         $banned = $config->get_string("banned_words");
         $comment = strtolower($event->comment);
         foreach (explode("\n", $banned) as $word) {
             $word = trim(strtolower($word));
             if (strlen($word) == 0) {
                 // line is blank
                 continue;
             } else {
                 if ($word[0] == '/') {
                     // lines that start with slash are regex
                     if (preg_match($word, $comment)) {
                         throw new CommentPostingException("Comment contains banned terms");
                     }
                 } else {
                     // other words are literal
                     if (strpos($comment, $word) !== false) {
                         throw new CommentPostingException("Comment contains banned terms");
                     }
                 }
             }
         }
     }
     if ($event instanceof SetupBuildingEvent) {
         $sb = new SetupBlock("Banned Phrases");
         $sb->add_label("One per line, lines that start with slashes are treated as regex<br/>");
         $sb->add_longtext_option("banned_words");
         $event->panel->add_block($sb);
     }
 }
Beispiel #13
0
 public function onSetupBuilding(Event $event)
 {
     global $config;
     $hosts = array("None" => "none", "Gravatar" => "gravatar");
     $sb = new SetupBlock("User Options");
     $sb->add_bool_option("login_signup_enabled", "Allow new signups: ");
     $sb->add_longtext_option("login_tac", "<br>Terms &amp; Conditions:<br>");
     $sb->add_choice_option("avatar_host", $hosts, "<br>Avatars: ");
     if ($config->get_string("avatar_host") == "gravatar") {
         $sb->add_label("<br>&nbsp;<br><b>Gravatar Options</b>");
         $sb->add_choice_option("avatar_gravatar_type", array('Default' => 'default', 'Wavatar' => 'wavatar', 'Monster ID' => 'monsterid', 'Identicon' => 'identicon'), "<br>Type: ");
         $sb->add_choice_option("avatar_gravatar_rating", array('G' => 'g', 'PG' => 'pg', 'R' => 'r', 'X' => 'x'), "<br>Rating: ");
     }
     $event->panel->add_block($sb);
 }
Beispiel #14
0
 public function onSetupBuilding(Event $event)
 {
     $sb = new SetupBlock("User Options");
     $sb->add_bool_option("login_signup_enabled", "Allow new signups: ");
     $sb->add_longtext_option("login_tac", "<br>Terms &amp; Conditions:<br>");
     $event->panel->add_block($sb);
 }
Beispiel #15
0
 public function onSetupBuilding($event)
 {
     $sb = new SetupBlock("News");
     $sb->add_longtext_option("news_text");
     $event->panel->add_block($sb);
 }