From 57cbff39152e7d982398fd35790bbbef1a788db4 Mon Sep 17 00:00:00 2001 From: Krytic Date: Sun, 7 Feb 2016 17:32:38 +1300 Subject: [PATCH] Major Update --- Upload/admin/modules/wiki/articles.php | 1 + Upload/admin/modules/wiki/import.php | 2 +- .../inc/plugins/wiki/installers/install.php | 9 +++ .../inc/plugins/wiki/templates/article.html | 62 +++++++++---------- .../wiki/templates/article_contents.html | 3 + .../inc/plugins/wiki/templates/protect.html | 2 +- .../wiki/templates/revision_article.html | 9 ++- readme.md | 10 ++- 8 files changed, 57 insertions(+), 41 deletions(-) create mode 100644 Upload/inc/plugins/wiki/templates/article_contents.html diff --git a/Upload/admin/modules/wiki/articles.php b/Upload/admin/modules/wiki/articles.php index 6a5e812..d3c1411 100644 --- a/Upload/admin/modules/wiki/articles.php +++ b/Upload/admin/modules/wiki/articles.php @@ -170,6 +170,7 @@ 'authors' => intval($mybb->user['uid']), 'title' => $db->escape_string($mybb->input['title']), 'content' => $db->escape_string($mybb->input['message']), + 'original' => $db->escape_string($mybb->input['message']), 'protected' => $protected, 'lastauthor' => $db->escape_string($mybb->user['username']), 'lastauthorid' => $db->escape_string($mybb->user['uid']), diff --git a/Upload/admin/modules/wiki/import.php b/Upload/admin/modules/wiki/import.php index 28ab886..5acc590 100644 --- a/Upload/admin/modules/wiki/import.php +++ b/Upload/admin/modules/wiki/import.php @@ -50,7 +50,7 @@ foreach($xml->article as $article) { - $query = "INSERT INTO " . TABLE_PREFIX . "wiki(`authors`,`title`,`content`,`protected`,`lastauthor`,`lastauthorid`,`category`) VALUES('" . $db->escape_string($article->authors) . "','" . $db->escape_string($article->title) . "','" . $db->escape_string($article->content) . "','" . $db->escape_string($article->protected) . "','" . $db->escape_string($article->lastauthor) . "','" . $db->escape_string($article->lastauthorid) . "','" . $db->escape_string($article->category) . "')"; + $query = "INSERT INTO " . TABLE_PREFIX . "wiki(`authors`,`title`,`content`,`protected`,`lastauthor`,`lastauthorid`,`category`,`original`) VALUES('" . $db->escape_string($article->authors) . "','" . $db->escape_string($article->title) . "','" . $db->escape_string($article->content) . "','" . $db->escape_string($article->protected) . "','" . $db->escape_string($article->lastauthor) . "','" . $db->escape_string($article->lastauthorid) . "','" . $db->escape_string($article->category) . "','" . $db->escape_string($article->original) . "')"; $sql = $db->write_query($query); if($db->error_number() > 0) { diff --git a/Upload/inc/plugins/wiki/installers/install.php b/Upload/inc/plugins/wiki/installers/install.php index 113183f..765bb8b 100644 --- a/Upload/inc/plugins/wiki/installers/install.php +++ b/Upload/inc/plugins/wiki/installers/install.php @@ -130,6 +130,15 @@ private function insertSettings() 'value' => 0, ); $db->insert_query('wiki_settings', $insert_array); + + $insert_array = array( + 'sid' => 'NULL', + 'name' => 'wiki_export_allowed', + 'title' => 'Exporting Enabled?', + 'optionscode' => 'yesno', + 'value' => 1, + ); + $db->insert_query('wiki_settings', $insert_array); } public function go() diff --git a/Upload/inc/plugins/wiki/templates/article.html b/Upload/inc/plugins/wiki/templates/article.html index d9bb592..b9bd893 100644 --- a/Upload/inc/plugins/wiki/templates/article.html +++ b/Upload/inc/plugins/wiki/templates/article.html @@ -1,33 +1,33 @@ - - {$mybb->settings['bbname']} - {$lang->wiki} - {$headerinclude} - - - {$header} - - - - - {$protectedbit} - - - -
- - {$wiki['title']} - - - {$lang->wiki_view} • - {$protect_opt} - {$lang->edit} • - {$lang->wiki_revisions} • - {$lang->wiki_contributors} • - {$lang->notes} - -
- {$wiki['content']} -
- {$footer} - + + {$mybb->settings['bbname']} - {$lang->wiki} + {$headerinclude} + + + {$header} + + + + + {$protectedbit} + + + +
+ + {$wiki['title']} + + + {$lang->wiki_view} • + {$protect_opt} + {$lang->edit} • + {$lang->wiki_revisions} • + {$lang->wiki_contributors} • + {$lang->notes} + +
+ {$wiki['contents']} +
+ {$footer} + \ No newline at end of file diff --git a/Upload/inc/plugins/wiki/templates/article_contents.html b/Upload/inc/plugins/wiki/templates/article_contents.html new file mode 100644 index 0000000..8fbe48a --- /dev/null +++ b/Upload/inc/plugins/wiki/templates/article_contents.html @@ -0,0 +1,3 @@ +
+ {$contents_element} +
\ No newline at end of file diff --git a/Upload/inc/plugins/wiki/templates/protect.html b/Upload/inc/plugins/wiki/templates/protect.html index e40e6dd..a5777b2 100644 --- a/Upload/inc/plugins/wiki/templates/protect.html +++ b/Upload/inc/plugins/wiki/templates/protect.html @@ -1 +1 @@ - Protect • \ No newline at end of file + {$lang->wiki_protect} • \ No newline at end of file diff --git a/Upload/inc/plugins/wiki/templates/revision_article.html b/Upload/inc/plugins/wiki/templates/revision_article.html index 5f77499..b01ea92 100644 --- a/Upload/inc/plugins/wiki/templates/revision_article.html +++ b/Upload/inc/plugins/wiki/templates/revision_article.html @@ -13,13 +13,18 @@ + + + {$lang->original} + + + {$lang->current} + - {$lang->original}

