Skip to content

Commit 699a987

Browse files
committed
Re-write URLs to be more understandable
1 parent cd604da commit 699a987

9 files changed

+77
-59
lines changed

.htaccess

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
RewriteEngine on
22

3-
RewriteCond %{REQUEST_FILENAME} !-d
43

5-
RewriteCond %{REQUEST_FILENAME}\.php -f
4+
RewriteRule ^activities activity.php [NC,L]
65

7-
RewriteRule ^activityfull/([0-9]) activityfull.php?activity=$1 [NC,L]
6+
RewriteRule ^home index.php [NC,L]
7+
8+
RewriteRule ^about about.php [NC,L]
9+
10+
RewriteRule ^contactus contact.php [NC,L]
11+
12+
RewriteRule ^login login.php [NC,L]
13+
14+
RewriteRule ^activity/([0-9]) activityfull.php?activity=$1 [NC,L]
15+
16+
RewriteRule ^post/([0-9]) postfull.php?post=$1 [NC,L]

activityfull.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$res = mysqli_fetch_assoc($result);
1515
if(!$res){
1616
echo "عذرا هذا النشاط غير متوفر";
17-
echo '<a href="activity.php">العوده للنشاطات</a>';
17+
echo '<a href="../activities">العوده للنشاطات</a>';
1818
exit;
1919
}
2020
?>
@@ -25,12 +25,12 @@
2525
<meta charset="utf-8">
2626
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
2727
<title>يقظة</title>
28-
<link rel="shortcut icon" href="assets/img/yaqdha_logo.png" />
28+
<link rel="shortcut icon" href="../assets/img/yaqdha_logo.png" />
2929
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
3030
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
3131
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
3232
<script src="https://kit.fontawesome.com/323f58b68e.js" crossorigin="anonymous"></script>
33-
<link rel="stylesheet" href="assets/css/activity.css">
33+
<link rel="stylesheet" href="../assets/css/activity.css">
3434
</head>
3535
<body dir="rtl">
3636
<?php require_once "assets/reqphp/navbar.php";?>
@@ -56,7 +56,7 @@
5656
{
5757
echo '<div class="carousel-item">';
5858
}
59-
echo '<img class="w-100 d-block imgcarfull" src="assets/activityimg/';echo $imgs['image'];echo '" alt=""></div>';
59+
echo '<img class="w-100 d-block imgcarfull" src="../assets/activityimg/';echo $imgs['image'];echo '" alt=""></div>';
6060
$count = $count + 1;
6161

6262
}
@@ -68,7 +68,7 @@
6868
</div>
6969

7070
<div class="card-body">
71-
<h4 class="text-right card-title"><img style="width: 60px;margin-left: 10px;" src="assets/img/yaqdha_post.png">يقظة</h4>
71+
<h4 class="text-right card-title"><img style="width: 60px;margin-left: 10px;" src="../assets/img/yaqdha_post.png">يقظة</h4>
7272
<small class="form-text text-lowercase text-muted activitydate" style="font-size: 16px;"><?php echo $res['activity_date']; ?></small>
7373
<p class="text-right card-text activitydate"><?php echo $res['activity_desc']; ?></p>
7474
<div data-href="http://yaqdha-iq.epizy.com/activityfull.php?activity=<?php echo $res['activity_id']; ?>"><a class="fb-share-button" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fyaqdha-iq.epizy.com%2Factivityfull.php%3Factivity%3D<?php echo $activity['activity_id']; ?>&amp;src=sdkpreparse"><i class="fab fa-facebook"></i> مشاركة</a></div>
@@ -81,7 +81,7 @@
8181
{
8282
?>
8383
<div class="comment_div text-right">
84-
<div class="comntavg"><img src="assets/img/user.png" style="width:40px; margin:5px"><span class="name"><?php echo $comment['username'];?></span></div>
84+
<div class="comntavg"><img src="../assets/img/user.png" style="width:40px; margin:5px"><span class="name"><?php echo $comment['username'];?></span></div>
8585
<p class="comments"><?php echo $comment['comment'];?></p>
8686
</div>
8787
<?php } ?>
@@ -125,7 +125,7 @@
125125
var cmntactivetid = <?php echo $res['activity_id'];?>;
126126
$("#morecomments").click(function(){
127127
cmntCount = cmntCount + 3;
128-
$("#comment_box").load("assets/reqphp/load-comments-active.php", {
128+
$("#comment_box").load("../assets/reqphp/load-comments-active.php", {
129129
cmntNewactivetid: cmntactivetid,
130130
cmntNewCount: cmntCount,
131131
});

assets/css/about.css

+11-7
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ body
3535
padding: 0;
3636
font-family:'HacenPromoter';
3737
font-weight:normal;
38-
overflow-y: hidden;
39-
white-space: nowrap;
40-
overflow-x:hidden;
38+
/* overflow-y: hidden; */
39+
/* white-space: nowrap; */
40+
/* overflow-x:hidden; */
4141
}
4242

4343
h2
@@ -69,12 +69,16 @@ h2
6969
border-radius: 15px;
7070
box-shadow:0 4px 10px rgba(84, 84, 84, 0.1);
7171
}
72-
72+
@-moz-document url-prefix() {
73+
.boxy {
74+
font-size: 19px !important;
75+
}
76+
}
7377
.boxy
7478
{
7579
font-family:'HacenLinerXL';
7680
font-weight:normal;
77-
font-size: 20px;
81+
font-size: 17.5px;
7882
white-space: normal;
7983
left: -10px;
8084
padding: 10px 0;
@@ -138,8 +142,8 @@ h2
138142
.q2
139143
{
140144
position: absolute;
141-
top: 89%;
142-
left: 0.75em;
145+
top: 90%;
146+
left: 0.7em;
143147
font-size: 60px;
144148
color: #2C3E50;
145149
}

assets/reqphp/addcomment.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
echo "Can't add new data " . mysqli_error($conn);
2020
exit;
2121
}
22-
header('location: index.php');
22+
header('location: home');
2323
exit;
2424
}
2525

@@ -41,7 +41,7 @@
4141
echo "Can't add new data " . mysqli_error($conn);
4242
exit;
4343
}
44-
header('location: postfull.php?post='.$postid.'');
44+
header('location: ../post/'.$postid.'');
4545
exit;
4646
}
4747

