uid, 3); while ($raamatuId = db_fetch_object($hetkeKasutajaRaamatuIdParing)){ $node = node_load($raamatuId->book_id); $hetkeKasutajaRaamatuPealkirjaParing = db_query("SELECT * FROM {term_data} td WHERE td.tid=%d", $node->field_raamatu_pealkiri[0]['value']); $raamatuPealkiri = db_fetch_object($hetkeKasutajaRaamatuPealkirjaParing); $trimmed = str_replace(' ', '%20', 'http://www.raamatumaailm.ee/sites/default/files/imagecache/skaanepilt/'.$node->field_kaanepilt[0]['filename']); $newPictureSizes = pildiSuurus($trimmed, 96); $block_content .= '
Muuda asukohta:
'; if($_POST['action']=='contact'){ if($_POST['.$raamatuId->book_id.']=='1'){ } elseif($_POST[$raamatuId->book_id]=='2'){ echo ""; $valitudRaamatuIdParing = db_query("UPDATE book_user_status SET status_id=1 WHERE book_id=$raamatuId->book_id AND user_id=$user->uid"); } elseif($_POST[$raamatuId->book_id]=='3'){ echo ""; $valitudRaamatuIdParing = db_query("UPDATE book_user_status SET status_id=2 WHERE book_id=$raamatuId->book_id AND user_id=$user->uid"); } elseif($_POST[$raamatuId->book_id]=='4'){ echo ""; $valitudRaamatuIdParing = db_query("UPDATE book_user_status SET status_id=3 WHERE book_id=$raamatuId->book_id AND user_id=$user->uid"); } elseif($_POST[$raamatuId->book_id]=='5'){ $valitudRaamatuteParing = db_query("SELECT * FROM book_user_status WHERE book_id=$raamatuId->book_id AND user_id=$user->uid AND status_id=4"); $leitud=mysql_num_rows($valitudRaamatuteParing); if($leitud!=0){ $teade = 'Valitud raamat on juba teie riiulis olemas!'; } else { echo ""; $valitudRaamatuIdParing = db_query("INSERT INTO book_user_status (book_id, user_id, status_id) VALUES($raamatuId->book_id, $user->uid, 4)"); } } elseif($_POST[$raamatuId->book_id]=='6'){ $valitudRaamatuteParing = db_query("SELECT * FROM book_user_status WHERE book_id=$raamatuId->book_id AND user_id=$user->uid AND status_id=5"); $leitud=mysql_num_rows($valitudRaamatuteParing); if($leitud!=0){ $teade = 'Valitud raamat on juba teie riiulis olemas!'; } else { echo ""; $valitudRaamatuIdParing = db_query("INSERT INTO book_user_status (book_id, user_id, status_id) VALUES($raamatuId->book_id, $user->uid, 5)"); } } elseif($_POST[$raamatuId->book_id]=='7'){ } elseif($_POST[$raamatuId->book_id]=='9'){ echo ""; $valitudRaamatuIdParing = db_query("DELETE FROM book_user_status WHERE book_id=$raamatuId->book_id AND user_id=$user->uid AND status_id=3"); } } else { echo $teade; } $block_content .= '
'; } $block_content .= '
'; if ($block_content == '
'){ $block['subject'] = ''; $block['content'] = 'Raamatud puuduvad, lisa uus raamat'; return $block; } $block['subject'] = ''; $block['content'] = $block_content; return $block; } }