diff --git a/README b/README index 6b4e32c..8bc01f9 100644 --- a/README +++ b/README @@ -1,8 +1,10 @@ -PHPCSV Guestbook version 0.92 +PHPCSV Guestbook version 0.93 Simple php guestbook with csv file data storage. -PHPCSV Guestbook 0.92 requires PHP 5.0 or higher version. +Working example: https://zlaxyi.soundragon.su/gb + +PHPCSV Guestbook 0.93 requires PHP 5.0 or higher version. Installation: @@ -19,4 +21,4 @@ Using: If you have uploaded files to a subfolder "/guestbook" of your webserver, then http://yourserver.domain/guestbook/ will open a guestbook. Following the link http://yourserver.domain/guestbook/administration.php will open the administration panel. -For changing appearance you can edit page.php like simple html (for example: add css tags). +For changing appearance you can edit page.php like simple html (for example: add css tags). \ No newline at end of file diff --git a/administration.php b/administration.php index 53cf422..3b2f6d1 100644 --- a/administration.php +++ b/administration.php @@ -1,6 +1,6 @@ 0)&&(count($Entries)>$GBpagination)) { + $Entries=array_reverse($Entries); + if ($_GET['page']) switch ($_GET['page']) { + case $Titles[First]: + $CurrentPage=0; + break; + case $Titles[Last]: + $CurrentPage=intdiv(count($Entries),$GBpagination); + break; + case "$Titles[Previous]": + $CurrentPage=$_SESSION['currentpage']-1; + break; + case "$Titles[Next]": + $CurrentPage=$_SESSION['currentpage']+1; + break; + default: + $CurrentPage=$_GET['page']-1; + } + else $CurrentPage=0; + for ($e = ($GBpagination*$CurrentPage); $e < ($GBpagination*($CurrentPage+1)); $e++) { + if ($e>=count($Entries)) break; + echo "

",$Entries[$e][7],". "; + if ($Entries[$e][2]) echo ""; + echo "",$Entry[0],""; + if ($Entries[$e][2]) echo ""; + if ($Entries[$e][1]) echo " ",$Titles[From]," ",$Entries[$e][1],""; + echo ", ",date("j.m.Y, H:i",$Entries[$e][5]),", ",$Titles[Wrote],":


\n"; + echo " ",nl2br($Entries[$e][4]),"
\n"; + if ($Entries[$e][6]) echo "
$Titles[Response]:
\n"; + if ($Entries[$e][6]) echo nl2br($Entries[$e][6]),"

\n"; + echo "

\n"; + } + echo "
\n"; + if ($CurrentPage>0) { + echo " \n"; + echo " \n"; + } + for ($p = ($CurrentPage-2); $p <= ($CurrentPage+2); $p++) { + $page = $p+1; + if (($p>=0)&&($p<(count($Entries)/$GBpagination))) { + echo " \n"; + } + } + if ($CurrentPage<((count($Entries)/$GBpagination)-1)) { + echo " \n"; + echo " \n"; + } + echo "
\n"; + $_SESSION['currentpage']=$CurrentPage; + } else { $Entries=array_reverse($Entries); foreach($Entries as $e=>$Entry) { echo "

",$Entry[7],". "; diff --git a/page.php b/page.php index d69e13e..e85e554 100644 --- a/page.php +++ b/page.php @@ -1,6 +1,6 @@ >"; ?> diff --git a/settings_ru.php b/settings_ru.php index 528c05d..a2d9d6e 100644 --- a/settings_ru.php +++ b/settings_ru.php @@ -1,6 +1,6 @@