Betreff: Re: Wer kennt sich gut mit MyAlbum-P aus von WDC am 27.06.2006 19:22:21
Ich bin der Meinung das ich diesen Befehl bearbeitet habe, und dann wurden die neuen Werte in die falschen Felder geschrieben.
// Update a photo
function myalbum_update_photo( $lid , $cid , $title , $desc , $valid = null , $ext = "" , $x = "" , $y = "" )
{
global $xoopsDB, $xoopsConfig, $xoopsModule;
global $table_photos , $table_text , $table_cat , $mod_url , $isadmin ;
if( isset( $valid ) ) {
$set_status = ",status='$valid'" ;
// Trigger Notification
if( $valid == 1 ) {
$notification_handler =& xoops_gethandler( 'notification' ) ;
// Global Notification
$notification_handler->triggerEvent( 'global' , 0 , 'new_photo' , array( 'PHOTO_TITLE' => $title , 'PHOTO_URI' => "$mod_url/photo.php?lid=$lid&cid=$cid" ) ) ;
// Category Notification
$rs = $xoopsDB->query( "SELECT title FROM $table_cat WHERE cid=$cid" ) ;
list( $cat_title ) = $xoopsDB->fetchRow( $rs ) ;
$notification_handler->triggerEvent( 'category' , $cid , 'new_photo' , array( 'PHOTO_TITLE' => $title , 'CATEGORY_TITLE' => $cat_title , 'PHOTO_URI' => "$mod_url/photo.php?lid=$lid&cid=$cid" ) ) ;
}
} else {
$set_status = '' ;
}
$set_date = empty( $_POST['store_timestamp'] ) ? ",date=UNIX_TIMESTAMP()" : "" ;
// not admin can only touch photos status>0
$whr_status = $isadmin ? '' : 'AND status>0' ;
if( $ext == "" ) {
// modify only text
$xoopsDB->query("UPDATE $table_photos SET cid='$cid',title='".addslashes($title)."' $set_status $set_date WHERE lid='$lid' $whr_status") ;
} else {
// modify text and image
$xoopsDB->query("UPDATE $table_photos SET cid='$cid',title='".addslashes($title)."', ext='$ext',res_x='$x',res_y='$y' $set_status $set_date WHERE lid='$lid' $whr_status");
}
$xoopsDB->query("UPDATE $table_text SET description='".addslashes($desc)."' WHERE lid='$lid'");
redirect_header( "editphoto.php?lid=$lid" , 0 , _ALBM_DBUPDATED ) ;
}
Das ist der Part, wo ich denke, das der Code rein muss. Hatte ich auch probiert, aber er hat mir die Werte halt in die falschen Felder geschrieben.
Danke das du dir soviel Mühe gibst.
|