Parašė zirualas· 2011 Lap. 30 10:11:05
#1
Modas:
http://phpfusion.lt/infusions/mo...mod_id=425
Taigi, noreciau sulaukti pagalbos susijusia su siuo modu. Problema tokia:
Kai nueinu i "www.manosaitas.lt/administration/points.php ismeta points pridejimo lenteles. Na viska ivedes (id, add points, suma) ju tiesiog neprideda.
Stai mano points.php failas:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright (c) 2005 Nick Jones
| http://www.php-fu...
+----------------------------------------------------+
| Mod created by : Omirikon
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES."templates/admin_header.php";
include LOCALE.LOCALESET."admin/admins.php";
if (!iADMIN) { redirect(BASEDIR."index.php"); }
opentable("Edit Points");
$id = $_POST['user_id'];
$option = $_POST['Merit_Admin'];
$edit_merit = $_POST['edit_merit'];
echo "<form name='input' action='' method='POST'>
User ID
<input type='text' name='user_id'>
<select name='points_Admin'>
<option value=''>Edit points</option>
<option value='user_merit+'>Add points</option>
<option value='user_merit-'>Subtract points</option>
</select>
Points
<input type='text' name='edit_points'>
<input type='submit' value='Submit' class='button'>
</form><br>";
//Edit Points
dbquery("UPDATE ".$db_prefix."users SET user_points=".$option."'".$edit_points."' WHERE user_id='".$id."'");
closetable();
opentable("Points Admin");
if (iMEMBER) {
if (!isset($sortby) || !preg_match("/^[0-9A-Z]$/", $sortby)) $sortby = "all";
$orderby = ($sortby == "all" ? "" : " WHERE user_name LIKE '".stripinput($sortby)."%'");
$result = dbquery("SELECT * FROM ".$db_prefix."users".$orderby."");
$rows = dbrows($result);
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$i = 0;
echo "<table align='center' cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>
<tr>
<td class='tbl2'><b>User ID</b></td>
<td class='tbl2'><b>User Name</b></td>
<td class='tbl2'><b>User Points</b></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><b>User Type</b></td>
</tr>\n";
$result = dbquery("SELECT * FROM ".$db_prefix."users".$orderby." ORDER BY user_id, user_name LIMIT $rowstart,20");
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;
echo "<tr>\n<td width='10%' class='$cell_color'>\n<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_id']."</a></td>\n";
echo "<td class='$cell_color'>\n<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>\n";
echo "<td class='$cell_color'>\n<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_points']."</a></td>\n";
echo "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'>".getuserlevel($data['user_level'])."</td>\n";
}
echo "</table>\n";
} else {
echo "<center><br>\nThere are no user names beginning with $sortby<br><br>\n</center>\n";
}
$search = array(
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
"S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"
);
echo "<hr>\n<table align='center' cellpadding='0' cellspacing='1' class='tbl-border'>\n<tr>\n";
echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>Show All</a></td>";
for ($i=0;$i < 36!="";$i++) {
echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."?sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
echo ($i==17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."?sortby=all'>Show All</a></td>\n</tr>\n<tr>\n" : "\n");
}
echo "</tr>\n</table>\n";
} else {
echo "<center><br>\n".$locale['003']."<br><br>\n</center>\n";
}
closetable();
echo "</td>\n";
require_once BASEDIR."footer.php";
Redagavo zirualas· 2011 Lap. 30 10:11:07