Przedszkolak
Postów: 29 Pomógł: 4
Data rejestracji: 12.02.2008 03:23
|
Mam również problem z PA. Cała wtyczka działa bez zarzutu, ale do panelu admina mogę dostać się tylko przez ręcznie wpisany link. Nie wiem czemu jej nie dodaje, choć sprawdzałem na podstawie sdk i innych wtyczek. Dodawanie linku do nawigacji działa dobrze. Będę wdzięczny za pomoc...
Plik infusion.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: infusion.php
| Author: extreme-fusion crew | modyfied by Liberator
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
include INFUSIONS."3dm_wars_panel/infusion_db.php";
if (file_exists(INFUSIONS."3dm_wars_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."3dm_wars_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."3dm_wars_panel/locale/English.php";
}
$inf_title = $locale['3DM_INF_NAME'];
$inf_description = $locale['3DM_INF_DESC'];
$inf_version = "0.1";
$inf_developer = "Liberator";
$inf_email = "";
$inf_weburl = "http://www.misnomer.pl";
$inf_folder = "3dm_wars_panel";
$inf_newtable[1] = DB_3DM_WARS." (
3dm_id smallint(5) unsigned NOT NULL auto_increment,
3dm_tag varchar(25) NOT NULL default '',
3dm_kraj varchar(25) NOT NULL default '',
3dm_adres varchar(50) NOT NULL default '',
3dm_tag2 varchar(25) NOT NULL default '',
3dm_kraj2 varchar(25) NOT NULL default '',
3dm_adres2 varchar(50) NOT NULL default '',
3dm_xvsx varchar(8) NOT NULL default '',
3dm_data varchar(20) NOT NULL default '',
3dm_liga varchar(20) NOT NULL default '',
3dm_mapa1 varchar(30) NOT NULL default '',
3dm_punkty11 varchar(3) NOT NULL default '',
3dm_punkty12 varchar(3) NOT NULL default '',
3dm_mapa2 varchar(30) NOT NULL default '',
3dm_punkty21 varchar(3) NOT NULL default '',
3dm_punkty22 varchar(3) NOT NULL default '',
3dm_mapa3 varchar(30) NOT NULL default '',
3dm_punkty31 varchar(3) NOT NULL default '',
3dm_punkty32 varchar(3) NOT NULL default '',
3dm_opis text NOT NULL default '',
PRIMARY KEY (`3dm_id`)
) TYPE=MyISAM;";
$inf_droptable[1] = DB_3DM_WARS;
$inf_adminpanel[1] = array(
"title" => $locale['3DM_INF_NAME'],
"panel" => "3dm_wars_admin.php",
"rights" => "3DM_WARS"
);
$inf_sitelink[1] = array(
"title" => $locale['3DM_INF_LINK'],
"url" => "3dm_wars.php",
"visibility" => "0"
);
?> Kliknij i zaczekaj na załadowanie kodu ...
Plik 3dm_wars_admin.php
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: 3dm_admin.php
| Author: extreme-fusion crew | modyfied by Liberator
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../maincore.php";
require_once THEMES."templates/admin_header.php";
include INFUSIONS."3dm_wars_panel/infusion_db.php";
if (!checkrights("3DM_WARS") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); }
// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."3dm_wars_panel/locale/".$settings['locale'].".php")) {
// Load the locale file matching the current site locale setting.
include INFUSIONS."3dm_wars_panel/locale/".$settings['locale'].".php";
} else {
// Load the infusion's default locale file.
include INFUSIONS."3dm_wars_panel/locale/English.php";
}
extract($_GET);
extract($_POST);
if (isset($step) && $step == "delete") {
$result = dbquery("DELETE FROM ".DB_3DM_WARS." WHERE 3dm_id='$stats_id'");
opentable($locale['3DM102']);
echo "<center><br>
".$locale['3DM002']."<br><br>
<a href='3dm_wars_admin.php".$aidlink."'>".$locale['3DM003']."</a><br><br>
<a href='".ADMIN."index.php".$aidlink."'>".$locale['3DM004']."</a><br><br>
</center>\n";
closetable();
} else {
if (isset($_POST['save_cat'])) {
$stats_tag = stripinput($_POST['stats_tag']);
$stats_kraj = stripinput($_POST['stats_kraj']);
$stats_adres = stripinput($_POST['stats_adres']);
$stats_tag2 = stripinput($_POST['stats_tag2']);
$stats_kraj2 = stripinput($_POST['stats_kraj2']);
$stats_adres2 = stripinput($_POST['stats_adres2']);
$stats_xvsx = stripinput($_POST['stats_xvsx']);
$stats_data = stripinput($_POST['stats_data']);
$stats_liga = stripinput($_POST['stats_liga']);
$stats_mapa1 = stripinput($_POST['stats_mapa1']);
$stats_punkty11 = stripinput($_POST['stats_punkty11']);
$stats_punkty12 = stripinput($_POST['stats_punkty12']);
$stats_mapa2 = stripinput($_POST['stats_mapa2']);
$stats_punkty21 = stripinput($_POST['stats_punkty21']);
$stats_punkty22 = stripinput($_POST['stats_punkty22']);
$stats_mapa3 = stripinput($_POST['stats_mapa3']);
$stats_punkty31 = stripinput($_POST['stats_punkty31']);
$stats_punkty32 = stripinput($_POST['stats_punkty32']);
$stats_opis = stripslashes($_POST['stats_opis']);
if (isset($step) && $step == "edit") {
$result = dbquery("UPDATE ".DB_3DM_WARS." SET 3dm_tag='$stats_tag', 3dm_kraj='$stats_kraj', 3dm_adres='$stats_adres', 3dm_tag2='$stats_tag2', 3dm_kraj2='$stats_kraj2', 3dm_adres2='$stats_adres2', 3dm_xvsx='$stats_xvsx', 3dm_data='$stats_data', 3dm_liga='$stats_liga', 3dm_mapa1='$stats_mapa1', 3dm_punkty11='$stats_punkty11', 3dm_punkty12='$stats_punkty12', 3dm_mapa2='$stats_mapa2', 3dm_punkty21='$stats_punkty21', 3dm_punkty22='$stats_punkty22', 3dm_mapa3='$stats_mapa3', 3dm_punkty31='$stats_punkty31', 3dm_punkty32='$stats_punkty32', 3dm_opis='$stats_opis' WHERE 3dm_id='$stats_id'");
} else {
$result = dbquery("INSERT INTO ".DB_3DM_WARS." VALUES('', '$stats_tag', '$stats_kraj', '$stats_adres', '$stats_tag2', '$stats_kraj2', '$stats_adres2', '$stats_xvsx', '$stats_data', '$stats_liga', '$stats_mapa1', '$stats_punkty11', '$stats_punkty12', '$stats_mapa2', '$stats_punkty21', '$stats_punkty22', '$stats_mapa3', '$stats_punkty31', '$stats_punkty32', '$stats_opis')");
}
header("Location:3dm_wars_admin.php".$aidlink."");
}
if (isset($step) && $step == "edit") {
$result = dbquery("SELECT * FROM ".DB_3DM_WARS." WHERE 3dm_id='$stats_id'");
$data = dbarray($result);
$stats_kraj = $data['3dm_kraj'];
$stats_tag = $data['3dm_tag'];
$stats_adres = $data['3dm_adres'];
$stats_kraj2 = $data['3dm_kraj2'];
$stats_tag2 = $data['3dm_tag2'];
$stats_adres2 = $data['3dm_adres2'];
$stats_xvsx = $data['3dm_xvsx'];
$stats_data = $data['3dm_data'];
$stats_liga = $data['3dm_liga'];
$stats_mapa1 = $data['3dm_mapa1'];
$stats_punkty11 = $data['3dm_punkty11'];
$stats_punkty12 = $data['3dm_punkty12'];
$stats_mapa2 = $data['3dm_mapa2'];
$stats_punkty21 = $data['3dm_punkty21'];
$stats_punkty22 = $data['3dm_punkty22'];
$stats_mapa3 = $data['3dm_mapa3'];
$stats_punkty31 = $data['3dm_punkty31'];
$stats_punkty32 = $data['3dm_punkty32'];
$stats_opis = $data['3dm_opis'];
$formaction = FUSION_SELF."".$aidlink."&step=edit&stats_id=".$data['3dm_id'];
opentable($locale['3DM107']);
} else {
$stats_kraj = ""; $stats_tag = ""; $stats_adres = ""; $stats_kraj2 = ""; $stats_tag2 = ""; $stats_adres2 = ""; $stats_xvsx = ""; $stats_data= ""; $stats_liga= ""; $stats_mapa1= ""; $stats_punkty11= ""; $stats_punkty12= ""; $stats_mapa2= ""; $stats_punkty21= ""; $stats_punkty22= ""; $stats_mapa3= ""; $stats_punkty31= ""; $stats_punkty32= ""; $stats_opis= "";
$formaction = FUSION_SELF."".$aidlink;
opentable($locale['3DM101']);
}
echo "<form name='addcat' method='post' action='$formaction'>
<table align='center' width='100%' cellspacing='0' cellpadding='0' class='tbl'>
<tr>
<td width='40%' align='right' valign='top'>
<table align='center' cellspacing='0' cellpadding='0' class='tbl'>
<tr>
<td width='49%' align='right'>".$locale['3DM102']."</td>
<td><input type='text' name='stats_tag' value='$stats_tag' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM116']."</td>
<td><select name='stats_kraj' class='textbox' style='width: 130px'><option SELECTED>$stats_kraj</option>";
@include IMAGES.'flagi/flagi2.txt';
echo "</td>
</tr>
<tr>
<td align='right'>".$locale['3DM103']."</td>
<td><input type='text' name='stats_adres' value='$stats_adres' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td align='right'> </td>
<td> </td>
</tr>
<tr>
<td width='49%' align='right'>".$locale['3DM102']."</td>
<td><input type='text' name='stats_tag2' value='$stats_tag2' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM116']."</td>
<td><select name='stats_kraj2' class='textbox' style='width: 130px'><option SELECTED>$stats_kraj2</option>";
@include IMAGES.'flagi/flagi2.txt';
echo "</td>
</tr>
<tr>
<td align='right'>".$locale['3DM103']."</td>
<td><input type='text' name='stats_adres2' value='$stats_adres2' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM104']."</td>
<td><input type='text' name='stats_xvsx' value='$stats_xvsx' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM105']."</td>
<td><input type='text' name='stats_data' value='$stats_data' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM108']."</td>
<td><input type='text' name='stats_liga' value='$stats_liga' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right' valign='top'>".$locale['3DM115']."</td>
<td><textarea name='stats_opis' cols='45' rows='7' class='textbox'>$stats_opis</textarea>
</td>
</tr></table></td>
<td width='40%' align='right' valign='top'>
<table align='center' cellspacing='0' cellpadding='0' class='tbl'>
<tr>
<td align='right'>".$locale['3DM109']."</td>
<td><input type='text' name='stats_mapa1' value='$stats_mapa1' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM110']."</td>
<td><input type='text' name='stats_punkty11' value='$stats_punkty11' class='textbox' style='width:30px;'> ".$locale['3DM111']." <input type='text' name='stats_punkty12' value='$stats_punkty12' class='textbox' style='width:30px;'>
</td>
</tr>
<tr>
<td align='right'> </td>
<td> </td>
</tr>
<tr>
<td align='right'>".$locale['3DM114']."</td>
<td><input type='text' name='stats_mapa2' value='$stats_mapa2' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM110']."</td>
<td><input type='text' name='stats_punkty21' value='$stats_punkty21' class='textbox' style='width:30px;'> ".$locale['3DM111']." <input type='text' name='stats_punkty22' value='$stats_punkty22' class='textbox' style='width:30px;'></td>
</tr>
<tr>
<td align='right'> </td>
<td> </td>
</tr>
<tr>
<td align='right'>".$locale['3DM114']."</td>
<td><input type='text' name='stats_mapa3' value='$stats_mapa3' class='textbox' style='width:100px;'></td>
</tr>
<tr>
<td align='right'>".$locale['3DM110']."</td>
<td><input type='text' name='stats_punkty31' value='$stats_punkty31' class='textbox' style='width:30px;'> ".$locale['3DM111']." <input type='text' name='stats_punkty32' value='$stats_punkty32' class='textbox' style='width:30px;'></td>
</tr>
</table>
</td></tr>
<tr>
<td align='center' colspan='2'>
<input type='submit' name='save_cat' value='".$locale['3DM106']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
tablebreak();
opentable($locale['3DM201']);
if (!isset($sortby)) $sortby = "all";
$orderby = ($sortby == "all" ? "" : " WHERE 3dm_tag LIKE '$sortby%'");
$result = dbquery("SELECT * FROM ".DB_3DM_WARS."".$orderby."");
$rows = dbrows($result);
if (!isset($rowstart)) $rowstart = 0;
if ($rows != 0) {
echo "<table align='center' width='100%' cellspacing='0'>
<tr>
<td class='tbl2' width='25%'><b>".$locale['3DM203']."</b></td>
<td align='center' class='tbl2' width='10%'><b>".$locale['3DM206']."</b></td>
<td align='center' class='tbl2' width='10%'><b>".$locale['3DM204']."</b></td>
<td align='center' class='tbl2' width='10%'><b>".$locale['3DM210']."</b></td>
<td align='center' class='tbl2' width='8%'><b>".$locale['3DM205']."</b></td>
<td align='center' class='tbl2' width='20%'><b>".$locale['3DM209']."</b></td>
<td align='center' class='tbl2' width='15%'><b>".$locale['3DM212']."</b></td>
<td align='right' class='tbl2' width='7%'><b>".$locale['3DM207']."</b></td>
</tr>\n";
$result = dbquery("SELECT * FROM ".DB_3DM_WARS."".$orderby." ORDER BY 3dm_id DESC, 3dm_tag LIMIT $rowstart,10");
while ($data = dbarray($result)) {
echo "<tr>\n<td class='small' width='20%'><img src='".IMAGES."flagi/".$data['3dm_kraj'].".gif'> <a href='".FUSION_SELF."".$aidlink."&step=edit&stats_id=".$data['3dm_id']."'><b> ".$data['3dm_tag']."</b></a></td>\n";
$punkty_klanu = $data['3dm_punkty11'] + $data['3dm_punkty21'] + $data['3dm_punkty31'];
$punkty_przeciwnika = $data['3dm_punkty12'] + $data['3dm_punkty22'] + $data['3dm_punkty32'];
$kolor_wygrany = "#008000";
$kolor_remisu = "#0000FF";
$kolor_przegrany = "#FF0000";
if($punkty_klanu > $punkty_przeciwnika) {
$kolor = "$kolor_wygrany";
$kolor2 = "$kolor_przegrany";
} elseif($punkty_klanu < $punkty_przeciwnika) {
$kolor = "$kolor_przegrany";
$kolor2 = "$kolor_wygrany";
} elseif($punkty_klanu == $punkty_przeciwnika) {
$kolor = "$kolor_remisu";
}
echo "<td class='small' align='center' width='10%'><b><font color=$kolor>$punkty_klanu</font> : <font color=$kolor2>$punkty_przeciwnika</font></b></td>";
echo "<td class='small' width='20%'><a href='".FUSION_SELF."".$aidlink."&step=edit&stats_id=".$data['3dm_id']."'><b> ".$data['3dm_tag2']."</b></a> <img src='".IMAGES."flagi/".$data['3dm_kraj2'].".gif'></td>\n";
echo "<td class='small' align='center' width='10%'>".$data['3dm_data']."</td>";
echo "<td class='small' align='center' width='10%'>".$data['3dm_liga']."</td>";
echo "<td class='small' align='center' width='8%'>".$data['3dm_xvsx']."</td>";
echo "<td class='small' align='center' width='25%'>".$data['3dm_mapa1']." / ".$data['3dm_mapa2']." / ".$data['3dm_mapa3']."</td>";
echo "<td class='small' align='right' width='7%'><a href='".FUSION_SELF."".$aidlink."&step=delete&stats_id=".$data['3dm_id']."'>".$locale['3DM208']."</a></td></tr>";
}
echo "</table>\n";
} else {
echo "<center><br>\n".$locale['3DM211']." <b>$sortby<b><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><table align='center' cellpadding='0' cellspacing='1' class='tbl-border'>\n<tr>\n";
echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."".$aidlink."&sortby=all'>".$locale['3DM202']."</a></td>";
for ($i=0;$i < 36!="";$i++) {
echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."".$aidlink."&sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
echo ($i==17 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."".$aidlink."&sortby=all'>".$locale['3DM202']."</a></td>\n</tr>\n<tr>\n" : "\n");
}
echo "</tr>\n</table>\n";
}
require_once THEMES."templates/footer.php";
?>
Kliknij i zaczekaj na załadowanie kodu ...
Pewnie gdzieś znowu robię głupi błąd, tak jak z tabelami, ale po prostu nie mogę go znaleźć... |