我有一个基于控制台的站点,但我无法弄清楚如何使用该$consoleORDER
值对这些数据进行排序。
基本上,我正在尝试使每个类别都按ordernum
.
编辑:好的抱歉缺少细节忘记了没有人看到实际代码执行我大声笑。
$dispConsoleFeatures = "";
$consoleAdmin = "";
$consoleStaff = "";
$consoleAccount = "";
$consoleMember = "";
$consoleNews = "";
$consoleRecruitment = "";
$consoleSecurity = "";
$consoleDivision = "";
$consoleTourny = "";
$consoleTraining = "";
$consoleAwards = "";
$consoleInfo = "";
$consoleUnknown = "";
$memConsole = getMemberInfo("console_options", $membername);
$ConsoleIDs = explode("[sep]", $memConsole);
foreach($ConsoleIDs as $console) {
$consoleORDER = getConsoleInfo2("ordernum", $console);
$consoleLINK = getConsoleInfo2("id", $console);
$consoleNAME = getConsoleInfo2("displayname", $console);
$consoleHIDE = getConsoleInfo2("hide", $console);
$consoleCATEGORY = getConsoleInfo2("category", $console);
$consoleAdmin_I = "<tr><td align='left'> <img src='images/console/admin.png'><br></td></tr>";
$consoleStaff_I = "<tr><td align='left'> <img src='images/console/staff.png'><br></td></tr>";
$consoleAccount_I = "<tr><td align='left'> <img src='images/console/account.png'><br></td></tr>";
$consoleMember_I = "<tr><td align='left'> <img src='images/console/member.png'><br></td></tr>";
$consoleNews_I = "<tr><td align='left'> <img src='images/console/news.png'><br></td></tr>";
$consoleRecruitment_I = "<tr><td align='left'> <img src='images/console/recruitment.png'><br></td></tr>";
$consoleSecurity_I = "<tr><td align='left'> <img src='images/console/security.png'><br></td></tr>";
$consoleDivision_I = "<tr><td align='left'> <img src='images/console/division.png'><br></td></tr>";
$consoleTourny_I = "<tr><td align='left'> <img src='images/console/tourny.png'><br></td></tr>";
$consoleTraining_I = "<tr><td align='left'> <img src='images/console/training.png'><br></td></tr>";
$consoleAwards_I = "<tr><td align='left'> <img src='images/console/awards.png'><br></td></tr>";
$consoleInfo_I = "<tr><td align='left'> <img src='images/console/info.png'><br></td></tr>";
$consoleUnknown_I = "<tr><td align='left'> <img src='images/console/unknown.png'><br></td></tr>";
if($console != "" AND $consoleHIDE == "0") {
if($consoleCATEGORY == "1") {
$consoleAdmin .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat1 = "$consoleAdmin_I<tr><td class='main' align='left'>$consoleAdmin</td></tr>";
} elseif($consoleCATEGORY == "2") {
$consoleMember .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat2 = "$consoleMember_I<tr><td class='main' align='left'>$consoleMember</td></tr>";
} elseif($consoleCATEGORY == "3") {
$consoleAccount .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat3 = "$consoleAccount_I<tr><td class='main' align='left'>$consoleAccount</td></tr>";
} elseif($consoleCATEGORY == "4") {
$consoleStaff .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat4 = "$consoleStaff_I<tr><td class='main' align='left'>$consoleStaff</td></tr>";
} elseif($consoleNews == "5") {
$consoleNews .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat5 = "$consoleNews_I<tr><td class='main' align='left'>$consoleNews</td></tr>";
} elseif($consoleCATEGORY == "7") {
$consoleDivision .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat7 = "$consoleDivision_I<tr><td class='main' align='left'>$consoleDivision</td></tr>";
} elseif($consoleCATEGORY == "8") {
$consoleTourny .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat8 = "$consoleTourny_I<tr><td class='main' align='left'>$consoleTourny</td></tr>";
} elseif($consoleCATEGORY == "9") {
$consoleNews .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat9 = "$consoleNews_I<tr><td class='main' align='left'>$consoleNews</td></tr>";
} elseif($consoleCATEGORY == "10") {
$consoleAwards .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat10 = "$consoleAwards_I<tr><td class='main' align='left'>$consoleAwards</td></tr>";
} elseif($consoleCATEGORY == "11") {
$consoleSecurity .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat11 = "$consoleSecurity_I<tr><td class='main' align='left'>$consoleSecurity</td></tr>";
} elseif($consoleCATEGORY == "12") {
$consoleRecruitment .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat12 = "$consoleRecruitment_I<tr><td class='main' align='left'>$consoleRecruitment</td></tr>";
} elseif($consoleCATEGORY == "14") {
$consoleTraining .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat14 = "$consoleTraining_I<tr><td class='main' align='left'>$consoleTraining</td></tr>";
} elseif($consoleCATEGORY == "15") {
$consoleUnknown .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat15 = "$consoleUnknown_I<tr><td class='main' align='left'>$consoleUnknown</td></tr>";
} elseif($consoleCATEGORY == "16") {
$consoleInfo .= " <a href='console.php?pid=$consoleLINK'>$consoleNAME</a><br>";
$dispCat16 = "$consoleInfo_I<tr><td class='main' align='left'>$consoleInfo</td></tr>";
}
$dispConsoleFeatures = "<tr><td class='main' align='center'> <img src='images/console/console.png'><br></td></tr>$dispCat1$dispCat4$dispCat2$dispCat11$dispCat12$dispCat10$dispCat14$dispCat8$dispCat9$dispCat5$dispCat7$dispCat3<br>$dispCat16<br>$dispCat15";
}
}
这样做的最终结果是:
显然我还不允许发布图片。有点烦人。所以我在这里上传了 tyhe 图片。
http://www.swfclan.com/snippet1.jpg
正如您在“锦标赛”下看到的那样,它的顺序是错误的,因为在我开始重新排列它们之前,我从没想过它是如何订购的。问题是顺序应该是(从上到下)进入锦标赛,创建锦标赛,添加锦标赛工作人员,删除锦标赛工作人员,锦标赛选项。
变量 $memConsole 是从成员数据中提取的,每个都是一个数字,它使用该数字来检索其余信息。