Example #1
0
            $b8->learn($text, b8::SPAM);
            $ratingAfter = $b8->classify($text);
            echo "<p>Saved the text as Spam</p>\n\n";
            echo "<div><table>\n";
            echo "<tr><td>Classification before learning:</td><td>" . formatRating($ratingBefore) . "</td></tr>\n";
            echo "<tr><td>Classification after learning:</td><td>" . formatRating($ratingAfter) . "</td></tr>\n";
            echo "</table></div>\n\n";
            break;
        case "Save as Ham":
            $ratingBefore = $b8->classify($text);
            $b8->learn($text, b8::HAM);
            $ratingAfter = $b8->classify($text);
            echo "<p>Saved the text as Ham</p>\n\n";
            echo "<div><table>\n";
            echo "<tr><td>Classification before learning:</td><td>" . formatRating($ratingBefore) . "</td></tr>\n";
            echo "<tr><td>Classification after learning:</td><td>" . formatRating($ratingAfter) . "</td></tr>\n";
            echo "</table></div>\n\n";
            break;
        case "Delete from Spam":
            $b8->unlearn($text, b8::SPAM);
            echo "<p style=\"color:green\">Deleted the text from Spam</p>\n\n";
            break;
        case "Delete from Ham":
            $b8->unlearn($text, b8::HAM);
            echo "<p style=\"color:green\">Deleted the text from Ham</p>\n\n";
            break;
    }
    $mem_used = round(memory_get_usage() / 1048576, 5);
    $peak_mem_used = round(memory_get_peak_usage() / 1048576, 5);
    $time_taken = round(microtimeFloat() - $time_start, 5);
}
    public function printMobileVideos($fp, $name = "", $cat = "")
    {
        global $settings_data, $lang_search_searchingFor;
        $searchContent = "";
        if (isset($_POST['sname'])) {
            $searchContent = $_POST['sname'];
        }
        if ($fp == false) {
            if ($name != "") {
                echo '<div class="mobilesearch"><h3>' . $lang_search_searchingFor . ' "' . $searchContent . '"</h3></div>';
            } else {
                if ($cat != "" && $name != "") {
                    echo '<div class="pick">' . $lang_mobile_pickVideo . '</div>';
                }
            }
        }
        $files = sortFileList();
        $i = 1;
        foreach ($files as $entry) {
            $videodata = explode("\n", file_get_contents($entry));
            $movie_rating = $videodata[5] * 10;
            if ($cat != "" && strstr($videodata[4], $cat) == false) {
                continue;
            }
            ?>

			<div style="width:100%;height:170px;"><a href="m_info.php?name=<?php 
            echo urlencode($videodata[1]);
            ?>
&raw=<?php 
            echo urlencode(cleanWAMP($videodata[6]));
            ?>
" style="text-decoration:none;"><div style="float:left;"><img src="<?php 
            echo $this->printPoster($videodata[3]);
            ?>
" border="0" width="100" height="150"></div><div class="mobile_video_title"><?php 
            echo $videodata[1];
            ?>
<br>

			<div align="left"><div class="classification"><div class="cover"></div>
    		<div class="progress" style="width:<?php 
            echo $movie_rating;
            ?>
%;"></div>
    		<div class="mobile_rated">Rated: <?php 
            echo formatRating($videodata[7]);
            ?>
</div>
    		<div class="mobile_plot"><?php 
            echo $videodata[8];
            ?>
</div>
    		</div></div></div></a></div>

			<?php 
            if ($fp == true) {
                if ($i == $settings_data['m_display']) {
                    break;
                }
            }
            $i++;
        }
    }