'; } if ($this_score != '0') { $a = ceil($this_score); if ($a - ($i -1) != '0') { $show_stars .= ''; } } for($i = 1; $i <= 5 - $this_score; $i++) { $show_stars .= ''; } if (is_array($show_stars)) { explode($show_stars);} RETURN $show_stars; } ?> $limit) { return substr_replace(strip_tags($string),$repl,$limit-strlen($repl)); } else { return $string; } } echo '

'; if ($tip=='yes') {echo'Pico Oscilloscope Tutorials

';} elseif($tip=='case'){echo'Pico Oscilloscope Case Studies

';} else{echo'Pico Oscilloscope Articles

';} $query = "select * from articles where tip='$tipe' order by date desc LIMIT $pagevalue, 11"; $result = mysql_query ($query); $ig=mysql_num_rows($result); $query = "select * from articles where tip='$tipe' order by date desc LIMIT $pagevalue, 10"; $result = mysql_query ($query); $ii=mysql_num_rows($result); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)){ echo'
'; //figure out if article is a video $query02 = "select type from articles where article_id = '$row[article_id]'"; $result02 = mysql_query ($query02); if ($result02) { while ($row02 = mysql_fetch_array($result02, MYSQL_BOTH)) { $arttype=$row02[type]; } } if(strlen($arttype)<1){ //if article doesnt contain a video attempt to display the pictures //if articles has images display them $query555 = "select image_id from temp_articles where id='$row[article_id]' LIMIT 1"; $result555 = mysql_query ($query555); if ($result555) { while ($row2 = mysql_fetch_array($result555, MYSQL_BOTH)) { if (strlen($row2[image_id] > 0)) { echo ""; }}} }else{ //apparently the article contains a video so lets display it based upon the file type... $query12 = "select * from temp_articles where id = '$row[article_id]' order by fig_num asc"; $result12 = mysql_query ($query12); if ($result12) { while ($row12 = mysql_fetch_array($result12, MYSQL_BOTH)) { if (strlen($row12[image_id] > 0)) { $vidurl='http://www.wavehook.com/uploads/'.$row12[image_id]; //check to see what typ of file the video is if($arttype=='swf'){$videosection='';} elseif($arttype=='avi' or $arttype=='mov'){$videosection='';} elseif($arttype=='wmv'){$videosection='';} elseif($arttype=='flv'){$videosection='';} echo $videosection; } } } } echo" $row[title]
".add_dots(strip_tags(html_entity_decode($row[body])),'...',145)."
open>> ".stars($row[score])."    by:$row[author_id] on $row[date]
"; }} if($pagevalue>0){ echo''; } if($ii==10){if($ig==11){ echo'';}} if(strlen($tip)<1){ echo'

New Article

          
'; include 'includes/footer.html';} if($tipe=='yes'){ echo'
New Tip

          
'; include 'includes/footer.html'; } if($tipe=='case'){ echo'
New Case Study

          
'; include 'includes/footer.html'; } }else{ //article was selected //do the insert comments if ($new_com){ mysql_query("insert into comments (art_id, username, comment, date) VALUES ('$article', '$_COOKIE[username]', '$new_comment', NOW())"); } //do the rating stuff if ($rate){ $query = "SELECT username FROM ratings WHERE username='$_COOKIE[username]' and article_id='$article'"; $result = mysql_query ($query) or trigger_error("Query: $query\n
MySQL Error: " . mysql_error()); if (mysql_num_rows($result) == 0) { mysql_query("update articles set score='$aveg' where article_id = '$article'"); $query2 = "INSERT INTO ratings ( article_id, username, rating) VALUES ('$article', '$_COOKIE[username]', '$ColumnsRatingsLevel')"; $result = mysql_query ($query2); if ($result) {$in = '
Your rating choice has been submitted';}}else {$uid = '
You have already voted for this article';}} //begin echoing main download table echo '

