Change revision display text

This commit is contained in:
Starbeamrainbowlabs 2016-06-26 18:08:35 +01:00
commit 21609fd61d
8 changed files with 2436 additions and 2552 deletions

2
.gitignore vendored
View File

@ -19,6 +19,8 @@ idindex.json
invindex.json
# The recent changes list
recent-changes.json
# The new settings file
peppermint.json
# The automatically downloaded parsedown files
Parsedown.php

View File

@ -1,19 +1,30 @@
# Changelog
## v0.12-dev
## v0.12-beta2
### Changed
- Changed revision display text ("Revision created by..." -> "Revision saved by...")
## v0.12-beta1
### Added
- Page history! Currently you can't do anything with the previous revisions - that will come in a future release.
- Implemented delayed indexing (#66)
- Added the time a page was last modified to the footer (#67)
- Added unified diff to edit conflict resolution pages (#64)
- Added image captions (#65)
- Added short syntax for images (#24)
### Changed
- Added text "Tag List: " to tag listing pages
- Page history! Currently you can't do anything with the previous revisions - that will come in a future release.
- Added checkerboard pattern behind transparent images on mouse hover on their preview pages.
- Improved support for SVGS.
- SVGs are sent as-is instead of a preview image unless `$settings->render_svg_previews` is set to `true`.
- Added code to find the dimensions of an SVG.
- Fixed an issue where you wouldn't be redirected correctly if you typed your password incorrectly
- Reduced the amount of space that the login bit in the top left takes up.
### Fixed
- Fixed a bug in the idindex generator.
- Fixed an issue where you wouldn't be redirected correctly if you typed your password incorrectly
## v0.11

File diff suppressed because it is too large Load Diff

View File

@ -1,129 +0,0 @@
{
"sitename": "Pepperminty Wiki",
"defaultpage": "Main Page",
"admindetails_name": "Administrator",
"admindetails_email": "admin@localhost",
"favicon": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB3VBMVEXhERHbKCjeVVXjb2\/kR0fhKirdHBziDg6qAADaHh7qLy\/pdXXUNzfMAADYPj7ZPDzUNzfbHx\/fERHpamrqMTHgExPdHx\/bLCzhLS3fVFTjT0\/ibm7kRkbiLi7aKirdISHeFBTqNDTpeHjgERHYJCTVODjYQkLaPj6\/AADVOTnpbW3cIyPdFRXcJCThMjLiTU3ibW3fVVXaKyv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,
"subpages_display_depth": 3,
"footer_message": "All content is under <a href='?page=License' target='_blank'>this license<\/a>. Please make sure that you read and understand the license, especially if you are thinking about copying some (or all) of this site's content, as it may restrict you from doing so.",
"editing_message": "<a href='?action=help#20-parser-default' target='_blank'>Formatting help<\/a> (<a href='https:\/\/github.com\/adam-p\/markdown-here\/wiki\/Markdown-Cheatsheet' target='_blank'>Markdown Cheatsheet<\/a>)<br \/>\nBy submitting your edit or uploading your file, you are agreeing to release your changes under <a href='?action=view&page=License' target='_blank'>this license<\/a>. Also note that if you don't want your work to be edited by other users of this site, please don't submit it here!",
"admindisplaychar": "&#9670;",
"protectedpagechar": "&#128274;",
"editing": true,
"anonedits": false,
"maxpagesize": 135000,
"parser": "parsedown",
"clean_raw_html": true,
"enable_math_rendering": true,
"users": {
"admin": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",
"user": "873ac9ffea4dd04fa719e8920cd6938f0c23cd678af330939cff53c3d2855f34"
},
"admins": [
"admin"
],
"use_sha3": false,
"require_login_view": false,
"data_storage_dir": ".",
"delayed_indexing_time": 0,
"nav_links": [
"user-status",
[
"Home",
"index.php"
],
"search",
[
"Read",
"index.php?page={page}"
],
[
"Edit",
"index.php?action=edit&page={page}"
],
[
"All&nbsp;Pages",
"index.php?action=list"
],
"menu"
],
"nav_links_extra": [
[
"&#x1f553; Page History",
"?action=history&page={page}"
],
[
"&#x1f3ab; All&nbsp;Tags",
"index.php?action=list-tags"
],
[
"Recent changes",
"?action=recent-changes"
],
[
"&#x1f845; Upload",
"index.php?action=upload"
],
[
"&#x2327; &#9670;Delete",
"index.php?action=delete&page={page}"
],
[
"&#x2398; &#9670;Move",
"index.php?action=move&page={page}"
],
[
"&#x1f510; &#9670;Toggle Protection",
"index.php?action=protect&page={page}"
]
],
"nav_links_bottom": [
[
"&#x1f5b6; Printable version",
"index.php?action=view&printable=yes&page={page}"
],
[
"Credits",
"index.php?action=credits"
],
[
"Help",
"index.php?action=help"
]
],
"upload_enabled": true,
"upload_allowed_file_types": [
"image\/jpeg",
"image\/png",
"image\/gif",
"image\/webp",
"image\/svg+xml",
"video\/mp4",
"video\/webm",
"audio\/mp4",
"audio\/mpeg"
],
"preview_file_type": "image\/png",
"default_preview_size": 640,
"mime_extension_mappings_location": "\/etc\/mime.types",
"mime_mappings_overrides": {
"text\/plain": "txt",
"audio\/mpeg": "mp3"
},
"min_preview_size": 1,
"max_preview_size": 2048,
"search_characters_context": 200,
"search_title_matches_weighting": 10,
"search_tags_matches_weighting": 3,
"defaultaction": "view",
"updateurl": "https:\/\/raw.githubusercontent.com\/sbrl\/pepperminty-wiki\/master\/index.php",
"optimize_pages": true,
"max_recent_changes": 512,
"export_allow_only_admins": false,
"sessionprefix": "auto",
"css": "auto",
"secret": "9eb151c6f3bb6f73a59596f4ed450ff8"
}

View File

@ -51,7 +51,7 @@ else
{
$env->user = $_SESSION[$settings->sessionprefix . "-user"];
$env->pass = $_SESSION[$settings->sessionprefix . "-pass"];
if($settings->users[$env->user] == $env->pass)
if($settings->users->{$env->user} == $env->pass)
{
// The user is logged in
$env->is_logged_in = true;
@ -927,7 +927,7 @@ class page_renderer
if($env->is_logged_in)
{
$result .= "<span class='inflexible'>" . self::render_username($env->user) . " <small>(<a href='index.php?action=logout'>Logout</a>)</small></span>";
$result .= page_renderer::$nav_divider;
//$result .= page_renderer::$nav_divider;
}
else
$result .= "<span><a href='index.php?action=login&returnto=" . rawurlencode($_SERVER["REQUEST_URI"]) . "'>Login</a></span>";

View File

@ -5,7 +5,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds a utility action (that anyone can use) called hash that hashes a given string. Useful when changing a user's password.",
"id": "action-hash",
"lastupdate": 1465757909,
"lastupdate": 1466593116,
"optional": false
},
{
@ -14,7 +14,7 @@
"author": "Starbeamrainbowlabs",
"description": "Exposes Pepperminty Wiki's new page protection mechanism and makes the protect button in the 'More...' menu on the top bar work.",
"id": "action-protect",
"lastupdate": 1465751051,
"lastupdate": 1466593116,
"optional": false
},
{
@ -23,7 +23,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds a 'raw' action that shows you the raw source of a page.",
"id": "action-raw",
"lastupdate": 1465757909,
"lastupdate": 1466593116,
"optional": false
},
{
@ -32,7 +32,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds a sidebar to the left hand side of every page. Add '$settings->sidebar_show = true;' to your configuration, or append '&sidebar=yes' to the url to enable. Adding to the url sets a cookie to remember your setting.",
"id": "extra-sidebar",
"lastupdate": 1450704211,
"lastupdate": 1466593116,
"optional": false
},
{
@ -41,7 +41,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds the ability to keep unlimited page history, limited only by your disk space. Note that this doesn't store file history (yet). Currently depends on feature-recent-changes for rendering of the history page.",
"id": "feature-history",
"lastupdate": 1465757909,
"lastupdate": 1466593116,
"optional": false
},
{
@ -50,7 +50,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds recent changes. Access through the 'recent-changes' action.",
"id": "feature-recent-changes",
"lastupdate": 1465757910,
"lastupdate": 1466593116,
"optional": false
},
{
@ -59,7 +59,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds support for redirect pages. Uses the same syntax that Mediawiki does.",
"id": "feature-redirect",
"lastupdate": 1452949822,
"lastupdate": 1466593116,
"optional": false
},
{
@ -68,7 +68,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.",
"id": "feature-search",
"lastupdate": 1465757892,
"lastupdate": 1466593116,
"optional": false
},
{
@ -77,7 +77,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File\/' prefix.",
"id": "feature-upload",
"lastupdate": 1466582736,
"lastupdate": 1466593116,
"optional": false
},
{
@ -86,7 +86,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds the credits page. You *must* have this module :D",
"id": "page-credits",
"lastupdate": 1465815023,
"lastupdate": 1466593116,
"optional": false
},
{
@ -95,7 +95,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds a debug action for administrator use only that collects a load of useful information to make reporting bugs easier.",
"id": "page-debug-info",
"lastupdate": 1465815112,
"lastupdate": 1466593116,
"optional": false
},
{
@ -104,7 +104,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds an action to allow administrators to delete pages.",
"id": "page-delete",
"lastupdate": 1465837295,
"lastupdate": 1466593116,
"optional": false
},
{
@ -113,7 +113,7 @@
"author": "Starbeamrainbowlabs",
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
"id": "page-edit",
"lastupdate": 1466582736,
"lastupdate": 1466593116,
"optional": false
},
{
@ -122,7 +122,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds a page that you can use to export your wiki as a .zip file. Uses $settings->export_only_allow_admins, which controls whether only admins are allowed to export the wiki.",
"id": "page-export",
"lastupdate": 1466582751,
"lastupdate": 1466593116,
"optional": false
},
{
@ -131,7 +131,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds a rather useful help page. Access through the 'help' action. This module also exposes help content added to Pepperminty Wiki's inbuilt invisible help section system.",
"id": "page-help",
"lastupdate": 1466009992,
"lastupdate": 1466593116,
"optional": false
},
{
@ -140,16 +140,16 @@
"author": "Starbeamrainbowlabs",
"description": "Adds a page that lists all the pages in the index along with their metadata.",
"id": "page-list",
"lastupdate": 1466010261,
"lastupdate": 1466593116,
"optional": false
},
{
"name": "Login",
"version": "0.8.3",
"version": "0.8.4",
"author": "Starbeamrainbowlabs",
"description": "Adds a pair of actions (login and checklogin) that allow users to login. You need this one if you want your users to be able to login.",
"id": "page-login",
"lastupdate": 1466582638,
"lastupdate": 1466595618,
"optional": false
},
{
@ -158,7 +158,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds an action to let users user out. For security reasons it is wise to add this module since logging in automatically opens a session that is valid for 30 days.",
"id": "page-logout",
"lastupdate": 1466011660,
"lastupdate": 1466593116,
"optional": false
},
{
@ -167,7 +167,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds an action to allow administrators to move pages.",
"id": "page-move",
"lastupdate": 1466582736,
"lastupdate": 1466593116,
"optional": false
},
{
@ -176,7 +176,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds an update page that downloads the latest stable version of Pepperminty Wiki. This module is currently outdated as it doesn't save your module preferences.",
"id": "page-update",
"lastupdate": 1466012454,
"lastupdate": 1466593116,
"optional": false
},
{
@ -185,7 +185,7 @@
"author": "Starbeamrainbowlabs",
"description": "Allows you to view pages. You really should include this one.",
"id": "page-view",
"lastupdate": 1466014372,
"lastupdate": 1466593116,
"optional": false
},
{
@ -194,7 +194,7 @@
"author": "Johnny Broadway & Starbeamrainbowlabs",
"description": "The *old* default parser for Pepperminty Wiki. Based on Johnny Broadway's Slimdown (with more than a few modifications). This parser's features are documented in the help page. Superceded by a customised extension of parsedown extra.",
"id": "parser-default-old",
"lastupdate": 1458824880,
"lastupdate": 1466593116,
"optional": true
},
{
@ -203,7 +203,7 @@
"author": "Emanuil Rusev & Starbeamrainbowlabs",
"description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation, and also *requires* write access to the disk on first load.",
"id": "parser-parsedown",
"lastupdate": 1464942369,
"lastupdate": 1466593118,
"optional": false
}
]

View File

@ -1,7 +1,7 @@
<?php
register_module([
"name" => "Login",
"version" => "0.8.3",
"version" => "0.8.4",
"author" => "Starbeamrainbowlabs",
"description" => "Adds a pair of actions (login and checklogin) that allow users to login. You need this one if you want your users to be able to login.",
"id" => "page-login",
@ -86,7 +86,7 @@ register_module([
//the user wants to log in
$user = $_POST["user"];
$pass = $_POST["pass"];
if($settings->users[$user] == hash_password($pass))
if($settings->users->$user == hash_password($pass))
{
$env->is_logged_in = true;
$expiretime = time() + 60*60*24*30; //30 days from now

View File

@ -93,7 +93,7 @@ register_module([
else
{
$content .= "<h1>Revision #$revisionNumber of $env->page</h1>\n";
$content .= "<p class='revision-note'><em>(Revision created by $revisionData->editor " . render_timestamp($revisionData->timestamp) . ". <a href='?page=" . rawurlencode($env->page) . "'>Jump to the current revision</a> or see a <a href='?action=history&page=" . rawurlencode($env->page) . "'>list of all revisions</a> for this page.)</em></p>\n";
$content .= "<p class='revision-note'><em>(Revision saved by $revisionData->editor " . render_timestamp($revisionData->timestamp) . ". <a href='?page=" . rawurlencode($env->page) . "'>Jump to the current revision</a> or see a <a href='?action=history&page=" . rawurlencode($env->page) . "'>list of all revisions</a> for this page.)</em></p>\n";
}
// Add an extra message if the requester was redirected from another page