1.x Eos -
+ Config change. Important breaking changes. See upgrade-from-1.1.md for more details.
+ + Added: Simple page title to see where it is at.
+ + Fixed: Search. Works now everywhere.
+ Updated: README.md
+ Updated: upgrade-from-1.0.md file for better reading
- + Fixed: Search. Works now everywhere.
- + Added: Simple page title to see where it is at.
1.1 Atlas - 2024-06-29
+ Config change: i18n. See upgrade-from-1.0.md for more details.
To delete an entry you have to select it and check the `Delete entry` option. Click `Save` and the entry is gone.
+# Search
+
The search is a mysql fulltext search. It builds an index by using the words provided in the entries. Everything longer then 3 chars is added
to the index. MySQL has its own [ignore/stop words](https://dev.mysql.com/doc/refman/26.10/en/fulltext-stopwords.html) build in.
+Using the search at the startpage, the results come frome everthing. Limiting the result to a maximum of 100.
+
+Searching withing a year or month, the results are limited to this timeframe.
+
# Requirements
+ A Webserver (tested on Apache 2.4)
-+ search
-++ filter by date and if available by category
+ categories with colors
+ PHP Better API
+ Go client improvements
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(\d{4})/(\d{2})/(\d{2})(|/(\S{4}))$ index.php?y=$1&m=$2&d=$3&id=$5 [L]
+ RewriteRule ^(\d{4})/(\d{2})/(\d{2})(|/(\S{4}))$ index.php?p=entry&y=$1&m=$2&d=$3&id=$5 [L]
RewriteRule ^(\d{4})/(\d{2})$ index.php?y=$1&m=$2 [L]
RewriteRule ^(\d{4})$ index.php?y=$1 [L]
- RewriteRule ^new$ index.php?p=new [L]
+ RewriteRule ^new$ index.php?p=entry [L]
+ RewriteRule ^category$ index.php?p=category [L]
</IfModule>
$driver->report_mode = MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT;
# default values
-$_view = 'list';
$_year = date('Y');
$_month = date('m');
$_day = date('d');
$_requestDateProvided = '';
$TemplateData = array();
+# valid pages
+$_validPages = array('list','entry','category');
+
+$_view = 'list';
+if(!empty($_GET['p'])) {
+ $_view = trim($_GET['p']);
+ $_view = Summoner::validate($_view,'nospace') ? $_view : 'list';
+
+ if(!in_array($_view,$_validPages)) {
+ $_view = "404";
+ }
+}
+
+## the following $_ are used in edit and list
if(isset($_GET['y']) && Summoner::validate($_GET['y'], 'digit')) {
$_year = trim($_GET['y']);
$_requestDateProvided .= 'Y';
$_day = trim($_GET['d']);
$_requestDateProvided .= '-d';
}
-if(isset($_GET['p']) && Summoner::validate($_GET['p'], 'nospace') && $_GET['p'] == "new") {
- $_view = 'entry';
-}
-if(isset($_GET['id']) && Summoner::validate($_GET['id'], 'shortlink',4)) {
- $_id = trim($_GET['id']);
- $_view = 'entry';
-}
require_once 'view/'.$_view.'/'.$_view.'.php';
form.button.save=Speichern
form.button.search=Suche
+form.cat.deletion=Löschen
+form.cat.name=Name
+form.cat.new.name=Neuer Name
+form.cat.new=Neue Kategorie
form.checkbox.deleteentry=Eintrag löschen
+text.404=Seite nicht gefunden.
text.home=Index
text.new=Neu
text.noentries=Nichts vorhanden.
+text.category=Kategorie
form.button.save=Save
form.button.search=Search
+form.cat.deletion=Delete
+form.cat.name=Name
+form.cat.new.name=New Name
+form.cat.new=New Category
form.checkbox.deleteentry=Delete Entry
+text.404=Page not found.
text.home=Home
text.new=New
text.noentries=Nothing here.
+text.category=Category
--- /dev/null
+<p><?php echo $i18n->t('text.404'); ?></p>
+<p><a href="<?php echo PATH_WEBROOT; ?>/"><?php echo $i18n->t('text.home'); ?></a></p>
--- /dev/null
+<?php
+/**
+ * scientia
+ *
+ * Copyright 2023 - 2026 Johannes Keßler
+ *
+ * https://www.bananas-playground.net/projekt/scientia/
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.
+ */
+
+http_response_code(404);
--- /dev/null
+<p>
+ <a href="<?php echo PATH_WEBROOT; ?>/"><?php echo $i18n->t('text.home'); ?></a>
+ | <a href="<?php echo PATH_WEBROOT; ?>/category"><?php echo $i18n->t('text.category'); ?></a>
+ | <a href="<?php echo PATH_WEBROOT; ?>/new"><?php echo $i18n->t('text.new'); ?></a>
+</p>
+
+<form method="post">
+ <table>
+ <thead>
+ <tr>
+ <th><?php echo $i18n->t('form.cat.name'); ?></th>
+ <th><?php echo $i18n->t('form.cat.new.name'); ?></th>
+ <th><?php echo $i18n->t('form.cat.deletion'); ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <?php echo $i18n->t('form.cat.new'); ?>
+ </td>
+ <td>
+ <input type="text" name="category[]" />
+ </td>
+ <td>
+ <input type="checkbox" name="deletecategory" value="delete" />
+ <small style="color: indianred"><?php echo $i18n->t('form.checkbox.deleteentry'); ?></small>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a href=""></a>
+ </td>
+ <td>
+ <input type="text" name="category[]" />
+ </td>
+ <td>
+ <input type="checkbox" name="deletecategory" value="delete" />
+ <small style="color: indianred"><?php echo $i18n->t('form.checkbox.deleteentry'); ?></small>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <input type="submit" name="updateCategories" value="<?php echo $i18n->t('form.button.save'); ?>">
+</form>
--- /dev/null
+<?php
+/**
+ * scientia
+ *
+ * Copyright 2023 - 2026 Johannes Keßler
+ *
+ * https://www.bananas-playground.net/projekt/scientia/
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.
+ */
-<p><a href="<?php echo PATH_WEBROOT; ?>/"><?php echo $i18n->t('text.home'); ?></a> | <a href="<?php echo PATH_WEBROOT; ?>/new"><?php echo $i18n->t('text.new'); ?></a></p>
+<p><a href="<?php echo PATH_WEBROOT; ?>/"><?php echo $i18n->t('text.home'); ?></a>
+ | <a href="<?php echo PATH_WEBROOT; ?>/new"><?php echo $i18n->t('text.new'); ?></a>
+</p>
<p>
<?php if(!empty($TemplateData['data'])) {
$_link = '';
<form method="post">
<textarea rows="25" placeholder="write here" name="fdata[entry]"><?php echo $TemplateData['data']['body'] ?? ''; ?></textarea>
<input type="submit" name="submitForm" value="<?php echo $i18n->t('form.button.save'); ?>">
+ <select name="category" id="cat-select">
+ <option value="">Category</option>
+ <hr />
+ </select>
<input type="checkbox" name="deleteEntry" value="yes" /> <small style="color: indianred"><?php echo $i18n->t('form.checkbox.deleteentry'); ?></small>
</form>
require_once 'lib/entry.class.php';
$Entry = new Entry($DB);
+if(isset($_GET['id']) && Summoner::validate($_GET['id'], 'shortlink',4)) {
+ $_id = trim($_GET['id']);
+}
+
$TemplateData['data'] = array();
if(!empty($_id)) {
$TemplateData['data'] = $Entry->load($_year,$_month,$_day,$_id);
<input type="submit" name="submitForm" value="<?php echo $i18n->t('form.button.search'); ?>">
</form>
<?php if(!empty($TemplateData['entries'])) { ?>
-<p><a href="<?php echo PATH_WEBROOT; ?>/"><?php echo $i18n->t('text.home'); ?></a> | <a href="<?php echo PATH_WEBROOT; ?>/new"><?php echo $i18n->t('text.new'); ?></a></p>
+<p>
+ <a href="<?php echo PATH_WEBROOT; ?>/"><?php echo $i18n->t('text.home'); ?></a>
+ | <a href="<?php echo PATH_WEBROOT; ?>/category"><?php echo $i18n->t('text.category'); ?></a>
+ | <a href="<?php echo PATH_WEBROOT; ?>/new"><?php echo $i18n->t('text.new'); ?></a>
+</p>
<?php
foreach($TemplateData['entries'] as $k=>$v) {
echo '<p>';