@@ -65,7 +65,7 @@
6565
echo "Can't add new data " . mysqli_error($conn);
6666
exit;
6767
}
68-
header('location: activity.php');
68+
header('location: activities');
6969
exit;
7070
}
7171

@@ -87,7 +87,7 @@
8787
echo "Can't add new data " . mysqli_error($conn);
8888
exit;
8989
}
90-
header('location: activityfull.php?activity='.$activeid.'');
90+
header('location: ../activity/'.$activeid.'');
9191
exit;
9292
}
9393

assets/reqphp/load-comments-active.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
?>
1313
<div class="comment_div text-right">
14-
<div class="comntavg"><img src="assets/img/user.png" style="width:40px; margin:5px"><span class="name"><?php echo $comment['username'];?></span></div>
14+
<div class="comntavg"><img src="../assets/img/user.png" style="width:40px; margin:5px"><span class="name"><?php echo $comment['username'];?></span></div>
1515
<p class="comments"><?php echo $comment['comment'];?></p>
1616
</div>
1717
<?php
@@ -34,7 +34,7 @@
3434
var cmntactivetid = <?php echo $cmntNewactivetid?>;
3535
$("#morecomments").click(function(){
3636
cmntCount = cmntCount + 3;
37-
$("#comment_box").load("assets/reqphp/load-comments-active.php", {
37+
$("#comment_box").load("../assets/reqphp/load-comments-active.php", {
3838
cmntNewactivetid: cmntactivetid,
3939
cmntNewCount: cmntCount,
4040
});

assets/reqphp/load-comments.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{
1313
?>
1414
<div class="comment_div text-right">
15-
<div class="comntavg"><img src="assets/img/user.png" style="width:40px; margin:5px"><span class="name"><?php echo $comment['username'];?></span></div>
15+
<div class="comntavg"><img src="../assets/img/user.png" style="width:40px; margin:5px"><span class="name"><?php echo $comment['username'];?></span></div>
1616
<p class="comments"><?php echo $comment['comment'];?></p>
1717
</div>
1818
<?php
@@ -35,7 +35,7 @@
3535
var cmntpostid = <?php echo $cmntNewpostid?>;
3636
$("#morecomments").click(function(){
3737
cmntCount = cmntCount + 3;
38-
$("#comment_box").load("assets/reqphp/load-comments.php", {
38+
$("#comment_box").load("../assets/reqphp/load-comments.php", {
3939
cmntNewpostid: cmntpostid,
4040
cmntNewCount: cmntCount,
4141
});

assets/reqphp/navbar.php

+31-26
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,55 @@
1717
}
1818
}
1919

20+
if(isset($title) && ($title == "activityfull" || $title == "postfull" )) { ?>
21+
<link rel="stylesheet" href="../assets/css/navbar.css">
22+
<nav class="navbar navbar-light navbar-expand-md sticky-top navigation-clean" style="background-color: #4fa6c4;"><a class="navbar-brand" href="home"><img class="logo" src="../assets/img/yaqdha_logo.png" style="width: 60px; margin:unset;"> </a><button data-toggle="collapse" class="navbar-toggler" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
2023

21-
?>
24+
<?php } else { ?>
2225
<link rel="stylesheet" href="assets/css/navbar.css">
26+
<nav class="navbar navbar-light navbar-expand-md sticky-top navigation-clean" style="background-color: #4fa6c4;"><a class="navbar-brand" href="home"><img class="logo" src="assets/img/yaqdha_logo.png" style="width: 60px; margin:unset;"> </a><button data-toggle="collapse" class="navbar-toggler" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
27+
28+
<?php } ?>
2329

24-
<nav class="navbar navbar-light navbar-expand-md sticky-top navigation-clean" style="background-color: #4fa6c4;"><a class="navbar-brand" href="index.php"><img class="logo" src="assets/img/yaqdha_logo.png" style="width: 60px; margin:unset;"> </a><button data-toggle="collapse" class="navbar-toggler" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
2530
<div class="container">
2631
<div class="collapse navbar-collapse text-center"
2732
id="navcol-1">
2833
<ul class="nav navbar-nav mx-5">
2934
<?php if((isset($title) && $title == "home")||!isset($title)) { ?>
30-
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="index.php" style="color: #ffffff; background-color: #32748B; border-radius:5px;">الصفحة الرئيسية</a></li>
31-
<li class="nav-item" role="presentation"><a class="nav-link" href="activity.php" style="color: #ffffff;">النشاطات</a></li>
32-
<li class="nav-item" role="presentation"><a class="nav-link" href="contact.php" style="color: #ffffff;">اتصل بنا</a></li>
33-
<li class="nav-item" role="presentation"><a class="nav-link" href="about.php" style="color: #ffffff;">حول</a></li><?php } ?>
35+
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="home" style="color: #ffffff; background-color: #32748B; border-radius:5px;">الصفحة الرئيسية</a></li>
36+
<li class="nav-item" role="presentation"><a class="nav-link" href="activities" style="color: #ffffff;">النشاطات</a></li>
37+
<li class="nav-item" role="presentation"><a class="nav-link" href="contactus" style="color: #ffffff;">اتصل بنا</a></li>
38+
<li class="nav-item" role="presentation"><a class="nav-link" href="about" style="color: #ffffff;">حول</a></li><?php } ?>
3439

3540
<?php if((isset($title) && $title == "postfull")) { ?>
36-
<li class="nav-item" role="presentation"><a class="nav-link shadow box" href="index.php" style="color: #ffffff; background-color: #32748B; border-radius:5px;">الصفحة الرئيسية</a></li>
37-
<li class="nav-item" role="presentation"><a class="nav-link" href="activity.php" style="color: #ffffff;">النشاطات</a></li>
38-
<li class="nav-item" role="presentation"><a class="nav-link" href="contact.php" style="color: #ffffff;">اتصل بنا</a></li>
39-
<li class="nav-item" role="presentation"><a class="nav-link" href="about.php" style="color: #ffffff;">حول</a></li><?php } ?>
41+
<li class="nav-item" role="presentation"><a class="nav-link shadow box" href="../home" style="color: #ffffff; background-color: #32748B; border-radius:5px;">الصفحة الرئيسية</a></li>
42+
<li class="nav-item" role="presentation"><a class="nav-link" href="../activities" style="color: #ffffff;">النشاطات</a></li>
43+
<li class="nav-item" role="presentation"><a class="nav-link" href="../contactus" style="color: #ffffff;">اتصل بنا</a></li>
44+
<li class="nav-item" role="presentation"><a class="nav-link" href="../about" style="color: #ffffff;">حول</a></li><?php } ?>
4045

4146
<?php if((isset($title) && $title == "activity")) { ?>
42-
<li class="nav-item" role="presentation"><a class="nav-link" href="index.php" style="color: #ffffff;">الصفحة الرئيسية</a></li>
43-
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="activity.php" style="color: #ffffff; background-color: #32748B; border-radius:5px;">النشاطات</a></li>
44-
<li class="nav-item" role="presentation"><a class="nav-link" href="contact.php" style="color: #ffffff;">اتصل بنا</a></li>
45-
<li class="nav-item" role="presentation"><a class="nav-link" href="about.php" style="color: #ffffff;">حول</a></li><?php } ?>
47+
<li class="nav-item" role="presentation"><a class="nav-link" href="home" style="color: #ffffff;">الصفحة الرئيسية</a></li>
48+
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="activities" style="color: #ffffff; background-color: #32748B; border-radius:5px;">النشاطات</a></li>
49+
<li class="nav-item" role="presentation"><a class="nav-link" href="contactus" style="color: #ffffff;">اتصل بنا</a></li>
50+
<li class="nav-item" role="presentation"><a class="nav-link" href="about" style="color: #ffffff;">حول</a></li><?php } ?>
4651

4752
<?php if((isset($title) && $title == "activityfull")) { ?>
48-
<li class="nav-item" role="presentation"><a class="nav-link" href="index.php" style="color: #ffffff;">الصفحة الرئيسية</a></li>
49-
<li class="nav-item" role="presentation"><a class="nav-link shadow box" href="activity.php" style="color: #ffffff; background-color: #32748B; border-radius:5px;">النشاطات</a></li>
50-
<li class="nav-item" role="presentation"><a class="nav-link" href="contact.php" style="color: #ffffff;">اتصل بنا</a></li>
51-
<li class="nav-item" role="presentation"><a class="nav-link" href="about.php" style="color: #ffffff;">حول</a></li><?php } ?>
53+
<li class="nav-item" role="presentation"><a class="nav-link" href="../home" style="color: #ffffff;">الصفحة الرئيسية</a></li>
54+
<li class="nav-item" role="presentation"><a class="nav-link shadow box" href="../activities" style="color: #ffffff; background-color: #32748B; border-radius:5px;">النشاطات</a></li>
55+
<li class="nav-item" role="presentation"><a class="nav-link" href="../contact" style="color: #ffffff;">اتصل بنا</a></li>
56+
<li class="nav-item" role="presentation"><a class="nav-link" href="../about" style="color: #ffffff;">حول</a></li><?php } ?>
5257

5358
<?php if((isset($title) && $title == "contact")) { ?>
54-
<li class="nav-item" role="presentation"><a class="nav-link" href="index.php" style="color: #ffffff;">الصفحة الرئيسية</a></li>
55-
<li class="nav-item" role="presentation"><a class="nav-link" href="activity.php" style="color: #ffffff;">النشاطات</a></li>
56-
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="contact.php" style="color: #ffffff; background-color: #32748B; border-radius:5px;">اتصل بنا</a></li>
57-
<li class="nav-item" role="presentation"><a class="nav-link" href="about.php" style="color: #ffffff;">حول</a></li><?php } ?>
59+
<li class="nav-item" role="presentation"><a class="nav-link" href="home" style="color: #ffffff;">الصفحة الرئيسية</a></li>
60+
<li class="nav-item" role="presentation"><a class="nav-link" href="activities" style="color: #ffffff;">النشاطات</a></li>
61+
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="contactus" style="color: #ffffff; background-color: #32748B; border-radius:5px;">اتصل بنا</a></li>
62+
<li class="nav-item" role="presentation"><a class="nav-link" href="about" style="color: #ffffff;">حول</a></li><?php } ?>
5863

5964
<?php if((isset($title) && $title == "about")) { ?>
60-
<li class="nav-item" role="presentation"><a class="nav-link" href="index.php" style="color: #ffffff;">الصفحة الرئيسية</a></li>
61-
<li class="nav-item" role="presentation"><a class="nav-link" href="activity.php" style="color: #ffffff;">النشاطات</a></li>
62-
<li class="nav-item" role="presentation"><a class="nav-link" href="contact.php" style="color: #ffffff;">اتصل بنا</a></li>
63-
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="about.php" style="color: #ffffff; background-color: #32748B; border-radius:5px;">حول</a></li><?php } ?>
65+
<li class="nav-item" role="presentation"><a class="nav-link" href="home" style="color: #ffffff;">الصفحة الرئيسية</a></li>
66+
<li class="nav-item" role="presentation"><a class="nav-link" href="activities" style="color: #ffffff;">النشاطات</a></li>
67+
<li class="nav-item" role="presentation"><a class="nav-link" href="contactus" style="color: #ffffff;">اتصل بنا</a></li>
68+
<li class="nav-item" role="presentation"><a class="nav-link active shadow box" href="about" style="color: #ffffff; background-color: #32748B; border-radius:5px;">حول</a></li><?php } ?>
6469
</ul>
6570
</div>
6671
</div>

assets/reqphp/search.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{
1919
while($row = mysqli_fetch_array($result))
2020
{
21-
echo'<a for="result" href="activityfull.php?activity='. $row['activity_id'].'" class="list-group-item list-group-item-action">
21+
echo'<a for="result" href="activity/'. $row['activity_id'].'" class="list-group-item list-group-item-action">
2222
<h5 id="bookres" class="activitytext">'.$row['activity_desc'].'</h5>
2323
<span id="auth">'.$row['activity_date'].'</span>
2424
</a>';

0 commit comments

Comments
 (0)