Skip to content

Commit

Permalink
Merge pull request #59 from LMWNWeb/analysis-0g3v1M
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
lewmilburn authored Nov 17, 2021
2 parents 992e602 + 2d096a1 commit 7840c8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion common/processes/database/create/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ function create_page($url, $categoryID, $template, $title, $description): bool
$query = 'SELECT `id` FROM `'.DATABASE_PREFIX."pages` WHERE `url` = '".$url."'";
if (mysqli_num_rows(mysqli_query($conn, $query)) != 0) {
log_error('WARNING', get_user_username($_SESSION['id'].' attempted to create a page but it already existed.'));

return false;
}

$query = 'INSERT INTO `'.DATABASE_PREFIX."pages` (`id`, `user_id`, `category_id`, `url`, `template`, `title`, `description`, `content`, `reference`, `image_url`, `image_credit`, `image_license`) VALUES (NULL, '".$_SESSION['id']."', '".$categoryID."', '".$url."', '".$template."', '".$title."', '".$description."', NULL, NULL, NULL, NULL, NULL)";
$query2 = 'INSERT INTO `'.DATABASE_PREFIX."pages_pending` (`id`, `user_id`, `category_id`, `title`, `content`, `reference`) VALUES (NULL, '0', '".$categoryID."', NULL, NULL, NULL)";


if (mysqli_query($conn, $query) && mysqli_query($conn, $query2)) {
$return = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion common/processes/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function send_email($email, $subject, $message): bool

return mail($to, $subject, $contents, $headers);
} elseif (CONFIG_EMAIL_FUNCTION == strtolower('smtp')) {
echo 'FATAL ERROR: SMTP is not implemented yet, please check your config.php file and visit https://docs.saturncms.net/0.1.0/developer/email for help.';
echo 'FATAL ERROR: SMTP is not implemented yet, please check your config.php file and visit https://docs.saturncms.net/0.1.0/developer/email for help.';
log_error('FATAL ERROR', 'SMTP is not implemented yet, please check your config.php file and visit https://docs.saturncms.net/0.1.0/developer/email for help.');
exit;
} else {
Expand Down
10 changes: 8 additions & 2 deletions common/processes/render_engine/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

const THEME_DIRECTORY = '/themes/';

function getarticles() {
function getarticles()
{
$i = 1;
$article = get_article_title($i);
$return = '';
Expand All @@ -24,6 +25,7 @@ function getarticles() {
$i++;
$article = get_article_title($i);
}

return $return;
}

Expand All @@ -36,7 +38,11 @@ function getdata($articleID): array
$articleData['author']['id'] = get_article_author_id($articleID);
$articleData['section']['navigation'] = file_get_contents($_SERVER['DOCUMENT_ROOT'].THEME_DIRECTORY.THEME_SLUG.'/navigation.tt');
$articleData['section']['footer'] = file_get_contents($_SERVER['DOCUMENT_ROOT'].THEME_DIRECTORY.THEME_SLUG.'/footer.tt');
if($articleID != null) { $articleData['section']['articles'] = $articleData['content'].'<br><br>'.$articleData['references'].'<br><br><em>Written by '.get_user_fullname($articleData['author']['id']).'</em>'; } else { $articleData['section']['articles'] = getarticles(); }
if ($articleID != null) {
$articleData['section']['articles'] = $articleData['content'].'<br><br>'.$articleData['references'].'<br><br><em>Written by '.get_user_fullname($articleData['author']['id']).'</em>';
} else {
$articleData['section']['articles'] = getarticles();
}
$articleData['image']['url'] = null;
$articleData['image']['credit'] = null;
$articleData['image']['license'] = null;
Expand Down
9 changes: 5 additions & 4 deletions panel/dashboard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@
?>
<li>Approve Pages and Articles.</li>
<?php
}
if (get_user_roleID($_SESSION['id'] >= '4')) {
?>
}
if (get_user_roleID($_SESSION['id'] >= '4')) {
?>
<li>Manage the Website's Core Settings</li>
<li>Manage the the Users and their permissions.</li>
<?php } ?>
<?php
} ?>
<li>Join the Team Chat and Socialise with Team Members.</li>
<li>and so much more!</li>
</ul>
Expand Down

0 comments on commit 7840c8d

Please sign in to comment.