Skip to content

Commit

Permalink
Major Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Krytic committed Feb 7, 2016
1 parent 49c3c6e commit 57cbff3
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 41 deletions.
1 change: 1 addition & 0 deletions Upload/admin/modules/wiki/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
Expand Down
2 changes: 1 addition & 1 deletion Upload/admin/modules/wiki/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
9 changes: 9 additions & 0 deletions Upload/inc/plugins/wiki/installers/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
62 changes: 31 additions & 31 deletions Upload/inc/plugins/wiki/templates/article.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->wiki}</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead">
<span>
<strong>{$wiki['title']}</strong>
</span>
<span style="float: right;">
<a href="wiki.php?action=view&amp;id={$wiki['id']}">{$lang->wiki_view}</a> &bull;
{$protect_opt}
<a href="wiki.php?action=edit&amp;id={$wiki['id']}">{$lang->edit}</a> &bull;
<a href="wiki.php?action=diff&amp;aid={$wiki['id']}">{$lang->wiki_revisions}</a> &bull;
<a href="wiki.php?action=contributors&amp;id={$wiki['id']}">{$lang->wiki_contributors}</a> &bull;
<a href="wiki.php?action=talk&amp;id={$wiki['id']}">{$lang->notes}</a>
</span>
</td>
</tr>
{$protectedbit}
<tr>
<td class="trow1">
{$wiki['content']}
</td>
</tr>
</table>
{$footer}
</body>
<head>
<title>{$mybb->settings['bbname']} - {$lang->wiki}</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead">
<span>
<strong>{$wiki['title']}</strong>
</span>
<span style="float: right;">
<a href="wiki.php?action=view&amp;id={$wiki['id']}">{$lang->wiki_view}</a> &bull;
{$protect_opt}
<a href="wiki.php?action=edit&amp;id={$wiki['id']}">{$lang->edit}</a> &bull;
<a href="wiki.php?action=diff&amp;aid={$wiki['id']}">{$lang->wiki_revisions}</a> &bull;
<a href="wiki.php?action=contributors&amp;id={$wiki['id']}">{$lang->wiki_contributors}</a> &bull;
<a href="wiki.php?action=talk&amp;id={$wiki['id']}">{$lang->notes}</a>
</span>
</td>
</tr>
{$protectedbit}
<tr>
<td class="trow1">
{$wiki['contents']}
</td>
</tr>
</table>
{$footer}
</body>
</html>
3 changes: 3 additions & 0 deletions Upload/inc/plugins/wiki/templates/article_contents.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="wiki_contents">
{$contents_element}
</div>
2 changes: 1 addition & 1 deletion Upload/inc/plugins/wiki/templates/protect.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="wiki.php?action=protect&mp;id={$wiki['id']}">Protect</a> &bull;
<a href="wiki.php?action=protect&amp;id={$wiki['id']}">{$lang->wiki_protect}</a> &bull;
9 changes: 7 additions & 2 deletions Upload/inc/plugins/wiki/templates/revision_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@
</span>
</td>
</tr>
<tr>
<td class="tcat">
<span class="smalltext"><strong>{$lang->original}</strong></span>
</td>
<td class="tcat">
<span class="smalltext"><strong>{$lang->current}</strong></span>
</td>
<tr>
<td class="trow1">
<strong>{$lang->original}</strong><br /><br />
{$article['original']}
</td>
<td class="trow2">
<strong>{$lang->current}</strong><br /><br />
{$article['content']}
</td>
</tr>
Expand Down
10 changes: 4 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.

0 comments on commit 57cbff3

Please sign in to comment.