function LogicGetOptionArray($ID,$step,$channeltype,$dsql) { global $OptionArrayList,$channels; $dsql->SetQuery("Select ID,typename,ispart,channeltype,issend From #@__arctype where reID='".$ID."' And ispart<>2 order by sortrank asc"); $dsql->Execute($ID); while($row=$dsql->GetObject($ID)){ if($row->channeltype==$channeltype && $row->issend==1){ if($row->ispart==0) $OptionArrayList .= "<option value='".$row->ID."' class='option3'>$step".$row->typename."</option>\r\n"; else if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>$step".$row->typename."</option>\r\n"; } LogicGetOptionArray($row->ID,$step."─",$channeltype,$dsql); } }
/** * 逻辑递归 * * @access public * @param int $id * @param string $step * @param string $channeltype * @param int $selid * @return string */ function LogicGetOptionArray($id, $step, $channeltype, $selid = 0) { global $OptionArrayList, $channels, $dsql; $selected = ''; $dsql->SetQuery("Select id,typename,ispart,channeltype,issend From `#@__arctype` where reid='" . $id . "' And ispart<2 order by sortrank asc"); $dsql->Execute($id); while ($row = $dsql->GetObject($id)) { if ($selid == $row->id) { $selected = " selected='{$selected}'"; } if ($row->channeltype == $channeltype && $row->issend == 1) { if ($row->ispart == 0) { $OptionArrayList .= "<option value='" . $row->id . "' class='option3'{$selected}>{$step}" . $row->typename . "</option>\r\n"; } else { if ($row->ispart == 1) { $OptionArrayList .= "<option value='" . $row->id . "' class='option2'{$selected}>{$step}" . $row->typename . "</option>\r\n"; } } } $selected = ''; LogicGetOptionArray($row->id, $step . "─", $channeltype, $selid); } }
function LogicGetOptionArray($id, $step, $channeltype, &$dsql, &$sonCats) { global $OptionArrayList, $channels, $cfg_admin_channel, $admin_catalogs; $dsql->SetQuery("Select id,typename,ispart,channeltype From `#@__arctype` where reid='" . $id . "' And ispart<>2 order by sortrank asc"); $dsql->Execute($id); while ($row = $dsql->GetObject($id)) { if ($cfg_admin_channel != 'all' && !in_array($row->id, $admin_catalogs)) { continue; } if ($row->channeltype == $channeltype && $row->ispart == 1) { $sonCats .= "<option value='" . $row->id . "' class='option1'>{$step}" . $row->typename . "</option>\r\n"; } else { if ($row->channeltype == $channeltype && $row->ispart == 0 || empty($channeltype)) { $sonCats .= "<option value='" . $row->id . "' class='option3'>{$step}" . $row->typename . "</option>\r\n"; } } LogicGetOptionArray($row->id, $step . '─', $channeltype, $dsql, $sonCats); } }
function LogicGetOptionArray($ID,$step,$channeltype,$dsql,$testpur=true) { global $OptionArrayList,$channels,$adminCats,$suserCatalog; $dsql->SetQuery("Select ID,typename,ispart,channeltype From #@__arctype where reID='".$ID."' And ispart<2 order by sortrank asc"); $dsql->Execute($ID); while($row=$dsql->GetObject($ID)) { if($suserCatalog!=-1 && $testpur && !TestAdmin() && !in_array($row->ID,$adminCats)) continue; if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option1'>$step".$row->typename."(封面频道)</option>\r\n"; else if($row->ispart==2) $OptionArrayList .=""; else if($row->channeltype!=$channeltype) $OptionArrayList .=""; else $OptionArrayList .= "<option value='".$row->ID."' class='option3'>$step".$row->typename."</option>\r\n"; LogicGetOptionArray($row->ID,$step."─",$channeltype,$dsql,false); } }