28,39 → 28,43 |
$query =& $dblink->query("SELECT * FROM settings"); |
$settings = array(); |
while ($query->fetchInto($setting, DB_FETCHMODE_ASSOC)) { |
$settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
$settings[stripslashes($setting["opt"])] = stripslashes($setting["optvalue"]); |
}; |
// Fetch information about distribution |
// Fetch info about distribution |
$query =& $dblink->query("SELECT * FROM version v JOIN distribution d ON d.dist_id=v.dist_id JOIN dtype p ON d.disttype=p.type_id WHERE v.dist_id='$distro' AND v.version_id='$version'"); |
$query->fetchInto($infodist, DB_FETCHMODE_ASSOC); |
// Fetch repos |
$repos=array_values($_GET); |
for ($i=3;$i<count($repos);$i++){ |
$pre=-1; //wtf? |
$id=(int)$repos[$i]; |
$sql =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN origin o ON o.orig_id=r.orig_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE r.rep_id=".$id); |
$sql->fetchInto($resinfo, DB_FETCHMODE_ASSOC); |
|
$repscheme = stripslashes($resinfo["scheme"]); |
$querysect =& $dblink->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$resinfo[rep_id]'"); |
$sections = ""; |
while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
$sections .= stripslashes($section["sectname"])." "; |
} |
$repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme); |
$repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme); |
$repscheme = str_replace("{URL}",$settings["url"],$repscheme); |
$repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme); |
$repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme); |
$repscheme = str_replace("{SECT}",$sections,$repscheme); |
$repscheme = str_replace("{ROOT}",stripslashes($resinfo["root_folder"]),$repscheme); |
if($pre != $resinfo["orig_id"]) { |
$result .= "### ".$resinfo["origin"]."( ".$resinfo["desk"]." ) - ".$resinfo["homeurl"]." ###\n"; |
} |
$pre = $resinfo["orig_id"]; |
$result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
} |
return $result; |
$porigid = -1; // Previous origin id |
for ($i=3;$i<count($repos);$i++){ |
$id=(int)$repos[$i]; |
// Fetch info about origin and scheme |
$sql =& $dblink->query("SELECT * FROM repository r JOIN ver2rep v ON r.rep_id=v.rep_id JOIN origin o ON o.orig_id=r.orig_id JOIN version v2 ON v.ver_id=v2.version_id JOIN scheme s ON s.scheme_id=r.scheme_id JOIN root r2 ON r2.root_id=r.root_id WHERE r.rep_id=".$id); |
$sql->fetchInto($resinfo, DB_FETCHMODE_ASSOC); |
$repscheme = stripslashes($resinfo["scheme"]); |
// Fetch info about sections |
$querysect =& $dblink->query("SELECT * FROM section s JOIN sect2rep r ON s.sect_id=r.sect_id WHERE r.rep_id='$resinfo[rep_id]'"); |
$sections = ""; |
while ($querysect->fetchInto($section,DB_FETCHMODE_ASSOC)) { |
$sections .= stripslashes($section["sectname"])." "; |
} |
// Conversion scheme |
$repscheme = str_replace("{TYPE}",stripslashes($infodist["type"]),$repscheme); |
$repscheme = str_replace("{PROTO}",$settings["proto"],$repscheme); |
$repscheme = str_replace("{URL}",$settings["url"],$repscheme); |
$repscheme = str_replace("{REP}",stripslashes($resinfo["repname"]),$repscheme); |
$repscheme = str_replace("{DIST}",stripslashes($infodist["vcodename"]),$repscheme); |
$repscheme = str_replace("{SECT}",$sections,$repscheme); |
$repscheme = str_replace("{ROOT}",stripslashes($resinfo["root_folder"]),$repscheme); |
// Comment if another origin |
if($porigid != $resinfo["orig_id"]) { |
$result .= "### ".$resinfo["origin"]."( ".$resinfo["desk"]." ) - ".$resinfo["homeurl"]." ###\n"; |
} |
$porigid = $resinfo["orig_id"]; |
// Result |
$result .= "# ".stripslashes($resinfo["repdescribe"])."\n".$repscheme."\n\n"; |
} |
return $result; |
} |
|
function getInfo($message,$dblink){ |