$addtitle "; } function makeThumb( $scrFile, $dstFile) { global $tpicw,$tpich; $im = ImageCreateFromJPEG( $scrFile ); $srcW = ImageSX( $im ); $srcH = ImageSY( $im ); if ($srcW > $srcH){ if ($srcW > $tpicw){ $dstW=$tpicw; $dstH = ($srcH*$dstW)/$srcW; }else{ $dstW=$srcW; $dstH=$srcH; }} elseif ($srcH > $tpich){ $dstH=$tpich; $dstW = ($srcW*$dstH)/$srcH; }else{ $dstW=$srcW; $dstH=$srcH; } $ni = ImageCreate( $dstW, $dstH ); ImageCopyResized( $ni, $im, 0, 0, 0, 0, $dstW, $dstH, $srcW, $srcH ); ImageJPEG( $ni, $dstFile ); imagedestroy($ni); } function makePic( $scrFile, $dstFile) { global $bpicw,$bpich; $im = ImageCreateFromJPEG( $scrFile ); $srcW = ImageSX( $im ); $srcH = ImageSY( $im ); if ($srcW > $srcH){ if ($srcW > $bpicw){ $dstW=$bpicw; $dstH = ($srcH*$dstW)/$srcW; }else{ $dstW=$srcW; $dstH=$srcH; }} elseif ($srcH > $bpich){ $dstH=$bpich; $dstW = ($srcW*$dstH)/$srcH; }else{ $dstW=$srcW; $dstH=$srcH; } $ni = ImageCreate( $dstW, $dstH ); ImageCopyResized( $ni, $im, 0, 0, 0, 0, $dstW, $dstH, $srcW, $srcH ); ImageJPEG( $ni, $dstFile ); imagedestroy($ni); } function getparent($parentid,$title) { global $prefix, $dbi; global $moduldir; $result = sql_query("select cid, title, parentid from ".$prefix."_content_categories where cid=$parentid order by title", $dbi); list($cid, $ptitle, $pparentid) = sql_fetch_row($result, $dbi); if ($ptitle!="") $title=$ptitle."/".$title; if ($pparentid!=0) { $title=getparent($pparentid,$title); } return $title; } function getparentlink($parentid,$title) { global $prefix, $dbi; global $moduldir; $result=sql_query("select cid, title, parentid from ".$prefix."_content_categories where cid=$parentid order by title", $dbi); list($cid, $ptitle, $pparentid) = sql_fetch_row($result, $dbi); if ($ptitle!="") $title="$ptitle/".$title; if ($pparentid!=0) { $title=getparentlink($pparentid,$title); } return $title; } function copyright(){ OpenTable(); echo "


"; CloseTable(); } function addnum($cid){ global $prefix, $dbi; $rescat=sql_query("select adds from ".$prefix."_content_categories where cid='$cid'",$dbi); while(list($adds)=sql_fetch_row($rescat,$dbi)){ if ($adds){ $nowdate=time(); // $resultnum=sql_query("select lid from ".$prefix."_content_pages where cid='$cid' and '$nowdate' < enddate",$dbi); Beschraenkung auf neue Inhalte $resultnum=sql_query("select lid from ".$prefix."_content_pages where cid='$cid'",$dbi); $addnum=sql_num_rows($resultnum, $dbi); echo " ($addnum)"; }}} function menu($mainlink) { global $moduldir, $modulname, $bgcolor2, $lang, $user; OpenTable(); /* echo "
\"\"

"; echo "
" ." " ."
"; echo "[ "; if ($mainlink>0) { echo ""._CSF_ADDSMAIN." | "; } */ echo "
"; echo ""._CSF_ADDLINK."" ." | "._CSF_NEW."" ." | "._CSF_POPULAR.""; if(is_user($user)){ echo" | "._CSF_EDITAD.""; } echo "
"; CloseTable(); } function SearchForm() { global $moduldir, $bgcolor2, $query; echo "
" ."" ."" ."
" ."
"; } function addinfomenu($lid) { global $moduldir, $bgcolor2, $submitter; echo "\n"; echo "
"._CSF_ZUSATZ."


" ."[ " ." "._CSF_ANNMAIL."" /* ." | "._CSF_ANNPM."" */ ." | "._CSF_REPORTADDBROKEN."" ." | \""._CSF_ADDPRINTER."\"" ." | \""._CSF_ADDFRIEND."\"" ." ] "; } function index() { global $prefix, $dbi; global $moduldir, $bgcolor2, $addcolor, $addcolor2; include("header.php"); echo "
"; echo "
"; echo "

Startseite / Fachbeiträge

\n"; $mainlink = 0; menu($mainlink); echo "
"; OpenTable(); echo "

"._CSF_ADDSMAINCAT."

"; $result = sql_query("select cid, title, cdescription from ".$prefix."_content_categories where parentid=0 order by title", $dbi); while(list($cid, $title, $cdescription) = sql_fetch_row($result, $dbi)) { echo "

 · $title"; addnum($cid); categorynewaddgrafik($cid); if ($cdescription) { echo "
$cdescription"; } echo "

"; //$numcat=sql_num_rows(sql_query("select cid, title from ".$prefix."_content_categories where parentid=$cid", $dbi),$dbi); $result2 = sql_query("select cid, title from ".$prefix."_content_categories where parentid=$cid order by title", $dbi); while(list($cid, $stitle) = sql_fetch_row($result2, $dbi)) { echo "

 · $stitle"; addnum($cid); categorynewaddgrafik($cid); } echo "

"; } $nowdate=time(); // $result=sql_query("select * from ".$prefix."_content_pages where '$nowdate' < enddate", $dbi); Beschraenkung auf neue Inhalte $result=sql_query("select * from ".$prefix."_content_pages", $dbi); $numrows = sql_num_rows($result, $dbi); $result=sql_query("select * from ".$prefix."_content_categories", $dbi); $catnum = sql_num_rows($result, $dbi); echo "

"._CSF_THEREARE." $numrows "._CSF_ADDS." "._CSF_AND." $catnum "._CSF_CATEGORIES." "._CSF_INDB."
"; echo "
"; echo "
"; $a = 1; $content = "

Fachbeiträge

"; $content .= ""; $sqlquery = "select lid, title, datum from ".$prefix."_content_pages where cid = \"$cid\" order by datum DESC limit 0,15"; $result20 = sql_query($sqlquery, $dbi); while(list($lid, $title, $datum) = sql_fetch_row($result20, $dbi)) { if ($colorswitch == $addcolor) { $colorswitch = $bgcolor1; } else { $colorswitch = $addcolor; } $content .= ""; $a++; } $content .= "
$a. $title
"; echo $content; $content = ""; echo "
"; echo "
"; CloseTable(); copyright(); include("footer.php"); } function newaddgrafik($datetime, $time) { global $moduldir, $bgcolor2; echo " "; $datetime=date("d-M-Y",$time); $startdate = time(); $count = 0; while ($count <= 7) { $daysold = date("d-M-Y", $startdate); if ("$daysold" == "$datetime") { if ($count<=1) { echo "\""._CSF_NEWTODAY."\""; } if ($count<=3 && $count>1) { echo "\""._CSF_NEWLAST3DAYS."\""; } if ($count<=7 && $count>3) { echo "\""._CSF_NEWTHISWEEK."\""; } } $count++; $startdate = (time()-(86400 * $count)); } } function categorynewaddgrafik($cat) { global $prefix, $dbi; global $moduldir, $bgcolor2; $nowdate=time(); // $newresult = sql_query("select datum from ".$prefix."_content_pages where cid=$cat and '$nowdate' < enddate order by datum desc limit 1", $dbi); $newresult = sql_query("select datum from ".$prefix."_content_pages where cid=$cat order by datum desc limit 1", $dbi); list($time)=sql_fetch_row($newresult, $dbi); echo " "; // setlocale ("LC_TIME", "$locale"); $datetime=date("d-M-Y",$time); $startdate = time(); $count = 0; while ($count <= 7) { $daysold = date("d-M-Y", $startdate); if ("$daysold" == "$datetime") { if ($count<=1) { echo "\""._CSF_CATNEWTODAY."\""; } if ($count<=3 && $count>1) { echo "\""._CSF_CATLAST3DAYS."\""; } if ($count<=7 && $count>3) { echo "\""._CSF_CATTHISWEEK."\""; } } $count++; $startdate = (time()-(86400 * $count)); } } function popgraphic($hits) { global $popular; if ($hits>=$popular) { echo " \""._CSF_POPULAR."\""; } } function convertorderbyin($orderby) { if ($orderby == "titleA") $orderby = "title ASC"; if ($orderby == "datumA") $orderby = "datum ASC"; if ($orderby == "hitsA") $orderby = "hits ASC"; if ($orderby == "titleD") $orderby = "title DESC"; if ($orderby == "datumD") $orderby = "datum DESC"; if ($orderby == "hitsD") $orderby = "hits DESC"; return $orderby; } function convertorderbytrans($orderby) { if ($orderby == "hits ASC") $orderbyTrans = ""._CSF_POPULARITY1.""; if ($orderby == "hits DESC") $orderbyTrans = ""._CSF_POPULARITY2.""; if ($orderby == "title ASC") $orderbyTrans = ""._CSF_TITLEAZ.""; if ($orderby == "title DESC") $orderbyTrans = ""._CSF_TITLEZA.""; if ($orderby == "datum ASC") $orderbyTrans = ""._CSF_DATE1.""; if ($orderby == "datum DESC") $orderbyTrans = ""._CSF_DATE2.""; return $orderbyTrans; } function convertorderbyout($orderby) { if ($orderby == "title ASC") $orderby = "titleA"; if ($orderby == "datum ASC") $orderby = "datumA"; if ($orderby == "hits ASC") $orderby = "hitsA"; if ($orderby == "linkratingsummary ASC") $orderby = "ratingA"; if ($orderby == "title DESC") $orderby = "titleD"; if ($orderby == "datum DESC") $orderby = "datumD"; if ($orderby == "hits DESC") $orderby = "hitsD"; if ($orderby == "linkratingsummary DESC") $orderby = "ratingD"; return $orderby; } switch($a_op) { case "menu": menu($mainlink); break; case "AddAd": include ("modules/$moduldir/addad.php"); break; case "NewAds": include ("modules/$moduldir/newads.php"); break; case "MostPopular": include ("modules/$moduldir/pop.php"); break; case "viewadd": include ("modules/$moduldir/viewad.php"); break; case "brokenlink": include ("modules/$moduldir/broken.php"); break; case "brokenlinkS": include ("modules/$moduldir/brokenS.php"); break; case "visit": include ("modules/$moduldir/visit.php"); break; case "Add": include ("modules/$moduldir/add.php"); break; case "AddEdit": include ("modules/$moduldir/addedit.php"); break; case "Update": include ("modules/$moduldir/update.php"); break; case "editadd": include ("modules/$moduldir/editad.php"); break; case "deladd": include ("modules/$moduldir/delad.php"); break; case "delete": include ("modules/$moduldir/delete.php"); break; case "search": include ("modules/$moduldir/search.php"); break; case "contact": include ("modules/$moduldir/contact.php"); break; case "contactS": include ("modules/$moduldir/contactS.php"); break; case "print": include ("modules/$moduldir/print.php"); break; case "friend": include ("modules/$moduldir/friend.php"); break; default: index(); break; } ?>