From: <sy...@us...> - 2004-09-13 18:15:02
|
Update of /cvsroot/tikiwiki/tiki/lib/articles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16233/lib/articles Modified Files: Tag: BRANCH-1-9 artlib.php Log Message: the query to find the last_id can return 0 if title is too long(title in bd != title param) => autosublission was not working Index: artlib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/articles/artlib.php,v retrieving revision 1.40.2.3 retrieving revision 1.40.2.4 diff -u -d -r1.40.2.3 -r1.40.2.4 --- artlib.php 26 Aug 2004 17:38:39 -0000 1.40.2.3 +++ artlib.php 13 Sep 2004 18:14:51 -0000 1.40.2.4 @@ -137,6 +137,7 @@ $result = $this->query($query,array($title,$authorName,(int) $topicId,$topicName,(int) $size, $useImage,$isfloat,$imgname,$imgtype,(int) $imgsize,$imgdata,(int) $image_x,(int) $image_y, $heading,$body,(int) $publishDate,(int) $expireDate,(int) $now,$user,$type,(float) $rating,$topline, $subtitle, $linkto, $image_caption, $lang, (int) $subId)); + $id = $subId; } else { // Insert the article $query = "insert into `tiki_submissions`(`title`,`authorName`,`topicId`,`useImage`,`image_name`,`image_size`, @@ -147,10 +148,10 @@ $result = $this->query($query,array($title,$authorName,(int) $topicId,$useImage,$imgname,(int) $imgsize,$imgtype, $imgdata,(int) $publishDate,(int) $expireDate, (int) $now,$heading,$body,$hash,$user,0,0,0,(int) $size,$topicName,(int) $image_x, (int) $image_y,$type,(float) $rating,$isfloat,$topline, $subtitle, $linkto, $image_caption, $lang)); + $query = "select `subId` from `tiki_submissions` where `subId`=last_insert_id()"; + $id = $this->getOne($query); } - $query = "select max(`subId`) from `tiki_submissions` where `created` = ? and `title`=? and `hash`=?"; - $id = $this->getOne($query,array((int) $now,$title,$hash)); $emails = $notificationlib->get_mail_events('article_submitted', '*'); if (!isset($_SERVER["SERVER_NAME"])) { $_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"]; |