","",$text); } /* function br2nl($string) { return preg_replace('##i', "\n", $string); } */ if (!eregi("modules.php",$PHP_SELF)) { die ("You can't access this file directly..."); } /************************************/ /* config for directory and name */ /************************************/ $moduldir="PressRelease"; // directory require_once("modules/$moduldir/config.php"); $index = 1; $menubox = 4; require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); //get_lang($module_name); require_once("modules/$moduldir/language/lang-german.php"); $pagetitle = ""._CSF_CLASSIFIED.""; /*********************/ /* Doc-directory */ /*********************/ $docdir="adengdocs/"; /*********************/ /* PDF-directory */ /*********************/ $pdfdir="adengpdf/"; /*********************/ /* Picture-directory */ /*********************/ $picdir="adengpics/"; function headertable($addtitle){ global $bgcolor2; // echo "
 $addtitle 
"; echo "
$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."_addeng_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."_addeng_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 getparentmeta($parentid,$title) { global $prefix, $dbi; global $moduldir; $result = sql_query("select cid, title, parentid from ".$prefix."_addeng_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=getparentmeta($pparentid,$title); } return $title; } function copyright(){ echo "


"; } function addnum($cid){ global $prefix, $dbi; $rescat=sql_query("select adds from ".$prefix."_addeng_categories where cid='$cid'",$dbi); while(list($adds)=sql_fetch_row($rescat,$dbi)){ if ($adds){ $nowdate=time(); // $resultnum=sql_query("select lid from ".$prefix."_addeng_adds where cid='$cid' and '$nowdate' < enddate",$dbi); Beschraenkung auf neue PressReleases $resultnum=sql_query("select lid from ".$prefix."_addeng_adds where cid='$cid' and isValidated='Yes' and isChanged = 'No'",$dbi); $addnum=sql_num_rows($resultnum, $dbi); echo " ($addnum)"; }}} function menu($mainlink) { global $moduldir, $modulname, $bgcolor2, $lang, $user; echo "
PressReleases
"; echo "[ "; if ($mainlink>0) { echo ""._CSF_ADDSMAIN.""; } if(is_user($user)){ echo" | "._CSF_ADDLINK.""; echo" | "._CSF_EDITAD.""; } echo " | "._CSF_NEW.""; // ." | "._CSF_POPULAR.""; echo" ]" .""; } function SearchForm() { global $moduldir, $bgcolor2, $query; echo "
" ."" ."" ."
" ."
"; } function addinfomenu($lid) { global $moduldir, $bgcolor2, $submitter; echo "\n"; echo "
"._CSF_ZUSATZ."


" ."[ " ." "._CSF_ANNMAIL."" ." | "._CSF_REPORTADDBROKEN."" ." | \""._CSF_ADDPRINTER."\"" ." | \""._CSF_ADDFRIEND."\"" ." ]"; } function index() { global $prefix, $dbi; global $moduldir, $bgcolor2, $addcolor, $addcolor2; include("header.php"); $mainlink = 0; menu($mainlink); echo "
"; echo "
"._CSF_ADDSMAINCAT."

"; echo ""; $result = sql_query("select cid, title, cdescription from ".$prefix."_addeng_categories where parentid=0 order by title", $dbi); $count = 0; while(list($cid, $title, $cdescription) = sql_fetch_row($result, $dbi)) { if ($count==0){echo "";if ($colorswitch == $addcolor) { $colorswitch = $addcolor2; } else { $colorswitch = $addcolor; }} echo ""; $count = 0; $dum = 0; }else{echo "";} } if ($dum == 1) { echo "
$title"; addnum($cid); /* categorynewaddgrafik($cid); */ //$numcat=sql_num_rows(sql_query("select cid, title from ".$prefix."_addeng_categories where parentid=$cid", $dbi),$dbi); $result2 = sql_query("select cid, title from ".$prefix."_addeng_categories where parentid=$cid order by title", $dbi); while(list($cid, $stitle) = sql_fetch_row($result2, $dbi)) { echo "
» $stitle"; addnum($cid); /* categorynewaddgrafik($cid); */ } /*if ($numcat > 3){ echo "
·..."; }*/ $count++; if ($count==2) { echo "
"; } elseif ($dum == 0) { echo ""; } $nowdate=time(); // $result=sql_query("select * from ".$prefix."_addeng_adds where '$nowdate' < enddate", $dbi); Beschraenkung auf neue PresseInfos /* $result=sql_query("select lid from ".$prefix."_addeng_adds where isValidated='Yes' and isChanged = 'No'", $dbi); $numrows = sql_num_rows($result, $dbi); $result=sql_query("select cid from ".$prefix."_addeng_categories", $dbi); $catnum = sql_num_rows($result, $dbi); echo "

"._CSF_THEREARE." $numrows "._CSF_ADDS." "._CSF_AND." $catnum "._CSF_CATEGORIES." "._CSF_INDB."
"; */ 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."_addeng_adds where cid=$cat and '$nowdate' < enddate order by datum desc limit 1", $dbi); $newresult = sql_query("select datum from ".$prefix."_addeng_adds where cid=$cat and isValidated='Yes' and isChanged ='No' 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 "FreiAds": $freigabe = 'Yes'; $isvalidated = 'No'; include ("modules/$moduldir/add.php"); break; case "Freigabe": sql_query("update ".$prefix."_addeng_adds set isValidated = 'Yes' where lid=$lid", $dbi); include ("modules/$moduldir/addedit.php"); break; case "AddEdit": include ("modules/$moduldir/addedit.php"); break; case "Update": $freigabe = 'Yes'; $isvalidated = 'No'; include ("modules/$moduldir/update.php"); break; case "FreiUpdate": $freigabe = 'Yes'; $isvalidated = 'No'; include ("modules/$moduldir/update.php"); break; case "StopPublish": sql_query("update ".$prefix."_addeng_adds set isChanged = 'Yes' where lid=$lid", $dbi); include ("modules/$moduldir/addedit.php"); break; case "StartPublish": sql_query("update ".$prefix."_addeng_adds set isChanged = 'No' where lid=$lid", $dbi); include ("modules/$moduldir/addedit.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 "keywords": include ("modules/$moduldir/keywords.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 "printpdf": include ("modules/$moduldir/printpdf.php"); break; case "friend": include ("modules/$moduldir/friend.php"); break; default: index(); break; } ?>