assign("docroot",$docroot); $smarty->template_dir ="/$docroot/includes"; $smarty->compile_dir = "/$docroot/includes/templates_c"; $smarty->clear_compiled_tpl("featurestories.html"); $obj=new Database($host="127.0.0.1", $db="pulseplanet", $user="adminpulse", $pwd="m0nkey@z00"); $obj2=new Database($host="127.0.0.1", $db="pulseplanet", $user="adminpulse", $pwd="m0nkey@z00"); $obj->query("SELECT * from featurestories order by datestamp desc limit 0,1"); while($obj->nextRecord()){ $id = $obj->getField("id"); $smarty->append("sendid",$id); $datestamp=$obj->getField("datestamp"); $datestamparray=split('-',$datestamp); $datestamp2=date("F Y", mktime(0, 0, 0, $datestamparray[1],$datestamparray[2], $datestamparray[0])); $smarty->append("datestamplist",$datestamp2); } /*$start=1; $_GET["start"]=1; if(!$_GET["start"]){$start = 0;}else{$start = $_GET["start"];}*/ /*if($_GET["id"]){*/ if($_GET['offset']){header("Location: http://www.pulseplanet.com/monthlyfeature/index.php");} $resquery="SELECT * from featurestories where id='" . $_GET["id"] . "'"; /*}*/ /*else {$resquery="SELECT * from featurestories limit $start,1";}*/ $obj->query($resquery); while($obj->nextRecord()){ $id = $obj->getField("id"); $smarty->assign("showid",$id); $filename = $obj->getField("filename"); list($toss,$date)=split("\-",$filename); $month=substr($date,0,-2); $year=substr($date,-2,2); $dateline="$month $year"; $smarty->assign("dateline",$dateline); $st = $obj->getField("st"); $smarty->assign("st",$st); $sc = $obj->getField("sc"); $sc=strip_tags($sc, '


  • '); $sc=ereg_replace("\n"," ",$sc); $sc=ereg_replace("
    ","\n",$sc); $sc=ereg_replace("

    ","\n",$sc); $sc=ereg_replace("

    ","\n",$sc); $sc=nl2br($sc); $smarty->assign("sc",$sc); $docroot=$_SERVER["DOCUMENT_ROOT"]; $obj2->query("SELECT * from featureimages where featureid='" . $id . "'"); while($obj2->nextRecord()) { $image[$id] = $obj2->getField("image"); $imgsize=getimagesize($docroot . "/monthlyfeature/storyimages/" . $image[$id]); $setwidtharray[]=$imgsize[0]; $tag[$id] = $obj2->getField("tag"); $smarty->append("image",$image[$id]); $smarty->append("tag",$tag[$id]);} if(is_array($setwidtharray)){ $setwidth=max($setwidtharray);} else{$setwidth=0;} if($setwidth > 275){$smarty->assign("colwidth",275);}else{ $smarty->assign("colwidth",$setwidth);} //$smarty->assign("colwidth",$setwidth); //$imagearea = str_replace('/monthlyfeature/storyimages/', 'thumbnailmonthly.php?limit=300&image=', $imagearea); $leadin = $obj->getField("leadin"); $smarty->assign("leadin",$leadin); $sa = $obj->getField("sa"); $smarty->assign("sa",$sa); $datestamp=$obj->getField("datestamp"); $smarty->assign("datestamp",$datestamp); $mp3 = $obj->getField("mp3"); $mp3=trim($mp3); $mp3tag = $obj->getField("mp3tag"); if($mp3 <> ''){ $smarty->assign("mp3",$mp3); $smarty->assign("showaudio","yes"); $smarty->assign("mp3tag",$mp3tag);}else{ $smarty->assign("showaudio","no");} } $getcwd=getcwd(); $smarty->assign("path",$getcwd); $smarty->display("featurestories.html"); ?>