some code refactoring, there is no any warnings now
This commit is contained in:
parent
15ad0e3e09
commit
8d36e4b584
|
@ -15,8 +15,8 @@ function ReadEntries() {
|
||||||
$Entries["$e"]=$entrydata;
|
$Entries["$e"]=$entrydata;
|
||||||
$Entries["$e"][10]=$e+1;
|
$Entries["$e"][10]=$e+1;
|
||||||
} fclose($fhandle);
|
} fclose($fhandle);
|
||||||
if (!$Entries[0]) $DataStatus="empty";
|
if (!isset($Entries[0])) $DataStatus="empty";
|
||||||
return $Entries;
|
else return $Entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SaveEntries() {
|
function SaveEntries() {
|
||||||
|
@ -50,10 +50,10 @@ function Search($SearchQuery) {
|
||||||
function AddSearchBar() {
|
function AddSearchBar() {
|
||||||
global $Titles;
|
global $Titles;
|
||||||
global $GBsearch;
|
global $GBsearch;
|
||||||
if (!(($_SESSION["EditStatus"]) or ($_SESSION["DeleteStatus"]=="deletion"))) if ($GBsearch) {
|
if ($GBsearch) if (!(isset($_SESSION["EditStatus"]) or ($_SESSION["DeleteStatus"]=="deletion"))) {
|
||||||
echo "<form action=administration.php method=post>";
|
echo "<form action=administration.php method=post>";
|
||||||
echo "<input type=text name=\"serachq\" value=\"\" maxlength=255>";
|
echo "<input type=text name=\"serachq\" value=\"\" maxlength=255>";
|
||||||
echo "<input type=submit name=\"search\" value=\"$Titles[Search]\">";
|
echo "<input type=submit name=\"search\" value=\"",$Titles["Search"],"\">";
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,13 +62,13 @@ function AdminHeaderView() {
|
||||||
global $Titles;
|
global $Titles;
|
||||||
global $GBadmin;
|
global $GBadmin;
|
||||||
global $GBpassword;
|
global $GBpassword;
|
||||||
echo "<h2><a href=\"index.php\">$Titles[AdminHeader]</a></h2>\n";
|
echo "<h2><a href=\"index.php\">",$Titles["AdminHeader"],"</a></h2>\n";
|
||||||
if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) {
|
if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) {
|
||||||
echo "<div style=\"position: absolute; right: 127px; top: 59px;\">",AddSearchBar(),"</div>";
|
echo "<div style=\"position: absolute; right: 127px; top: 59px;\">",AddSearchBar(),"</div>";
|
||||||
echo "<form action=administration.php method=post>\n";
|
echo "<form action=administration.php method=post>\n";
|
||||||
echo " <p align=\"right\"><input type=submit name=\"exit\" value=\"$Titles[AdminExit]\"></p>\n";
|
echo " <p align=\"right\"><input type=submit name=\"exit\" value=\"",$Titles["AdminExit"],"\"></p>\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
echo " $Titles[AdminHello], $GBadmin!\n";
|
echo " ",$Titles["AdminHello"],", $GBadmin!\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,10 +80,10 @@ function SingleEntry($Entry) {
|
||||||
global $GBcategoryfield;
|
global $GBcategoryfield;
|
||||||
echo " <tr><td>",($Entry[10]),"<input type=checkbox name=\"cb",($Entry[10]-1),"\" value=\"checked\"></td><td>$Entry[0]</td>";
|
echo " <tr><td>",($Entry[10]),"<input type=checkbox name=\"cb",($Entry[10]-1),"\" value=\"checked\"></td><td>$Entry[0]</td>";
|
||||||
if ($GBcityfield) echo "<td>$Entry[1]</td>";
|
if ($GBcityfield) echo "<td>$Entry[1]</td>";
|
||||||
if ($HBlinkfield) echo "<td>$Entry[2]</td>";
|
if ($GBlinkfield) echo "<td>$Entry[2]</td>";
|
||||||
if ($GBsubjectfield) echo "<td>$Entry[7]</td>";
|
if ($GBsubjectfield) echo "<td>$Entry[7]</td>";
|
||||||
if ($GBcategoryfield) echo "<td>$Entry[8]</td>";
|
if ($GBcategoryfield) echo "<td>$Entry[8]</td>";
|
||||||
echo "<td>$Entry[3]</td><td>",nl2br($Entry[4]),"</td><td>",nl2br($Entry[6]),"</td><td>",date("j.m.Y, H:i",$Entry[5]),"</td><td><input type=submit name=\"submit",($Entry[10]-1),"\" value=\"$Titles[AdminEdit]\"></td></tr>\n";
|
echo "<td>$Entry[3]</td><td>",nl2br($Entry[4]),"</td><td>",nl2br($Entry[6]),"</td><td>",date("j.m.Y, H:i",$Entry[5]),"</td><td><input type=submit name=\"submit",($Entry[10]-1),"\" value=\"",$Titles["AdminEdit"],"\"></td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function AdminEntriesView() {
|
function AdminEntriesView() {
|
||||||
|
@ -98,23 +98,23 @@ function AdminEntriesView() {
|
||||||
global $GBlinkfield;
|
global $GBlinkfield;
|
||||||
global $GBsubjectfield;
|
global $GBsubjectfield;
|
||||||
global $GBcategoryfield;
|
global $GBcategoryfield;
|
||||||
if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) if ($DataStatus=="empty") echo "$Titles[EmptyFile]\n";
|
if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) if ($DataStatus=="empty") echo $Titles["EmptyFile"],"\n";
|
||||||
else if ($_SESSION["DeleteStatus"]=="deletion") {
|
else if ($_SESSION["DeleteStatus"]=="deletion") {
|
||||||
echo " $Titles[AdminSureDel] ",count($_SESSION["DeleteEntries"])," $Titles[AdminSureDelMessages]?\n";
|
echo " ",$Titles["AdminSureDel"]," ",count($_SESSION["DeleteEntries"])," ",$Titles["AdminSureDelMessages"],"?\n";
|
||||||
echo "<form action=administration.php method=post>\n";
|
echo "<form action=administration.php method=post>\n";
|
||||||
echo " <input type=submit name=\"applydelete\" value=\"$Titles[AdminDelete]\">\n";
|
echo " <input type=submit name=\"applydelete\" value=\"",$Titles["AdminDelete"],"\">\n";
|
||||||
echo " <input type=submit name=\"canceldelete\" value=\"$Titles[AdminCancel]\">\n";
|
echo " <input type=submit name=\"canceldelete\" value=\"",$Titles["AdminCancel"],"\">\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
} else if ($_SESSION["EditStatus"]) {
|
} else if (isset($_SESSION["EditStatus"])) {
|
||||||
echo " $Titles[AdminMessage] ", ($_SESSION["EditStatus"]),", ",date("j.m.Y, H:i",$AdminEntries[($_SESSION["EditStatus"]-1)][5]),":<br>\n";
|
echo " ",$Titles["AdminMessage"]," ", ($_SESSION["EditStatus"]),", ",date("j.m.Y, H:i",$AdminEntries[($_SESSION["EditStatus"]-1)][5]),":<br>\n";
|
||||||
echo "<form action=administration.php method=post>\n";
|
echo "<form action=administration.php method=post>\n";
|
||||||
echo " $Titles[AdminName]: <input type=text name=\"editname\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][0],"\" maxlength=255><br>\n";
|
echo " ",$Titles["AdminName"],": <input type=text name=\"editname\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][0],"\" maxlength=255><br>\n";
|
||||||
if ($GBcityfield) echo " $Titles[City] <input type=text name=\"editfrom\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][1],"\" maxlength=255><br>\n";
|
if ($GBcityfield) echo " ",$Titles["City"]," <input type=text name=\"editfrom\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][1],"\" maxlength=255><br>\n";
|
||||||
if ($GBlinkfield) echo " $Titles[Link] <input type=text name=\"editlink\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][2],"\" maxlength=255><br>\n";
|
if ($GBlinkfield) echo " ",$Titles["Link"]," <input type=text name=\"editlink\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][2],"\" maxlength=255><br>\n";
|
||||||
echo " $Titles[Email] <input type=text name=\"editmail\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][3],"\" maxlength=255><br>\n";
|
echo " ",$Titles["Email"]," <input type=text name=\"editmail\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][3],"\" maxlength=255><br>\n";
|
||||||
if ($GBsubjectfield) echo " $Titles[Subject] <input type=text name=\"editsubj\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][7],"\" maxlength=255><br>\n";
|
if ($GBsubjectfield) echo " ",$Titles["Subject"]," <input type=text name=\"editsubj\" value=\"",$AdminEntries[($_SESSION["EditStatus"]-1)][7],"\" maxlength=255><br>\n";
|
||||||
if ($GBcategoryfield) {
|
if ($GBcategoryfield) {
|
||||||
echo " $Titles[Category] <select name=\"editcategory\">";
|
echo " ",$Titles["Category"]," <select name=\"editcategory\">";
|
||||||
foreach($GBcategoryfield as $Category) {
|
foreach($GBcategoryfield as $Category) {
|
||||||
echo " <option value=\"$Category\"";
|
echo " <option value=\"$Category\"";
|
||||||
if ($AdminEntries[($_SESSION["EditStatus"]-1)][8]==$Category) echo " selected=\"selected\"";
|
if ($AdminEntries[($_SESSION["EditStatus"]-1)][8]==$Category) echo " selected=\"selected\"";
|
||||||
|
@ -122,43 +122,43 @@ function AdminEntriesView() {
|
||||||
}
|
}
|
||||||
echo "</select><br>\n";
|
echo "</select><br>\n";
|
||||||
}
|
}
|
||||||
echo " $Titles[AdminMessage]:<br>\n <textarea name=\"edittext\" wrap=virtual cols=50 rows=5 maxlength=$GBtextlenght>",$AdminEntries[($_SESSION["EditStatus"]-1)][4],"</textarea><br>\n";
|
echo " ",$Titles["AdminMessage"],":<br>\n <textarea name=\"edittext\" wrap=virtual cols=50 rows=5 maxlength=$GBtextlenght>",$AdminEntries[($_SESSION["EditStatus"]-1)][4],"</textarea><br>\n";
|
||||||
echo " $Titles[Response]:<br>\n <textarea name=\"editresp\" wrap=virtual cols=50 rows=5 maxlength=$GBtextlenght>",$AdminEntries[($_SESSION["EditStatus"]-1)][6],"</textarea><br>\n";
|
echo " ",$Titles["Response"],":<br>\n <textarea name=\"editresp\" wrap=virtual cols=50 rows=5 maxlength=$GBtextlenght>",$AdminEntries[($_SESSION["EditStatus"]-1)][6],"</textarea><br>\n";
|
||||||
echo " <input type=submit name=\"submiteedit\" value=\"$Titles[AdminApply]\"> ";
|
echo " <input type=submit name=\"submiteedit\" value=\"",$Titles["AdminApply"],"\"> ";
|
||||||
echo "<input type=submit name=\"applydelete\" value=\"$Titles[AdminDelete]\"> ";
|
echo "<input type=submit name=\"applydelete\" value=\"",$Titles["AdminDelete"],"\"> ";
|
||||||
echo "<input type=submit name=\"canceledit\" value=\"$Titles[AdminCancel]\">\n";
|
echo "<input type=submit name=\"canceledit\" value=\"",$Titles["AdminCancel"],"\">\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
} else {
|
} else {
|
||||||
if($_POST['search']&&$_POST['serachq']) {
|
if(isset($_POST["search"])&&$_POST["serachq"]) {
|
||||||
$SearchResult=Search($_POST['serachq']);
|
$SearchResult=Search($_POST["serachq"]);
|
||||||
if ($SearchResult) {
|
if ($SearchResult) {
|
||||||
$GBpagination=0;
|
$GBpagination=0;
|
||||||
unset($AdminEntries);
|
unset($AdminEntries);
|
||||||
foreach($SearchResult as $n=>$Entry) $AdminEntries[$n]=$Entry[1];
|
foreach($SearchResult as $n=>$Entry) $AdminEntries[$n]=$Entry[1];
|
||||||
} else echo "$Titles[NoResult]: '",$_POST['serachq'],"'.<br>\n";
|
} else echo $Titles["NoResult"],": '",$_POST["serachq"],"'.<br>\n";
|
||||||
}
|
}
|
||||||
if (($GBpagination>0)&&(count($AdminEntries)>$GBpagination)) {
|
if (($GBpagination>0)&&(count($AdminEntries)>$GBpagination)) {
|
||||||
$Entries=array_reverse($AdminEntries);
|
$Entries=array_reverse($AdminEntries);
|
||||||
if ($_GET['page']) switch ($_GET['page']) {
|
if (isset($_GET["page"])) switch ($_GET["page"]) {
|
||||||
case $Titles[First]:
|
case $Titles["First"]:
|
||||||
$CurrentPage=0;
|
$CurrentPage=0;
|
||||||
break;
|
break;
|
||||||
case $Titles[Last]:
|
case $Titles["Last"]:
|
||||||
$CurrentPage=intdiv(count($Entries),$GBpagination);
|
$CurrentPage=intdiv(count($Entries),$GBpagination);
|
||||||
break;
|
break;
|
||||||
case "$Titles[Previous]":
|
case $Titles["Previous"]:
|
||||||
$CurrentPage=$_SESSION['currentpage']-1;
|
$CurrentPage=$_SESSION["currentpage"]-1;
|
||||||
break;
|
break;
|
||||||
case "$Titles[Next]":
|
case $Titles["Next"]:
|
||||||
$CurrentPage=$_SESSION['currentpage']+1;
|
$CurrentPage=$_SESSION["currentpage"]+1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$CurrentPage=$_GET['page']-1;
|
$CurrentPage=$_GET["page"]-1;
|
||||||
} else $CurrentPage=0;
|
} else $CurrentPage=0;
|
||||||
echo "<form action=administration.php method=\"get\">\n";
|
echo "<form action=administration.php method=\"get\">\n";
|
||||||
if ($CurrentPage>0) {
|
if ($CurrentPage>0) {
|
||||||
echo " <input type=\"submit\" value=\"$Titles[First]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["First"],"\" name=\"page\"/>\n";
|
||||||
echo " <input type=\"submit\" value=\"$Titles[Previous]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["Previous"],"\" name=\"page\"/>\n";
|
||||||
}
|
}
|
||||||
for ($p = ($CurrentPage-2); $p <= ($CurrentPage+2); $p++) {
|
for ($p = ($CurrentPage-2); $p <= ($CurrentPage+2); $p++) {
|
||||||
$page = $p+1;
|
$page = $p+1;
|
||||||
|
@ -169,74 +169,79 @@ function AdminEntriesView() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($CurrentPage<((count($Entries)/$GBpagination)-1)) {
|
if ($CurrentPage<((count($Entries)/$GBpagination)-1)) {
|
||||||
echo " <input type=\"submit\" value=\"$Titles[Next]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["Next"],"\" name=\"page\"/>\n";
|
||||||
echo " <input type=\"submit\" value=\"$Titles[Last]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["Last"],"\" name=\"page\"/>\n";
|
||||||
}
|
}
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
echo "<form action=administration.php method=post>\n";
|
echo "<form action=administration.php method=post>\n";
|
||||||
echo "<table border=1 width=\"100%\">\n <tr><th></th><th>$Titles[AdminName]</th>";
|
echo "<table border=1 width=\"100%\">\n <tr><th></th><th>",$Titles["AdminName"],"</th>";
|
||||||
if ($GBcityfield) echo "<th>$Titles[City]</th>";
|
if ($GBcityfield) echo "<th>",$Titles["City"],"</th>";
|
||||||
if ($HBlinkfield) echo "<th>$Titles[Link]</th>";
|
if ($GBlinkfield) echo "<th>",$Titles["Link"],"</th>";
|
||||||
if ($GBsubjectfield) echo "<th>$Titles[Subject]</th>";
|
if ($GBsubjectfield) echo "<th>",$Titles["Subject"],"</th>";
|
||||||
if ($GBcategoryfield) echo "<th>$Titles[Category]</th>";
|
if ($GBcategoryfield) echo "<th>",$Titles["Category"],"</th>";
|
||||||
echo "<th>$Titles[Email]</th><th>$Titles[AdminMessage]</th><th>$Titles[Response]</th><th>$Titles[AdminDate]</th><th></th></tr>\n";
|
echo "<th>",$Titles["Email"],"</th><th>",$Titles["AdminMessage"],"</th><th>",$Titles["Response"],"</th><th>",$Titles["AdminDate"],"</th><th></th></tr>\n";
|
||||||
for ($e = ($GBpagination*$CurrentPage); $e < ($GBpagination*($CurrentPage+1)); $e++) {
|
for ($e = ($GBpagination*$CurrentPage); $e < ($GBpagination*($CurrentPage+1)); $e++) {
|
||||||
if ($e>=count($Entries)) break;
|
if ($e>=count($Entries)) break;
|
||||||
$Entry = $Entries[$e];
|
$Entry = $Entries[$e];
|
||||||
SingleEntry($Entry);
|
SingleEntry($Entry);
|
||||||
}
|
}
|
||||||
$_SESSION['currentpage']=$CurrentPage;
|
$_SESSION["currentpage"]=$CurrentPage;
|
||||||
} else {
|
} else {
|
||||||
echo "<form action=administration.php method=post>\n";
|
echo "<form action=administration.php method=post>\n";
|
||||||
echo "<table border=1 width=\"100%\">\n <tr><th></th><th>$Titles[AdminName]</th>";
|
echo "<table border=1 width=\"100%\">\n <tr><th></th><th>",$Titles["AdminName"],"</th>";
|
||||||
if ($GBcityfield) echo "<th>$Titles[City]</th>";
|
if ($GBcityfield) echo "<th>",$Titles["City"],"</th>";
|
||||||
if ($HBlinkfield) echo "<th>$Titles[Link]</th>";
|
if ($GBlinkfield) echo "<th>",$Titles["Link"],"</th>";
|
||||||
if ($GBsubjectfield) echo "<th>$Titles[Subject]</th>";
|
if ($GBsubjectfield) echo "<th>",$Titles["Subject"],"</th>";
|
||||||
if ($GBcategoryfield) echo "<th>$Titles[Category]</th>";
|
if ($GBcategoryfield) echo "<th>",$Titles["Category"],"</th>";
|
||||||
echo "<th>$Titles[Email]</th><th>$Titles[AdminMessage]</th><th>$Titles[Response]</th><th>$Titles[AdminDate]</th><th></th></tr>\n";
|
echo "<th>",$Titles["Email"],"</th><th>",$Titles["AdminMessage"],"</th><th>",$Titles["Response"],"</th><th>",$Titles["AdminDate"],"</th><th></th></tr>\n";
|
||||||
$Entries=array_reverse($AdminEntries);
|
$Entries=array_reverse($AdminEntries);
|
||||||
foreach($Entries as $e=>$Entry) SingleEntry($Entry);
|
foreach($Entries as $e=>$Entry) SingleEntry($Entry);
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
echo " <input type=submit name=\"submitdelete\" value=\"$Titles[AdminDeleteChecked]\">\n";
|
echo " <input type=submit name=\"submitdelete\" value=\"",$Titles["AdminDeleteChecked"],"\">\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
} else {
|
} else {
|
||||||
if (($_POST["login"])&&(!$_SESSION["SessionStatus"])) echo "$Titles[WrongLogin]<br>\n";
|
if (isset($_POST["login"])&&(!$_SESSION["SessionStatus"])) echo $Titles["WrongLogin"],"<br>\n";
|
||||||
echo "<form action=administration.php method=post>\n";
|
echo "<form action=administration.php method=post>\n";
|
||||||
echo " $Titles[Login] <input type=text name=\"adminlogin\" maxlength=255><br>\n";
|
echo " ",$Titles["Login"]," <input type=text name=\"adminlogin\" maxlength=255><br>\n";
|
||||||
echo " $Titles[Password] <input type=password name=\"adminpass\" maxlength=255><br>\n";
|
echo " ",$Titles["Password"]," <input type=password name=\"adminpass\" maxlength=255><br>\n";
|
||||||
echo " <input type=submit name=\"login\" value=\"$Titles[Enter]\">\n";
|
echo " <input type=submit name=\"login\" value=\"",$Titles["Enter"],"\">\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((($_POST["adminlogin"])==$GBadmin)&&(($_POST["adminpass"])==$GBpassword)) $_SESSION["SessionStatus"]=(md5($GBadmin.$GBpassword));
|
if (isset($_POST["adminlogin"]))
|
||||||
if ($_POST["exit"]) $_SESSION["SessionStatus"]="";
|
if ((($_POST["adminlogin"])==$GBadmin)&&(($_POST["adminpass"])==$GBpassword)) $_SESSION["SessionStatus"]=(md5($GBadmin.$GBpassword));
|
||||||
if ($_POST["canceldelete"]) {
|
if (isset($_POST["exit"])) $_SESSION["SessionStatus"]="";
|
||||||
|
if (isset($_POST["canceldelete"])) {
|
||||||
$_SESSION["DeleteStatus"]="";
|
$_SESSION["DeleteStatus"]="";
|
||||||
Unset($_SESSION["DeleteEntries"]);
|
Unset($_SESSION["DeleteEntries"]);
|
||||||
}
|
}
|
||||||
if ($_POST["canceledit"]) Unset($_SESSION["EditStatus"]);
|
if (isset($_POST["canceledit"])) Unset($_SESSION["EditStatus"]);
|
||||||
if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) {
|
if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) {
|
||||||
$AdminEntries=ReadEntries();
|
$AdminEntries=ReadEntries();
|
||||||
if ($_POST["submitdelete"]) {
|
if (isset($_POST["submitdelete"])) {
|
||||||
$_SESSION["DeleteStatus"]="deletion";
|
$_SESSION["DeleteStatus"]="deletion";
|
||||||
foreach($AdminEntries as $e=>$Entry) if ($_POST["cb$e"]) $_SESSION["DeleteEntries"][]=$e;
|
foreach($AdminEntries as $e=>$Entry) if (isset($_POST["cb$e"])) $_SESSION["DeleteEntries"][]=$e;
|
||||||
if (!count($_SESSION["DeleteEntries"])) $_SESSION["DeleteStatus"]="";
|
if (!count($_SESSION["DeleteEntries"])) $_SESSION["DeleteStatus"]="";
|
||||||
} if (($_POST["submiteedit"])&&($_SESSION["EditStatus"])) {
|
} if (isset($_POST["submiteedit"])) if (($_POST["submiteedit"])&&($_SESSION["EditStatus"])) {
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][0]=$_POST["editname"];
|
$AdminEntries[($_SESSION["EditStatus"]-1)][0]=$_POST["editname"];
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][1]=$_POST["editfrom"];
|
if (isset($_POST["editfrom"])) $AdminEntries[($_SESSION["EditStatus"]-1)][1]=$_POST["editfrom"];
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][2]=$_POST["editlink"];
|
else $AdminEntries[($_SESSION["EditStatus"]-1)][1]="";
|
||||||
|
if (isset($_POST["editlink"])) $AdminEntries[($_SESSION["EditStatus"]-1)][2]=$_POST["editlink"];
|
||||||
|
else $AdminEntries[($_SESSION["EditStatus"]-1)][2]="";
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][3]=$_POST["editmail"];
|
$AdminEntries[($_SESSION["EditStatus"]-1)][3]=$_POST["editmail"];
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][4]=$_POST["edittext"];
|
$AdminEntries[($_SESSION["EditStatus"]-1)][4]=$_POST["edittext"];
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][6]=$_POST["editresp"];
|
$AdminEntries[($_SESSION["EditStatus"]-1)][6]=$_POST["editresp"];
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][7]=$_POST["editsubj"];
|
if (isset($_POST["editsubj"])) $AdminEntries[($_SESSION["EditStatus"]-1)][7]=$_POST["editsubj"];
|
||||||
$AdminEntries[($_SESSION["EditStatus"]-1)][8]=$_POST["editcategory"];
|
else $AdminEntries[($_SESSION["EditStatus"]-1)][7]="";
|
||||||
|
if (isset($_POST["editcategory"])) $AdminEntries[($_SESSION["EditStatus"]-1)][8]=$_POST["editcategory"];
|
||||||
|
else $AdminEntries[($_SESSION["EditStatus"]-1)][8]="";
|
||||||
SaveEntries();
|
SaveEntries();
|
||||||
Unset($_SESSION["EditStatus"]);
|
Unset($_SESSION["EditStatus"]);
|
||||||
$AdminEntries=ReadEntries();
|
$AdminEntries=ReadEntries();
|
||||||
} if ($_POST["applydelete"]) {
|
} if (isset($_POST["applydelete"])) if ($_POST["applydelete"]) {
|
||||||
if ($_SESSION["EditStatus"]) {
|
if (isset($_SESSION["EditStatus"])) {
|
||||||
Unset($AdminEntries[($_SESSION["EditStatus"]-1)]);
|
Unset($AdminEntries[($_SESSION["EditStatus"]-1)]);
|
||||||
SaveEntries();
|
SaveEntries();
|
||||||
Unset($_SESSION["EditStatus"]);
|
Unset($_SESSION["EditStatus"]);
|
||||||
|
@ -248,11 +253,11 @@ if ($_SESSION["SessionStatus"]==(md5($GBadmin.$GBpassword))) {
|
||||||
$_SESSION["DeleteStatus"]="";
|
$_SESSION["DeleteStatus"]="";
|
||||||
$AdminEntries=ReadEntries();
|
$AdminEntries=ReadEntries();
|
||||||
}
|
}
|
||||||
} if (!$_SESSION["EditStatus"]) for ($e=0;$e<count($AdminEntries);$e++) if ($_POST["submit$e"]) $_SESSION["EditStatus"]=($e+1);
|
} if (!isset($_SESSION["EditStatus"])) for ($e=0;$e<count($AdminEntries);$e++) if (isset($_POST["submit$e"])) $_SESSION["EditStatus"]=($e+1);
|
||||||
}
|
}
|
||||||
?><html>
|
?><html>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $Titles[HeadTitle];?></title>
|
<title><?php echo $Titles["HeadTitle"];?></title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Ubuntu:regular&subset=Latin,Cyrillic">
|
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Ubuntu:regular&subset=Latin,Cyrillic">
|
||||||
<link rel="stylesheet" type="text/css" href="anthrstlsht.css">
|
<link rel="stylesheet" type="text/css" href="anthrstlsht.css">
|
||||||
|
|
186
index.php
186
index.php
|
@ -16,15 +16,15 @@ function SendMail() {
|
||||||
global $GBlinkfield;
|
global $GBlinkfield;
|
||||||
global $GBsubjectfield;
|
global $GBsubjectfield;
|
||||||
global $GBcategoryfield;
|
global $GBcategoryfield;
|
||||||
$message=$_POST['name'];
|
$message=$_POST["name"];
|
||||||
if ($GBcityfield) $message=$message." ".$Titles[From]." ".$_POST['from'];
|
if ($GBcityfield) $message=$message." ".$Titles["From"]." ".$_POST["from"];
|
||||||
$message=$message."(";
|
$message=$message."(";
|
||||||
if ($GBlinkfield) $message=$message.$_POST['link'].", ";
|
if ($GBlinkfield) $message=$message.$_POST["link"].", ";
|
||||||
$message=$message.$_POST['email'].") ".$Titles[Wrote];
|
$message=$message.$_POST["email"].") ".$Titles["Wrote"];
|
||||||
if ($GBsubjectfield) $message=$message." ".$_POST['subj'];
|
if ($GBsubjectfield) $message=$message." ".$_POST["subj"];
|
||||||
if ($GBcategoryfield) $message=$message." [".$_POST['category']."]";
|
if ($GBcategoryfield) $message=$message." [".$_POST["category"]."]";
|
||||||
$message=$message.":\r\n\r\n".$_POST['text']."\r\n\r\n_____\r\n".$Titles[MailAdmin];
|
$message=$message.":\r\n\r\n".$_POST["text"]."\r\n\r\n_____\r\n".$Titles["MailAdmin"];
|
||||||
mail($GBnotificationmailto, $Titles[MailSubject], $message,
|
mail($GBnotificationmailto, $Titles["MailSubject"], $message,
|
||||||
"From: ".$GBnotificationmailfrom." \r\n"."Content-type: text/plain; charset=utf-8\r\n"
|
"From: ".$GBnotificationmailfrom." \r\n"."Content-type: text/plain; charset=utf-8\r\n"
|
||||||
."X-Mailer: PHP/".phpversion());
|
."X-Mailer: PHP/".phpversion());
|
||||||
}
|
}
|
||||||
|
@ -38,15 +38,15 @@ function ReadEntries() {
|
||||||
$Entries["$e"][10]=$e+1;
|
$Entries["$e"][10]=$e+1;
|
||||||
}
|
}
|
||||||
fclose($fhandle);
|
fclose($fhandle);
|
||||||
if (!$Entries[0]) $DataStatus="empty";
|
if (!isset($Entries[0])) $DataStatus="empty";
|
||||||
return $Entries;
|
else return $Entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SaveFile() {
|
function SaveFile() {
|
||||||
$filename = substr(md5(uniqid()), 0, 13).'.'.pathinfo($_FILES['uploadedfile']['name'], PATHINFO_EXTENSION);
|
$filename = substr(md5(uniqid()), 0, 13).'.'.pathinfo($_FILES["uploadedfile"]["name"], PATHINFO_EXTENSION);
|
||||||
$uploaddir = 'upload/';
|
$uploaddir = "upload/";
|
||||||
$uploadfile = $uploaddir.$filename;
|
$uploadfile = $uploaddir.$filename;
|
||||||
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $uploadfile)) {
|
if (move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], $uploadfile)) {
|
||||||
return $uploadfile;
|
return $uploadfile;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
@ -55,8 +55,8 @@ function SaveFile() {
|
||||||
|
|
||||||
function CheckFile() {
|
function CheckFile() {
|
||||||
global $GBimagesize;
|
global $GBimagesize;
|
||||||
if (getimagesize($_FILES['uploadedfile']['tmp_name'])) {
|
if (getimagesize($_FILES["uploadedfile"]["tmp_name"])) {
|
||||||
if ((filesize($_FILES['uploadedfile']['tmp_name']))<($GBimagesize)) return SaveFile();
|
if ((filesize($_FILES["uploadedfile"]["tmp_name"]))<($GBimagesize)) return SaveFile();
|
||||||
else return false;
|
else return false;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
|
@ -71,34 +71,34 @@ function AddEntry() {
|
||||||
global $GBsubjectfield;
|
global $GBsubjectfield;
|
||||||
global $GBcategoryfield;
|
global $GBcategoryfield;
|
||||||
global $GBstriptags;
|
global $GBstriptags;
|
||||||
if (!$GBstriptags) $NewEntry[name]=$_POST['name'];
|
if (!$GBstriptags) $NewEntry["name"]=$_POST["name"];
|
||||||
else $NewEntry[name]=strip_tags($_POST['name']);
|
else $NewEntry["name"]=strip_tags($_POST["name"]);
|
||||||
if ($GBcityfield) {
|
if ($GBcityfield) {
|
||||||
if (!$GBstriptags) $NewEntry[from]=$_POST['from'];
|
if (!$GBstriptags) $NewEntry["from"]=$_POST["from"];
|
||||||
else $NewEntry[from]=strip_tags($_POST['from']);
|
else $NewEntry["from"]=strip_tags($_POST["from"]);
|
||||||
} else $NewEntry[from]="";
|
} else $NewEntry["from"]="";
|
||||||
if ($GBlinkfield) {
|
if ($GBlinkfield) {
|
||||||
if (!$GBstriptags) $NewEntry[link]=$_POST['link'];
|
if (!$GBstriptags) $NewEntry["link"]=$_POST["link"];
|
||||||
else $NewEntry[link]=strip_tags($_POST['link']);
|
else $NewEntry["link"]=strip_tags($_POST["link"]);
|
||||||
} else $NewEntry[link]="";
|
} else $NewEntry["link"]="";
|
||||||
$NewEntry[email]=$_POST['email'];
|
$NewEntry["email"]=$_POST["email"];
|
||||||
if (!$GBstriptags) $NewEntry[text]=$_POST['text'];
|
if (!$GBstriptags) $NewEntry["text"]=$_POST["text"];
|
||||||
else $NewEntry[text]=strip_tags($_POST['text']);
|
else $NewEntry["text"]=strip_tags($_POST["text"]);
|
||||||
if ($UploadedFile) $NewEntry[text]=$NewEntry[text]." <br><img src=\"$UploadedFile\">";
|
if ($UploadedFile) $NewEntry["text"]=$NewEntry["text"]." <br><img src=\"$UploadedFile\">";
|
||||||
$NewEntry[datetime]=time();
|
$NewEntry["datetime"]=time();
|
||||||
$NewEntry[response]="";
|
$NewEntry["response"]="";
|
||||||
if ($GBsubjectfield) {
|
if ($GBsubjectfield) {
|
||||||
if (!$GBstriptags) $NewEntry[subj]=$_POST['subj'];
|
if (!$GBstriptags) $NewEntry["subj"]=$_POST["subj"];
|
||||||
else $NewEntry[subj]=strip_tags($_POST['subj']);
|
else $NewEntry["subj"]=strip_tags($_POST["subj"]);
|
||||||
} else $NewEntry[subj]="";
|
} else $NewEntry["subj"]="";
|
||||||
if ($GBcategoryfield) $NewEntry[category]=strip_tags($_POST['category']);
|
if ($GBcategoryfield) $NewEntry["category"]=strip_tags($_POST["category"]);
|
||||||
else $NewEntry[category]="";
|
else $NewEntry["category"]="";
|
||||||
$NewEntry[parameters]="";
|
$NewEntry["parameters"]="";
|
||||||
$fhandle=fopen($GBdata,"a");
|
$fhandle=fopen($GBdata,"a");
|
||||||
fputcsv($fhandle,$NewEntry);
|
fputcsv($fhandle,$NewEntry);
|
||||||
fclose($fhandle);
|
fclose($fhandle);
|
||||||
$PageStatus="added";
|
$PageStatus="added";
|
||||||
$_SESSION['captcha']="";
|
$_SESSION["captcha"]="";
|
||||||
}
|
}
|
||||||
|
|
||||||
function AddEntryView() {
|
function AddEntryView() {
|
||||||
|
@ -112,21 +112,21 @@ function AddEntryView() {
|
||||||
global $GBlinkfield;
|
global $GBlinkfield;
|
||||||
global $GBsubjectfield;
|
global $GBsubjectfield;
|
||||||
global $GBcategoryfield;
|
global $GBcategoryfield;
|
||||||
echo "<h2>",$Titles[Page],"</h2><br>\n";
|
echo "<h2>",$Titles["Page"],"</h2><br>\n";
|
||||||
if ($PageStatus=="added") echo "$Titles[Added]"."<br>\n";
|
if ($PageStatus=="added") echo $Titles["Added"]."<br>\n";
|
||||||
$captchanumber11=rand(1, 4);
|
$captchanumber11=rand(1, 4);
|
||||||
$captchanumber12=rand(0, 9);
|
$captchanumber12=rand(0, 9);
|
||||||
$captchanumber21=rand(1, 4);
|
$captchanumber21=rand(1, 4);
|
||||||
$captchanumber22=rand(0, 9);
|
$captchanumber22=rand(0, 9);
|
||||||
$_SESSION['captcha']=md5(base64_encode(($captchanumber11.$captchanumber12)+($captchanumber21.$captchanumber22)));
|
$_SESSION["captcha"]=md5(base64_encode(($captchanumber11.$captchanumber12)+($captchanumber21.$captchanumber22)));
|
||||||
echo "<form action=index.php method=post enctype=\"multipart/form-data\">\n";
|
echo "<form action=index.php method=post enctype=\"multipart/form-data\">\n";
|
||||||
echo " $Titles[Name]: <input type=text name=\"name\" value=\"",$Values["name"],"\" maxlength=255> ($Titles[Required])<br>\n";
|
echo " ",$Titles["Name"],": <input type=text name=\"name\" value=\"",$Values["name"],"\" maxlength=255> (",$Titles["Required"],")<br>\n";
|
||||||
if ($GBcityfield) echo " $Titles[City]: <input type=text name=\"from\" value=\"",$Values["from"],"\" maxlength=255><br>\n";
|
if ($GBcityfield) echo " ",$Titles["City"],": <input type=text name=\"from\" value=\"",$Values["from"],"\" maxlength=255><br>\n";
|
||||||
if ($GBlinkfield) echo " $Titles[Link]: <input type=text name=\"link\" value=\"",$Values["link"],"\" maxlength=255><br>\n";
|
if ($GBlinkfield) echo " ",$Titles["Link"],": <input type=text name=\"link\" value=\"",$Values["link"],"\" maxlength=255><br>\n";
|
||||||
echo " $Titles[Email]: <input type=text name=\"email\" value=\"",$Values["email"],"\" maxlength=255> ($Titles[NotPublic])<br>\n";
|
echo " ",$Titles["Email"],": <input type=text name=\"email\" value=\"",$Values["email"],"\" maxlength=255> ($Titles[NotPublic])<br>\n";
|
||||||
if ($GBsubjectfield) echo " $Titles[Subject]: <input type=text name=\"subj\" value=\"",$Values["subj"],"\" maxlength=255><br>\n";
|
if ($GBsubjectfield) echo " ",$Titles["Subject"],": <input type=text name=\"subj\" value=\"",$Values["subj"],"\" maxlength=255><br>\n";
|
||||||
if ($GBcategoryfield) {
|
if ($GBcategoryfield) {
|
||||||
echo " $Titles[Category]: <select name=\"category\">";
|
echo " ",$Titles["Category"],": <select name=\"category\">";
|
||||||
foreach($GBcategoryfield as $Category) {
|
foreach($GBcategoryfield as $Category) {
|
||||||
echo " <option value=\"$Category\"";
|
echo " <option value=\"$Category\"";
|
||||||
if ($Values["category"]==$Category) echo " selected=\"selected\"";
|
if ($Values["category"]==$Category) echo " selected=\"selected\"";
|
||||||
|
@ -134,18 +134,18 @@ function AddEntryView() {
|
||||||
}
|
}
|
||||||
echo "</select><br>\n";
|
echo "</select><br>\n";
|
||||||
}
|
}
|
||||||
echo " $Titles[Text]:<br>\n <textarea name=\"text\" wrap=virtual cols=50 rows=5 maxlength=$GBtextlenght>",$Values["text"],"</textarea><br>\n";
|
echo " ",$Titles["Text"],":<br>\n <textarea name=\"text\" wrap=virtual cols=50 rows=5 maxlength=$GBtextlenght>",$Values["text"],"</textarea><br>\n";
|
||||||
if ($GBupload) {
|
if ($GBupload) {
|
||||||
echo " <label for=\"file\">".$Titles[FileUpload]."</label>\n";
|
echo " <label for=\"file\">".$Titles["FileUpload"]."</label>\n";
|
||||||
echo " <input type=\"file\" name=\"uploadedfile\"><br>\n";
|
echo " <input type=\"file\" name=\"uploadedfile\"><br>\n";
|
||||||
}
|
}
|
||||||
if ($GBcaptcha) echo " $Titles[Captcha]: <font class=\"text\">$captchanumber11</font><font>$captchanumber11</font><font>$captchanumber12</font> $Titles[CaptchaPlus] <font>$captchanumber21</font><font>$captchanumber22</font><font class=\"text\">$captchanumber21</font> = <input type=text name=\"captcha\" size=2 maxlength=2> ?<br>\n";
|
if ($GBcaptcha) echo " ",$Titles["Captcha"],": <font class=\"text\">$captchanumber11</font><font>$captchanumber11</font><font>$captchanumber12</font> ",$Titles["CaptchaPlus"]," <font>$captchanumber21</font><font>$captchanumber22</font><font class=\"text\">$captchanumber21</font> = <input type=text name=\"captcha\" size=2 maxlength=2> ?<br>\n";
|
||||||
echo " <input type=submit name=\"submit\" value=\"$Titles[Submit]\">\n";
|
echo " <input type=submit name=\"submit\" value=\"",$Titles["Submit"],"\">\n";
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
if ($PageStatus=="emptyname") echo "$Titles[EmptyName]<br>\n";
|
if ($PageStatus=="emptyname") echo $Titles["EmptyName"],"<br>\n";
|
||||||
if ($PageStatus=="emptytext") echo "$Titles[EmptyText]<br>\n";
|
if ($PageStatus=="emptytext") echo $Titles["EmptyText"],"<br>\n";
|
||||||
if ($PageStatus=="wrongimage") echo "$Titles[WrongImage]<br>\n";
|
if ($PageStatus=="wrongimage") echo $Titles["WrongImage"],"<br>\n";
|
||||||
if ($PageStatus=="wrongcaptcha") echo "$Titles[WrongCaptcha]<br>\n";
|
if ($PageStatus=="wrongcaptcha") echo $Titles["WrongCaptcha"],"<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function Search($SearchQuery) {
|
function Search($SearchQuery) {
|
||||||
|
@ -171,7 +171,7 @@ function AddSearchBar() {
|
||||||
if ($GBsearch) {
|
if ($GBsearch) {
|
||||||
echo "<form action=index.php method=post>";
|
echo "<form action=index.php method=post>";
|
||||||
echo "<input type=text name=\"serachq\" value=\"\" maxlength=255>";
|
echo "<input type=text name=\"serachq\" value=\"\" maxlength=255>";
|
||||||
echo "<input type=submit name=\"search\" value=\"$Titles[Search]\">";
|
echo "<input type=submit name=\"search\" value=\"",$Titles["Search"],"\">";
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,9 +187,9 @@ function SinlgeEntry($Entry) {
|
||||||
if ($Entry[2]) echo "<a href=\"",$Entry[2],"\">";
|
if ($Entry[2]) echo "<a href=\"",$Entry[2],"\">";
|
||||||
echo "<b>",$Entry[0],"</b>";
|
echo "<b>",$Entry[0],"</b>";
|
||||||
if ($Entry[2]) echo "</a>";
|
if ($Entry[2]) echo "</a>";
|
||||||
if ($Entry[1]) echo " ",$Titles[From]," <b>",$Entry[1],"</b>";
|
if ($Entry[1]) echo " ",$Titles["From"]," <b>",$Entry[1],"</b>";
|
||||||
echo ", ",date("j.m.Y, H:i",$Entry[5]),", ",$Titles[Wrote];
|
echo ", ",date("j.m.Y, H:i",$Entry[5]),", ",$Titles["Wrote"];
|
||||||
if (($GBsubjectfield)&&($Entry[7])) echo " ",$Titles[About]," '",$Entry[7],"'";
|
if (($GBsubjectfield)&&($Entry[7])) echo " ",$Titles["About"]," '",$Entry[7],"'";
|
||||||
if (($GBcategoryfield)&&($Entry[8])) echo " [",$Entry[8],"]";
|
if (($GBcategoryfield)&&($Entry[8])) echo " [",$Entry[8],"]";
|
||||||
echo ":</div></h4><br>\n";
|
echo ":</div></h4><br>\n";
|
||||||
if ($GBreadmore>0) {
|
if ($GBreadmore>0) {
|
||||||
|
@ -199,12 +199,12 @@ function SinlgeEntry($Entry) {
|
||||||
if ($_POST[$readmorenumber]) echo " ",nl2br($Entry[4]),"<br>\n";
|
if ($_POST[$readmorenumber]) echo " ",nl2br($Entry[4]),"<br>\n";
|
||||||
else {
|
else {
|
||||||
$Message = substr($Message, 0, $GBreadmore);
|
$Message = substr($Message, 0, $GBreadmore);
|
||||||
$Message = substr($Message, 0, strrpos($Message, ' '))."... <form action=\"\" method=\"post\"><button type=\"submit\" name=\"readmore".$Entry[10]."\" value=\"read\" class=\"btn-link\">".$Titles[ReadMore]."</button></form>";
|
$Message = substr($Message, 0, strrpos($Message, ' '))."... <form action=\"\" method=\"post\"><button type=\"submit\" name=\"readmore".$Entry[10]."\" value=\"read\" class=\"btn-link\">".$Titles["ReadMore"]."</button></form>";
|
||||||
echo " ",nl2br($Message),"<br>\n";
|
echo " ",nl2br($Message),"<br>\n";
|
||||||
}
|
}
|
||||||
} else echo " ",nl2br($Entry[4]),"<br>\n";
|
} else echo " ",nl2br($Entry[4]),"<br>\n";
|
||||||
} else echo " ",nl2br($Entry[4]),"<br>\n";
|
} else echo " ",nl2br($Entry[4]),"<br>\n";
|
||||||
if ($Entry[6]) echo "<br><i><b>$Titles[Response]:</b><br>\n";
|
if ($Entry[6]) echo "<br><i><b>",$Titles["Response"],":</b><br>\n";
|
||||||
if ($Entry[6]) echo nl2br($Entry[6]),"</i><br>\n";
|
if ($Entry[6]) echo nl2br($Entry[6]),"</i><br>\n";
|
||||||
echo "</div><hr>\n";
|
echo "</div><hr>\n";
|
||||||
}
|
}
|
||||||
|
@ -219,32 +219,32 @@ function EntriesView() {
|
||||||
global $GBlinkfield;
|
global $GBlinkfield;
|
||||||
global $GBsubjectfield;
|
global $GBsubjectfield;
|
||||||
global $GBcategoryfield;
|
global $GBcategoryfield;
|
||||||
if ($DataStatus=="empty") echo "$Titles[EmptyFile]";
|
if ($DataStatus=="empty") echo $Titles["EmptyFile"];
|
||||||
else if($_POST['search']&&$_POST['serachq']) {
|
else if(isset($_POST["search"])&&isset($_POST["serachq"])) {
|
||||||
$SearchResult=Search($_POST['serachq']);
|
$SearchResult=Search($_POST["serachq"]);
|
||||||
if ($SearchResult) {
|
if ($SearchResult) {
|
||||||
$GBpagination=0;
|
$GBpagination=0;
|
||||||
unset($Entries);
|
unset($Entries);
|
||||||
foreach($SearchResult as $n=>$Entry) $Entries[$n]=$Entry[1];
|
foreach($SearchResult as $n=>$Entry) $Entries[$n]=$Entry[1];
|
||||||
} else echo "$Titles[NoResult]: '",$_POST['serachq'],"'.<br>\n";
|
} else echo $Titles["NoResult"].": '",$_POST["serachq"],"'.<br>\n";
|
||||||
}
|
}
|
||||||
if (($GBpagination>0)&&(count($Entries)>$GBpagination)) {
|
if (($GBpagination>0)&&(count($Entries)>$GBpagination)) {
|
||||||
$Entries=array_reverse($Entries);
|
$Entries=array_reverse($Entries);
|
||||||
if ($_GET['page']) switch ($_GET['page']) {
|
if (isset($_GET["page"])) switch ($_GET["page"]) {
|
||||||
case $Titles[First]:
|
case $Titles["First"]:
|
||||||
$CurrentPage=0;
|
$CurrentPage=0;
|
||||||
break;
|
break;
|
||||||
case $Titles[Last]:
|
case $Titles["Last"]:
|
||||||
$CurrentPage=(int)((count($Entries)-1)/$GBpagination);
|
$CurrentPage=(int)((count($Entries)-1)/$GBpagination);
|
||||||
break;
|
break;
|
||||||
case "$Titles[Previous]":
|
case $Titles["Previous"]:
|
||||||
$CurrentPage=$_SESSION['currentpage']-1;
|
$CurrentPage=$_SESSION["currentpage"]-1;
|
||||||
break;
|
break;
|
||||||
case "$Titles[Next]":
|
case $Titles["Next"]:
|
||||||
$CurrentPage=$_SESSION['currentpage']+1;
|
$CurrentPage=$_SESSION["currentpage"]+1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$CurrentPage=$_GET['page']-1;
|
$CurrentPage=$_GET["page"]-1;
|
||||||
}
|
}
|
||||||
else $CurrentPage=0;
|
else $CurrentPage=0;
|
||||||
for ($e = ($GBpagination*$CurrentPage); $e < ($GBpagination*($CurrentPage+1)); $e++) {
|
for ($e = ($GBpagination*$CurrentPage); $e < ($GBpagination*($CurrentPage+1)); $e++) {
|
||||||
|
@ -253,8 +253,8 @@ function EntriesView() {
|
||||||
}
|
}
|
||||||
echo "<form action=index.php method=\"get\">\n";
|
echo "<form action=index.php method=\"get\">\n";
|
||||||
if ($CurrentPage>0) {
|
if ($CurrentPage>0) {
|
||||||
echo " <input type=\"submit\" value=\"$Titles[First]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["First"],"\" name=\"page\"/>\n";
|
||||||
echo " <input type=\"submit\" value=\"$Titles[Previous]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["Previous"],"\" name=\"page\"/>\n";
|
||||||
}
|
}
|
||||||
for ($p = ($CurrentPage-2); $p <= ($CurrentPage+2); $p++) {
|
for ($p = ($CurrentPage-2); $p <= ($CurrentPage+2); $p++) {
|
||||||
$page = $p+1;
|
$page = $p+1;
|
||||||
|
@ -265,50 +265,52 @@ function EntriesView() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($CurrentPage<((count($Entries)/$GBpagination)-1)) {
|
if ($CurrentPage<((count($Entries)/$GBpagination)-1)) {
|
||||||
echo " <input type=\"submit\" value=\"$Titles[Next]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["Next"],"\" name=\"page\"/>\n";
|
||||||
echo " <input type=\"submit\" value=\"$Titles[Last]\" name=\"page\"/>\n";
|
echo " <input type=\"submit\" value=\"",$Titles["Last"],"\" name=\"page\"/>\n";
|
||||||
}
|
}
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
$_SESSION['currentpage']=$CurrentPage;
|
$_SESSION["currentpage"]=$CurrentPage;
|
||||||
} else {
|
} else {
|
||||||
|
if (isset($Entries[0])) {
|
||||||
$Entries=array_reverse($Entries);
|
$Entries=array_reverse($Entries);
|
||||||
foreach($Entries as $e=>$Entry) SinlgeEntry($Entry);
|
foreach($Entries as $e=>$Entry) SinlgeEntry($Entry);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_POST['submit']) {
|
if(isset($_POST["submit"])) {
|
||||||
if (!$_POST['text']) $PageStatus="emptytext";
|
if (!$_POST["text"]) $PageStatus="emptytext";
|
||||||
if (!$_POST['name']) $PageStatus="emptyname";
|
if (!$_POST["name"]) $PageStatus="emptyname";
|
||||||
if ($GBupload) {
|
if ($GBupload) {
|
||||||
if ($_FILES['uploadedfile']['tmp_name']) {
|
if ($_FILES["uploadedfile"]["tmp_name"]) {
|
||||||
$UploadedFile=CheckFile();
|
$UploadedFile=CheckFile();
|
||||||
if (!$UploadedFile) {
|
if (!$UploadedFile) {
|
||||||
$PageStatus="wrongimage";
|
$PageStatus="wrongimage";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (($_POST['name'])&&($_POST['text']))
|
if (($_POST["name"])&&($_POST["text"]))
|
||||||
if ($_POST["captcha"]&&(md5(base64_encode($_POST["captcha"]))==$_SESSION["captcha"])) {
|
if (isset($_POST["captcha"])&&(md5(base64_encode($_POST["captcha"]))==$_SESSION["captcha"])) {
|
||||||
if (!$PageStatus=="wrongimage") {
|
if (!isset($PageStatus)=="wrongimage") {
|
||||||
AddEntry();
|
AddEntry();
|
||||||
if ($GBnotificationmailto) SendMail();
|
if ($GBnotificationmailto) SendMail();
|
||||||
}
|
}
|
||||||
} else if (!$GBcaptcha) {
|
} else if (!$GBcaptcha) {
|
||||||
if (!$PageStatus=="wrongimage") {
|
if (!isset($PageStatus)=="wrongimage") {
|
||||||
AddEntry();
|
AddEntry();
|
||||||
if ($GBnotificationmailto) SendMail();
|
if ($GBnotificationmailto) SendMail();
|
||||||
}
|
}
|
||||||
} else $PageStatus="wrongcaptcha";
|
} else $PageStatus="wrongcaptcha";
|
||||||
if (($PageStatus)&&!($PageStatus=="added")) {
|
if (($PageStatus)&&!($PageStatus=="added")) {
|
||||||
$SESSION["value"]["name"]=$_POST['name'];
|
$SESSION["value"]["name"]=$_POST["name"];
|
||||||
$SESSION["value"]["from"]=$_POST['from'];
|
$SESSION["value"]["from"]=$_POST["from"];
|
||||||
$SESSION["value"]["link"]=$_POST['link'];
|
$SESSION["value"]["link"]=$_POST["link"];
|
||||||
$SESSION["value"]["subj"]=$_POST['subj'];
|
$SESSION["value"]["subj"]=$_POST["subj"];
|
||||||
$SESSION["value"]["category"]=$_POST['category'];
|
$SESSION["value"]["category"]=$_POST["category"];
|
||||||
$SESSION["value"]["email"]=$_POST['email'];
|
$SESSION["value"]["email"]=$_POST["email"];
|
||||||
$SESSION["value"]["text"]=$_POST['text'];
|
$SESSION["value"]["text"]=$_POST["text"];
|
||||||
$Values=$SESSION["value"];
|
$Values=$SESSION["value"];
|
||||||
} else Unset($SESSION["value"]);
|
} else if (isset($SESSION["value"])) Unset($SESSION["value"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$Entries=ReadEntries();
|
$Entries=ReadEntries();
|
||||||
|
|
2
page.php
2
page.php
|
@ -7,7 +7,7 @@
|
||||||
?><!DOCTYPE html>
|
?><!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $Titles[HeadTitle];?></title>
|
<title><?php echo $Titles["HeadTitle"];?></title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Ubuntu:regular&subset=Latin,Cyrillic">
|
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Ubuntu:regular&subset=Latin,Cyrillic">
|
||||||
<link rel="stylesheet" type="text/css" href="anthrstlsht.css">
|
<link rel="stylesheet" type="text/css" href="anthrstlsht.css">
|
||||||
|
|
102
settings.php
102
settings.php
|
@ -30,55 +30,55 @@ $GBcategoryfield=array(
|
||||||
4=>"Order",
|
4=>"Order",
|
||||||
5=>"Other");
|
5=>"Other");
|
||||||
$GBstriptags=true; // enable or disable strip tags function during adding new entry
|
$GBstriptags=true; // enable or disable strip tags function during adding new entry
|
||||||
$Titles[HeadTitle]="Guestbook";
|
$Titles["HeadTitle"]="Guestbook";
|
||||||
$Titles[Page]="Guestbook";
|
$Titles["Page"]="Guestbook";
|
||||||
$Titles[Name]="Your name";
|
$Titles["Name"]="Your name";
|
||||||
$Titles[Required]="required";
|
$Titles["Required"]="required";
|
||||||
$Titles[City]="City";
|
$Titles["City"]="City";
|
||||||
$Titles[Email]="E-mail";
|
$Titles["Email"]="E-mail";
|
||||||
$Titles[NotPublic]="will not be published";
|
$Titles["NotPublic"]="will not be published";
|
||||||
$Titles[Link]="Homepage";
|
$Titles["Link"]="Homepage";
|
||||||
$Titles[Text]="Your message";
|
$Titles["Text"]="Your message";
|
||||||
$Titles[Captcha]="Security question";
|
$Titles["Captcha"]="Security question";
|
||||||
$Titles[CaptchaPlus]="plus";
|
$Titles["CaptchaPlus"]="plus";
|
||||||
$Titles[Submit]="Submit";
|
$Titles["Submit"]="Submit";
|
||||||
$Titles[Added]="Your message has been added.";
|
$Titles["Added"]="Your message has been added.";
|
||||||
$Titles[EmptyName]="Please, type your name.";
|
$Titles["EmptyName"]="Please, type your name.";
|
||||||
$Titles[EmptyText]="Please, type your message.";
|
$Titles["EmptyText"]="Please, type your message.";
|
||||||
$Titles[WrongCaptcha]="Please, type correct security answer.";
|
$Titles["WrongCaptcha"]="Please, type correct security answer.";
|
||||||
$Titles[From]="from";
|
$Titles["From"]="from";
|
||||||
$Titles[Wrote]="wrote";
|
$Titles["Wrote"]="wrote";
|
||||||
$Titles[Response]="Response";
|
$Titles["Response"]="Response";
|
||||||
$Titles[EmptyFile]="Guestbook is empty yet.";
|
$Titles["EmptyFile"]="Guestbook is empty yet.";
|
||||||
$Titles[Login]="Administrator login:";
|
$Titles["Login"]="Administrator login:";
|
||||||
$Titles[Password]="Password:";
|
$Titles["Password"]="Password:";
|
||||||
$Titles[Enter]="Enter";
|
$Titles["Enter"]="Enter";
|
||||||
$Titles[WrongLogin]="Wrong login or password.";
|
$Titles["WrongLogin"]="Wrong login or password.";
|
||||||
$Titles[AdminHeader]="Guestbook administration";
|
$Titles["AdminHeader"]="Guestbook administration";
|
||||||
$Titles[AdminExit]="Exit";
|
$Titles["AdminExit"]="Exit";
|
||||||
$Titles[AdminHello]="Hello";
|
$Titles["AdminHello"]="Hello";
|
||||||
$Titles[AdminName]="Name";
|
$Titles["AdminName"]="Name";
|
||||||
$Titles[AdminMessage]="Message";
|
$Titles["AdminMessage"]="Message";
|
||||||
$Titles[AdminDate]="Date";
|
$Titles["AdminDate"]="Date";
|
||||||
$Titles[AdminApply]="Apply changes";
|
$Titles["AdminApply"]="Apply changes";
|
||||||
$Titles[AdminDeleteChecked]="Delete checked";
|
$Titles["AdminDeleteChecked"]="Delete checked";
|
||||||
$Titles[AdminEdit]="Edit";
|
$Titles["AdminEdit"]="Edit";
|
||||||
$Titles[AdminDelete]="Delete";
|
$Titles["AdminDelete"]="Delete";
|
||||||
$Titles[AdminCancel]="Cancel";
|
$Titles["AdminCancel"]="Cancel";
|
||||||
$Titles[AdminSureDel]="Are you sure to delete";
|
$Titles["AdminSureDel"]="Are you sure to delete";
|
||||||
$Titles[AdminSureDelMessages]="messages";
|
$Titles["AdminSureDelMessages"]="messages";
|
||||||
$Titles[MailSubject]="New entry in your guestbook";
|
$Titles["MailSubject"]="New entry in your guestbook";
|
||||||
$Titles[MailAdmin]="You can edit, delete or reply this message via admin page";
|
$Titles["MailAdmin"]="You can edit, delete or reply this message via admin page";
|
||||||
$Titles[First]="First";
|
$Titles["First"]="First";
|
||||||
$Titles[Last]="Last";
|
$Titles["Last"]="Last";
|
||||||
$Titles[Previous]="<<";
|
$Titles["Previous"]="<<";
|
||||||
$Titles[Next]=">>";
|
$Titles["Next"]=">>";
|
||||||
$Titles[Search]="Search";
|
$Titles["Search"]="Search";
|
||||||
$Titles[NoResult]="No search result";
|
$Titles["NoResult"]="No search result";
|
||||||
$Titles[ReadMore]="Read more";
|
$Titles["ReadMore"]="Read more";
|
||||||
$Titles[FileUpload]="Upload image:";
|
$Titles["FileUpload"]="Upload image:";
|
||||||
$Titles[WrongImage]="Can't upload image.";
|
$Titles["WrongImage"]="Can't upload image.";
|
||||||
$Titles[Subject]="Subject";
|
$Titles["Subject"]="Subject";
|
||||||
$Titles[Category]="Category";
|
$Titles["Category"]="Category";
|
||||||
$Titles[About]="about";
|
$Titles["About"]="about";
|
||||||
?>
|
?>
|
||||||
|
|
102
settings_ru.php
102
settings_ru.php
|
@ -31,55 +31,55 @@ $GBcategoryfield=array(
|
||||||
4=>"Order",
|
4=>"Order",
|
||||||
5=>"Other");
|
5=>"Other");
|
||||||
$GBstriptags=true; // включение или отключение функции обрезания тегов при добавлении новой записи
|
$GBstriptags=true; // включение или отключение функции обрезания тегов при добавлении новой записи
|
||||||
$Titles[HeadTitle]="Гостевая книга";
|
$Titles["HeadTitle"]="Гостевая книга";
|
||||||
$Titles[Page]="Гостевая книга";
|
$Titles["Page"]="Гостевая книга";
|
||||||
$Titles[Name]="Ваше имя";
|
$Titles["Name"]="Ваше имя";
|
||||||
$Titles[Required]="обязательно";
|
$Titles["Required"]="обязательно";
|
||||||
$Titles[City]="Город";
|
$Titles["City"]="Город";
|
||||||
$Titles[Email]="Электронная почта";
|
$Titles["Email"]="Электронная почта";
|
||||||
$Titles[NotPublic]="не будет публиковаться";
|
$Titles["NotPublic"]="не будет публиковаться";
|
||||||
$Titles[Link]="Домашняя страница";
|
$Titles["Link"]="Домашняя страница";
|
||||||
$Titles[Text]="Ваше сообщение";
|
$Titles["Text"]="Ваше сообщение";
|
||||||
$Titles[Captcha]="Вопрос безопасности";
|
$Titles["Captcha"]="Вопрос безопасности";
|
||||||
$Titles[CaptchaPlus]="плюс";
|
$Titles["CaptchaPlus"]="плюс";
|
||||||
$Titles[Submit]="Отправить";
|
$Titles["Submit"]="Отправить";
|
||||||
$Titles[Added]="Ваше сообщение было добавлено.";
|
$Titles["Added"]="Ваше сообщение было добавлено.";
|
||||||
$Titles[EmptyName]="Пожалуйста, введите Ваше имя.";
|
$Titles["EmptyName"]="Пожалуйста, введите Ваше имя.";
|
||||||
$Titles[EmptyText]="Пожалуйста, введите текст сообщения.";
|
$Titles["EmptyText"]="Пожалуйста, введите текст сообщения.";
|
||||||
$Titles[WrongCaptcha]="Пожалуйста, введите верный ответ на вопрос безопасности.";
|
$Titles["WrongCaptcha"]="Пожалуйста, введите верный ответ на вопрос безопасности.";
|
||||||
$Titles[From]="из";
|
$Titles["From"]="из";
|
||||||
$Titles[Wrote]="написал";
|
$Titles["Wrote"]="написал";
|
||||||
$Titles[Response]="Ответ";
|
$Titles["Response"]="Ответ";
|
||||||
$Titles[EmptyFile]="Гостевая книга пока пуста.";
|
$Titles["EmptyFile"]="Гостевая книга пока пуста.";
|
||||||
$Titles[Login]="Имя администратора:";
|
$Titles["Login"]="Имя администратора:";
|
||||||
$Titles[Password]="Пароль:";
|
$Titles["Password"]="Пароль:";
|
||||||
$Titles[Enter]="Войти";
|
$Titles["Enter"]="Войти";
|
||||||
$Titles[WrongLogin]="Неверные имя администратора или пароль.";
|
$Titles["WrongLogin"]="Неверные имя администратора или пароль.";
|
||||||
$Titles[AdminHeader]="Администрация гостевой книги";
|
$Titles["AdminHeader"]="Администрация гостевой книги";
|
||||||
$Titles[AdminExit]="Выход";
|
$Titles["AdminExit"]="Выход";
|
||||||
$Titles[AdminHello]="Приветствую";
|
$Titles["AdminHello"]="Приветствую";
|
||||||
$Titles[AdminName]="Имя";
|
$Titles["AdminName"]="Имя";
|
||||||
$Titles[AdminMessage]="Сообщение";
|
$Titles["AdminMessage"]="Сообщение";
|
||||||
$Titles[AdminDate]="Дата";
|
$Titles["AdminDate"]="Дата";
|
||||||
$Titles[AdminApply]="Принять изменения";
|
$Titles["AdminApply"]="Принять изменения";
|
||||||
$Titles[AdminDeleteChecked]="Удалить отмеченные";
|
$Titles["AdminDeleteChecked"]="Удалить отмеченные";
|
||||||
$Titles[AdminEdit]="Редактирование";
|
$Titles["AdminEdit"]="Редактирование";
|
||||||
$Titles[AdminDelete]="Удалить";
|
$Titles["AdminDelete"]="Удалить";
|
||||||
$Titles[AdminCancel]="Отменить";
|
$Titles["AdminCancel"]="Отменить";
|
||||||
$Titles[AdminSureDel]="Вы уверены, что хотите удалить";
|
$Titles["AdminSureDel"]="Вы уверены, что хотите удалить";
|
||||||
$Titles[AdminSureDelMessages]="сообщений";
|
$Titles["AdminSureDelMessages"]="сообщений";
|
||||||
$Titles[MailSubject]="Новая запись в вашей гостевой книге";
|
$Titles["MailSubject"]="Новая запись в вашей гостевой книге";
|
||||||
$Titles[MailAdmin]="Вы можете редактировать, удалить или ответить на эту запись через страницу администрирования";
|
$Titles["MailAdmin"]="Вы можете редактировать, удалить или ответить на эту запись через страницу администрирования";
|
||||||
$Titles[First]="В начало";
|
$Titles["First"]="В начало";
|
||||||
$Titles[Last]="В конец";
|
$Titles["Last"]="В конец";
|
||||||
$Titles[Previous]="Назад";
|
$Titles["Previous"]="Назад";
|
||||||
$Titles[Next]="Вперед";
|
$Titles["Next"]="Вперед";
|
||||||
$Titles[Search]="Поиск";
|
$Titles["Search"]="Поиск";
|
||||||
$Titles[NoResult]="Ничего не найдено";
|
$Titles["NoResult"]="Ничего не найдено";
|
||||||
$Titles[ReadMore]="Читать далее";
|
$Titles["ReadMore"]="Читать далее";
|
||||||
$Titles[FileUpload]="Загрузить изображение:";
|
$Titles["FileUpload"]="Загрузить изображение:";
|
||||||
$Titles[WrongImage]="Не могу загрузить изображение.";
|
$Titles["WrongImage"]="Не могу загрузить изображение.";
|
||||||
$Titles[Subject]="Тема";
|
$Titles["Subject"]="Тема";
|
||||||
$Titles[Category]="Категория";
|
$Titles["Category"]="Категория";
|
||||||
$Titles[About]="о";
|
$Titles["About"]="о";
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue