'.$dr[name].'';
}
$bg1=BG_1;
eval ("\$links_new = \"".gettemplate("links_new")."\";");
echo $links_new;
}
else redirect('index.php?site=links', 'no access!');
}
elseif($_GET['action']=="edit") {
$linkID=$_GET['linkID'];
if(ispageadmin($userID) || isnewsadmin($userID)) {
$ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."links WHERE linkID='$linkID'"));
$name=$ds[name];
$url=$ds[url];
$info=$ds[info];
$newsrubrics=safe_query("SELECT * FROM ".PREFIX."links_categorys ORDER BY name");
if(mysql_num_rows($newsrubrics)) {
while($dr=mysql_fetch_array($newsrubrics)) {
if($ds[linkcatID]==$dr[linkcat]) $linkcats.='';
else $linkcats.='';
}
}
else $linkcats='';
$linkcats=str_replace(" selected", "", $linkcats);
$linkcats=str_replace('value="'.$ds[linkcatID].'"', 'value="'.$ds[linkcatID].'" selected', $linkcats);
$bg1=BG_1;
eval ("\$links_edit = \"".gettemplate("links_edit")."\";");
echo $links_edit;
}
else redirect('index.php?site=links', 'no access!');
}
elseif($_GET['action']=="show") {
if(ispageadmin($userID) || isnewsadmin($userID)) echo'
';
$linkcatID=$_GET['linkcatID'];
$linkID=$_GET['linkID'];
$linkcat=safe_query("SELECT * FROM ".PREFIX."links WHERE linkcatID='$linkcatID' ORDER BY name");
if(mysql_num_rows($linkcat)) {
eval ("\$links_details_head = \"".gettemplate("links_details_head")."\";");
echo $links_details_head;
$i=1;
while($ds=mysql_fetch_array($linkcat)){
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
$i++;
$link=''.$ds[name].'';
$info=cleartext($ds[info]);
if($ds[banner]) $banner='';
if(ispageadmin($userID) || isnewsadmin($userID))
$adminaction='
';
eval ("\$links_details = \"".gettemplate("links_details")."\";");
echo $links_details;
unset($banner);
}
eval ("\$links_foot = \"".gettemplate("links_foot")."\";");
echo $links_foot;
}
else echo 'no links available.
[ go back ]';
}
else {
if(ispageadmin($userID) || isnewsadmin($userID)) echo'
';
$cats=safe_query("SELECT * FROM ".PREFIX."links_categorys ORDER BY name");
if(mysql_num_rows($cats)) {
$anzcats=mysql_num_rows(safe_query("SELECT linkcatID FROM ".PREFIX."links_categorys"));
eval ("\$links_category = \"".gettemplate("links_category")."\";");
echo $links_category;
$i=1;
while($ds=mysql_fetch_array($cats)) {
$anzlinks=mysql_num_rows(safe_query("SELECT linkID FROM ".PREFIX."links WHERE linkcatID='".$ds[linkcatID]."'"));
if($i%2) {
$bg1=BG_1;
$bg2=BG_2;
}
else {
$bg1=BG_3;
$bg2=BG_4;
}
$linkcatname='• '.$ds[name].'';
eval ("\$links_content = \"".gettemplate("links_content")."\";");
echo $links_content;
$i++;
}
eval ("\$links_foot = \"".gettemplate("links_foot")."\";");
echo $links_foot;
}
else echo 'no categories available.';
}
?>