Mam problem, otóż na php-fusion nikt mi nie odpowiada, więc chciałem się tu spytać. Chciałem Przerobić ten skrypt:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright 2002 - 2008 Nick Jones
| <a href=\"http://www.php-fusion.co.uk/\" target=\"_blank\">http://www.php-fusion.co.uk/</a>
+--------------------------------------------------------+
| Filename: user_rang_include.php
| Author: Qwertz
+--------------------------------------------------------+
| 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/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
if ($profile_method == "input") {
if (iADMIN && checkrights("C")){
echo "<td class='tbl' valign='top'>[Admin] Rang: </td>\n"; echo "<td class='tbl'><input type='text' name='user_rang' value='".(isset($user_data['user_rang']) ?
$user_data['user_rang'] : "")."' maxlength='75' class='textbox' style='width:295px;' /></td>\n"; } else {
}
} elseif ($profile_method == "display") {
if ($user_data['user_rang']) {
echo "<td width='1%' class='tbl1' style='white-space:nowrap'>Rang special:</td>\n"; echo "<td align='right' class='tbl1'>"; echo "<img src='".$user_data['user_rang']."' alt='".$user_data['user_rang']."' />\n"; }
} elseif ($profile_method == "validate_insert") {
$db_fields .= ", user_rang";
$db_values .= ", '".(isset($_POST['user_rang']) ? stripinput
(trim($_POST['user_rang'])) : "")."'";
} elseif ($profile_method == "validate_update") {
$db_values .= ", user_rang='".(isset($_POST['user_rang']) ? stripinput
(trim($_POST['user_rang'])) : "")."'";} ?>
Na wysuwane menu:, jednak jak ja próbuje to nie działa ;/ :
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright Š 2002 - 2008 Nick Jones
| <a href=\"http://www.php-fusion.co.uk/\" target=\"_blank\">http://www.php-fusion.co.uk/</a>
+--------------------------------------------------------+
| Filename: user_rang_include.php
| Author:
+--------------------------------------------------------+
| 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/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
if ($profile_method == "input") {
if (iADMIN && checkrights("C")){
$user_rang = (isset($user_data['user_rang']) ?
$user_data['user_rang'] : 0
); echo "<td class='tbl'>Ranga :</td>\n"; echo "<td class='tbl'>\n<select name='user_rang' class='textbox'>\n"; echo "<option value='0'".($user_rang=="0"?
" selected='selected'":"")."></option>\n"; echo "<option value='1'".($user_rang=="1"?
" selected='selected'":"").">Php.png</option>\n"; echo "<option value='2'".($user_rang=="2"?
" selected='selected'":"").">vip.png</option>\n"; echo "<option value='3'".($user_rang=="3"?
" selected='selected'":"").">girl.png</option>\n"; echo "<option value='4'".($user_rang=="4"?
" selected='selected'":"").">spammer.png</option>\n"; echo "<option value='5'".($user_rang=="5"?
" selected='selected'":"").">n00b.png</option>\n"; echo "<option value='6'".($user_rang=="6"?
" selected='selected'":"").">pomocnik.png</option>\n"; echo "<option value='7'".($user_rang=="7"?
" selected='selected'":"").">haker.png</option>\n"; echo "</select>\n</td>\n"; }
} elseif ($profile_method == "display") {
if (isset($user_data['user_rang']) && $user_data['user_rang'] != "0") { echo "<td width='1%' class='tbl1' style='white-space:nowrap'>Ranga :</td>\n"; echo "<td align='right' class='tbl1'>".($user_data['user_rang']=="1" ? Php
.png
: vip
.png
: girl
.png
: spammer
.png
: n00b
.png
: pomocnik
.png
: haker
.png
)."</td>\n"; }
} elseif ($profile_method == "validate_insert" || $profile_method == "validate_update") {
$user_rang = (isset($_POST['user_rang']) && isNum
($_POST['user_rang']) ?
$_POST['user_rang'] : 0
); if ($profile_method == "validate_insert") {
$db_fields .= ", user_rang";
$db_values .= ", '".$user_rang."'";
} else {
$db_values .= ", user_rang='".$user_rang."'";
}
}
?>
Za pomoc z góry dziękuję !
Ten post edytował Ziom73 3.08.2009, 21:49:18