Author |
Message |
12/02/2006 20:42:17
|
basargunyel
Beginner
Joined: 18/11/2005 17:11:52
Messages: 24
Offline
|
hello,
i made the changes to stop spam on version 2.3.1, following the notes on sticky. but i've lost my guestbook. a blank page appears, u can see it on http://www.zeynepadali.com/agb/index.php
i know something i did is wrong, i tried to undo changes and redo them, but still nothing. it may be a silly mistake but pls help me. i hope old messages are still there, since these changes dont erase anything.
i may reinstall a new version but it will take a lot of work, redesigning forms, etc. but it wont be a fast solution.
pls help me
|
|
12/02/2006 20:51:58
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Your old messages are stil there. You should update to 2.3.4. Download 2.3.4 from this site and replace your existing files with the new ones. Make a backup copy of your templates first as the 2.3.4 templates should be identical except header.php, form.php and body.php I think. then goto www.carbonize.co.uk/AG and get my premodded anti bot files.
oh DO NOT DELETE YOUR EXISTING CONFIG.INC.PHP FILE FROM THE ADMIN FOLDER that has your database info in it and must not be touched so delete the config.inc.php file from the files you download from here.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
12/02/2006 20:59:56
|
basargunyel
Beginner
Joined: 18/11/2005 17:11:52
Messages: 24
Offline
|
isnt there another way? it will take a lot of time. i think i made a small mistake so that index page or entry page cannot be viewed
|
|
12/02/2006 21:11:54
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Ok send me your index page. webmaster@carbonize.co.uk
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
12/02/2006 23:13:49
|
basargunyel
Beginner
Joined: 18/11/2005 17:11:52
Messages: 24
Offline
|
sorry how do i send it?
here's the code, but i have made no changes to the index page, as it was stated in the rules.
<?php
/**
* ----------------------------------------------
* Advanced Guestbook 2.3.1 (PHP/MySQL)
* ----------------------------------------------
*/
$include_path = dirname(__FILE__);
include_once $include_path."/admin/config.inc.php";
include_once $include_path."/lib/$DB_CLASS";
include_once $include_path."/lib/image.class.php";
include_once $include_path."/lib/template.class.php";
if (IS_MODULE) {
if (!eregi("modules.php", $HTTP_SERVER_VARS['PHP_SELF'])) {
die ("You can't access this file directly...");
}
$ModName = basename(dirname( __FILE__ ));
ob_start();
include("header.php");
$GB_PG["base_url"] .= "/modules/$ModName";
$GB_SELF = basename($HTTP_SERVER_VARS['PHP_SELF']);
$GB_PG["index"] = "$GB_SELF?op=modload&name=$ModName&file=index";
$GB_PG["admin"] = "$GB_SELF?op=modload&name=$ModName&file=index&agbook=admin";
$GB_PG["comment"] = "$GB_SELF?op=modload&name=$ModName&file=index&agbook=comment";
$GB_PG["addentry"] = "$GB_SELF?op=modload&name=$ModName&file=index&agbook=addentry";
if (!isset($agbook)) {
$agbook = '';
}
switch ($agbook) {
case "admin":
include_once $include_path."/lib/session.class.php";
$gb_auth = new gb_session($include_path);
$AUTH = $gb_auth->checkSessionID();
$VARS = $gb_auth->fetch_array($gb_auth->query("SELECT * FROM ".$gb_auth->table['cfg']));
$gb_auth->free_result($gb_auth->result);
$template = new gb_template($include_path);
if (isset($HTTP_COOKIE_VARS['lang']) && !empty($HTTP_COOKIE_VARS['lang'])) {
$template->set_lang($HTTP_COOKIE_VARS['lang']);
} else {
$template->set_lang($VARS['lang']);
}
$LANG = $template->get_content();
$gb_auth->close_db();
if (!$AUTH) {
$message = (isset($username) || isset($password)) ? $LANG["PassMess2"] : $LANG["PassMess1"];
eval("\$enter_html = \"".$template->get_template($GB_TPL['header'])."\";");
eval("\$enter_html .= \"".$template->get_template($GB_TPL['adm_enter'])."\";");
eval("\$enter_html .= \"".$template->get_template($GB_TPL['footer'])."\";");
echo $enter_html;
} else {
$GB_PG["admin"] = $GB_PG["base_url"]."/admin.php?username=$username&password=$password&enter=1";
header("Location: $GB_PG[admin]");
exit();
}
break;
case "comment":
include_once $include_path."/lib/vars.class.php";
include_once $include_path."/lib/comment.class.php";
$gb_com = new gb_comment($include_path);
$gb_com->id = (isset($HTTP_GET_VARS["gb_id"])) ? $HTTP_GET_VARS["gb_id"] : '';
$gb_com->id = (isset($HTTP_POST_VARS["gb_id"])) ? $HTTP_POST_VARS["gb_id"] : $gb_com->id;
$gb_com->comment = (isset($HTTP_POST_VARS["comment"])) ? $HTTP_POST_VARS["comment"] : '';
$gb_com->user = (isset($HTTP_POST_VARS["gb_user"])) ? $HTTP_POST_VARS["gb_user"] : '';
$gb_com->pass_comment = (isset($HTTP_POST_VARS["pass_comment"])) ? $HTTP_POST_VARS["pass_comment"] : '';
$gb_action = (isset($HTTP_POST_VARS["gb_comment"])) ? $HTTP_POST_VARS["gb_comment"] : '';
$gb_com->comment_action($gb_action);
$gb_com->db->close_db();
break;
case "addentry":
include_once $include_path."/lib/vars.class.php";
include_once $include_path."/lib/add.class.php";
$gb_post = new addentry($include_path);
$gb_post->name = (isset($HTTP_POST_VARS["gb_name"])) ? $HTTP_POST_VARS["gb_name"] : '';
$gb_post->email = (isset($HTTP_POST_VARS["gb_email"])) ? $HTTP_POST_VARS["gb_email"] : '';
$gb_post->url = (isset($HTTP_POST_VARS["gb_url"])) ? $HTTP_POST_VARS["gb_url"] : '';
$gb_post->comment = (isset($HTTP_POST_VARS["gb_comment"])) ? $HTTP_POST_VARS["gb_comment"] : '';
$gb_post->location = (isset($HTTP_POST_VARS["gb_location"])) ? $HTTP_POST_VARS["gb_location"] : '';
$gb_post->icq = (isset($HTTP_POST_VARS["gb_icq"])) ? $HTTP_POST_VARS["gb_icq"] : '';
$gb_post->aim = (isset($HTTP_POST_VARS["gb_aim"])) ? $HTTP_POST_VARS["gb_aim"] : '';
$gb_post->gender = (isset($HTTP_POST_VARS["gb_gender"])) ? $HTTP_POST_VARS["gb_gender"] : '';
$gb_post->userfile = (isset($HTTP_POST_FILES["userfile"]["tmp_name"]) && $HTTP_POST_FILES["userfile"]["tmp_name"] != "") ? $HTTP_POST_FILES : '';
$gb_post->user_img = (isset($HTTP_POST_VARS["gb_user_img"])) ? $HTTP_POST_VARS["gb_user_img"] : '';
$gb_post->preview = (isset($HTTP_POST_VARS["gb_preview"])) ? 1 : 0;
$gb_post->private = (isset($HTTP_POST_VARS["gb_private"])) ? 1 : 0;
echo $gb_post->process($HTTP_POST_VARS["gb_action"]);
} else {
echo $gb_post->process();
}
$gb_post->db->close_db();
break;
default:
include_once $include_path."/lib/vars.class.php";
include_once $include_path."/lib/gb.class.php";
$gb = new guestbook($include_path);
$entry = (isset($HTTP_GET_VARS["entry"])) ? $HTTP_GET_VARS["entry"] : 0;
$entry = (isset($HTTP_POST_VARS["entry"])) ? $HTTP_POST_VARS["entry"] : $entry;
echo $gb->show_entries($entry);
$gb->db->close_db();
}
ob_end_flush();
$base_path = dirname(dirname($include_path));
chdir("$base_path");
include("$base_path/footer.php");
} else {
include_once $include_path."/lib/vars.class.php";
include_once $include_path."/lib/gb.class.php";
$gb = new guestbook($include_path);
$entry = (isset($HTTP_GET_VARS["entry"])) ? $HTTP_GET_VARS["entry"] : 0;
$entry = (isset($HTTP_POST_VARS["entry"])) ? $HTTP_POST_VARS["entry"] : $entry;
echo $gb->show_entries($entry);
}
?>
|
|
12/02/2006 23:15:57
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
The error wil more likely be in the gb.class.php file from the lib folder. Just open up your email client and paste it into it.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
12/02/2006 23:19:31
|
basargunyel
Beginner
Joined: 18/11/2005 17:11:52
Messages: 24
Offline
|
i feel stupid but i didnt understand "Just open up your email client and paste it into it", sorry
|
|
13/02/2006 00:15:45
|
basargunyel
Beginner
Joined: 18/11/2005 17:11:52
Messages: 24
Offline
|
Carbonize pls help me, i am waiting in front of the screen for your answer I wish i made copies of the files that i changed, and manually delete the spam messages.
|
|
13/02/2006 10:53:32
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Do what you did above. Everybodies gb.class.php file is the same so it makes no difference. Just paste it in here like you did before.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
13/02/2006 17:04:57
|
basargunyel
Beginner
Joined: 18/11/2005 17:11:52
Messages: 24
Offline
|
ok here's the code, i didnt make any changes to it. another question, what is the location for comments previously added to agb?
<?php
/**
* ----------------------------------------------
* Advanced Guestbook 2.3.1 (PHP/MySQL)
* Copyright (c)2001 Chi Kien Uong
* URL: http://www.proxy2.de
* ----------------------------------------------
*/
class guestbook {
var $total;
var $db;
var $template;
var $path;
function guestbook($path='') {
$this->db = new guestbook_vars($path);
$this->db->getVars();
$this->total = 0;
$this->path = $path;
$this->template = &$this->db->template;
}
function get_nav($entry=0) {
global $HTTP_SERVER_VARS, $GB_PG;
$self = (IS_MODULE && eregi("\?",$GB_PG["index"])) ? "$GB_PG[index]&entry=" : basename($HTTP_SERVER_VARS['PHP_SELF'])."?entry=";
$next_page = $entry+$this->db->VARS['entries_per_page'];
$prev_page = $entry-$this->db->VARS['entries_per_page'];
$navigation = '';
if ($prev_page >= 0) {
$navigation = " <img src=\"$GB_PG[base_url]/img/back.gif\" width=\"16\" height=\"14\"><a href=\"$self$prev_page\">".$this->db->LANG["NavPrev"]."</a>\n";
}
if ($next_page < $this->total) {
$navigation = $navigation." <a href=\"$self$next_page\">".$this->db->LANG["NavNext"]."</a><img src=\"$GB_PG[base_url]/img/next.gif\" width=\"16\" height=\"14\">\n";
}
return $navigation;
}
function show_entries($entry=0) {
global $GB_PG;
$LANG =& $this->db->LANG;
$VARS =& $this->db->VARS;
$this->db->fetch_array($this->db->query("select count(*) as total from ".$this->db->table['data']));
$this->total = $this->db->record["total"];
$TPL = $this->get_entries($entry,$this->db->VARS["entries_per_page"]);
$TPL['GB_TOTAL'] = $this->total;
$TPL['GB_JUMPMENU'] = implode("\n",$this->generate_JumpMenu());
$TPL['GB_TIME'] = $this->db->DateFormat(time());
$TPL['GB_NAVIGATION'] = $this->get_nav($entry);
$TPL['GB_HTML_CODE'] = ($this->db->VARS["allow_html"] == 1) ? $this->db->LANG["BookMess2"] : $this->db->LANG["BookMess1"];
eval("\$guestbook_html = \"".$this->template->get_template($this->db->GB_TPL['header'])."\";");
eval("\$guestbook_html .= \"".$this->template->get_template($this->db->GB_TPL['body'])."\";");
eval("\$guestbook_html .= \"".$this->template->get_template($this->db->GB_TPL['footer'])."\";");
return $guestbook_html;
}
function generate_JumpMenu() {
$menu_array[] = "<select name=\"entry\" class=\"select\">";
$menu_array[] = "<option value=\"0\" selected>".$this->db->LANG["FormSelect"]."</option>";
if ($this->db->VARS["entries_per_page"] < $this->total) {
$remain = $this->total % $this->db->VARS["entries_per_page"];
$i = $this->total-$remain;
while ($i > 0) {
$num_max = $i;
$num_min = $num_max-$this->db->VARS["entries_per_page"];
$num_min++;
$menu_array[] = "<option value=\"$remain\">$num_min-$num_max</option>";
$i = $num_min-1;
$remain += $this->db->VARS["entries_per_page"];
}
}
$menu_array[] = "</select>";
$menu_array[] = "<input type=\"submit\" value=\"".$this->db->LANG["FormButton"]."\" class=\"input\">";
return $menu_array;
}
function get_entries($entry,$last_entry) {
global $GB_UPLOAD, $GB_PG;
$img = new gb_image();
$img->set_border_size($this->db->VARS["img_width"], $this->db->VARS["img_height"]);
$LANG =& $this->db->LANG;
$id = $this->total-$entry;
$HOST = '';
$COMMENT = '';
$GB_ENTRIES = '';
$i=0;
$template['entry'] = $this->template->get_template($this->db->GB_TPL['entry']);
$template['com'] = $this->template->get_template($this->db->GB_TPL['com']);
$template['url'] = $this->template->get_template($this->db->GB_TPL['url']);
$template['icq'] = $this->template->get_template($this->db->GB_TPL['icq']);
$template['aim'] = $this->template->get_template($this->db->GB_TPL['aim']);
$template['email'] = $this->template->get_template($this->db->GB_TPL['email']);
$template['image'] = $this->template->get_template($this->db->GB_TPL['image']);
$result = $this->db->query("select x.*, y.p_filename, y.width, y.height, z.comments from ".$this->db->table['data']." x left join ".$this->db->table['pics']." y on (x.id=y.msg_id and y.book_id=2) left join ".$this->db->table['com']." z on (x.id=z.id) group by x.id order by x.id desc limit $entry, $last_entry");
while ($row = $this->db->fetch_array($result)) {
$DATE = $this->db->DateFormat($row['date']);
$MESSAGE = nl2br($row['comment']);
if ($row['p_filename'] && ereg("^img-",$row['p_filename'])) {
if (file_exists("$this->path/$GB_UPLOAD/t_$row[p_filename]")) {
$row['p_filename'] = "t_$row[p_filename]";
}
$new_img_size = $img->get_img_size_format($row['width'], $row['height']);
eval("\$USER_PIC = \"".$template['image']."\";");
} else {
$USER_PIC = '';
}
if ($this->db->VARS["smilies"] == 1) {
$MESSAGE = $this->db->emotion($MESSAGE);
}
if (!$row['location']) {
$row['location'] = "-";
}
$bgcolor = ($i % 2) ? $this->db->VARS["tb_color_2"] : $this->db->VARS["tb_color_1"];
$i++;
if ($row['url']) {
eval("\$URL = \"".$template['url']."\";");
} else {
$URL = '';
}
if ($row['icq'] && $this->db->VARS["allow_icq"]==1) {
eval("\$ICQ = \"".$template['icq']."\";");
} else {
$ICQ = '';
}
if ($row['aim'] && $this->db->VARS["allow_aim"]==1) {
eval("\$AIM = \"".$template['aim']."\";");
} else {
$AIM = '';
}
if ($row['email']) {
eval("\$EMAIL = \"".$template['email']."\";");
} else {
$EMAIL = '';
}
if ($this->db->VARS["allow_gender"]==1) {
$GENDER = ($row['gender']=="f") ? " <img src=\"$GB_PG[base_url]/img/female.gif\" width=\"12\" height=\"12\">" : " <img src=\"$GB_PG[base_url]/img/male.gif\" width=\"12\" height=\"12\">";
} else {
$GENDER = '';
}
if ($this->db->VARS["show_ip"] == 1) {
$hostname = ( eregi("^[-a-z_]+", $row['host']) ) ? "Host" : "IP";
$HOST = "$hostname: $row[host]\n";
}
if ($row['comments']) {
$this->db->query("select * from ".$this->db->table['com']." where id='$row[id]' order by com_id asc");
while ($com = $this->db->fetch_array($this->db->result)) {
$com['comments'] = nl2br($com['comments']);
eval("\$COMMENT .= \"".$template['com']."\";");
}
}
$GB_COMMENT = (IS_MODULE && eregi("\?",$GB_PG["comment"])) ? "$GB_PG[comment]&gb_id=$row[id]" : "$GB_PG[comment]?gb_id=$row[id]";
eval("\$GB_ENTRIES .= \"".$template['entry']."\";");
$COMMENT = "";
$id--;
}
$TPL['GB_ENTRIES'] = $GB_ENTRIES;
return $TPL;
}
}
?>
|
|
13/02/2006 18:23:08
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
Ok well all the template files appear to be in place and nothing wrong with the gb.class.php file. May I suggest just downloading 2.3.4 from this site and replacing every file EXCEPT the config.inc.php file in the admin folder. That file must not be touched.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
13/02/2006 19:31:13
|
basargunyel
Beginner
Joined: 18/11/2005 17:11:52
Messages: 24
Offline
|
ok i'll do it. before installation a few questions: (i couldnt find em in forum topics)
- will my messages remain the same, with the attached pictures?
- what are the file names that i must keep from the old version so that my entry page(index maybe?), comments form page (with deleted questions, smilies etc.), modified questions in my own language remains the same? i will be happy if you tell me, so that i save some time.
i really appreciate if you answer these in detail. i will not delete config.inc.php, not to forget
thank you very much carbonize...
|
|
13/02/2006 20:07:38
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
All entries, comments and settings are stored in your database and not in the guestbook folder. If you installed the guestbook using cPanel DO NOT tell cPanel to uninstall it as this will delete the database as well. As I said replace all files EXCEPT config.inc.php as this holds the database settings.
Unless you hard coded the altered questions into the templates they will be found in the relevant language file. If your site is in English then that file would be lang/english.php.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
|