Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emadelawady committed Sep 16, 2019
1 parent 5ee9ad5 commit 55cb470
Show file tree
Hide file tree
Showing 21 changed files with 596 additions and 250 deletions.
2 changes: 2 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RewriteEngine On
ErrorDocument 404 /http://localhost/blog/404.php
1 change: 1 addition & 0 deletions 404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php echo 'error Page Not Found' ?>
114 changes: 71 additions & 43 deletions add-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

session_start();

$pageTitle = "Add post";
$pageTitle = "إضافة مقالة";

if (isset($_SESSION['user'])) {
include 'init.php';

// get header
$hook_up->inc_header('light', '-');
// users table
Expand Down Expand Up @@ -81,16 +82,14 @@
}
?>

<main class="uk-margin-remove uk-margin-auto fullHieght" uk-grid>
<main class="uk-margin-remove uk-margin-auto" uk-grid>
<!-- <div id="sidebar" class="uk-width-1-6 uk-padding-remove">
<?php //include $templates . 'sidebar.php'; ?>
</div> -->
<div class="uk-width-1-1 uk-padding-small otherBackground uk-text-center">
<div class="uk-width-1-1 otherBackground uk-text-center">
<div class="uk-container">
<div class="uk-margin-remove" uk-grid>
<div class="uk-width-1-1">
<h2>Add Post</h2>
</div>
<div class="" uk-grid>

