The forums are currently locked and only available for read only access
_BiG_HeaD_
Kommer du hit ofta?
Medlem
Forum Posts: 379
Member Since:
September 20, 2001
September 20, 2001
![sp_UserOfflineSmall](https://nordichardware.se/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
När man lägger till en länk så läggs den till två gånger i databasen.
Den läggs bara till två gånger om man har bytt huvud kategorin.
Får inga errors, bara att dom läggs till två gånger.
<?
// Delete link
if (isset($_GET[module]) && $_GET[module]=="delete" && isset($_GET[id]))
{
$r = mysql_fetch_assoc(mysql_query("SELECT usrtbl.fld_userclass,usrtbl.fld_id FROM usrtbl INNER JOIN mgntbl ON mgntbl.fld_id=$_GET[id] AND mgntbl.fld_userid=usrtbl.fld_id"));
if (($r[fld_userclass]<$_SESSION[userclass] || $r[fld_id]==$_SESSION[id]) && $_SESSION[userclass]>2) // Användaren har högre behörighet än 2 och (högre behörighet än den som posta eller har samma id som den som posta)
{
mysql_query("DELETE FROM mgntbl WHERE fld_id = $_GET[id]");
}
if (mysql_affected_rows()==1)
{
echo ("<FONT CLASS="SpecialMessage">Link has been deleted! Blasphemy!</FONT>");
}
else {echo (mysql_error());}
}
// Add link
elseif (!isset ($_POST[id]) && isset($_SERVER[REMOTE_ADDR]) && isset($_SESSION[username]) && isset($_POST[title]) && isset($_POST[magnetlink]) && trim($_POST[magnetlink])!=="" && trim($_POST[title])!=="" && isset($_POST[cat]) && isset($_POST[subcat]) && isset($_GET[action]) && $_GET[action]=="adddb")
{
mysql_query("INSERT INTO mgntbl (fld_name, fld_magnetlink,fld_cat,fld_subcat,fld_datetime,fld_userid,fld_ip) VALUES('". addslashes($_POST[title]) ."','". addslashes($_POST[magnetlink]) ."','$_POST[cat]','$_POST[subcat]',NOW(),$_SESSION[id],'$_SERVER[REMOTE_ADDR]')");
if (mysql_affected_rows()==1)
{
echo ("<FONT CLASS="SpecialMessage">Yihaw! Your link was added!</FONT>");
}
$_GET[module]=$_POST[cat];
$_POST[title]="";
$_POST[magnetlink]="";
$_POST[description]="";
$_GET[action]="add";
}
// Modify::Update
elseif (isset($_POST[id]) && isset($_SERVER[REMOTE_ADDR]) && isset($_POST[title]) && isset($_POST[magnetlink]) && trim($_POST[magnetlink])!=="" && isset($_POST[cat]) && isset($_POST[subcat]) && isset($_GET[action]) && $_GET[action]=="adddb")
{
if (trim($_POST[title])=="")
{
list (, $_POST[title]) = split("&dn=",$_POST[magnetlink]);
$_POST[title] = urldecode($_POST[title]);
}
mysql_query("UPDATE mgntbl SET
fld_name = '". addslashes($_POST[title]) ."',
fld_magnetlink = '". addslashes($_POST[magnetlink]) ."',
fld_cat = '$_POST[cat]',
fld_subcat = '$_POST[subcat]',
fld_ip = '$_SERVER[REMOTE_ADDR]' WHERE fld_id=$_POST[id]");
echo ("<FONT CLASS="SpecialMessage">Yihaw! Your link was modified!</FONT>");
}
// Modify::Select
elseif (isset($_GET[action]) && $_GET[action]=="modify" && isset($_GET[id]))
{
$r = mysql_fetch_assoc(mysql_query("SELECT usrtbl.fld_userclass, usrtbl.fld_id, mgntbl.fld_name, mgntbl.fld_magnetlink, mgntbl.fld_cat, mgntbl.fld_subcat FROM usrtbl INNER JOIN mgntbl ON mgntbl.fld_id=$_GET[id] AND mgntbl.fld_userid=usrtbl.fld_id"));
if (($r[fld_userclass]<$_SESSION[userclass] || $r[fld_id]==$_SESSION[id]) && $_SESSION[userclass]>2)
{
$_POST[module]=$r[fld_cat];
$_POST[title]=$r[fld_name];
$_POST[magnetlink]=$r[fld_magnetlink];
$_POST[cat]=$r[fld_cat];
$_POST[subcat]=$r[fld_subcat];
$_GET[action]="add";
}
}
elseif (isset($_GET[action]) && $_GET[action]=="add")
{
?>
<FORM ACTION="index.php?navigation=memberarea&page=addlink&action=adddb" NAME="addsql" METHOD="post">
Release Title::(No nicknames, release info just the name of the release)
<?if (isset($_GET[id])) {?> <INPUT TYPE="hidden" NAME="id" VALUE="<?=$_GET[id]?>"> <?}?>
<?if (isset($_POST[id])) {?> <INPUT TYPE="hidden" NAME="id" VALUE="<?=$_POST[id]?>"> <?}?>
<INPUT TYPE="Text" NAME="title" SIZE="60" VALUE="<?if (isset($_POST[title])) echo ($_POST[title]);?>">
MagnetLink::(if this is a bundled release, use a new row for each file.)
<TEXTAREA NAME="magnetlink" COLS="110" ROWS="15"><?if (isset($_POST[magnetlink])) echo ($_POST[magnetlink]);?></TEXTAREA>
Description::(Leave empty for no description):
<TEXTAREA NAME="description" COLS="110" ROWS="8"><?if (isset($_POST[description])){echo($_POST[description]);}?></TEXTAREA>
Category
<SELECT onChange="addsql.action='index.php?page=addlink&action=add';addsql.submit();" NAME="cat">
<OPTION <? if(isset ($_POST[cat]) && $_POST[cat]=="Applications"){ echo ("SELECTED"); }?>>Applications</OPTION>
<OPTION <? if(isset($_POST[cat]) && $_POST[cat]=="Audio"){ echo ("SELECTED"); }?>>Audio</OPTION>
<OPTION <? if(isset($_POST[cat]) && $_POST[cat]=="Games"){ echo ("SELECTED"); }?>>Games</OPTION>
<OPTION <? if(isset($_POST[cat]) && $_POST[cat]=="Video"){ echo ("SELECTED"); }?>>Video</OPTION>
<OPTION <? if(isset($_POST[cat]) && $_POST[cat]=="Miscellaneous"){ echo ("SELECTED"); }?>>Miscellaneous</OPTION>
</SELECT>
<SELECT name="subcat">
<?
if ((isset($_POST[cat]) && $_POST[cat]=="Applications") || !isset($_POST[cat]))
{
echo ("<OPTION VALUE="" "); if (isset($_POST[subcat]) && $_POST[subcat]=="") {echo("SELECTED");} echo(">Main</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Keygen") {echo("SELECTED");} echo(">Keygen</OPTION>");
}
elseif (isset($_POST[cat]) && $_POST[cat]=="Audio")
{
echo ("<OPTION VALUE="""); if (isset($_POST[subcat]) && $_POST[subcat]=="") {echo("SELECTED");} echo(">Main</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Albums") {echo("SELECTED");} echo(">Albums</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Songs") {echo("SELECTED");} echo(">Songs</OPTION>");
}
elseif (isset($_POST[cat]) && $_POST[cat]=="Games")
{
echo ("<OPTION VALUE="" "); if (isset($_POST[subcat]) && $_POST[subcat]=="") {echo("SELECTED");} echo(">Main</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Images") {echo("SELECTED");} echo(">Images</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Rips") {echo("SELECTED");} echo(">Rips</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Roms") {echo("SELECTED");} echo(">Roms</OPTION>");
}
elseif (isset($_POST[cat]) && $_POST[cat]=="Video")
{
echo ("<OPTION VALUE="" "); if (isset($_POST[subcat]) && $_POST[subcat]=="") {echo("SELECTED");} echo(">Main</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Anime") {echo("SELECTED");} echo(">Anime</OPTION>");
echo ("<OPTION VALUE="dvdrips" "); if (isset($_POST[subcat]) && $_POST[subcat]=="dvdrips") {echo("SELECTED");} echo(">DVD Rips</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Music") {echo("SELECTED");} echo(">Music</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Series") {echo("SELECTED");} echo(">Series</OPTION>");
echo ("<OPTION "); if (isset($_POST[subcat]) && $_POST[subcat]=="Screeners") {echo("SELECTED");} echo(">Screeners</OPTION>");
}
elseif (isset($_POST[cat]) && $_POST[cat]=="Miscellaneous")
{
echo ("<OPTION VALUE="" "); if (isset($_POST[subcat]) && $_POST[subcat]=="") {echo("SELECTED");} echo(">Main</OPTION>");
}
?> </SELECT>
<?
if (isset($_GET[id]) || isset($_POST[id])){ echo ("<A HREF="javascript: document.addsql.submit()">Modify Link...</A>");}
else { echo("<A HREF="javascript: document.addsql.submit()">Add Link... </A>");}
?>
|| Reset form...
</FORM>
<?
}
?>
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 694
Currently Online:
Guest(s) 32
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967
Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL
© Simple:Press —
![sp_Information](https://nordichardware.se/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_Information.png)