{$article['original']} - {$lang->current}

{$article['content']} diff --git a/readme.md b/readme.md index 9af86de..ce818c0 100644 --- a/readme.md +++ b/readme.md @@ -32,17 +32,15 @@ MyBB Wiki also inserts two new MyCodes into your forum. They are used like so: ` A link is not added pointing to the wiki, you must add that yourself. :) -### A note about Settings - -The setting "Use Markdown Parser" is actually a choice. You can either choose to enable the Markdown parser (and disable the MyCode parser) or enable the MyCode parser (and enable the Markdown parser). So selecting "Yes" on this setting will enable Markdown and disable MyCode, and vice versa. The reason for this is that Markdown and MyCode are incompatible so you've to either choose one or the other. Note that this will not disable the standard MyBB Parser, you will just be unable to use MyCode. Some of the settings hinge on each other - for instance, with MyCode disabled, the editor will not appear (for obvious reasons), with Markdown enabled, the settings to parse HTML (etc) will be ignored. - ## License -[Licensed under Creative Commons Attribution NonCommercial ShareAlike 3.0 Unported.](creativecommons.org/licenses/by-nc-sa/3.0/) +[Original Code is licensed under Creative Commons Attribution NonCommercial ShareAlike 3.0 Unported.](creativecommons.org/licenses/by-nc-sa/3.0/) +Some code has been used from other people and this is noted where applicable. The license for the Markdown parser is available at `Upload/inc/plugins/wiki/markdown-license.txt`. **This plugin is not affiliated with or related to Stefan-T's plugin of the same name.** ## Contributions -Please submit pull requests against the **master** branch. \ No newline at end of file +Please submit pull requests against the **master** branch. +**master** is considered to be bleeding edge, and the tagged releases here or on the MyBB Mods site are stable. \ No newline at end of file