Rhinestones Logo
Rhinestones Banner
"; $pdficon=""; $pdfDir= $currNewsDir.$st_fileDirPDF; $imgDir= $currNewsDir.$st_fileDirMid; $imgDirOrig= $currNewsDir.$st_fileDirUp; $blankImg= $currNewsDir.$st_blankImg; if (isset($_REQUEST['id'])){ $id = $_REQUEST['id']; if ($id>0){ $db_result = fn_dbQuery("SELECT *, UNIX_TIMESTAMP(`date`) as `dateUnix` FROM ".$st_db_newstable." WHERE id ='$id' && ActionAlert='0'"); while($row = mysql_fetch_array($db_result)){ echo '

Rhinestones News

'; $id = $row ["id"]; $image = $row ["image"]; $image_width = $row ["image_width"]; //if IMAGE is smaller then 200px wide then just use the original Image if ($image_width<200) {$imgDir=$imgDirOrig;} $image_caption = $row ["image_caption"]; $author = $row ["author"]; if ($author!="") {$author="by ".$author."

";} if (strlen($row ["pdf"])>5) { $pdf_display = "
".$pdficon." ".nl2br($row ["pdf_display"])."

 
"; } else {$pdf_display="";} $headline = "

".nl2br(stripslashes($row ["headline"]))."  



\n"; if($row['url'] != ''){ $url = "".nl2br(stripslashes($row["url_caption"]))."

\n"; }else{ $url = ""; } $date = "".date('F j, Y', $row['dateUnix'])."

\n"; $body = "".nl2br(stripslashes($row ["body"]))."\n"; if (strlen($image)+0>5) {$image=$imgDir.$image;$image_caption = "".nl2br(stripslashes($image_caption))."";} else {$image=$blankImg;$image_caption="";} $imageHTML = "\n\n\n\n\n\n\n
    
".$image_caption."

"; if(empty($row['image'])){$imageHTML = "";} echo $headline."
".$url.$pdf_display.$date.$author.$imageHTML.$body."
 
 « Go Back
   
"; } } } else { //find out which alert Type to list //fn_DUMP($_REQUEST['alertType']); require_once 'DB.php'; //$section = urldecode($_REQUEST['section']); $section = "news"; /*echo "

At Wilson Farms, it's important to us to play an active role in making our community a better place to live. That's why each month we provide charitable organizations across New York State with the support they need to serve our communities.

";*/ echo '

'.ucwords($section).'

'; //get Product Numbers from Db //return as Option Tags $dsn = array( 'phptype' => 'mysql', 'username' => $st_db_user, 'password' => $st_db_pass, 'hostspec' => $st_db_host, 'database' => $st_db_name ); $db =& DB::connect($dsn); if (PEAR::isError($db)) { die($db->getMessage()); } // Proceed with a query... $sql_query = "SELECT id, headline, UNIX_TIMESTAMP(date) as uDate FROM `".$st_db_newstable."` WHERE hide!=1 && section LIKE '%".mysql_escape_string($section)."%' ORDER BY `uDate` DESC "; //$sql_query = "SELECT id, headline, url_id, UNIX_TIMESTAMP(date) as uDate FROM `".$st_db_newstable."` WHERE hide!=1 && alertType LIKE '%transport%' ORDER BY `uDate` DESC "; $db_sql = "SELECT * FROM `".$st_db_prefsTable."` WHERE `id` =1"; $db_result = fn_dbQuery($db_sql); while($row=mysql_fetch_array($db_result)){ $headlinesPerPage=$row["headlinesPerPage"]; $maxCurrentWords=$row["maxCurrentWords"]; $maxCurrent=$row["maxCurrent"]; } $headlinesPerPage = ($headlinesPerPage>0)?$headlinesPerPage:10; require_once $_SERVER['DOCUMENT_ROOT'].'/news/Pager_Wrapper.php'; //this file $pagerOptions = array( 'mode' => 'Sliding', 'delta' => 5, 'perPage' => $headlinesPerPage, 'linkClass' => 'pager', 'curPageLinkClassName' => 'current_pager', 'urlVar' => 'page' ); $paged_data = Pager_Wrapper_DB($db, $sql_query, $pagerOptions); //fn_DUMP($paged_data); if(is_array($paged_data['data']) && count($paged_data['data'])>0 ){ echo "
".$paged_data['links']."

"; foreach($paged_data['data'] as $item){ /*if( !empty($item['url_id']) ){ $articleHref = fn_url_lookup($item['url_id']); }else{*/ $articleHref = $st_fileDirNews."?id=".$item['id']; //} echo "

".date("m/d/y", $item['uDate'])." - ".$item['headline']."

"; } echo "

 "; }else{ echo "

No Articles Found for ".ucwords($section)."!

"; } } /* //echo "show all\n"; $db_sql = "SELECT * FROM `".$st_db_prefsTable."` WHERE `id` =1"; $db_result = fn_dbQuery($db_sql); while($row=mysql_fetch_array($db_result)){ $headlinesPerPage=$row["headlinesPerPage"]; $maxCurrentWords=$row["maxCurrentWords"]; $maxCurrent=$row["maxCurrent"]; } $db_sql = "SELECT * FROM `".$st_db_newstable."` WHERE ActionAlert='0' ORDER BY `date` DESC"; $db_result = fn_dbQuery($db_sql); $lvl=substr(basename($PHP_SELF),-5,1); // read which archive page we are on, by looking at the filename. //out put table start echo '

Rhinestones News

'; $count=1; $hidden=0; if(isset($headlinesPerPage)){ $showcount=1+$headlinesPerPage*($lvl+0); if (is_numeric($lvl)) { echo ""; } } $numrows=mysql_num_rows($db_result); while($row=mysql_fetch_array($db_result)){ //echo "enter while"; $id=$row["id"]; $hide=$row["hide"]; if($hide=="1"){$hidden++;continue;} list($y,$m,$d)=split('[- ]',$row["date"]); $y2=substr ($y,2,4); $date=""; $articleHref= $currNewsDir.$st_fileDirNews."?id=$id"; $headline=" "; //echo "
count =".$count; //echo "
Showcount =".$showcount; if ($count>=$showcount) {echo $date.$headline;} // don't show what's on previous pages. if(isset($headlinesPerPage)){ // if headlines limiter is set, if($count==$headlinesPerPage*($lvl+1)||($numrows==$hidden+$count)){ // if at last row for this page (either b/c it reached the limit or it's at the LAST record retrieved) if ($lvl==1){ //if at first archive page, PREV page is news.php, not an archive page. $prev=" Back to Current  "; } else if ($lvl>1) { // otherwise PREV page is an archive page. $prev="< More Recent     "; } if ($numrows==$hidden+$count) { // if at LAST news article, offer link back to current if ($lvl>1){ $next="     Back to Current >"; } } else { // otherwise show link to more (older) articles $next="     Older Articles >"; } echo ""; break;} } $count++; } echo "
   
Archive (page ".$lvl.")

".$m."/".$d."/".$y2."

".$prev.$next."   
   
"; */ //} //mysql_close($db_link); ?>
Rochester Rhinos