public function __destruct() { global $test_cnt; $test_cnt--; } public static function destroy(&$obj) { unset($obj); } } Show(); $obj1 = new counter(); $obj1->Show(); Show(); $obj2 = new counter(); $obj2->Show(); Show(); counter::destroy($obj1); Show(); // or uncomment this line and it works //counter::destroy($obj2); echo "Done\n"; ?> --EXPECT-- Count: 0 Id: 0 Count: 1 Id: 1 Count: 2 Count: 1 Done
function Show($siteid = 1, $id = 0, $i = 0) { global $dosql; $dosql->Execute("SELECT * FROM `#@__infoclass` WHERE `siteid`={$siteid} AND `parentid`={$id} ORDER BY `orderid` ASC", $id); $i++; while ($row = $dosql->GetArray($id)) { switch ($row['infotype']) { case 0: $addurl = 'info_update.php?id=' . $row['id']; $infotype = ' <i title="栏目属于[单页]类型">[单页]</i>'; break; case 1: $addurl = 'infolist_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[列表]类型">[列表]</i>'; break; case 2: $addurl = 'infoimg_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[图片]类型">[图片]</i>'; break; case 3: $addurl = 'soft_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[下载]类型">[下载]</i>'; break; case 4: $addurl = 'soft_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[商品]类型">[商品]</i>'; break; default: $r = $dosql->GetOne("SELECT * FROM `#@__diymodel` WHERE `id`=" . $row['infotype']); if (isset($r) && is_array($r)) { $addurl = 'modeldata_add.php?m=' . $r['modelname'] . '&cid=' . $row['id']; $infotype = ' <i title="栏目属于[' . $r['modeltitle'] . ']类型">[' . $r['modeltitle'] . ']</i>'; } else { $addurl = 'javascript:;'; $infotype = ' 没有获取到类型'; } } //设置$classname $classname = ''; //设置空格 for ($n = 1; $n < $i; $n++) { $classname .= ' '; } //设置折叠 if ($row['parentid'] == '0') { $classname .= '<span class="minusSign" id="rowid_' . $row['id'] . '" onclick="DisplayRows(' . $row['id'] . ');">'; } else { $classname .= '<span class="subType">'; } $classname .= $row['classname'] . '</span>'; //信息类型 $classname .= '<span class="infoTypeTxt">' . $infotype . '</span>'; ?> <div rel="rowpid_<?php echo GetTopID($row['parentstr']); ?> "> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable"> <tr align="left" class="dataTr"> <td width="3%" height="32"><input type="checkbox" name="siteid[<?php echo $siteid; ?> ]" value="<?php echo $siteid; ?> " onclick="SelRole(<?php echo $siteid; ?> ,<?php echo $row['id']; ?> ,this);" /></td> <td align="left"><?php echo $classname; ?> </td> <td width="30%" class="privTxt"><span> <input type="checkbox" name="priv[<?php echo $siteid; ?> ][<?php echo $row['id']; ?> ][]" value="list" /> 查看</span> <span> <input type="checkbox" name="priv[<?php echo $siteid; ?> ][<?php echo $row['id']; ?> ][]" value="add" /> 添加</span> <span> <input type="checkbox" name="priv[<?php echo $siteid; ?> ][<?php echo $row['id']; ?> ][]" value="update" /> 修改</span> <span> <input type="checkbox" name="priv[<?php echo $siteid; ?> ][<?php echo $row['id']; ?> ][]" value="del" /> 删除</span></td> </tr> </table> </div> <?php Show($siteid, $row['id'], $i + 2); } }
function Show($id = 0, $i = 0) { global $dosql, $cfg_siteid; $dosql->Execute("SELECT * FROM `#@__weblinktype` WHERE siteid='{$cfg_siteid}' AND parentid={$id} ORDER BY orderid ASC", $id); $i++; while ($row = $dosql->GetArray($id)) { //设置$classname $classname = ''; //设置空格 for ($n = 1; $n < $i; $n++) { $classname .= ' '; } //设置折叠 if ($row['parentid'] == '0') { $classname .= '<span class="minusSign" id="rowid_' . $row['id'] . '" onclick="DisplayRows(' . $row['id'] . ');">'; } else { $classname .= '<span class="subType">'; } $classname .= $row['classname'] . '</span>'; switch ($row['checkinfo']) { case 'true': $checkinfo = '显示'; break; case 'false': $checkinfo = '隐藏'; break; default: $checkinfo = '没有获取到参数'; } ?> <div rel="rowpid_<?php echo GetTopID($row['parentstr']); ?> "> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable"> <tr align="left" class="dataTr"> <td width="5%" height="36" class="firstCol"><input type="checkbox" name="checkid[]" id="checkid[]" value="<?php echo $row['id']; ?> " /></td> <td width="3%"><?php echo $row['id']; ?> <input type="hidden" name="id[]" id="id[]" value="<?php echo $row['id']; ?> " /></td> <td width="40%"><?php echo $classname; ?> </td> <td width="20%" align="center"><a href="weblinktype_save.php?action=up&id=<?php echo $row['id']; ?> &parentid=<?php echo $row['parentid']; ?> &orderid=<?php echo $row['orderid']; ?> " class="leftArrow" title="提升排序"></a> <input type="text" name="orderid[]" id="orderid[]" class="inputls" value="<?php echo $row['orderid']; ?> " /> <a href="weblinktype_save.php?action=down&id=<?php echo $row['id']; ?> &parentid=<?php echo $row['parentid']; ?> &orderid=<?php echo $row['orderid']; ?> " class="rightArrow" title="下降排序"></a></td> <td width="32%" class="action endCol"><span><a href="weblinktype_add.php?id=<?php echo $row['id']; ?> ">添加下级</a></span> | <span><a href="weblinktype_save.php?id=<?php echo $row['id']; ?> &action=check&checkinfo=<?php echo $row['checkinfo']; ?> " title="点击进行显示与隐藏操作"><?php echo $checkinfo; ?> </a></span> | <span><a href="weblinktype_update.php?id=<?php echo $row['id']; ?> ">修改</a></span> | <span class="nb"><a href="weblinktype_save.php?action=del&id=<?php echo $row['id']; ?> " onclick="return ConfDel(2);">删除</a></span></td> </tr> </table> </div> <?php Show($row['id'], $i + 2); } }
function GraphChange($action, $recursive = 0, $no_output = 0) { global $pid, $unix_gid, $eid, $uid, $guid, $TBSUEXEC_PATH, $TBADMINGROUP; global $template, $unix_pid; $html = ""; $reqarg = "-a "; $versarg = $template->vers(); if ($action == "zoomout" || $action == "zoomin") { $optarg = ""; if ($action == "zoomin") { $optarg = "-z in"; } else { $optarg = "-z out"; } # Need to update the template graph. SUEXEC($uid, "{$unix_pid},{$unix_gid}", "webtemplate_graph {$optarg} {$guid}", SUEXEC_ACTION_DIE); } else { $optarg = $recursive ? "-r" : ""; if ($action == "showtemplate") { $reqarg .= "show"; } elseif ($action == "hidetemplate") { $reqarg .= "hide"; } elseif ($action == "showhidden") { $reqarg .= "showhidden"; # Applies only to root template $versarg = "1"; } elseif ($action == "hidehidden") { $reqarg .= "hidehidden"; # Applies only to root template $versarg = "1"; } elseif ($action == "activate") { $reqarg .= "activate"; } elseif ($action == "inactivate") { $reqarg .= "inactivate"; } else { PAGEARGERROR("Invalid action {$action}"); return; } $reqarg .= " {$guid}/{$versarg}"; SUEXEC($uid, "{$unix_pid},{$unix_gid}", "webtemplate_control {$reqarg} {$optarg}", SUEXEC_ACTION_DIE); } $template->Refresh(); $html = ""; if (!$no_output) { $html = Show("graph", 0, 0); } return $html; }
public function setGear($Array) { if (!is_array($Array)) { return; } $this->log(__LINE__, '... set gear'); $this->Gear['slots'] = count($Array); $GearArray = NULL; // Get ID List //$this->log(__LINE__, '... getting items json from XIVPads'); // THIS FILE SHOULD REALLY BE HOSTED LOCALLY // OR MEMCACHED // OR REDIS // OR unoe $ItemIDArray = []; if (file_exists(__DIR__ . '/items.json')) { $ItemIDArray = json_decode(file_get_contents(__DIR__ . "/items.json"), true); $this->log(__LINE__, '... >> obtained item json locally'); } // Loop through gear equipped $Main = NULL; $this->log(__LINE__, '... big loop'); foreach ($Array as $A) { // Temp array $Temp = array(); //Show($A); // Loop through data $this->log(__LINE__, '... big loop 2'); foreach ($A as $i => $Line) { // Name / Id if (stripos($Line, 'item_name') !== false && stripos($Line, 'item_name_right') === false) { // Name $index = $i + 2; $itemName = $A[$index]; $itemName = strip_tags(html_entity_decode($itemName)); $itemName = str_ireplace('">', null, $itemName); $itemName = str_ireplace("'", "'", trim($itemName)); $Temp['name'] = $itemName; if (empty($Temp['name'])) { Show($A); } // Get item ID $Temp['id'] = null; $itemNameHashed = md5(strtolower(preg_replace('/[^a-z-]/i', null, $itemName))); if (isset($ItemIDArray[$itemNameHashed])) { $itemID = $ItemIDArray[$itemNameHashed]; $Temp['id'] = $itemID; $Temp['xivdb'] = 'http://xivdb.com/?item/' . $itemID . '/' . str_ireplace(' ', '-', $itemName); } else { //Show($itemNameHashed); //Show($itemName); //Show(strtolower(preg_replace('/[^a-z-]/i', null, $itemName))); } } // If glamoured if (stripos($Line, 'mirageitem_ic') !== false) { $index = $i + 1; $itemGlamourIcon = $A[$index]; $itemGlamourIcon = trim(explode('"', $itemGlamourIcon)[1]); $Temp['glamour']['icon'] = $itemGlamourIcon; $index = $i + 4; $itemGlamourName = $A[$index]; $itemGlamourName = strip_tags(html_entity_decode($itemGlamourName)); $itemGlamourName = str_ireplace("'", "'", trim($itemGlamourName)); $Temp['glamour']['name'] = $itemGlamourName; // Get item ID $Temp['glamour']['id'] = null; $itemGlamourNameHashed = md5(strtolower(preg_replace('/[^a-z-]/i', null, $itemGlamourName))); if (isset($ItemIDArray[$itemGlamourNameHashed])) { $itemGlamourID = $ItemIDArray[$itemGlamourNameHashed]; $Temp['glamour']['id'] = $itemGlamourID; $Temp['glamour']['xivdb'] = 'http://xivdb.com/?item/' . $itemGlamourID . '/' . str_ireplace(' ', '-', $itemGlamourName); } else { //Show($itemNameHashed); //Show($itemName); //Show(strtolower(preg_replace('/[^a-z-]/i', null, $itemName))); } } // Category / Slot / Class if (stripos($Line, 'category_name') !== false) { // Category $index = $i; $itemCategory = $A[$i]; $itemCategory = strip_tags(html_entity_decode($itemCategory)); $itemCategory = str_ireplace("'", "'", trim($itemCategory)); $Temp['category'] = htmlspecialchars_decode($itemCategory); // Slot $itemSlot = $itemCategory; if (strpos($itemSlot, " Arm") !== false || strpos($itemSlot, " Arms") !== false || strpos($itemSlot, " Grimoire") !== false || strpos($itemSlot, " Primary Tool") !== false) { $ClassJob = strtolower(explode("'", $itemSlot)[0]); $itemSlot = 'Main'; } // If tool if (strpos($itemSlot, " Secondary Tool") !== false) { $ClassJob = strtolower(explode("'", $itemSlot)[0]); $itemSlot = 'tool'; } $Temp['slot'] = strtolower($itemSlot); } // Icon if (stripos($Line, 'socket_64') !== false) { $index = $i + 1; $itemIcon = $A[$index]; $itemIcon = trim(explode('"', $itemIcon)[1]); $Temp['icon'] = $itemIcon; } // Item level if (stripos($Line, 'Item Level') !== false) { $index = $i; $itemLevel = $A[$index]; $itemLevel = strip_tags(html_entity_decode($itemLevel)); $itemLevel = filter_var($itemLevel, FILTER_SANITIZE_NUMBER_INT); $Temp['ilevel'] = $itemLevel; } // Level if (stripos($Line, 'gear_level') !== false) { $index = $i; $itemLevel = $A[$index]; $itemLevel = strip_tags(html_entity_decode($itemLevel)); $itemLevel = filter_var($itemLevel, FILTER_SANITIZE_NUMBER_INT); $Temp['level'] = $itemLevel; } // ID Lodestone if (stripos($Line, 'bt_db_item_detail') !== false) { $index = $i + 1; $Data = trim(str_ireplace(array('>', '"'), NULL, html_entity_decode(preg_match("/\\/lodestone\\/playguide\\/db\\/item\\/([a-z0-9]{11})\\//", $A[$index], $matches)))); // TODO : Fix properly, matches is returining false, likely index incorrect. $Temp['id_lodestone'] = null; if (isset($matches[1])) { $Temp['id_lodestone'] = $matches[1]; } } // Cannot equip if (stripos($Line, 'Cannot equip gear to') !== false) { $Data = trim(str_ireplace(array('>', '"'), NULL, strip_tags(html_entity_decode($Line)))); $Temp['no_equip'] = htmlspecialchars_decode(trim(str_replace(['Cannot equip gear to', '.'], null, $Data)), ENT_QUOTES); $Temp['no_equip_slots'] = explode(" ", str_ireplace([".", ", or", ", and", "Cannot equip gear to ", ","], null, $Data)); $Temp['no_equip_count'] = count($Temp['no_equip_slots']); } } $this->log(__LINE__, '... big loop 2 /end'); // Slot manipulation, mainly for rings $Slot = $Temp['slot']; if (isset($GearArray['slots'][$Slot]) && $Slot == 'ring') { $Slot = $Slot . 2; } $Temp['slot'] = $Slot; // Add index $Temp['slot_id'] = array_search($Temp['slot'], $this->GearSlots); // Append array $GearArray['numbers'][$Temp['slot_id']] = $Temp; $GearArray['slots'][$Slot] = $Temp; } $this->log(__LINE__, '... big loop /end'); // Set Gear $this->Gear['equipped'] = $GearArray; // Set Active Class $ReplaceArray = ['Two-Handed ', 'One-Handed']; $ClassJob = str_ireplace($ReplaceArray, NULL, $ClassJob); $this->Stats['active']['class'] = $ClassJob; if (isset($this->Gear['equipped']['slots']['soul crystal'])) { $this->Stats['active']['job'] = str_ireplace("Soul of the ", NULL, $this->Gear['equipped']['slots']['soul crystal']); } }
/* Chocobos */ /***********************************************/ $material = 1; $Type = "MOUNT"; for ($i = 0; $i < 19; $i++) { if ($i == 17 || $i == 18) { continue; } $e = str_pad($i, 4, 0, STR_PAD_LEFT); $ID = "D0001E" . $e . "E" . $e . "E" . $e . "E" . $e; $DWN = 'chara/demihuman/d0001/obj/equipment/e0001/model/d0001e0001_dwn.mdl'; if ($i == 9) { $DWN = 'chara/demihuman/d0001/obj/equipment/e0009/model/d0001e0009_dwn.mdl'; } $SQL_Values[] = "('" . $ID . "'\n\t\t\t\t\t\t, 'chara/demihuman/d0001/obj/equipment/e" . $e . "/model/d0001e" . $e . "_top.mdl'\n\t\t\t\t\t\t, 'chara/demihuman/d0001/obj/equipment/e" . $e . "/model/d0001e" . $e . "_sho.mdl'\n\t\t\t\t\t\t, '" . $DWN . "'\n\t\t\t\t\t\t, 'chara/demihuman/d0001/obj/equipment/e" . $e . "/model/d0001e" . $e . "_met.mdl'\n\t\t\t\t\t\t, '" . $material . "'\n\t\t\t\t\t\t, '" . translate_name($ID, "en") . "'\n\t\t\t\t\t\t, '" . translate_name($ID, "de") . "'\n\t\t\t\t\t\t, '" . translate_name($ID, "fr") . "'\n\t\t\t\t\t\t, '" . translate_name($ID, "jp") . "'\n\t\t\t\t\t\t, '" . ($ID == translate_name($ID, "TYPE") ? $Type : translate_name($ID, "TYPE")) . "'\n\t\t\t\t\t\t, '" . $ICON . "')"; } /***********************************************/ /* Naked monsters */ /***********************************************/ $material = 1; $Type = "BEASTMAN"; $BMs = array(array("d1007", "e0001"), array("d1007", "e0002"), array("d1005", "e0001"), array("d1005", "e0002")); foreach ($BMs as $BM) { $ID = strtoupper($BM[0]) . strtoupper($BM[1]); $SQL_Values[] = "('" . $ID . "'\n\t\t\t\t\t, 'chara/demihuman/" . $BM[0] . "/obj/equipment/" . $BM[1] . "/model/" . $BM[0] . "" . $BM[1] . "_top.mdl'\n\t\t\t\t\t, ''\n\t\t\t\t\t, ''\n\t\t\t\t\t, ''\n\t\t\t\t\t, '" . $material . "'\n\t\t\t\t\t, '" . translate_name($ID, "en") . "'\n\t\t\t\t\t, '" . translate_name($ID, "de") . "'\n\t\t\t\t\t, '" . translate_name($ID, "fr") . "'\n\t\t\t\t\t, '" . translate_name($ID, "jp") . "'\n\t\t\t\t\t, '" . ($ID == translate_name($ID, "TYPE") ? $Type : translate_name($ID, "TYPE")) . "'\n\t\t\t\t\t, '" . $ICON . "')"; } Show($SQL_Values); $SQL .= implode(",", $SQL_Values) . " ON DUPLICATE KEY UPDATE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ID=VALUES(ID)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Type=VALUES(Type)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Body=VALUES(Body)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Hands=VALUES(Hands)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Icon=VALUES(Icon)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Legs=VALUES(Legs)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Head=VALUES(Head)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Material=VALUES(Material)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_EN=VALUES(Name_EN)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_DE=VALUES(Name_DE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_FR=VALUES(Name_FR)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_JP=VALUES(Name_JP)"; //print_r($SQL); $DB->IUSQL($SQL); echo "<h2>Complete</h2>";
fclose($handle); } $row = 1; if (($handle = fopen("quests.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $Cards['Quests'][] = $data; $All[] = $data; } fclose($handle); } // ---------------------------------------------------------------------- // Check Cards foreach ($All as $card) { $image = 'cards/' . $card[4] . '.png'; if (!file_exists($image)) { Show($card); } } echo '<hr/>'; echo '<pre>'; echo 'var Cards = {<br>'; echo '<div>'; // Create Javascript foreach ($Cards as $Title => $List) { echo $Title . ': [<div>'; foreach ($List as $Cards) { echo '['; // Title echo '"' . $Cards[0] . '",<br/>'; // Flavour echo '"' . $Cards[2] . '",<br/>';
// only interested in materials //print $file->getFilename(); $m = substr($PathArray[3], -4); $b = substr($PathArray[6], -4); $material = (int) substr($PathArray[8], -4); if ($m < 7000) { $Type = 'MONSTER'; } else { if ($m >= 7000 && $m < 8000) { $Type = 'SUMMON'; } else { if ($m > 8000 && $m < 9000) { $Type = 'PET'; } else { if ($m >= 9000) { $Type = 'MONSTER'; } } } } $Model = "chara/monster/m" . $m . "/obj/body/b" . $b . "/model/m" . $m . "b" . $b . ".mdl"; $ID = "m" . $m . "b" . $b . "_" . $material; Show("ID :" . $ID . " | TYPE: " . $Type . " FUNC | " . translate_name($ID, "TYPE")); $SQL_Values[] = "('" . $ID . "', '" . $Model . "', '" . $material . "', '" . translate_name($ID, "en") . "', '" . translate_name($ID, "de") . "', '" . translate_name($ID, "fr") . "', '" . translate_name($ID, "jp") . "', '" . ($ID == translate_name($ID, "TYPE") ? $Type : translate_name($ID, "TYPE")) . "', '" . $ICON . "')"; } } } $SQL .= implode(",", $SQL_Values) . " ON DUPLICATE KEY UPDATE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t Model=VALUES(Model)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Type=VALUES(Type)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Material=VALUES(Material)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Icon=VALUES(Icon)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_DE=VALUES(Name_DE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_FR=VALUES(Name_FR)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_FR=VALUES(Name_FR)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, Name_JP=VALUES(Name_JP)"; //print_r($SQL); $DB->IUSQL($SQL); echo "<h2>Complete</h2>";
chmod("../includes/translate_csv.php", 0775); Show("--- js ---"); // JS Loop $Translations = array(); $s = 5; $i = 0; foreach ($Contents as $C) { if ($i > $s) { $csv = str_getcsv($C, ',', '"'); $EN = $csv[1]; $DE = $csv[2]; $FR = $csv[3]; $JP = $csv[4]; $js = $csv[5]; if ($js) { Show("JP: " . $EN . " => " . trim($JP)); $Translations[] = "arr['" . trim(addslashes($EN)) . "'] = new Array('" . addslashes(trim($JP)) . "', '" . $EN . "', '" . addslashes(trim($DE)) . "', '" . addslashes(trim($FR)) . "');"; } } $i++; } $Context = NULL; foreach ($Translations as $T) { $Context .= $T . "\n"; } $p1 = "Translate = { TranslateWord: function(s) { var arr = {}; \n "; $p2 = "\n if(s in arr) { var l = Cookies.get('Language'); var nw = arr[s][l]; if (!nw) { nw = s; } return nw; } else { return s; } } };"; $JSCode = str_ireplace("\n", " ", $p1 . $Context . $p2); unlink("../scripts/translate_csv.js"); file_put_contents("../scripts/translate_csv.js", $JSCode); chmod("../scripts/translate_csv.js", 0775);
function ShowExpansion($results) { foreach ($results as $result) { Show($result->Titles); } }
function Show($id = 0, $i = 0) { global $dosql, $cfg_siteid, $cfg_adminlevel, $catgoryListPriv, $catgoryAddPriv, $catgoryUpdatePriv, $catgoryDelPriv; $i++; $dosql->Execute("SELECT * FROM `#@__infoclass` WHERE `siteid`='{$cfg_siteid}' AND `parentid`={$id} ORDER BY `orderid` ASC", $id); while ($row = $dosql->GetArray($id)) { switch ($row['infotype']) { case 0: $addurl = 'info_update.php?id=' . $row['id']; $infotype = ' <i title="栏目属于[单页]类型">[单页]</i>'; break; case 1: $addurl = 'infolist_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[列表]类型">[列表]</i>'; break; case 2: $addurl = 'infoimg_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[图片]类型">[图片]</i>'; break; case 3: $addurl = 'soft_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[下载]类型">[下载]</i>'; break; case 4: $addurl = 'goods_add.php?cid=' . $row['id']; $infotype = ' <i title="栏目属于[商品]类型">[商品]</i>'; break; default: $r = $dosql->GetOne("SELECT * FROM `#@__diymodel` WHERE `id`=" . $row['infotype']); if (isset($r) && is_array($r)) { $addurl = 'modeldata_add.php?m=' . $r['modelname'] . '&cid=' . $row['id']; $infotype = ' <i title="栏目属于[' . $r['modeltitle'] . ']类型">[' . $r['modeltitle'] . ']</i>'; } else { $addurl = 'javascript:;'; $infotype = ' 没有获取到类型'; } } //设置$classname $classname = ''; //设置空格 for ($n = 1; $n < $i; $n++) { $classname .= ' '; } //设置折叠 if ($row['parentid'] == '0') { $classname .= '<span class="minusSign" id="rowid_' . $row['id'] . '" onclick="DisplayRows(' . $row['id'] . ');">'; } else { $classname .= '<span class="subType">'; } //添加权限 if ($cfg_adminlevel != 1) { if (in_array($row['id'], $catgoryAddPriv)) { $classname .= '<a href="' . $addurl . '" title="点击添加内容">' . $row['classname'] . '</a></span>'; $addStr = '<a href="infoclass_add.php?infotype=' . $row['infotype'] . '&id=' . $row['id'] . '">添加子栏目</a>'; } else { $classname .= '<span title="暂无添加权限哦~">' . $row['classname'] . '</span></span>'; $addStr = '添加子栏目'; } } else { $classname .= '<a href="' . $addurl . '" title="点击添加内容">' . $row['classname'] . '</a></span>'; $addStr = '<a href="infoclass_add.php?infotype=' . $row['infotype'] . '&id=' . $row['id'] . '">添加子栏目</a>'; } //信息类型 $classname .= '<span class="infoTypeTxt">' . $infotype . '</span>'; //修改权限 if ($cfg_adminlevel != 1) { if (in_array($row['id'], $catgoryUpdatePriv)) { $updateStr = '<a href="infoclass_update.php?id=' . $row['id'] . '">修改</a>'; } else { $updateStr = '修改'; } } else { $updateStr = '<a href="infoclass_update.php?id=' . $row['id'] . '">修改</a>'; } //删除权限 if ($cfg_adminlevel != 1) { if (in_array($row['id'], $catgoryDelPriv)) { $delStr = '<a href="infoclass_save.php?action=delclass&id=' . $row['id'] . '" onclick="return ConfDel(2);">删除</a>'; } else { $delStr = '删除'; } } else { $delStr = '<a href="infoclass_save.php?action=delclass&id=' . $row['id'] . '" onclick="return ConfDel(2);">删除</a>'; } //审核状态 switch ($row['checkinfo']) { case 'true': $checkinfo = '显示'; break; case 'false': $checkinfo = '隐藏'; break; default: $checkinfo = '没有获取到参数'; } //审核权限 if ($cfg_adminlevel != 1) { if (in_array($row['id'], $catgoryUpdatePriv)) { $checkStr = '<a href="infoclass_save.php?action=check&id=' . $row['id'] . '&checkinfo=' . $row['checkinfo'] . '" title="点击进行显示与隐藏操作">' . $checkinfo . '</a>'; } else { $checkStr = $checkinfo; } } else { $checkStr = '<a href="infoclass_save.php?action=check&id=' . $row['id'] . '&checkinfo=' . $row['checkinfo'] . '" title="点击进行显示与隐藏操作">' . $checkinfo . '</a>'; } ?> <div rel="rowpid_<?php echo GetTopID($row['parentstr']); ?> "> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable"> <tr align="left" class="dataTr"> <td width="5%" height="36" class="firstCol"><input type="checkbox" name="checkid[]" id="checkid[]" value="<?php echo $row['id']; ?> " /></td> <td width="3%"><?php echo $row['id']; ?> <input type="hidden" name="id[]" id="id[]" value="<?php echo $row['id']; ?> " /></td> <td width="40%"><?php echo $classname; ?> </td> <td width="20%" align="center"><a href="infoclass_save.php?action=up&id=<?php echo $row['id']; ?> &parentid=<?php echo $row['parentid']; ?> &orderid=<?php echo $row['orderid']; ?> " class="leftArrow" title="提升排序"></a> <input type="text" name="orderid[]" id="orderid[]" class="inputls" value="<?php echo $row['orderid']; ?> " /> <a href="infoclass_save.php?action=down&id=<?php echo $row['id']; ?> &parentid=<?php echo $row['parentid']; ?> &orderid=<?php echo $row['orderid']; ?> " class="rightArrow" title="下降排序"></a></td> <td width="32%" class="action endCol"><span><?php echo $addStr; ?> </span> | <span><?php echo $checkStr; ?> </span> | <span><?php echo $updateStr; ?> </span> | <span class="nb"><?php echo $delStr; ?> </span></td> </tr> </table> </div> <?php Show($row['id'], $i + 2); } }