</script> </head> <body> <?php error_reporting(E_ERROR | E_PARSE); include "./summarize.php"; // scan nama file korpus $dir_corpus = "./corpus"; $files = scandir($dir_corpus); $files = array_slice($files, 2); //print_r($files); // hasil if (isset($_GET["filename"]) && isset($_GET["compression"])) { $filename = $_GET["filename"]; $compression = $_GET["compression"]; $output = summarize($filename, $compression); $title = substr($filename, 0, -4); } ?> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container-fluid"> <a class="brand" href="index.php">Auto Text Summarization</a> <div class="nav-collapse collapse"> <ul class="nav"> <li><a class="brand" style="margin-left:85px;"><?php echo $title; ?> </a></li> </ul> </div>
<?php if (isset($posts[5])) { ?> <article class="subpost"> <div class="content-post"> <div class="text-post pull-right"> <p class="date-post"> < <?php echo $posts[5]->getDate(); ?> > </p> <h1> <?php echo summarize($posts[5]->getHeadline(), 70); ?> </h1> <a class="read-more pull-right"> LEER MÁS </a> </div> </div> </article> <?php } ?> </div> </div>
<h3>Editorial</h3> <div id="editorial_box"> <?php foreach ($postsEditorial as $i => $post) { ?> <div> <a href="editorial.php"> <img src="images/editorial01.png"> </a> <h4><?php echo summarize($post->getTitle(), 40); ?> </h4> <p><?php echo summarize($post->getBody(), 180); ?> </p> <!-- <p><strong>J. Clemente Raimondi</strong><br>Presidente</p> --> </div> <?php } ?> <div> <a href="editorial.php"> <img src="images/editorial01.png"> </a> <h4>Bienvenida</h4> <p>Como Presidente, hago partícipe a toda la sociedad de los objetivos, la misión, la visión, los valores, los integrantes y las acciones...</p> <p><strong>J. Clemente Raimondi</strong><br>Presidente</p>
/** * Renderize the view. * * @return null */ public function render(array $posts) { ?> <div class="modal fade modal-confirmation" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <p> <?php echo CONFIRMATION_TEXT; ?> </p> <button type="button" class="btn btn-primary delete-yes" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo YES_TEXT; ?> </button> <button type="button" class="btn btn-primary delete-no" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo NO_TEXT; ?> </button> </div> </div> </div> <?php if (empty($posts)) { ?> <p> No hay noticias cargados/as por el momento. </p> <?php } else { ?> <table> <thead> <tr> <th> Tíitulo </th> <th> Copete </th> <th> Fecha </th> <th> Cuerpo </th> <th> Fuente </th> <th> Categoría </th> <th> Imagen </th> <th class="border-cell"> Modificar </th> <th> Eliminar </th> </tr> </thead> <tbody> <?php foreach ($posts as $post) { ?> <tr> <td> <?php echo $post->getTitle(); ?> </td> <td> <?php echo summarize($post->getHeadline()); ?> </td> <td> <?php echo $post->getDate(); ?> </td> <td> <?php echo summarize($post->getBody()); ?> </td> <td> <?php echo $post->getSource(); ?> </td> <td> <?php echo $post->getCategory(); ?> </td> <td> <a href="<?php echo $this->generateURL('post', 'edit_image', $post->getIdPost()); ?> "> <span class="glyphicon glyphicon-picture"></span> </a> </td> <td class="border-cell"> <a href="<?php echo $this->generateURL('post', 'edit', $post->getIdPost()); ?> "> <span class="glyphicon glyphicon-pencil"></span> </a> </td> <td> <a class="delete-link" href="<?php echo $this->generateURL('post', 'delete', $post->getIdPost()); ?> "> <span class="glyphicon glyphicon-trash"></span> </a> </td> </tr> <?php } ?> </tbody> </table> <?php } }
<section id="historias"> <h2>Historias de Vida</h2> <?php foreach ($stories as $story) { $gallery = getStoryGallery($story->getIdStory()); ?> <div class="view view-tenth"> <img src="requests/_story_image.php?id_story_image=<?php echo $gallery[0]->getIdStoryImage(); ?> " /> <div class="mask"> <p><?php echo summarize($story->getBody(), 60); ?> </p> <span class="mas"><a href="historia.php?id_story=<?php echo $story->getIdStory(); ?> ">+</a></span> </div> </div> <?php } ?> </section><!--Fin historias de vida--> <section id="mitos">
<?php if (isset($highlightedPosts[1])) { ?> <article class="subpost"> <div class="content-post"> <div class="text-post pull-right"> <p class="date-post"> < <?php echo $highlightedPosts[1]->getDate(); ?> > </p> <h1> <?php echo summarize($highlightedPosts[1]->getTitle(), 70); ?> </h1> <a href="noticias.php?id_post=<?php echo $highlightedPosts[1]->getIdPost(); ?> " class="read-more pull-right"> LEER MÁS </a> </div> </div> </article> <?php } ?>
include_once 'ressources/class.ini.inc'; include_once 'ressources/class.squid.inc'; include_once 'ressources/class.system.network.inc'; $user = new usersMenus(); if ($user->AsWebStatisticsAdministrator == false) { $tpl = new templates(); echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');"; die; exit; } if (isset($_GET["popup"])) { popup(); exit; } if (isset($_GET["summarize"])) { summarize(); exit; } js(); function js() { $t = time(); $tpl = new templates(); $title = $tpl->_ENGINE_parse_body("{refresh_summary}"); $page = CurrentPageName(); $dateT = date("{l} {F} d", $_GET["xtime"]); if ($tpl->language == "fr") { $dateT = date("{l} d {F} ", $_GET["xtime"]); } $title = $tpl->_ENGINE_parse_body("{$dateT}»{refresh_summary}"); $html = "\n\t\tfunction start{$t}(){\n\t\t\tYahooWinS('550','{$page}?popup=yes&xtime={$_GET["xtime"]}&t={$t}','{$title}');\n\t\t\n\t\t}\n\t\t\n\t\tfunction ChProgr(xvalue){\n\t\t\n\t\t\t\$('#progress-{$t}').progressbar({ value: xvalue});\n\t\t\n\t\t}\n\t\t\n\t\tfunction Start1{$t}(){\n\t\t\tChProgr(30);\n\t\t\tLoadAjaxTiny('infos-{$t}','{$page}?summarize=yes&xtime={$_GET["xtime"]}&t={$t}');\n\t\t}\n\t\t\n\t\tfunction Finish2{$t}(){\n\t\t\t\$('#progress-{$t}').remove();\n\t\t\t\n\t\t}\n\t\t\n\t\tfunction Finish{$t}(){\n\t\t\tChProgr(100);\n\t\t\tsetTimeout('Finish2{$t}()',2000);\n\t\t}\n\t\t\n\t\t\n\tstart{$t}();";
include_once('ressources/class.groups.inc'); include_once('ressources/class.artica.inc'); include_once('ressources/class.ini.inc'); include_once('ressources/class.squid.inc'); include_once('ressources/class.system.network.inc'); $user=new usersMenus(); if($user->AsWebStatisticsAdministrator==false){ $tpl=new templates(); echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');"; die();exit(); } if(isset($_GET["popup"])){popup();exit;} if(isset($_GET["summarize"])){summarize();exit;} if(isset($_GET["progress"])){progress();exit;} js(); function js(){ $t=time(); $tpl=new templates(); $title=$tpl->_ENGINE_parse_body("{category_database_update}"); $page=CurrentPageName(); $html=" function start$t(){ YahooWinS('550','$page?popup=yes&t=$t','$title'); }
/** * Renderize the view. * * @return null */ public function render(array $notes) { ?> <script type="text/javascript"> $(function(){ $("h1 a").remove(); }); </script> <div class="modal fade modal-confirmation" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <p> <?php echo CONFIRMATION_TEXT; ?> </p> <button type="button" class="btn btn-primary delete-yes" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo YES_TEXT; ?> </button> <button type="button" class="btn btn-primary delete-no" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo NO_TEXT; ?> </button> </div> </div> </div> <?php if (empty($notes)) { ?> <p> No hay notas cargados/as por el momento. </p> <?php } else { ?> <table> <thead> <tr> <th> Tíitulo </th> <th> Texto </th> <th class="border-cell"> Modificar </th> <!--<th> Eliminar </th> --> </tr> </thead> <tbody> <?php foreach ($notes as $note) { ?> <tr> <td> <?php echo $note->getNote(); ?> </td> <td> <?php echo summarize($note->getNoteText(), 100); ?> </td> <td class="border-cell"> <a href="<?php echo $this->generateURL('note', 'edit', $note->getIdNote()); ?> "> <span class="glyphicon glyphicon-pencil"></span> </a> </td> <!-- <td> <a class="delete-link" href="<?php //echo $this->generateURL('note', 'delete', $note->getIdNote()) ?> "> <span class="glyphicon glyphicon-trash"></span> </a> </td> --> </tr> <?php } ?> </tbody> </table> <?php } }
/** * Renderize the view. * * @return null */ public function render(array $professionals) { ?> <div class="modal fade modal-confirmation" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <p> <?php echo CONFIRMATION_TEXT; ?> </p> <button type="button" class="btn btn-primary delete-yes" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo YES_TEXT; ?> </button> <button type="button" class="btn btn-primary delete-no" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo NO_TEXT; ?> </button> </div> </div> </div> <?php if (empty($professionals)) { ?> <p> No hay professionals cargados/as por el momento. </p> <?php } else { ?> <table> <thead> <tr> <th> Nombre </th> <th> Bio </th> <th> Imagen </th> <th class="border-cell"> Modificar </th> <th> Eliminar </th> </tr> </thead> <tbody> <?php foreach ($professionals as $professional) { ?> <tr> <td> <?php echo $professional->getName(); ?> </td> <td> <?php echo summarize($professional->getBio()); ?> </td> <td> <a href="<?php echo $this->generateURL('professional', 'edit_gallery', $professional->getIdProfessional()); ?> "> <span class="glyphicon glyphicon-picture"></span> </a> </td> <td class="border-cell"> <a href="<?php echo $this->generateURL('professional', 'edit', $professional->getIdProfessional()); ?> "> <span class="glyphicon glyphicon-pencil"></span> </a> </td> <td> <a class="delete-link" href="<?php echo $this->generateURL('professional', 'delete', $professional->getIdProfessional()); ?> "> <span class="glyphicon glyphicon-trash"></span> </a> </td> </tr> <?php } ?> </tbody> </table> <?php } }
$tests_to_run[] = $filename; } } } elseif ($name == '-all') { # Each 'section' in the config file becomes a key in the array. # The section name plus .php is the test script name. foreach (array_keys($val_data) as $test_name) { $tests_to_run[] = $test_name . '.php'; } } elseif ($name == '-match') { if (++$arg >= $argc) { break; } $match_pattern = $argv[$arg]; } else { $tests_to_run[] = $name; } } # Apply a match pattern (-match pattern) to limit the tests to run: if (!empty($match_pattern)) { $tests_to_run = array_values(array_filter($tests_to_run, create_function('$s', "return fnmatch('{$match_pattern}', \$s);"))); } $total_tests = count($tests_to_run); preface(); $start_time = microtime(TRUE); foreach ($tests_to_run as $name) { do_test($name); } summarize(microtime(TRUE) - $start_time); cleanup(); exit(0);
<?php foreach ($posts as $post) { ?> <div class="col-sm-6 col-md-4"> <article> <p class="date-post"> < <?php echo $post->getDate(); ?> > </p> <h2> <?php echo summarize($post->getTitle(), 100); ?> </h2> <a href="noticias.php?id_post=<?php echo $post->getIdPost(); ?> " class="read-more pull-right"> LEER MÁS </a> </article> </div> <?php } ?>
public function summary() { $ret = parent::summary(); $ret['req_states'] = squash($this->req_states); $ret['gen_state'] = summarize($this->gen_state); $ret['configurable'] = $this->configurable; return $ret; }
/** * Renderize the view. * * @return null */ public function render(array $sliders, array $stories, array $myths) { ?> <div class="modal fade modal-confirmation" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <p> <?php echo CONFIRMATION_TEXT; ?> </p> <button type="button" class="btn btn-primary delete-yes" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo YES_TEXT; ?> </button> <button type="button" class="btn btn-primary delete-no" data-toggle="button" aria-pressed="false" autocomplete="off"> <?php echo NO_TEXT; ?> </button> </div> </div> </div> <?php if (empty($sliders)) { ?> <p> No hay sliders cargados/as por el momento. </p> <?php } else { ?> <table> <thead> <tr> <th> Tíitulo </th> <th> Cuerpo </th> <th> Link </th> <th> Galería </th> <th class="border-cell"> Modificar </th> <th> Eliminar </th> </tr> </thead> <tbody> <?php foreach ($sliders as $slider) { ?> <tr> <td> <?php echo $slider->getTitle(); ?> </td> <td> <?php echo summarize($slider->getBody()); ?> </td> <td> <?php echo $slider->getLink(); ?> </td> <td> <a href="<?php echo $this->generateURL('slider', 'edit_gallery', $slider->getIdSlider()); ?> "> <span class="glyphicon glyphicon-picture"></span> </a> </td> <td class="border-cell"> <a href="<?php echo $this->generateURL('slider', 'edit', $slider->getIdSlider()); ?> "> <span class="glyphicon glyphicon-pencil"></span> </a> </td> <td> <a class="delete-link" href="<?php echo $this->generateURL('slider', 'delete', $slider->getIdSlider()); ?> "> <span class="glyphicon glyphicon-trash"></span> </a> </td> </tr> <?php } ?> </tbody> </table> <?php } ?> <br> <h1> Historias de Vida <a href="<?php echo generateURL('story', 'add'); ?> " class="pull-right"> <span class="glyphicon glyphicon-plus"></span> </a> </h1> <?php if (empty($stories)) { ?> <p> No hay historias cargados/as por el momento. </p> <?php } else { ?> <table> <thead> <tr> <th> Tíitulo </th> <th> Cuerpo </th> <th> Galería </th> <th class="border-cell"> Modificar </th> <th> Eliminar </th> </tr> </thead> <tbody> <?php foreach ($stories as $story) { ?> <tr> <td> <?php echo $story->getTitle(); ?> </td> <td> <?php echo summarize($story->getBody()); ?> </td> <td> <a href="<?php echo $this->generateURL('story', 'edit_gallery', $story->getIdStory()); ?> "> <span class="glyphicon glyphicon-picture"></span> </a> </td> <td class="border-cell"> <a href="<?php echo $this->generateURL('story', 'edit', $story->getIdStory()); ?> "> <span class="glyphicon glyphicon-pencil"></span> </a> </td> <td> <a class="delete-link" href="<?php echo $this->generateURL('story', 'delete', $story->getIdStory()); ?> "> <span class="glyphicon glyphicon-trash"></span> </a> </td> </tr> <?php } ?> </tbody> </table> <?php } ?> <br> <h1> Mitos <a href="<?php echo generateURL('myth', 'add'); ?> " class="pull-right"> <span class="glyphicon glyphicon-plus"></span> </a> </h1> <?php if (empty($myths)) { ?> <p> No hay mitos cargados/as por el momento. </p> <?php } else { ?> <table> <thead> <tr> <th> Texto </th> <th class="border-cell"> Modificar </th> <th> Eliminar </th> </tr> </thead> <tbody> <?php foreach ($myths as $myth) { ?> <tr> <td> <?php echo $myth->getTextMyth(); ?> </td> <td class="border-cell"> <a href="<?php echo $this->generateURL('myth', 'edit', $myth->getIdMyth()); ?> "> <span class="glyphicon glyphicon-pencil"></span> </a> </td> <td> <a class="delete-link" href="<?php echo $this->generateURL('myth', 'delete', $myth->getIdMyth()); ?> "> <span class="glyphicon glyphicon-trash"></span> </a> </td> </tr> <?php } ?> </tbody> </table> <?php } }
Draft link code:<br/> <textarea>javascript:<?= h(rawurlencode(str_replace('EXTRA', 'is-link=1', $bookmarklet_code))) ?></textarea> </p> <p> Draft article code:<br/> <textarea>javascript:<?= h(rawurlencode(str_replace('EXTRA', '', $bookmarklet_code))) ?></textarea> </p> <? exit; } $url = substring_before(normalize_space($_GET['u']), ' '); $title = normalize_space($_GET['t']); $selection = trim($_GET['s']); $is_link = isset($_GET['is-link']) && intval($_GET['is-link']); $slug = trim(preg_replace('/[^a-z0-9-]+/ms', '-', strtolower(summarize($title, 60))), '-'); if (! $slug) $slug = 'draft'; if ($selection) { $body = "> " . str_replace("\n", "\n> ", trim($selection)) . "\n\n"; if (! $is_link) $body = "[$title]($url):\n\n" . $body; } else { $body = ''; } $draft_contents = $title . "\n" . str_repeat('=', max(10, min(40, strlen($title)))) . "\n" . ($is_link ? "Link: " . $url . "\n" : '') . "publish-not-yet\n" . "\n" .
// •••••••••• SEARCH RESULTS $postsperpage = 20; $pg = !isset($_GET['pg']) ? 1 : $_GET['pg']; $first = ($pg - 1) * $postsperpage; //Which post to start with on the page $query = 'SELECT * FROM blog WHERE ' . $search . ' ORDER BY timestamp DESC LIMIT ' . $first . ', ' . $postsperpage; $posts = $db->dq($query); echo '<h1>Search results for: ' . $_GET['search'] . '</h1>'; if (sizeof($posts) < 1) { echo '<p>No matches.</p>'; } else { foreach ($posts as $post) { echo '<div class="search_result"> <h2><a href="/blog/' . $post['url'] . '">' . stripslashes($post['title']) . '</a></h2> <time dateTime="' . date("Y-m-d", $post['timestamp']) . '">' . date("j F Y", $post['timestamp']) . '</time> <p>' . summarize($post['article'], $post['color']) . '…</p> </div>'; } } ?> </article> <footer> <?php // •••••••••• SEARCH RESULT PAGINATION $pgnums = $db->dq1('SELECT COUNT(*) AS count FROM blog WHERE ' . $search); $numposts = $pgnums['count'];
| description: | this function takes the first x words or paragraphs from a long text and | displays it as teaser with a "read more" link underneath. | ------------------------------------------------------------------------------*/ function summarize($paragraph, $limit, $link) { $text = ''; $words = 0; $tok = strtok($paragraph, ' '); while ($tok) { $text .= " {$tok}"; $words++; if ($words >= $limit && (substr($tok, -1) == '!' || substr($tok, -1) == '.')) { break; } $tok = strtok(' '); } $text .= ' ' . $link; return ltrim($text); } // use like this $example = 'Heres some code to extract the first part of a long paragraph, e.g. to use as a summary. Starting at the beginning of the paragraph it gets as many complete sentences as are necessary to contain $limit words. For example, with $limit at 20 it would return the first two sentences of the paragraph e reading right now (the first 20 words plus the rest of the sentence in which the limit was hit)'; $link = '<a href="#">read more</a>'; echo '<p>' . summarize($example, 5, $link) . '</p>';
<?php // Make sure user is logged in require_login(); // Normalize the URL $href = normalize_url(@$_POST['href']); // Strip tags, normalize whitespace, shorten if necessary $summary = summarize($_POST['summary']); // Filter content to prevent against XSS attacks $content = filter_content($_POST['content']); // Escape content for the database to prevent SQL injection $href = $db->escape($href); $summary = $db->escape($summary); $space = $db->escape($_POST['space']); $content = $db->escape($content); $version = $db->escape($_POST['version']); if (isset($_POST['status']) && is_numeric($_POST['status'])) { $status = $db->escape($_POST['status']); } else { $status = 1; } // Check to make sure we have everything if (empty($href)) { respond(0, "Please specify an 'href' argument."); } else { if (empty($space)) { respond(0, "Please specify a 'space' argument."); } else { if (empty($content)) { respond(0, "Please specify a 'content' argument."); } else {