<?php /** * * @package Itschi * @since 2007/05/25 * */ defined('main') or die('no direct access'); $title = $allgAr[ 'title' ] . ' :: Likes'; $hmenu = 'Likes'; $design = new design($title, $hmenu); $design->header(); if ($menu->getA(1) == 'l') { $likes = intval($menu->getE(1)); } if ($menu->getA(1) == 'd') { $delid = intval($menu->getE(1)); } $komm_id = escape($_POST['komm_id'], 'integer'); if (isset($_SESSION[ 'authid' ])) { $username = db_result(db_query("SELECT name FROM prefix_user WHERE id = " . $_SESSION[ 'authid' ]), 0); $usr_avatar = db_result(db_query("SELECT avatar FROM prefix_user WHERE id = " . $_SESSION[ 'authid' ]), 0); $usr_rang = db_result(db_query("SELECT rang FROM prefix_user WHERE id = " . $_SESSION[ 'authid' ]), 0); if (isset($_POST[text])) { db_query("insert into `prefix_neues` set user_id='".$_SESSION[ 'authid' ]."', text='".escape($_POST['text'],'string')."', time='".time()."', is_komment='0'"); } if (isset($komm_id)) { db_query("insert into `prefix_neues` set user_id='".$_SESSION[ 'authid' ]."', text='".escape($_POST['komment'],'string')."', time='".time()."', is_komment='".$komm_id."'"); } if (isset($likes)) { $like = db_fetch_assoc(db_query("select * from `prefix_likes` where m_id = '".$likes."'")); $m = db_fetch_assoc(db_query("select * from `prefix_neues` where id = '".$likes."'")); if ($like['id'] == '') { db_query("insert into `prefix_likes` set user_id='".$_SESSION[ 'authid' ]."', user_id2='".$m['user_id']."',m_id='".$likes."'"); } else if ($like['id'] != '' && $like['user_id'] == $_SESSION[ 'authid' ]) { db_query("delete from `prefix_likes` where id='".$like[id]."'"); } } if (isset($delid)) { $own = db_fetch_assoc(db_query("select * from `prefix_neues` where id = '".$delid."'")); if ($own[user_id] == $_SESSION[ 'authid' ]) { if ($own[is_komment] == '0') { db_query("delete from `prefix_neues` where id='".$delid."' or is_komment='".$delid."'"); } else { db_query("delete from `prefix_neues` where id='".$delid."'"); } } } } $res = db_query("SELECT * FROM `prefix_neues` where is_komment = '0' order by id desc"); while ($row = db_fetch_assoc($res)) { $likes = ''; $komments = ''; $res2 = db_query("SELECT * FROM `prefix_neues` where is_komment = '".$row[id]."' order by id"); while ($row2 = db_fetch_assoc($res2)) { $member2 = db_fetch_assoc(db_query("select * from `prefix_user` where id = '".$row2['user_id']."'")); $komments .= '<div class="comment" id="commentBox_16123"> <div class="commentText"><div id="comments_16123"><div> <table cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td valign="top" width="40px"></td><td style="border:1px solid black;" bgcolor="#EFEFEF"><a href="user.php?id='.$row2['user_id'].'">'.$member2['username'].'</a>: '.htmlspecialchars(stripslashes($row2[text])).'<br><small><span>'.date("d.m.Y H:i:s",$row2[time]).' Uhr '; if ($user->row[username] == $member2['username']) { $komments .= '| <a href="?del='.$row2['id'].'">Löschen</a>'; } $komments .= '</span></small></td></tr></tbody></table></div></div><div class="input" id="input_16123"></div></div>'; } $like = db_fetch_assoc(db_query("select count(id) as g from `prefix_likes` where m_id='".$row['id']."'")); $youlike = '0'; $res3 = db_query("SELECT * FROM `prefix_likes` where m_id= '".$row['id']."' order by id"); while ($row3 = db_fetch_assoc($res3)) { $member3 = db_fetch_assoc(db_query("select * from `prefix_user` where id = '".$row3['user_id']."'")); $likes .= $likes ? ', ' : ''; $likes .= '<a href="user.php?id='.$member3['user_id'].'">'.$member3['username'].'</a>'; if ($member3['username'] == $user->row['username']) { $youlike = '1'; } } $member = db_fetch_assoc(db_query("select * from `prefix_user` where id = '".$row['user_id']."'")); $tpl = new tpl('likes.htm'); $output = array( 'ID' => $row['id'], 'USER_ID' => $row['user_id'], 'TEXT' => escape($row['text'],'textarea'), 'KOMMENTS' => $komments, 'LIKES' => $likes, 'LIKEZAHL' => $like[g], 'YOU_LIKE' => $youlike, 'USERNAME' => $member['username'], 'TIME' => date("d.m.Y H:i:s",$row['time']), 'TITLE_TAG' => 'Startseite | ', 'USERNAME' => $username, 'USER_POINTS' => number_format($user->row['user_points'], 0, '', '.'), 'USER_POSTS' => number_format($user->row['user_posts'], 0, '', '.'), 'USER_AVATAR' => ($usr_avatar) ? $usr_avatar : $config['default_avatar'], 'USER_LEGEND' => $usr_rang); $tpl->set_ar_out($ar, 0); } $design->footer(); ?>
und das kommt dabei raus!
MySQL Error: 1054 : Unknown column 'rang' in 'field list' in Query: SELECT rang FROM ic1_user WHERE id = 1 Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:50 -- db_check_error(...) @ likes.php:21 -- db_query(...) @ index.php:39 -- require_once(...) Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /mnt/webc/23/40/52788640/htdocs/Famenet/include/includes/func/db/mysql.php on line 54 MySQL Error: 1146 : Table 'DB939234.ic1_neues' doesn't exist in Query: insert into `ic1_neues` set user_id='1', text='', time='1316163192', is_komment='0' Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:50 -- db_check_error(...) @ likes.php:23 -- db_query(...) @ index.php:39 -- require_once(...) MySQL Error: 1146 : Table 'DB939234.ic1_neues' doesn't exist in Query: SELECT * FROM `ic1_neues` where is_komment = '0' order by id desc Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:50 -- db_check_error(...) @ likes.php:38 -- db_query(...) @ index.php:39 -- require_once(...) Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /mnt/webc/23/40/52788640/htdocs/Famenet/include/includes/func/db/mysql.php on line 58
Zuletzt modifiziert von Nex4T am 16.09.2011 - 11:01:10