$t_err_bnm"; } if (!empty($ymail)) { if (!ereg("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$", $ymail)) { $error .= "
  • $t_err_wym"; } } else { $ymail = $owner_email; } if (trim($yfname) == "") { $error .= "
  • $t_err_bfn"; } if (!ereg("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$", $yfmail)) { $error .= "
  • $t_err_wfm"; } $output = box_open(2, $get_rows[CatIcon], $get_rows[CatDesc]); if (trim($ymsg) != "") { if (strlen(trim($ymsg)) > 255) { $error .= "
  • $t_err_tlc"; } } if ($error != "") { $output .= <<

    $t_err_inv:

    $error

    $tback EOF; } else { $urltosend = "$base_url/wmview.php?ArtID=$ArtID"; $subject = $t_rf_sbj; $contents = "Ciao $yfname...,\n"; $contents .= "$yname $t_rf_snt\n\n"; $contents .= "$ArtTitle - $ArtDate\n$urltosend\n\n"; if ($ymsg != "") { $contents .= "$t_rf_msg $yname:\n$ymsg\n\n"; } $contents .= "$t_rf_rgd\n"; $contents .= "$site_title\n$owner_email\n\n"; //mail($yfmail, $subject, $contents, "da: $ymail\nReply-To: $ymail"); $upd_refer = mysqli_query($db, "UPDATE $article_file SET ArtRefer = ArtRefer + 1, ArtDate = '$ArtDate' WHERE ArtID = '$ArtID'"); $output .= <<

    $t_rf_thk $yname, $yfname $t_rf_not $yfmail

    $tback

    EOF; } $output .= box_close("", "", ""); } else { if (checkIE() == "1") { $size = 30; } else { $size = 20; } $sizetarea = $size + round($size / 2, 0); $output = box_open(2, $get_rows[CatIcon], $get_rows[CatDesc]); $output .= GetArticle($ArtID, 0); $output .= <<
    $trefer

    *) $t_rf_yna: 
    $t_rf_yml: 
    *) $t_rf_yfn: 
    *) $t_rf_yfm: 
    $t_rf_ams: 
    *) $t_gnr_mus
    EOF; $output .= box_close("", "", ""); } } else { /* $clength=strlen($content); if($clength > $maxchr){ require "StoryPager/StoryPager.lib"; $pager=new StoryPager; $pager->optimum_pl($maxchr); $pager->split($content); $isi=$pager->pages; if(!isset($page)){ $page=0; }else{ $page--; } $content=$isi[$page]; } */ $image_file = "images/icons/$get_rows[CatIcon]"; if (!file_exists($image_file)) { $image_file = "images/shim.gif"; } if ($get_rows[ArtRate] > 0) { $wv_rate = $get_rows[ArtRate] / $get_rows[ArtTRate]; } else { $wv_rate = 0; } if ($wv_rate > 0 && $t_rt_use) { $wv_star = "   "; for ($s = 5; $s <= $wv_rate; $s++) { $wv_star .= ""; } $wv_rest = $wv_rate - ($s - 1); if ($wv_rest > 0.49 && $wv_rest < 0.75) { $wv_star .= ""; } elseif ($wv_rest >= 0.75) { $wv_star .= ""; } } $wv_botlink = " \"$trefer\" \"$tpver\""; $wv_botlink_ket = " Visti: $get_rows[ArtView] | Inviati: $get_rows[ArtRefer] | Stampato: $get_rows[ArtPrint]"; $wv_botlink_ket .= ")"; if ($get_rows[ArtImm] != "") { $pippo .= ""; } else { $pippo .= ""; } if ($get_rows[ArtFile] != "") { $lillo .= "\"$t_cmt\" Visualizza allegato o filmato"; } else { $lillo .= ""; } if ($get_rows[ArtFile2] != "") { $lillo2 .= " "; } else { $lillo2 .= ""; } if ($get_rows[ArtnameLink] != "") { $mommo .= "\"$t_cmt\"$get_rows[ArtnameLink]"; } else { $mommo .= ""; } $ArtTitle = ($get_rows["ArtTitle"]); $ArtLead = ($get_rows["ArtLead"]); $CatDesc = ($get_rows["CatDesc"]); $output .= <<
     $CatDesc

    $pretty_time
    $ArtTitle $wv_star
    $ArtLead

    $pippo$content 


    $lillo       $mommo

    $lillo2

    $wv_botlink$wv_botlink_ket
    EOF; // Show 5 newest than current Article //$get_news=mysql_query("select * from $article_file where ArtCat='$ArtCat' and ArtID>'$ArtID' order by ArtDate desc limit 0,5",$db); $get_news = mysqli_query($db, "SELECT * FROM $article_file WHERE ArtCat = '$ArtCat' AND ArtID > '$ArtID'"); $nw_numrec = mysqli_num_rows($get_news); if ($nw_numrec > 0) { if ($nw_numrec < 5) { $nw_limit = $nw_numrec; $nw_start = 0; } else { $nw_limit = 5; $nw_start = $nw_numrec - $nw_limit; } $get_news = mysqli_query($db, "SELECT * FROM $article_file WHERE ArtCat = '$ArtCat' AND ArtID > '$ArtID' ORDER BY ArtDate DESC LIMIT $nw_start, $nw_limit"); $output .= <<
    EOF; while ($get_rows = mysqli_fetch_array($get_news)) { $pretty_time = pretty_time($get_rows["ArtDate"], 1); $ArtTitle = ($get_rows["ArtTitle"]); $output .= << EOF; } $output .= "
    $tnewnews
    • $ArtTitle – $pretty_time
    "; } // Show 5 past news before current Article $get_news = mysqli_query($db, "select * from $article_file where ArtCat='$ArtCat' and ArtID<'$ArtID' order by ArtDate desc limit 0,5"); if (mysqli_num_rows($get_news) > 0) { $output .= <<
    EOF; while ($get_rows = mysqli_fetch_array($get_news)) { $pretty_time = pretty_time($get_rows["ArtDate"], 1); $ArtTitle = ($get_rows["ArtTitle"]); $output .= << EOF; } $output .= "
    $tpastnews
    • $ArtTitle – $pretty_time
    "; } $upd_view = mysqli_query($db, "UPDATE $article_file SET ArtView = ArtView + 1, ArtDate = '$ArtDate' WHERE ArtID = '$ArtID'"); } } else { $output = box_open(2, "note.gif", "#$ArtID"); $output .= "$tnonews"; $output .= box_close("", "", ""); $page_title = $tnonews; } } else { if (isset($ArtCat)) { if (!isset($pos)) { $pos = 0; } $temp_pos = $pos; if (isset($ArtCat)) { $where = "and $article_file.ArtCat='$ArtCat'"; } else { $where = ""; } $get_count = mysqli_query($db, "select count(ArtID) as Total from $article_file where $article_file.ArtCat='$ArtCat'") or die($myQuery . "

    " . mysqli_error($db)); $count_row = mysqli_fetch_array($get_count); $numrec = $count_row["Total"]; $numpage = intval($numrec / $step); if ($numrec % $step) { $numpage++; } $get_news = mysqli_query($db, "select *,$article_catfile.ArtDesc as CatDesc,$article_catfile.ArtIcon as CatIcon from $article_file,$article_catfile where $article_file.ArtCat=$article_catfile.ArtCat $where order by $article_file.ArtDate desc limit $pos,$step"); if (mysqli_num_rows($get_news) == "0") { $output = box_open(2, "note.gif", "#$ArtCat"); $output .= "$tnonews"; $output .= box_close("", "", ""); $page_title = $tnonews; } else { $i = 0; while ($get_rows = mysqli_fetch_array($get_news)) { $CatDesc = ($get_rows["CatDesc"]); $i++; if ($i == 1) { $output .= << EOF; } $pretty_time = pretty_time($get_rows["ArtDate"], 1); $ArtTitle = ($get_rows["ArtTitle"]); $output .= << EOF; $page_title = $get_rows["CatDesc"]; } $output .= "
     $CatDesc

    $ArtTitle
    Inserito il $pretty_time
    "; } } else { if ($Top) { $wv_query[] = "SELECT * FROM $article_file WHERE ArtView > 0 ORDER BY ArtView DESC LIMIT 0,10"; $wv_query[] = "SELECT * FROM $article_file WHERE ArtRefer > 0 ORDER BY ArtRefer DESC LIMIT 0,10"; $wv_query[] = "SELECT * FROM $article_file WHERE ArtPrint > 0 ORDER BY ArtPrint DESC LIMIT 0,10"; $wv_querydesc[] = $t_top_viw; $wv_querydesc[] = $t_top_rfr; $wv_querydesc[] = $t_top_prn; $wv_queryval[] = "ArtView"; $wv_queryval[] = "ArtRefer"; $wv_queryval[] = "ArtPrint"; $wv_topout = ""; for ($i = 0; $i < count($wv_query); $i++) { $get_news = mysqli_query($db, $wv_query[$i]); $wv_topout .= "$wv_querydesc[$i]"; while ($get_rows = mysqli_fetch_array($get_news)) { $wv_ptime = pretty_time($get_rows["ArtDate"], 1); if ($wv_queryval[$i] == "RateVal") { $wv_qryval = number_format($get_rows["RateVal"], 2); } else { $wv_qryval = $wv_queryval[$i]; $wv_qryval = $get_rows[$wv_qryval]; } $wv_topout .= "•$get_rows[ArtTitle]  ($wv_qryval)  – $wv_ptime"; } $wv_topout .= ""; } $output = box_open(2, "top.gif", "$t_top_txt"); $output .= $wv_topout; $output .= box_close("", "", ""); $page_title = $t_top_txt; } } } /* Print Out the whole thing we've got from above into browser */ flush(); include("header.php"); echo "
    "; include("rightcol.php"); echo "
    "; echo $output; echo "
    "; if ($numpage > 1) { pagespan("$PHP_SELF?ArtCat=$ArtCat", $tsnews, 0); } echo "
    "; include("leftcol.php"); echo "
    "; include("footer.php");