From 7f8c54249dea60f624e3f90b6c29adbd1207781b Mon Sep 17 00:00:00 2001
From: Benjamin Southall
+ Please use to the form below to apply to be staff.
+ If you don't want to use this form you can also email admin@lainchan.org or ask in #questions on the Lainchan IRC channel.
+ In the rest of your application section, please specify the following information:
+ Do you have to specify all the requested information below ?
+ No of course not, but the more you specify the more likely your application will be approved, because applications
+ that demostrate that you can put effort in things, tell us that you can be bothered putting effort into things.
+ What position you wanted to apply for ? E.g. Chan staff ? IRC staff ? Sysadmin ? Developer ? All of the above ?
+ None of the above ? Special snowflake role invented just for you ?
+ Your reasons for applying ?
+ Your existing qualifications for the position
+ A summary of your strengths, weaknesses and interesting points / quirks
+ If chan staff , then please specify which boards you are interested in and your experience with their subject matter.
+
+ Things to not include on your application.
+ 1. NSFW pictures
+ 2. Anything that is against the rules on the Rules page.
+ 3. Short stories about ducks and ribbons and that guy Jimmy and other off topic things.
+ 4. Your entire life story.
+ 5. Your passport number or SSN and / or other identifying information.
+ 6. Your rant about XYZ and how much all ABC need to suffer DEF because of it.
+ {{ settings.title }}
+
+
+
+
+
+
+
diff --git a/templates/themes/calendar/calendarpost.php b/templates/themes/calendar/calendarpost.php
new file mode 100644
index 00000000..a36e080c
--- /dev/null
+++ b/templates/themes/calendar/calendarpost.php
@@ -0,0 +1,53 @@
+bindValue(':title', $title);
+ $query->bindValue(':description', $description);
+ $query->bindValue(':start', $start);
+ $query->bindValue(':end', $end);
+ $query->bindValue(':url', $url);
+ $query->bindValue(':color', $color);
+ $query->execute() or error(db_error($query));
+ break;
+ case "delete":
+ $id = $_POST['id'];
+ $query = query("DELETE from calendar_events WHERE id = :id") or error(db_error());
+ break;
+ case "update":
+ $id = $_POST['id'];
+ $title = $_POST['title'];
+ $description = $_POST['description'];
+ $start = $_POST['start'];
+ $end = $_POST['end'];
+ $query = prepare(" UPDATE calendar_events SET title = :title, description = :description, start = :start, end = :end, url = :url, color =:color WHERE id = :id");
+ $query->bindValue(':id', $id);
+ $query->bindValue(':title', $title);
+ $query->bindValue(':description', $description);
+ $query->bindValue(':start', $start);
+ $query->bindValue(':end', $end);
+ $query->bindValue(':url', $url);
+ $query->bindValue(':color', $color);
+ $query->execute() or error(db_error($query));
+ break;
+ default:
+ }
+ } elseif ($method == 'GET') {
+ // Method is GET
+ $query = query("SELECT * FROM calendar_events ORDER BY id") or error(db_error());
+ echo json_encode($query->fetchAll(PDO::FETCH_ASSOC));
+ }
+
+?>
diff --git a/templates/themes/calendar/info.php b/templates/themes/calendar/info.php
new file mode 100644
index 00000000..0687a26d
--- /dev/null
+++ b/templates/themes/calendar/info.php
@@ -0,0 +1,36 @@
+ 'Site title',
+ 'name' => 'title',
+ 'type' => 'text'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Slogan',
+ 'name' => 'subtitle',
+ 'type' => 'text',
+ 'comment' => '(optional)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'File',
+ 'name' => 'file',
+ 'type' => 'text',
+ 'default' => $config['file_index'],
+ 'comment' => '(eg. "index.html")'
+ );
+
+ // Unique function name for building everything
+ $theme['build_function'] = 'calendar_build';
+
diff --git a/templates/themes/calendar/theme.php b/templates/themes/calendar/theme.php
new file mode 100644
index 00000000..8e9d32db
--- /dev/null
+++ b/templates/themes/calendar/theme.php
@@ -0,0 +1,40 @@
+ $settings,
+ 'config' => $config,
+ 'boardlist' => createBoardlist()
+ ));
+ }
+ public static function phppage($settings) {
+ global $config;
+ $page = file_get_contents('templates/themes/calendar/calendarpost.php');
+ return $page;
+ }
+ };
+
+?>
diff --git a/templates/themes/calendar/thumb.png b/templates/themes/calendar/thumb.png
new file mode 100644
index 00000000..d0c3c771
Binary files /dev/null and b/templates/themes/calendar/thumb.png differ
diff --git a/templates/themes/staffapplication/info.php b/templates/themes/staffapplication/info.php
new file mode 100644
index 00000000..a8093093
--- /dev/null
+++ b/templates/themes/staffapplication/info.php
@@ -0,0 +1,36 @@
+ 'Site title',
+ 'name' => 'title',
+ 'type' => 'text'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Slogan',
+ 'name' => 'subtitle',
+ 'type' => 'text',
+ 'comment' => '(optional)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'File',
+ 'name' => 'file',
+ 'type' => 'text',
+ 'default' => $config['file_index'],
+ 'comment' => '(eg. "index.html")'
+ );
+
+ // Unique function name for building everything
+ $theme['build_function'] = 'staffapplication_build';
+
diff --git a/templates/themes/staffapplication/staffapplication.html b/templates/themes/staffapplication/staffapplication.html
new file mode 100644
index 00000000..9ff98802
--- /dev/null
+++ b/templates/themes/staffapplication/staffapplication.html
@@ -0,0 +1,80 @@
+{% filter remove_whitespace %}
+
+
+
+
+
+ {% if config.meta_keywords %}{% endif %}
+
+
+ {{ settings.title }}
+
+
+
+
+
+
+
+{% endfilter %}
diff --git a/templates/themes/staffapplication/staffapplicationpost.php b/templates/themes/staffapplication/staffapplicationpost.php
new file mode 100644
index 00000000..0e1b14ca
--- /dev/null
+++ b/templates/themes/staffapplication/staffapplicationpost.php
@@ -0,0 +1,54 @@
+\r\n" : "was unable to be submitted.
Your staff application " . $sentmessage; + } + + } + else + { + $displaymessage = "
ANTISPAM VALUE INCORRECT
\r\n"; + + } +} +else { +$displaymessage = "ANTISPAM NOT SET
\r\n"; +} +$displaymessage .= '[ Return Home ]'; + +echo Element('page.html', array( + 'index' => $config['root'], + 'title' => _('Staff Application'), + 'config' => $config, + 'boardlist' => createBoardlist(isset($mod) ? $mod : false), + 'body' => $displaymessage, + ) + ); +?> diff --git a/templates/themes/staffapplication/theme.php b/templates/themes/staffapplication/theme.php new file mode 100644 index 00000000..a827a7f8 --- /dev/null +++ b/templates/themes/staffapplication/theme.php @@ -0,0 +1,40 @@ + $settings, + 'config' => $config, + 'boardlist' => createBoardlist() + )); + } + public static function phppage($settings) { + global $config; + $page = file_get_contents('templates/themes/staffapplication/staffapplicationpost.php'); + return $page; + } + }; + +?> diff --git a/templates/themes/staffapplication/thumb.png b/templates/themes/staffapplication/thumb.png new file mode 100644 index 00000000..d0c3c771 Binary files /dev/null and b/templates/themes/staffapplication/thumb.png differ diff --git a/templates/themes/ukko4/info.php b/templates/themes/ukko4/info.php new file mode 100644 index 00000000..dbbf6da8 --- /dev/null +++ b/templates/themes/ukko4/info.php @@ -0,0 +1,55 @@ + 'Board name', + 'name' => 'title', + 'type' => 'text', + 'default' => 'Ukko' + ); + $theme['config'][] = array( + 'title' => 'Board URI', + 'name' => 'uri', + 'type' => 'text', + 'default' => '*', + 'comment' => '(ukko for example)' + ); + $theme['config'][] = array( + 'title' => 'Subtitle', + 'name' => 'subtitle', + 'type' => 'text', + 'comment' => '(%s = thread limit. for example "%s freshly bumped threads")' + ); + $theme['config'][] = array( + 'title' => 'Excluded boards', + 'name' => 'exclude', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + $theme['config'][] = array( + 'title' => 'Number of threads', + 'name' => 'thread_limit', + 'type' => 'text', + 'default' => '15', + ); + // Unique function name for building everything + $theme['build_function'] = 'ukko4_build'; + $theme['install_callback'] = 'ukko4_install'; + + if(!function_exists('ukko4_install')) { + function ukko4_install($settings) { + if (!file_exists($settings['uri'])) + @mkdir($settings['uri'], 0777) or error("Couldn't create " . $settings['uri'] . ". Check permissions.", true); + file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); + } + } + diff --git a/templates/themes/ukko4/theme.php b/templates/themes/ukko4/theme.php new file mode 100644 index 00000000..4511483e --- /dev/null +++ b/templates/themes/ukko4/theme.php @@ -0,0 +1,162 @@ +settings = $settings; + + if (! ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete')) { + return; + } + + $action = generation_strategy('sb_ukko', array()); + + if ($action == 'delete') { + file_unlink($settings['uri'] . '/index.html'); + if ($config['api']['enabled']) { + $jsonFilename = $settings['uri'] . '/0.json'; + file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/catalog.json'; + file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/threads.json'; + file_unlink($jsonFilename); + } + } + elseif ($action == 'rebuild') { + file_write($settings['uri'] . '/index.html', $ukko->build()); + } + } + + class ukko4 { + public $settings; + public function build($mod = false) { + global $config; + $boards = listBoards(); + + $body = ''; + $overflow = array(); + $board = array( + 'dir' => $this->settings['uri'] . "/", + 'url' => $this->settings['uri'], + 'uri' => $this->settings['uri'], + 'name' => $this->settings['title'], + 'title' => sprintf($this->settings['subtitle'], $this->settings['thread_limit']) + ); + + $boardsforukko = array(); + $query = ''; + foreach($boards as &$_board) { + if(in_array($_board['uri'], explode(' ', $this->settings['exclude']))) + continue; + $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL UNION ALL ", $_board['uri'], $_board['uri']); + array_push($boardsforukko,$_board); + } + $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query); + $query = query($query) or error(db_error()); + + $count = 0; + $threads = array(); + if ($config['api']['enabled']) { + $apithreads = array(); + } + while($post = $query->fetch()) { + + if(!isset($threads[$post['board']])) { + $threads[$post['board']] = 1; + } else { + $threads[$post['board']] += 1; + } + + if($count < $this->settings['thread_limit']) { + openBoard($post['board']); + $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod); + + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `sticky` DESC, `id` DESC LIMIT :limit", $post['board'])); + $posts->bindValue(':id', $post['id']); + $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); + $posts->execute() or error(db_error($posts)); + + $num_images = 0; + while ($po = $posts->fetch()) { + if ($po['files']) + $num_images++; + $post2 = new Post($po, $mod ? '?/' : $config['root'], $mod); + $thread->add($post2); + + } + if ($posts->rowCount() == ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview'])) { + $ct = prepare(sprintf("SELECT COUNT(`id`) as `num` FROM ``posts_%s`` WHERE `thread` = :thread UNION ALL SELECT COUNT(`id`) FROM ``posts_%s`` WHERE `files` IS NOT NULL AND `thread` = :thread", $post['board'], $post['board'])); + $ct->bindValue(':thread', $post['id'], PDO::PARAM_INT); + $ct->execute() or error(db_error($count)); + + $c = $ct->fetch(); + $thread->omitted = $c['num'] - ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']); + + $c = $ct->fetch(); + $thread->omitted_images = $c['num'] - $num_images; + } + + + $thread->posts = array_reverse($thread->posts); + $body .= '