-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsysauthors.php
More file actions
executable file
·56 lines (47 loc) · 1.78 KB
/
sysauthors.php
File metadata and controls
executable file
·56 lines (47 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
include_once './common.php';
$pageTitle = $pageTitle." - "."المؤلفون";
function showBody($start = 0){
$searchKeywords = $_REQUEST["searchkeywords"];
$authors = UtilityDB::getAuthors($_REQUEST["searchkeywords"], $start, PAGE_LIMIT+1);
$hasMore = false;
if(count($authors)>PAGE_LIMIT) {
$hasMore = true;
$authors = array_slice($authors, 0, PAGE_LIMIT);
$start += PAGE_LIMIT;
}
foreach($authors as $id=>$name){
$nameID = replace($name, " ", "_");
echo "<div class='author boxitem'><h2><a href='author/$nameID'>$name</a></h2></div>";
}
if($hasMore) {
echo "<div class='author boxitem more'><h2><a class=\"redlink\" href=\"javascript:loadItems('home.php?page=ajaxauthors&searchkeywords=$searchKeywords&start=$start');\">أكثر ...</a></h2></div>";
}
}
function showMainBar() {
?>
<div class="mainbarsection">
<h1>
<?php if(array_key_exists("searchkeywords", $_REQUEST)) { ?>
<a class='redlink' href='/authors'>المؤلفون</a>
<?php } else { ?>
<span>المؤلفون</span>
<?php } ?>
<?php if(array_key_exists("searchkeywords", $_REQUEST)) { ?>
<span class="highlight"> / </span>
<span >[ <?=$_REQUEST["searchkeywords"]?> ]</span>
<?php } ?>
</h1>
</div>
<div class="mainbarsection">
<form action="" onsubmit="javascript: window.open('authors/search/'+$('#keywords').val(), '_self'); return false;">
<input type="text" id="keywords" value="<?=$_REQUEST["searchkeywords"]?>">
<input type="submit" value="بحث">
</form>
</div>
<?php
}
function showAjaxBody() {
showBody($_REQUEST["start"]);
}
?>