Archive
CompCheck Newsletter Articles

$totalpages) { // set current page to last page $currentpage = $totalpages; } // end if // if current page is less than first page... if ($currentpage < 1) { // set current page to first page $currentpage = 1; } // end if // the offset of the list, based on current page $offset = ($currentpage - 1) * $rowsperpage; /////////////////////////////////////////// $sql = "SELECT * FROM workcomp_articles ORDER BY wcarticle_date desc, wcarticle_id desc LIMIT 1,100 "; $result =mysql_query($sql, $link) or trigger_error("SQL", E_USER_ERROR); //$num_results = mysql_num_rows($result); //if ($num_results!=0) { //for ($i=0; $i <$num_results; $i++){ //$row = mysql_fetch_array($result); while ($row = mysql_fetch_assoc($result)) { echo '

'.$row['wcarticle_headline'].'
'; $date = $row['wcarticle_date']; include("datefix.php"); echo ', '.$year.'

'; $story = $row['wcarticle_story']; $story1 = str_replace("\n", "
", $story); $text = str_replace("\t", "
", $story1); //set $ncontent to the string you are trying to shorten $maxlength=250; //max characters to display $nlength = strlen($text); if($nlength > $maxlength) { $text_short = substr(trim($text),0,$maxlength); $text_short = substr($text,0,strlen($text_short)-strpos(strrev($text_short)," ")); $text_short = $text_short.' ... More »

'; } echo $text_short; echo '


'; } //} ?>



Why Join CMTA?
Download brochure