• [MOD] guestbook 5 0 5 1
Currently:  

Author Topic: [MOD] guestbook  (Read 528727 times)

0 Members and 1 Guest are viewing this topic.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] guestbook
« Reply #135 on: February 13, 2006, 03:49:13 PM »
as i already said,
please post your constants.php and guestbook.php here.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline Svenni70

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • svenni.org
Re: [MOD] guestbook
« Reply #136 on: February 13, 2006, 04:01:22 PM »
here is the constants.php


<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: constants.php                                        *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.1                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

// If 4images has problems to find out the right URL, define it here.
// define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

// Table names
define('CATEGORIES_TABLE', $table_prefix.'categories');
define('COMMENTS_TABLE', $table_prefix.'comments');
define('GROUP_ACCESS_TABLE', $table_prefix.'groupaccess');
define('GROUP_MATCH_TABLE', $table_prefix.'groupmatch');
define('GROUPS_TABLE', $table_prefix.'groups');
define('IMAGES_TABLE', $table_prefix.'images');
define('IMAGES_TEMP_TABLE', $table_prefix.'images_temp');
define('LIGHTBOXES_TABLE', $table_prefix.'lightboxes');
define('POSTCARDS_TABLE', $table_prefix.'postcards');
define('SESSIONS_TABLE', $table_prefix.'sessions');
define('SESSIONVARS_TABLE', $table_prefix.'sessionvars');
define('SETTINGS_TABLE', $table_prefix.'settings');
define('USERS_TABLE', $table_prefix.'users');
define('WORDLIST_TABLE', $table_prefix.'wordlist');
define('WORDMATCH_TABLE', $table_prefix.'wordmatch');
define('GUESTBOOK_TABLE', $table_prefix.'guestbook');

// URL Parameters
define('URL_IMAGE_ID', 'image_id');
define('URL_CAT_ID', 'cat_id');
define('URL_USER_ID', 'user_id');
define('URL_POSTCARD_ID', 'postcard_id');
define('URL_COMMENT_ID', 'comment_id');
define('URL_PAGE', 'page');
define('URL_ID', 'id');


// User levels
define('GUEST', -1);
define('USER_AWAITING', 1);
define('USER', 2);
define('ADMIN', 9);


// Permission levels
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);


// Group types
define('GROUPTYPE_GROUP', 1);
define('GROUPTYPE_SINGLE', 2);


// Chmod for files and directories created by 4images
define('CHMOD_FILES', 0666);
define('CHMOD_DIRS', 0777);


// Will be used to replace the {xxx} tage if the value is empty.
// Netscape Browser sometimes need this to display table cell background colors.
define('REPLACE_EMPTY', '&nbsp;');


// Max rating value
define('MAX_RATING', 5);


// Days postcards will be held in the database
define('POSTCARD_EXPIRY', 10);


// Time offset for your website. Sometimes usefull if your server is located
// in other timezones.
define('TIME_OFFSET', 0);


// All words <= MIN_SEARCH_KEYWORD_LENGTH and >= MAX_SEARCH_KEYWORD_LENGTH
// are not added to the search index
define('MIN_SEARCH_KEYWORD_LENGTH', 3);
define('MAX_SEARCH_KEYWORD_LENGTH', 25);

// If you set this to 1, admins will authenticated additionally with cookies.
// If you use "User Integration", you should set this to 0.
define('ADMIN_SAFE_LOGIN', 0);


// If you use GD higher 2.0.1 and PHP higher 4.0.6 set this to 1.
// Your thumbnails will be created with better quality
define('CONVERT_IS_GD2', 0);


// If you have a lot of images in your database,
// the random image function could make your programm slow.
// Try first to set "SHOW_RANDOM_CAT_IMAGE" to 0.
define('SHOW_RANDOM_IMAGE', 1);
define('SHOW_RANDOM_CAT_IMAGE', 0);


// Check existence of remote image files.
// If you choose 1, you could get sometimes timeout errors
define('CHECK_REMOTE_FILES', 0);


// Allow execution of PHP code in templates
define('EXEC_PHP_CODE', 1);

