Location: PHPKode > projects > Wiki Web Help > wwh/pages/links.php
<?php
require_once("../config.php");

$links = '';

$sql = "SELECT * FROM langxref WHERE language != ''";
$result = mysql_query($sql,$con) or die(mysql_error());
$n = mysql_num_rows($result);
for($r=0;$r<$n;$r++){
	$langnode = mysql_result($result, $r, 'node_id');    
	parsenode($langnode, $node,$con);

}

//header('Content-Type: text/html; charset=UTF-8');
echo substr($links,3);

function parsenode($lid,$node,$con){
	$sql = "SELECT node.node_id,label FROM page ".
		"INNER JOIN node on page.node_id=node.node_id WHERE ".
		"node.parent_id=$lid";
	$resultp = mysql_query($sql,$con) or die(mysql_error());
	$np = mysql_num_rows($resultp);
	for($p=0;$p<$np;$p++){
		$id = mysql_result($resultp, $p, 'node.node_id');
		$label = mysql_result($resultp, $p, 'label');
        	addlink($id,$label);
        	parsenode($id, $node,$con);
	}
    
}

function addlink($id,$label){
	global $links;
	$links.= " | <a href='getpage.php?id=$id&title=".htmlspecialchars($label)."'>".htmlspecialchars($label)."</a> ";
}
?>
Return current item: Wiki Web Help