Downloads for this article

    '; echo "
  • About using downloads
  • Download PicoScope Demo Software
  • "; $query = "select image_text, psd_id,fig_num from articles, temp_articles where id = '$article' and id = article_id order by fig_num asc"; $result = mysql_query ($query); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { //if psd has a value display link to download it if (strlen($row[psd_id] > 0)) {echo "
  • Figure # $row[fig_num]: $row[image_text]
  • ";}}} $query2 = "select * from articles where article_id = '$article'"; $result = mysql_query ($query2); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {echo "

    Article written by: $row[author_id]

"; }} //end of main download table //if image has a value display it //figure out if article is a video $query2 = "select type from articles where article_id = '$article'"; $result = mysql_query ($query2); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {$arttype=$row[type];}} if(strlen($arttype)<1){ // // /// /// /// /// /// /// //// /// /// // // / / / / //// / // // // // / / /// / // / / / /// /// / // / // // if article doesnt contain a video attempt to display the pictures $query2 = "select * from temp_articles where id = '$article' order by fig_num asc"; $result = mysql_query ($query2); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { if (strlen($row[image_id] > 0)){echo "

Fig # $row[fig_num] $row[image_text]
";}}} }else{ //apparently the article contains a video so lets display it based upon the file type... $query2 = "select * from temp_articles where id = '$article' order by fig_num asc"; $result = mysql_query ($query2); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { if (strlen($row[image_id] > 0)){ $vidurl='http://www.wavehook.com/uploads/'.$row[image_id]; //check to see what typ of file the video is if($arttype=='swf'){$videosection=' ';} elseif($arttype=='avi' or $arttype=='mov'){$videosection=' ';} elseif($arttype=='wmv'){$videosection=' ';} elseif($arttype=='flv'){$videosection=' ';} } } } } // // /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// //// //// //// /// //// //// ///// ////// ///// ////// ////// //display the right side of screen $alt_words = array("Figure ","figure ","fig ","fig. ","Fig ","Fig. "); $query2 = "select * from articles where article_id = '$article'"; $result = mysql_query ($query2); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { $rc_body=$row[body]; $rc_title=$row[title]; $egrcount=0; foreach ($alt_words as $noaltwords){ if(eregi($noaltwords, $rc_body)){$egrcount++;}} if($egrcount>1){ $query2 = "select * from temp_articles, articles where id = '$article' and article_id='$article' order by fig_num desc"; $result = mysql_query ($query2); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { $figure_number[] = $row[fig_num]; $image = $row[image_id]; if (strlen($image) > 0){ foreach($alt_words as $keyword){ $f_num = $row[fig_num] ; $key_counting = $keyword.$f_num; $fig_count = substr_count( $rc_body,"$key_counting"); if($fig_count > 0){ $ithis = "Figure_".$f_num.""; $rc_body = eregi_replace("$key_counting", $ithis, $rc_body); } } } } }} echo '

'.$rc_title.'

'.$videosection.'
'.html_entity_decode($rc_body).'

Rate this article!

Currently this article has a average rating of '; $query = "SELECT COUNT(*),AVG(rating) FROM ratings WHERE article_id='$article'"; $result = mysql_query ($query); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)) { $aveg = number_format($row[1],2); mysql_query("update articles set score='$aveg' where article_id = '$article'"); echo $aveg.' from '.$row[0];}} echo' users
 

excellent

very good

good

fair

poor

 
  '.$in.' '.$uid.'
 Comments '; $query2 = "select * from comments where art_id='$article'"; $result = mysql_query ($query2); echo '('.mysql_num_rows($result).')';echo '  

';$query2 = "select * from comments where art_id='$article' order by date asc"; $result = mysql_query ($query2); if ($result) { while ($row = mysql_fetch_array($result, MYSQL_BOTH)){echo '
'.$row[comment].' by  '.$row[username].' on '.$row[date].'

'; }}}} if($_COOKIE[username]){echo '

Add Your Comment

by '.$_COOKIE[username].' (HTML tags aren\'t allowed.)


';} echo'
'; include 'includes/footer.html';} ?>