<div class="uk-width-1-1 form_errors">
<?php
if(! empty($formErrors)){
Expand All @@ -109,64 +108,93 @@
<!-- Start Add Post -->
<div class="">
<!-- Start add post form -->
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data" class="uk-margin-auto uk-text-center" uk-grid>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data" class="uk-margin-top uk-margin-auto uk-text-center" uk-grid>
<h3 class="MainColor">
معلومات أساسية
</h3>
<div class="uk-width-1-1 title_desc" uk-grid>


<!-- Start Post Name Field -->
<div class="uk-margin uk-width-1-1">
<div class="uk-inline">
<div class="uk-width-1-1">
<div class="">
<span class="uk-form-icon" uk-icon="icon: user"></span>
<input type="text" name="name" class="uk-input uk-form-width-large live-title" autocomplete="off" placeholder="Post Name" />
<input type="text" name="name" class="uk-input uk-form-width-large live-title" autocomplete="off" placeholder="عنوان المقالة" />
</div>
</div>
<!-- End Post Name Field -->
<!-- Start Description Field -->
<div class="uk-margin uk-width-1-1">
<div class="uk-inline">
<div class="uk-width-1-1">
<div class="">
<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: lock"></span>
<textarea name="description" class="uk-textarea uk-form-width-large" placeholder="Description"></textarea>
<textarea name="description" class="uk-textarea uk-form-width-large live-title" placeholder="المحتوى"></textarea>
</div>
</div>
<!-- End Description Field -->
</div>

<h3 class="MainColor">أختار قسم</h3>
<!-- Start category Field -->
<div class="uk-margin uk-width-1-1">
<div class="uk-inline">
<span>Category</span>
<select class="uk-form-select uk-select" name="cat" data-uk-form-select>
<option value="0">...</option>
<?php
$stmt = $con->prepare("SELECT * FROM categories");
$stmt->execute();
$cats = $stmt->fetchAll();
foreach ($cats as $cat) { ?>
<option value="<?php echo $cat['ID'] ?>"><?php echo $cat['Name']; ?></option>
<?php
}
?>
</select>
</div>
<div class="uk-width-1-1">
<div class="uk-form-controls uk-form-controls-text cat_form" uk-grid>

<?php $stmt = $con->prepare("SELECT * FROM categories");
$stmt->execute();
$cats = $stmt->fetchAll();
foreach ($cats as $cat) { ?>
<div class="uk-width-1-2 uk-padding-removen uk-text-right">
<label class="uk-label uk-padding-small">
<input class="uk-radio" type="radio" name="cat" value="<?php echo $cat['ID'] ?>">
<?php echo $cat['Name']; ?>
</label>
</div>
<?php } ?>
</div>
</div>
<!-- End category Field -->

<h3 class="MainColor">
معلومات أساسية
</h3>
<div class="uk-width-1-1 title_desc" uk-grid>
<!-- Start Tags Field -->
<div class="uk-margin uk-width-1-1">
<div class="uk-inline">
<i class="fas fa-tags"></i>
<input type="text" name="tags" class="uk-input uk-form-width-large" placeholder="separate tags with commas (,)" />
</div>
<h4 class="MainColor">
<i class="fas fa-tags"></i>
كلمات مفتاحية - لمحركات البحث
</h4>
<div class="uk-width-1-1">

<div class="">
<input type="text" name="tags" class="uk-input uk-form-width-large" placeholder="أفصل بين الكلمات المميزة فى مقالك بعلامة الـ (,)" />
</div>
</div>
<!-- End Tags Field -->

<h4 class="MainColor">
<i class="fas fa-check"></i>
صورة المقال الرئيسية
</h4>
<div class="">

<span class="uk-form-icon" uk-icon="icon: user"></span>
<input id="image" onchange="document.getElementById('blah').src = window.URL.createObjectURL(this.files[0])" type="file" name="post_upload" class="uk-input uk-form-width-large" required="required" />
</div>
<!-- Start post image Field -->
<div class="uk-margin uk-width-1-1 image_upload">
<div class="uk-inline">
<span class="uk-form-icon" uk-icon="icon: user"></span>
<input id="image" onchange="document.getElementById('blah').src = window.URL.createObjectURL(this.files[0])" type="file" name="post_upload" class="uk-input uk-form-width-large" required="required" />
<img id="blah" width="100" height="100" />
</div>
<div class="uk-width-1-1 image_upload">


<div class="uk-margin">
<img class="" id="blah" width="300" height="150" />

</div>

</div>
</div>
<!-- End post image Field -->
<!-- Start Submit Field -->
<div class="uk-margin uk-width-1-1">
<div class="uk-width-1-1">
<div class="uk-inline">
<input type="submit" value="Add Post" class="uk-button uk-button-primary" />
<input type="submit" value="اضافة مقال" class="uk-button uk-button-primary" />
</div>
</div>
<!-- End Submit Field -->
Expand Down
3 changes: 3 additions & 0 deletions admin/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
ob_start(); // output baffering start

session_start();

if(isset($_SESSION['Username'])) {
Expand Down Expand Up @@ -62,3 +64,4 @@
</form>
</div>
<?php include $templates . 'footer.php'; ?>
<?php ob_end_flush(); // Release The Output ?>
72 changes: 72 additions & 0 deletions coll.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<nav class="uk-navbar uk-width-1-1 uk-margin-remove down_nav" uk-navbar>
<ul class="uk-navbar-nav uk-width-1-1 uk-text-center" uk-grid>
<!-- Right -->
<li class="profile_email">
<a>
<span class="uk-text-capitalize">��� �������� : <?php echo $_SESSION['user']; ?> </span>
</a>
</li>
<li class="profile_email">
<a>
<span class="">������ ����������</span>
<span class=""><?php echo $user_info['Email']; ?></span>
</a>
</li>
<li class="profile_email">
<a>
<span class="">���� ��������</span>
<?php if ($user_info['RegStatus'] == 1) {
echo "<span class=''>Activated</span>";
} else{
echo "<span class='uk-label-danger'>Not Activated</span>";

}?>
</a>
</li>
</ul>
</nav>








============== important for sign up front end page

<!-- Start Sign Up Form -->

<form class="uk-form uk-height-1-1 uk-width-1-1 uk-flex-middle signup uk-flex" method="POST" <?php $_SERVER['PHP_SELF'] ?>>
<div class="uk-form-row uk-text-center">
<div class="uk-margin">
<label class="uk-form-label uk-padding-small" for="user">User Name</label>
<div class="uk-form-controls uk-inline-clip">
<input name="user" pattern=".{4,20}" title="Must be between 4 - 20" class="uk-padding-small uk-input" type="text" id="user" placeholder="User Name" required autocomplete="off">
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label uk-padding-small" for="password">Password</label>
<div class="uk-form-controls uk-inline-clip">
<input name="pass" minlength="6" class="uk-padding-small uk-input" type="password" id="password" placeholder="Password" autocomplete="new-password" required>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label uk-padding-small" for="password">Repeat Password</label>
<div class="uk-form-controls uk-inline-clip">
<input name="pass2" minlength="6" class="uk-padding-small uk-input" type="password" id="password2" placeholder="Password" autocomplete="new-password" required>
</div>
</div>
<div class="uk-margin">
<label class="uk-form-label uk-padding-small" for="user">Email</label>
<div class="uk-form-controls uk-inline-clip">
<input name="email" class="uk-padding-small uk-input" type="email" id="email" placeholder="your Email" required>
</div>
</div>
<div class="uk-margin">
<div class="uk-form-controls">
<input class="uk-button uk-button-primary" name="signup" type="submit" id="submit" value="Sign Up">
</div>
</div>
</div>
</form>
35 changes: 35 additions & 0 deletions edit-profile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/*
================================================
== Edit Profile Page
== You Can Edit your Profile From Here
================================================
*/

ob_start(); // Output Buffering Start

session_start();

$pageTitle = $_SESSION['user'] . "'s" . " Edit Profile";

if (isset($_SESSION['user'])) {
// get init
include 'init.php';
// get header
$hook_up->inc_header('light', '-');
// users table
global $user_info;
?>
<?php echo 'edit profile'; ?>

<?php
$hook_up->inc_footer('main', '-');
} else {
header('Location: login.php');

exit();
}

ob_end_flush(); // Release The Output
?>
2 changes: 1 addition & 1 deletion includes/components/latest_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>
<div class="uk-width-1-2">
<p class="uk-margin-remove-top">
<?php echo date("D M Y", strtotime($post['Add_Date']));?>
<?php echo date("M Y", strtotime($post['Add_Date']));?>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/components/random_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>
<div class="uk-width-1-2">
<p class="uk-margin-remove-top">
<?php echo date("D M Y", strtotime($post['Add_Date']));?>
<?php echo date("M Y", strtotime($post['Add_Date']));?>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/components/top_commented.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
<div class="uk-width-1-2">
<p class="uk-margin-remove-top">
<?php echo date("D M Y", strtotime($post['Add_Date']));?>
<?php echo date("M Y", strtotime($post['Add_Date']));?>
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/components/top_rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</div>
<div class="uk-width-1-2">
<p class="uk-margin-remove-top">
<?php echo date("D M Y", strtotime($post['Add_Date']));?>
<?php echo date("M Y", strtotime($post['Add_Date']));?>
</p>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions includes/templates/comments/comment-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@
<img class="uk-comment-avatar" src="avatar.jpg" width="80" height="80" alt="">
</div>
<div class="uk-width-expand">
<h4 class="uk-comment-title uk-margin-remove"><a class="uk-link-reset" href="#"><?php echo $comment['Username']; ?></a></h4>
<p class="uk-comment-meta uk-margin-remove-top"><a class="uk-link-reset" href="#">12 days ago</a></p>
<h4 class="uk-comment-title"><a class="uk-link-reset" href="#"><?php echo $comment['Username']; ?></a></h4>
<p class="uk-comment-meta uk-margin-remove-top">
<?php echo $comment['comment_date']; ?>
</p>
</div>
</div>
<div class="uk-position-top-right uk-position-small uk-hidden-hover"><a class="uk-link-muted" href="#">Reply</a></div>
<div class="uk-position-top-left uk-position-small uk-hidden-hover"><a class="uk-link-muted" href="#">اترك رد</a>
</div>
</header>
<div class="uk-comment-body">
<p><?php echo $comment['comment']; ?></p>
Expand Down
6 changes: 4 additions & 2 deletions includes/templates/footer-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
</ul>
</div>
<div class="uk-width-1-1@s">
<p class="copyright">جميع الحقوق محفوظة <a href="#">راجنار</a>.</p>
<p class="copyright">
تصميم وبرمجة
@ <a href="#">راجنار</a>.</p>
</div>
<!--- END COL -->
</div>
Expand All @@ -79,7 +81,7 @@
<!--- END CONTAINER -->
<?php
// store scripts name into array with variable
$scripts = array(/*'vue.min', */ 'uikit-icons.min', 'uikit.min', /*'bootstrap.min',*/ 'jquery-1.12.1.min', 'jquery-ui.min', 'main');
$scripts = array(/*'vue.min', */ 'uikit-icons.min', 'uikit.min', 'bootstrap.min', 'jquery-1.12.1.min', 'jquery-ui.min', 'main');

foreach ($scripts as $val) {
on_scripts($val);
Expand Down
2 changes: 1 addition & 1 deletion includes/templates/footer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// store scripts name into array with variable
$scripts = array('vue.min', 'uikit-icons.min', 'uikit.min', /*'bootstrap.min',*/ 'jquery-1.12.1.min', 'jquery-ui.min', 'main');
$scripts = array('vue.min', 'uikit-icons.min', 'uikit.min','bootstrap.min', 'jquery-1.12.1.min', 'jquery-ui.min', 'main');

foreach ($scripts as $val) {
on_scripts($val);
Expand Down
Loading

0 comments on commit 55cb470

Please sign in to comment.