Location: PHPKode > projects > Chinese Project Forum > upload/board_jump.php
<? 

if($user_id) {
	eval ("\$profile_link = \"".gettemplate("board_jump_profile")."\";");
	if($pms && $userdata[canusepms]) eval ("\$pm_link = \"".gettemplate("board_jump_pm")."\";");
}

function makeboardjumpbit($bid,$depth=1) {
	global $boardcache, $boardid, $permissioncache;

	if(!isset($boardcache[$bid])) {
		return;
 	}

  	while (list($key1,$val1) = each($boardcache[$bid])) {
    		while(list($key2,$boards) = each($val1)) {
			if($boards[invisible] && !$permissioncache[$boards[boardid]]) continue;
			$out .= "<OPTION value=\"".$boards[boardid]."\"";
			if($boardid == $boards[boardid]) $out .= " selected";
			if($depth>1) $out .= ">".str_repeat("--",$depth-1)." ".editDBdata($boards[boardname])."</option>";
			else $out .= ">".editDBdata($boards[boardname])."</option>";
			$out.=makeboardjumpbit($boards[boardid],$depth+1);
     		} 
  	} 
  	unset($boardcache[$bid]);
  	return $out;
}

$recordset = &$conn->Execute("SELECT * FROM ".$prefix."_boards ORDER by boardparentid ASC, sort ASC");
while (!$recordset->EOF) {
  $row = $recordset->fields;
  $boardcache[$row[boardparentid]][$row[sort]][$row[boardid]] = $row;
  $recordset->MoveNext();
}

$recordset = &$conn->Execute("SELECT boardid FROM ".$prefix."_object2board WHERE objectid = '$user_group' AND boardpermission = 1");
while (!$recordset->EOF) {
  $row = $recordset->fields;
  $permissioncache[$row[boardid]] = 1;
  $recordset->MoveNext();
}

$board_links = makeboardjumpbit(0);
$recordset->close();

eval ("\$board_jump = \"".gettemplate("board_jump")."\";");
?>
Return current item: Chinese Project Forum