// Data paths
define('MEDIA_DIR', 'data/media');
define('THUMB_DIR', 'data/thumbnails');
define('MEDIA_TEMP_DIR', 'data/tmp_media');
define('THUMB_TEMP_DIR', 'data/tmp_thumbnails');
define('DATABASE_DIR', 'data/database');
define('TEMPLATE_DIR', 'templates');


// Script version
define('SCRIPT_VERSION', '1.7.1');


// Debug contants
// define("PRINT_STATS", 1);
// define("PRINT_QUERIES", 1);
// define('PRINT_CACHE_MESSAGES', 1);

?>
Svenni

Offline Svenni70

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • svenni.org
Re: [MOD] guestbook
« Reply #137 on: February 13, 2006, 04:02:40 PM »
here is the guestbook.php


<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: details.php                                          *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) f?r weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$main_template = 'guestbook';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');

if ($config['guestbook_view'] != 1) {
  header("Location: ".$site_sess->url(ROOT_PATH."index.php"));
  exit;
}

if ($action == "") {
   $action = "showcomments";
}

if (isset($HTTP_GET_VARS[URL_COMMENT_ID]) || isset($HTTP_POST_VARS[URL_COMMENT_ID])) {
  $comment_id = (isset($HTTP_GET_VARS[URL_COMMENT_ID])) ? intval($HTTP_GET_VARS[URL_COMMENT_ID]) : intval($HTTP_POST_VARS[URL_COMMENT_ID]);
}
else {
  $comment_id = 0;
}
if ($action == "deletecomment") {
  if (!$comment_id || ($config['user_delete_guestbook'] != 1 && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
 
  $sql = "SELECT comment_id, comment_ip
          FROM ".GUESTBOOK_TABLE."
          WHERE comment_id = $comment_id";
  $comment_row = $site_db->query_firstrow($sql);
  if (!$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
 
  $txt_clickstream = $lang['comment_delete'];
 
  $sql = "DELETE FROM ".GUESTBOOK_TABLE."
          WHERE comment_id = $comment_id";
  $result = $site_db->query($sql);
 
  $msg = ($result) ? $lang['comment_delete_success'] : $lang['comment_delete_error'];
}

if ($action == "removecomment") {
  if (!$comment_id || ($config['user_delete_guestbook'] != 1 && $user_info['user_level'] != ADMIN)) {
    header("Location: ".$site_sess->url($url, "&"));
    exit;
  }

  $sql = "SELECT comment_id, user_name AS comment_user_name, comment_site, comment_text, comment_ip
          FROM ".GUESTBOOK_TABLE."
          WHERE comment_id = $comment_id";
  $comment_row = $site_db->query_firstrow($sql);
  if (!$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) {
    header("Location: ".$site_sess->url($url, "&"));
    exit;
  }

  $txt_clickstream = $lang['comment_delete'];
  $comment_user_name = $comment_row['comment_user_name'];
 
  $site_template->register_vars(array(
    "comment_id" => $comment_id,
    "comment_user_name" => htmlspecialchars($comment_user_name),
    "comment_site" => format_text($comment_row['comment_site'], 0, $config['wordwrap_comments'], 0, 0),
    "comment_text" => format_text($comment_row['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
    "lang_delete_comment" => $lang['comment_delete'],
    "lang_delete_comment_confirm" => $lang['comment_delete_confirm'],
    "lang_name" => $lang['name'],
    "lang_site" => $lang['site'],
    "lang_comment" => $lang['comment'],
    "lang_submit" => $lang['submit'],
    "lang_reset" => $lang['reset'],
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']
  ));
  $contents = $site_template->parse_template("guestbook_deletecomment");
}

if ($action == "updatecomment") {
  if (!$comment_id || ($config['user_edit_guestbook'] != 1 && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
  $sql = "SELECT comment_id, comment_ip
          FROM ".GUESTBOOK_TABLE." 
          WHERE comment_id = $comment_id";
  $comment_row = $site_db->query_firstrow($sql);
  if (!$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
 
  $txt_clickstream = $lang['comment_edit'];
 
  $error = 0;
 
  $comment_site = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_site']));
  $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
  $comment_user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_user_name']));
 
  if ($comment_user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    } elseif ($site_db->not_empty("SELECT user_name FROM ".
                              GUESTBOOK_TABLE.
                           " WHERE user_name= '".strtolower($comment_user_name)."' AND comment_date > ".(time()-60 * 60 * 24))) {
      $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
      $error = 1;
   }
    if ($comment_text == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
      $error = 1;
    }

   if (!$error)  {
      if ($comment_site =="http://") {
         $comment_site = "";
      }
      $sql = "UPDATE ".GUESTBOOK_TABLE."
               SET comment_site = '$comment_site', comment_text = '$comment_text', user_name= '$comment_user_name'
            WHERE comment_id = $comment_id";
      $result = $site_db->query($sql);
      $msg = ($result) ? $lang['comment_edit_success'] : $lang['comment_edit_error'];
   } else {
      $action = "editcomment";
      $sendprocess = 1;
   }
}

if ($action == "editcomment") {
  if (!$comment_id || ($config['user_edit_guestbook'] != 1 && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $sql = "SELECT comment_id, user_name AS comment_user_name, comment_site, comment_text, comment_ip
          FROM ".GUESTBOOK_TABLE."
        WHERE comment_id = $comment_id";
  $comment_row = $site_db->query_firstrow($sql);
  if (!$comment_row || ($comment_row['comment_ip'] != $session_info['session_ip'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
 
  $txt_clickstream = $lang['comment_edit'];

  $comment_site = (isset($HTTP_POST_VARS['comment_site'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_site']))) : (empty($comment_row['comment_site']) ? "http://" : $comment_row['comment_site']);
  $comment_text = (isset($HTTP_POST_VARS['comment_text'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_text']))) : $comment_row['comment_text'];
  $comment_user_name = (isset($HTTP_POST_VARS['comment_user_name'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_user_name']))) : $comment_row['comment_user_name'];

  $bbcode = "";
  if ($config['bb_comments'] == 1) {
    $site_template->register_vars(array(
      "lang_bbcode" => $lang['bbcode'],
     "smiles_text" => get_smiles_text(),
      "lang_tag_prompt" => $lang['tag_prompt'],
      "lang_link_text_prompt" => $lang['link_text_prompt'],
      "lang_link_url_prompt" => $lang['link_url_prompt'],
      "lang_link_email_prompt" => $lang['link_email_prompt'],
      "lang_list_type_prompt" => $lang['list_type_prompt'],
      "lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    $bbcode = $site_template->parse_template("bbcode");
  }

  $site_template->register_vars(array(
    "bbcode" => $bbcode,
    "comment_id" => $comment_id,
    "comment_user_name" => htmlspecialchars($comment_user_name),
    "comment_site" => htmlspecialchars($comment_site),
    "comment_text" => htmlspecialchars($comment_text),
    "lang_edit_comment" => $lang['comment_edit'],
    "lang_name" => $lang['name'],
    "lang_site" => $lang['site'],
    "lang_comment" => $lang['comment'],
    "lang_submit" => $lang['submit'],
    "lang_reset" => $lang['reset'],
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no'],
  ));
  $contents = $site_template->parse_template("guestbook_editcomment");
}

//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if ($action == "postcomment" && $config['guestbook_post'] == 1) {
    $comment_user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_user_name']));
    $comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
   $comment_site = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_site']));
    // Flood Check
   $sql = "SELECT comment_ip, comment_date
              FROM ".GUESTBOOK_TABLE."
         WHERE comment_ip = '".$session_info['session_ip']."' 
         ORDER BY comment_date DESC
         LIMIT 1";
   $spam_row = $site_db->query_firstrow($sql);
   $spamtime = $spam_row['comment_date'] + 360;

   if (time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
      $error = 1;
   }

   if ($comment_user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    } elseif ($site_db->not_empty("SELECT user_name FROM ".
                              GUESTBOOK_TABLE.
                           " WHERE user_name= '".strtolower($comment_user_name)."' AND comment_date > ".(time()-60 * 60 * 24))) {
      $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
      $error = 1;
   }
    if ($comment_text == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
      $error = 1;
    }

   if (!$error)  {
      if ($comment_site =="http://") {
         $comment_site = "";
      }
      $sql = "INSERT INTO ".GUESTBOOK_TABLE."
               (user_name, comment_site, comment_text, comment_ip, comment_date)
            VALUES
            ('$comment_user_name', '$comment_site', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
   }
   unset($spam_row);
}


//-----------------------------------------------------
//---Show Guestbook Comments---------------------------
//-----------------------------------------------------

if (($action == "showcomments" || $action == "postcomment" ) && $config['guestbook_view'] == 1) {
     if (isset($HTTP_POST_VARS['commentsetperpage']) || isset($HTTP_GET_VARS['commentsetperpage'])) {
      $commentsetperpage = (intval($HTTP_POST_VARS['commentsetperpage']) ) ? intval($HTTP_POST_VARS['commentsetperpage']) : intval($HTTP_GET_VARS['commentsetperpage']);
      if ($commentsetperpage) {
         $site_sess->set_session_var("commentperpage", $commentsetperpage);
         $session_info['commentperpage'] = $commentsetperpage;
      }
   }

   if (isset($session_info['commentperpage'])) {
      $commentperpage = $session_info['commentperpage'];
   } else {
      $commentperpage = 8;
   }
 
   $sql = "SELECT COUNT(user_name) AS comments
          FROM ".GUESTBOOK_TABLE;
   $result = $site_db->query_firstrow($sql);
   $num_comments = $result['comments'];
   $site_db->free_result();
   $num_rows_all = (isset($num_comments)) ? $num_comments : 0;
   $link_arg = $site_sess->url(ROOT_PATH."guestbook.php"); 
   include_once(ROOT_PATH.'includes/paging.php');
   $getpaging = new Paging($page, $commentperpage, $num_rows_all, $link_arg);
   $offset = $getpaging->get_offset();
   $site_template->register_vars(array(
        "paging" => $getpaging->get_paging(),
      "paging_stats" => $getpaging->get_paging_stats()
   ));

   $sql = "SELECT comment_id, user_name AS comment_user_name, comment_site, comment_text, comment_ip, comment_date
         FROM ".GUESTBOOK_TABLE."
         ORDER BY comment_date DESC
         LIMIT $offset, $commentperpage";
 
   $result = $site_db->query($sql);
   $comment_row = array();
   while ($row = $site_db->fetch_array($result)) {
      $comment_row[] = $row;
   }
   $site_db->free_result($result);
   $num_comments = sizeof($comment_row);
   $comments = "";
   
   $site_template->register_vars(array(
        "lang_guest_from" => $lang['guest_from'],
      "lang_guest_site" => $lang['guest_site']
   ));
   if ($num_comments) {
      $bgcounter = 0;
      for ($i = 0; $i < $num_comments; $i++) {
         $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

         $comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
         $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

         $admin_links = "";
         if ($user_info['user_level'] == ADMIN) {
            $admin_links .= "<a href=\"".
                          $site_sess->url(ROOT_PATH."guestbook.php?action=editcomment&amp;comment_id=".
                                         $comment_row[$i]['comment_id']).
                          "\" target=\"admin_edit\">".$lang['edit']."</a>&nbsp;";
            $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id'])."\" target=\"admin_edit\">".$lang['delete']."</a>";
         } elseif ($comment_row[$i]['comment_ip'] == $session_info['session_ip']) { // if ip equals, permit to edit
            $admin_links .= ($config['user_edit_guestbook'] != 1) ? "" :
                          "<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id'])."\" target=\"admin_edit\">".$lang['edit']."</a>&nbsp;";
            $admin_links .= ($config['user_delete_guestbook'] != 1) ? "" :
                          "<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id'])."\" target=\"admin_edit\">".$lang['delete']."</a>";
         }
         $site_template->register_vars(array(
            "comment_id" => $comment_row[$i]['comment_id'],
            "comment_user_name" => $comment_user_name,
            "comment_user_ip" => $comment_user_ip,
            "comment_site" => format_text($comment_row[$i]['comment_site'], 0, $config['wordwrap_comments'], 0, 0),
            "comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
            "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
            "row_bg_number" => $row_bg_number,
            "admin_links" => $admin_links,
         ));
            $comments .= $site_template->parse_template("guestbook_comment_bit");
         
      } // end for
   } else {
      $comments = $lang['be_the_first'];
   }
   //---End Show Guestbook Comments----


  //-----------------------------------------------------
  //--- BBCode & Form -----------------------------------
  //-----------------------------------------------------
  $bbcode = "";
  if ($config['bb_comments'] == 1) {
    $site_template->register_vars(array(
      "lang_bbcode" => $lang['bbcode'],
       
      "lang_tag_prompt" => $lang['tag_prompt'],
      "lang_link_text_prompt" => $lang['link_text_prompt'],
      "lang_link_url_prompt" => $lang['link_url_prompt'],
      "lang_link_email_prompt" => $lang['link_email_prompt'],
      "lang_list_type_prompt" => $lang['list_type_prompt'],
      "lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    $bbcode = $site_template->parse_template("bbcode");
  }

  if ($config['guestbook_post'] != 1) {
     $comment_form = "";
  } else {
  $comment_user_name = (isset($HTTP_POST_VARS['comment_user_name']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['comment_user_name']))) : (($user_info['user_level'] != GUEST) ? htmlspecialchars($user_info['user_name']) : "");
  $comment_site = (isset($HTTP_POST_VARS['comment_site']) && $error) ? stripslashes(htmlspecialchars(trim($HTTP_POST_VARS['comment_site']))) : "http://";

  $site_template->register_vars(array(
     "bbcode" => $bbcode,
      "comment_user_name" => $comment_user_name,
      "comment_site" => $comment_site,
      "comment_text" => $comment_text,
      "lang_post_guestbook" => $lang['post_guestbook'],
      "lang_name" => $lang['name'],
      "lang_site" => $lang['site'],
      "lang_comment" => $lang['comment']
    ));
    $comment_form = $site_template->parse_template("guestbook_form");
   $site_template->register_vars("guestbook_form", $comment_form);
   $contents = $site_template->parse_template("guestbook_showcomments");
   unset($comment_form);
  } // end if allow_comments
  $txt_clickstream = $lang['post_guestbook'];
}

//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator']
            ."<a href=\"".$site_sess->url(ROOT_PATH."guestbook.php?action=showcomments")."\">".$lang['guestbook']."</a>".$config['category_separator'].$txt_clickstream."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "contents" => $contents,
  "guestbook_comments" => $comments,
  "lang_sign_my_guestbook" => $lang['sign_my_guestbook'],
  "msg" => $msg,
  "clickstream" => $clickstream
));
unset($contents);
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');

?>
Svenni

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] guestbook
« Reply #138 on: February 13, 2006, 04:31:24 PM »
I have another question over this :

Quote

my sql is mysql 3


Could you tell, from your phpinfo page, the 'exact build number' of mySQL 3 ? 4images requires a minimum version build of mySQL 3 actually. ;)

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] guestbook
« Reply #139 on: February 13, 2006, 05:04:36 PM »
Let me guess.

You are not using the default 4images config?

You have set your own table_prefix?

$table_prefix = "4images_1"; in your config.php?

If yes, than that is the error,
cause the installtion script doesn't read the info for the table prefix.

I attached you an correct installer.
Run this, then it should work.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline Svenni70

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • svenni.org
Re: [MOD] guestbook
« Reply #140 on: February 13, 2006, 05:56:25 PM »
no i get away the wrong message but i loose my image so i upload but thats ok i can upload it again,

http://www.svenni.net/foto/guestbook.php

when i try to post a message in the guestbook i can not se it after
Svenni

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] guestbook
« Reply #141 on: February 13, 2006, 06:00:30 PM »
Sounds like you're looking to access your guestbook remotely. Is it the case ?

Offline Svenni70

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • svenni.org
Re: [MOD] guestbook
« Reply #142 on: February 13, 2006, 06:08:06 PM »
i really dont no,i have follow the steps in the begining of this post 
Svenni

Offline elvedix

  • Pre-Newbie
  • Posts: 2
  • Bosanceros.Com
    • View Profile
    • Bosanceros.Com
Re: [MOD] guestbook
« Reply #143 on: March 02, 2006, 08:06:44 PM »
Also a big thank you from me

Can anybody tell me, how can i only allow registered user to write into the book`?


guestbook.php

After
 
Code: [Select]
include(ROOT_PATH.'includes/page_header.php');
Add
Code: [Select]
if ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) {
  show_error_page($lang['no_permission']);
  exit;
}

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [MOD] guestbook
« Reply #144 on: March 14, 2006, 03:10:09 PM »
Is this possible to use some other filed while submitting in the Guestbook.
Like e-mail & Country ??

How can i Enable Smiles in guestbook post.
I m not a  Programmer.
          But
I m a Good Learner.

Offline Bear

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: [MOD] guest book
« Reply #145 on: March 22, 2006, 08:26:43 AM »
I realise that this is a guest book, for guests.  :wink:

I am having a problem with looks like one of those advertiser bots and i am getting loads of bulk advert links posted on the guest book.
Quote
wow!!! . http://casino-royale.gamblingand.net/casino-royale-script.htm * http://lott (22.03.2006 06:55)
wow!!! . http://casino-royale.gamblingand.net/casino-royale-script.htm * http://lotto.fcpages.com/lotto-super-7.htm * http://bankrupt.prevedmundo.com/credit-card-bankrupt.htm * http://benzene.prevedmundo.com/benzene-intermediate.htm * http://black-jack.gamblingand.net/black-casino-jack.htm  
Homepage: wow!!! . [url]http://casino-royale.gamblingand.net/casino-royale-script.htm
* http://lotto.fcpages.com/lotto-super-7.htm * http://bankrupt.prevedmundo.com/credit-card-bankrupt.htm * [url]http://benzene.prevedmundo.com/benzene-  

Tried banning them by ip but the ip keeps changing, any one have any ideas to stop them or if not how can i change the permissions for members only as an alternative cure.

Thank you

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [MOD] guestbook
« Reply #146 on: March 22, 2006, 10:40:53 AM »
I installed the guest book a week ago, I did some modification, installed smiles & comment spam check.
2 days ago, when I checked my guestbook, everything was working fine. I posted some msgs to test and it was all right.

Today I decided to make the guest book available for users. (Was doing test myself before)

But when I opened the guestbook. I got this error msg
Code: [Select]
DB Error: Bad SQL Query: SELECT COUNT(user_name) AS comments FROM GUESTBOOK_TABLE
Table 'mysite_wallpaper.GUESTBOOK_TABLE' doesn't exist

DB Error: Bad SQL Query: SELECT comment_id, user_name AS comment_user_name, comment_site, comment_text, comment_ip, comment_date FROM GUESTBOOK_TABLE ORDER BY comment_date DESC LIMIT 0, 8
Table 'mysite_wallpaper.GUESTBOOK_TABLE' doesn't exist

I havn't changed anything since last 2 days.
Why i m getting this error ??  Help Please.  :(
I m not a  Programmer.
          But
I m a Good Learner.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] guestbook
« Reply #147 on: March 22, 2006, 10:52:54 AM »
Why i m getting this error ??

because :
'mysite_wallpaper.GUESTBOOK_TABLE' doesn't exist
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: [MOD] guestbook
« Reply #148 on: March 22, 2006, 10:58:54 AM »
BUT 2 days ago, everything was working just fine  :(

How a table from database can be deleted ??  ( I m going to check my DB)

And if this is the case, what I can I do to remove this error??
 
Install database update from guestbook mode once again??

//Edited

Ok I checked my DB. The table is still there. I do have my old entries in it. Something else is wrong.
« Last Edit: March 22, 2006, 11:20:06 AM by Fastian »
I m not a  Programmer.
          But
I m a Good Learner.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] guestbook
« Reply #149 on: March 22, 2006, 11:24:22 AM »
1. check your DB with myPhpAdmin if GUESTBOOK_TABLE exist
2. if GUESTBOOK_TABLE exist check your includes/constants.php
Code: [Select]
define('GUESTBOOK_TABLE', $table_prefix.'guestbook');

Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...