Kod
<?php
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."members-profile.php";
include LOCALE.LOCALESET."user_fields.php";
if (file_exists(LOCALE.LOCALESET."members-profile-mod.php")) {
include LOCALE.LOCALESET."members-profile-mod.php";
} else {
include LOCALE."English/members-profile-mod.php";
}
if (iMEMBER) {
if (isset($_GET['lookup']) && isNum($_GET['lookup'])) define('lookup', $_GET['lookup']);
if (isset($_GET['group_id']) && isNum($_GET['group_id'])) define('group_id', $_GET['group_id']);
global $data, $userdata;
if (isset($_POST['kasuj'])) {
$result = dbquery("DELETE FROM ".$db_prefix."user_view WHERE user_view_do='".$userdata['user_id']."'");
}
[b]if (isset($_POST['kasuj_zazn'])) {
$result = dbquery("DELETE FROM ".$db_prefix."user_view WHERE user_view_do='WARUNEK'");
}[/b]
$result = dbquery("SELECT * FROM ".$db_prefix."user_view WHERE user_view_do='".$userdata['user_id']."'");
opentable("Szpieg");
echo "<table><tr><td class='tbl2'>Szpieg pokazuje i zapisuje odwiedziny innych użytkowników na Twoim profilu.</tr></td>
<tr><td class='tbl4'>
UWAGA: To jest wczesna alfa, więc proszę o wyrozumiało¶ć;)</td></tr></table>";
closetable();
opensidex("Ostatnie odwiedziny");
echo "<table>";
if (dbrows($result) != 0)
{
while ($d = mysql_fetch_array($result))
{
$result2 = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$d['user_view_od']."' LIMIT 5");
while ($dane = dbarray($result2)) {
echo "<tr><td class='tbl2'><center><b><img src='images/info.png'> ".showdate("shortdate", $d['user_view_date'])."</b> Twój profil odwiedził/a: <a href='profile.php?lookup=".$dane['user_id']."'> ".$dane['user_name']."</center></a>";
if ($dane['user_id'] == $d['user_view_do']) {
echo "<small><font color='green'>eMKa msg: </font>".$d['user_view_name']." zauważyłam, że często lubisz podgl±dywać sam/± siebie..</small>";
}
echo "</td><td align='right' class='tbl7'>";
if (!$dane['user_avatar'])
{
echo "<img src='imagenotfound.jpg' hspace='1' width='80' height='80'>";
} else {
echo "<img src='images/avatars/".$dane['user_avatar']."' hspace='1' width='80' height='80'>";
}
echo "</td><td class='tbl7'>";
if ($dane['user_msn']) {
echo "<a href='gg:".$dane['user_msn']."'><img src='http://www.gadu-gadu.pl/users/status.asp?id=".$dane['user_msn']."&styl=1' title='napisz na gg'></a><hr>";
}
echo "<a href='messages.php?msg_send=".$dane['user_id']."'> <center><img src='http://www.mkoszalin.eu/infusions/shoutbox_panel/images/pm.png' border='0' title='wy¶lij wiadomo¶ć prywatn±'></a><hr>";
$lastseen = time() - $dane['user_lastvisit'];
if ($lastseen < 200 || $data['user_id'] == "2") {
echo "<img src='".INFUSIONS."shoutbox_panel/images/online.png' alt='user jest online' title='".$dane['user_name']." jest online'>";
} else {
echo "<img src='".INFUSIONS."shoutbox_panel/images/offline.png' alt='user jest offline' title='".$dane['user_name']." jest offline'>";
}
echo "</td>
<form id='form' name='userform' method='post' action='".FUSION_SELF."'>
<td class='tbl2'>[b]<input type='checkbox' name='check'>[/b]</td></tr></center>";
}
}
} else {
echo "<tr><td class='tbl7'>Jeszcze nikt nie odwiedził Twojego profilu. Może pokaż innym, że tu jeste¶!</td></tr>";
}
echo "<td><tr>
<input type='submit' name='kasuj' value='usuń wszystkie' class='button'>
[b]<input type='submit' name='kasuj_zazn' value='usuń zaznaczone' class='button'>[/b]
</form><hr>
</tr></td>";
echo "</table>";
closesidex();
}
require_once "side_right.php";
require_once "footer.php";
?>
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."members-profile.php";
include LOCALE.LOCALESET."user_fields.php";
if (file_exists(LOCALE.LOCALESET."members-profile-mod.php")) {
include LOCALE.LOCALESET."members-profile-mod.php";
} else {
include LOCALE."English/members-profile-mod.php";
}
if (iMEMBER) {
if (isset($_GET['lookup']) && isNum($_GET['lookup'])) define('lookup', $_GET['lookup']);
if (isset($_GET['group_id']) && isNum($_GET['group_id'])) define('group_id', $_GET['group_id']);
global $data, $userdata;
if (isset($_POST['kasuj'])) {
$result = dbquery("DELETE FROM ".$db_prefix."user_view WHERE user_view_do='".$userdata['user_id']."'");
}
[b]if (isset($_POST['kasuj_zazn'])) {
$result = dbquery("DELETE FROM ".$db_prefix."user_view WHERE user_view_do='WARUNEK'");
}[/b]
$result = dbquery("SELECT * FROM ".$db_prefix."user_view WHERE user_view_do='".$userdata['user_id']."'");
opentable("Szpieg");
echo "<table><tr><td class='tbl2'>Szpieg pokazuje i zapisuje odwiedziny innych użytkowników na Twoim profilu.</tr></td>
<tr><td class='tbl4'>
UWAGA: To jest wczesna alfa, więc proszę o wyrozumiało¶ć;)</td></tr></table>";
closetable();
opensidex("Ostatnie odwiedziny");
echo "<table>";
if (dbrows($result) != 0)
{
while ($d = mysql_fetch_array($result))
{
$result2 = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$d['user_view_od']."' LIMIT 5");
while ($dane = dbarray($result2)) {
echo "<tr><td class='tbl2'><center><b><img src='images/info.png'> ".showdate("shortdate", $d['user_view_date'])."</b> Twój profil odwiedził/a: <a href='profile.php?lookup=".$dane['user_id']."'> ".$dane['user_name']."</center></a>";
if ($dane['user_id'] == $d['user_view_do']) {
echo "<small><font color='green'>eMKa msg: </font>".$d['user_view_name']." zauważyłam, że często lubisz podgl±dywać sam/± siebie..</small>";
}
echo "</td><td align='right' class='tbl7'>";
if (!$dane['user_avatar'])
{
echo "<img src='imagenotfound.jpg' hspace='1' width='80' height='80'>";
} else {
echo "<img src='images/avatars/".$dane['user_avatar']."' hspace='1' width='80' height='80'>";
}
echo "</td><td class='tbl7'>";
if ($dane['user_msn']) {
echo "<a href='gg:".$dane['user_msn']."'><img src='http://www.gadu-gadu.pl/users/status.asp?id=".$dane['user_msn']."&styl=1' title='napisz na gg'></a><hr>";
}
echo "<a href='messages.php?msg_send=".$dane['user_id']."'> <center><img src='http://www.mkoszalin.eu/infusions/shoutbox_panel/images/pm.png' border='0' title='wy¶lij wiadomo¶ć prywatn±'></a><hr>";
$lastseen = time() - $dane['user_lastvisit'];
if ($lastseen < 200 || $data['user_id'] == "2") {
echo "<img src='".INFUSIONS."shoutbox_panel/images/online.png' alt='user jest online' title='".$dane['user_name']." jest online'>";
} else {
echo "<img src='".INFUSIONS."shoutbox_panel/images/offline.png' alt='user jest offline' title='".$dane['user_name']." jest offline'>";
}
echo "</td>
<form id='form' name='userform' method='post' action='".FUSION_SELF."'>
<td class='tbl2'>[b]<input type='checkbox' name='check'>[/b]</td></tr></center>";
}
}
} else {
echo "<tr><td class='tbl7'>Jeszcze nikt nie odwiedził Twojego profilu. Może pokaż innym, że tu jeste¶!</td></tr>";
}
echo "<td><tr>
<input type='submit' name='kasuj' value='usuń wszystkie' class='button'>
[b]<input type='submit' name='kasuj_zazn' value='usuń zaznaczone' class='button'>[/b]
</form><hr>
</tr></td>";
echo "</table>";
closesidex();
}
require_once "side_right.php";
require_once "footer.php";
?>
kod wyświetla osoby które odwiedziły profil użytkownika, mam problem z usunięciem zaznaczonych checkboxów, tzn co należy wpisać aby po kliknięciu na "usuń zaznaczone" i zaznaczeniu przez użytkownika kilka checkboxów, żeby je usunęło?
gdyby checkboxy nie były generowane automatycznie to problemu bym nie mial, więc pytanie jest takie jak sprawdzić w warunku czy checkbox jest zaznaczony, jeśli tak to jak to umieścić w zapytaniu mysql?