From 5f5e29d0e55a367a35de9d8811660493108621b2 Mon Sep 17 00:00:00 2001 From: Krytic Date: Mon, 14 Nov 2016 21:28:55 +1300 Subject: [PATCH] fix a few outstanding errors, prep for v1.2.1 release --- Upload/admin/modules/wiki/categories.php | 3 +- Upload/inc/languages/english/wiki.lang.php | 1 + Upload/inc/plugins/wiki.php | 2 +- .../plugins/wiki/templates/category_desc.html | 5 ++- Upload/inc/plugins/wiki/templates/page.html | 4 +-- .../wiki/templates/stylesheets/wiki.css | 33 +++++++++++-------- Upload/wiki.php | 11 ++----- 7 files changed, 32 insertions(+), 27 deletions(-) diff --git a/Upload/admin/modules/wiki/categories.php b/Upload/admin/modules/wiki/categories.php index 18754f2..adafb07 100644 --- a/Upload/admin/modules/wiki/categories.php +++ b/Upload/admin/modules/wiki/categories.php @@ -100,8 +100,9 @@ else { $name = $db->escape_string($mybb->input['cat_title']); + $desc = $db->escape_string($mybb->input['cat_desc']); - $query = $db->write_query("INSERT INTO " . TABLE_PREFIX . "wiki_categories(title) VALUES('" . $name . "')"); + $query = $db->write_query("INSERT INTO " . TABLE_PREFIX . "wiki_categories(title, description) VALUES('{$name}', '{$desc}')"); if(!$query) { diff --git a/Upload/inc/languages/english/wiki.lang.php b/Upload/inc/languages/english/wiki.lang.php index 814d42f..5e1a2bd 100644 --- a/Upload/inc/languages/english/wiki.lang.php +++ b/Upload/inc/languages/english/wiki.lang.php @@ -15,6 +15,7 @@ $l['wiki_talk_prefix'] = "Talk: "; $l['wiki_categories_header'] = "Categories"; $l['wiki_view_all'] = "View All"; +$l['wiki_now_viewing'] = "Now viewing: {1} — {2}"; /* --- Error Messages --- */ $l['oops'] = "The Wiki has been disabled!"; $l['invalid_article'] = "No article exists with that id."; diff --git a/Upload/inc/plugins/wiki.php b/Upload/inc/plugins/wiki.php index 57ff5f1..f9ca863 100644 --- a/Upload/inc/plugins/wiki.php +++ b/Upload/inc/plugins/wiki.php @@ -143,7 +143,7 @@ function wiki_activate() // And so the fun begins. $ins = array( - "tid" => NULL, + "tid" => 0, "title" => "wiki_" . $file->getBasename('.html'), "template" => $db->escape_string(file_get_contents($file->getPathname())), "sid" => "-2", diff --git a/Upload/inc/plugins/wiki/templates/category_desc.html b/Upload/inc/plugins/wiki/templates/category_desc.html index 0a3059f..444e3be 100644 --- a/Upload/inc/plugins/wiki/templates/category_desc.html +++ b/Upload/inc/plugins/wiki/templates/category_desc.html @@ -1 +1,4 @@ -— {$category_desc} \ No newline at end of file +
+

{$category_desc}

+

{$category_desc}

+
\ No newline at end of file diff --git a/Upload/inc/plugins/wiki/templates/page.html b/Upload/inc/plugins/wiki/templates/page.html index a8f77fe..0eaad74 100644 --- a/Upload/inc/plugins/wiki/templates/page.html +++ b/Upload/inc/plugins/wiki/templates/page.html @@ -19,11 +19,9 @@ -
- {$category_desc} -
+ {$category_desc} diff --git a/Upload/inc/plugins/wiki/templates/stylesheets/wiki.css b/Upload/inc/plugins/wiki/templates/stylesheets/wiki.css index 9b26d45..9f9ebcd 100644 --- a/Upload/inc/plugins/wiki/templates/stylesheets/wiki.css +++ b/Upload/inc/plugins/wiki/templates/stylesheets/wiki.css @@ -84,21 +84,28 @@ ul.btn-group li a:active{ float: left; } -/** - * From the bootstrap project - * http://getbootstrap.com - */ -.well { - min-height:10px; - padding:12px; - margin-bottom:20px; - background-color:#f5f5f5; - border:1px solid #e3e3e3; - border-radius:4px; - -webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05); - box-shadow:inset 0 1px 1px rgba(0,0,0,.05) +div.alert-message { + display: block; + padding: 13px 12px 12px; + font-weight: bold; + font-size: 14px; + color: white; + background-color: #2ba6cb; + border: 1px solid rgba(0, 0, 0, 0.1); + margin-bottom: 12px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + border-radius: 3px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.3); + position: relative; +} +div.alert-message p { + margin: 0px; } #logo ul.top_links a.wiki { background-image: url('../../../images/wiki_icon.png'); } + diff --git a/Upload/wiki.php b/Upload/wiki.php index 3bc815a..2c0c09e 100644 --- a/Upload/wiki.php +++ b/Upload/wiki.php @@ -147,8 +147,6 @@ eval("\$protectedbit = \"".$templates->get("wiki_protectedbit")."\";"); } - - add_breadcrumb($wiki['title']); if($settings['wiki_mybbparser']) @@ -386,11 +384,8 @@ $sql = $db->write_query( sprintf( - "UPDATE `%swiki` - SET `content`='{$message}', `authors`='{$authors}', `lastauthor`='{$mybb->user['username']}', `lastauthorid`='{$mybb->user['uid']}', `notepad`='{$notes}' - WHERE `id`='{$id}'", TABLE_PREFIX - ) - ); + "UPDATE `%swiki`", TABLE_PREFIX) . "SET `content`='{$message}', `authors`='{$authors}', `lastauthor`='{$mybb->user['username']}', `lastauthorid`='{$mybb->user['uid']}', `notepad`='{$notes}' + WHERE `id`='{$id}'"); $sql = $db->write_query(sprintf("INSERT INTO %swiki_edits(`aid`,`author`,`revision`) VALUES('{$id}','{$mybb->user['uid']}','{$message}')", TABLE_PREFIX)); @@ -577,7 +572,7 @@ $wikilist = ""; - $category_desc = $category_index[$cid]['description']; + $category_desc = $lang->sprintf($lang->wiki_now_viewing, $category_index[$cid]['title'], $category_index[$cid]['description']); eval("\$category_desc = \"".$templates->get("wiki_category_desc")."\";"); if($db->num_rows($query) > 0)
{$lang->wiki} {$lang->new}{$exportbit}