1
BigBrother
manually inserted table
  • 2005/3/25 13:03

  • BigBrother

  • Just popping in

  • Posts: 1

  • Since: 2005/3/25


Hallo,

I try to extend my xtremguestbook with an archive-function. Therefor I created a new table "xoops_xtremguestbook_archiv" (It's a copy of the original guestbook-table). I added the following code:

the functions in admin/index.php:
Quote:

function Messagearchivieren($idmsg) {

//"Are you sure?"-Question
xoops_cp_header();
OpenTable();
echo "<\div align='center'>"._XTG_ARCHIV."<\br /><\br />
<\input type='button' onclick=\"document.location='index.php?op=Messagearchivieren1&idmsg=".$idmsg."'\" value='"._XTG_YES."'>
<\input type='button' onclick=\"document.location='index.php'\" value='"._XTG_NO."'><\/div>";

CloseTable();
xoops_cp_footer();

}

function Messagearchivieren1($idmsg) {

global $xoopsDB, $xoopsModule;
$myts =& MyTextSanitizer::getInstance();

//select message to archive
$result=$xoopsDB->query("SELECT user_id,uname,url,email,title,message,note,post_time,poster_ip,moderate FROM ".$xoopsDB->prefix("xtremguestbook")." WHERE xtremguestbook_id=$idmsg");
list($user_id,$uname,$url,$email,$title,$message,$note,$post_time,$poster_ip,$moderate) = $xoopsDB->fetchRow($result);

//write into archive
$sqlinsert=$xoopsDB->queryf("INSERT INTO ".$xoopsDB->prefix("xtremguestbook_archiv")." (user_id,uname,title,message,post_time,email,url,poster_ip,moderate) VALUES (".$uid.",'".$username."','".$title."','".$message."','".$post_time."','".$email."','".$url."','".$poster_ip."','".$moderate."')");

//delete from guestbook
$result=$xoopsDB->queryf("DELETE FROM ".$xoopsDB->prefix("xtremguestbook")." WHERE xtremguestbook_id=$idmsg");

redirect_header("index.php",1,_XTG_MSGDEL);
exit();
}


the table-structure in sql/mysql.sql:
Quote:

CREATE TABLE `xtremguestbook_archiv` (
`xtremguestbook_id` int(11) NOT NULL auto_increment,
`user_id` int(11) default NULL,
`uname` varchar(150) default NULL,
`title` varchar(150) default NULL,
`message` longtext,
`note` longtext,
`post_time` int(10) NOT NULL default '0',
`email` varchar(60) default NULL,
`url` varchar(100) default NULL,
`poster_ip` varchar(15) default NULL,
`moderate` tinyint(1) default NULL,
PRIMARY KEY (`xtremguestbook_id`)
) TYPE=MyISAM;


an in xoops_version.php:
Quote:

$modversion['tables'][1] = "xtremguestbook_archiv";


After this I updated the module.
Now the Problem: the selected message will be deleted from the guestbook but will not be written in my archive-table.

Does anybody know what to change or what to extend?

Yours,
Bernd Marks

Login

Who's Online

185 user(s) are online (160 user(s) are browsing Support Forums)


Members: 0


Guests: 185


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits