/*
CMSimple Guestbook plugin
© 2006 - Joachim Barthel - www.qualifire.de/cmsimple/en
---------------------------------------------------------------------
Disclaimer: No warranties at all, use on your own risk !
---------------------------------------------------------------------
Requirements: - CMSimple 2.5 is installed and running.
- The plugin loader from cmsimpleplugins.svarrer.dk
is installed and working !
---------------------------------------------------------------------
Feedback to: jbarthel@qualifire.de
---------------------------------------------------------------------
Version 0.1 beta 0 (23. Feb. 2006)
Version 0.1 beta 1 (26. Feb. 2006)
- Support for multilingual use
- Enhancements of display
- Support of CrLf in message
- Storing of IP address
Version 0.1 beta 2 (14. March 2006)
- No double entries on refresh
- Text-Captcha for spam protections
- Using CSS for displaying the entries
Version 0.1 beta 3 (19. March 2006)
- Display of EMAIL and WEBSITE switchable
- Option for removing HTML and SCRIPT elements
- Full CSS support for colors
- Splitting into pages
Version 0.1 beta 4 (24. March 2006)
- support of french language (thanx to Gerd)
- constant width of name column
- Info-Mail for new entries
- ignores empty lines
Version 0.1 beta 5a (18. April 2006)
- support of apostrophe (' and ")
- checking of mandatory field (incl. white spaces)
- beautified info email
- enhanced Captcha
- thanks email
- switching on/off
- support for php w/o bcmath
Version 0.1 beta 5b (19. April 2006)
- enhanced header() for MS IIS
Version 0.1 beta 5c (20. April 2006)
- display of PHP errors (=white page problem)
Version 0.1 beta 5d (30. April 2006)
- enhanced handling of title field
*/
function gblist() {
GLOBAL $su, $sl, $plugin_cf, $plugin_tx, $pth, $plugin;
$t = "";
if(eregi("true",$plugin_cf['gbook']['captcha'])) {
$gbcc = isset($_POST['gbcc']) ? $_POST['gbcc'] : $_GET['gbcc'];
} else {
$gbcc = CreateTextCaptcha();
}
$gbname = isset($_POST['gbname']) ? $_POST['gbname'] : $_GET['gbname'];
$gbemail = isset($_POST['gbemail']) ? $_POST['gbemail'] : $_GET['gbemail'];
$gbwebsite = isset($_POST['gbwebsite']) ? $_POST['gbwebsite'] : $_GET['gbwebsite'];
$gbtitle = isset($_POST['gbtitle']) ? $_POST['gbtitle'] : $_GET['gbtitle'];
$gbmessage = isset($_POST['gbmessage']) ? $_POST['gbmessage'] : $_GET['gbmessage'];
$gbpage = isset($_POST['page']) ? $_POST['page'] : $_GET['page'];
error_reporting(E_ALL);
$plugin = basename(dirname(__FILE__),"/");
$gbfile = $pth['folder']['plugins'].$plugin."/content/guestbook_".$sl.".txt";
$imgpath = $pth['folder']['plugins']."gbook/";
if($gbname && $gbmessage) {
if ($gbcc == CreateTextCaptcha()) {
$gbwebsite = eregi_replace("http://","",$gbwebsite);
$gbname = RemoveHtml($gbname);
$gbemail = RemoveHtml($gbemail);
$gbwebsite = RemoveHtml($gbwebsite);
$gbtitle = str_replace(";",",", $gbtitle);
$gbtitle = RemoveHtml($gbtitle);
if(eregi("true",$plugin_cf['gbook']['remove_html'])) {
$gbmessage = RemoveHtml($gbmessage);
}
$gbmessage = str_replace(chr(13).chr(10),"
",$gbmessage);
$gbmessage = str_replace(chr(13),"
",$gbmessage);
$gbmessage = str_replace(chr(10),"
",$gbmessage);
$gbmessage = str_replace(";",",",$gbmessage);
if (!$fp = fopen($gbfile, 'a')) {
$t .= "