Example #1
0
You should have received a copy of the GNU General Public License,
and the GNU Lesser General Public License along with this program.
If not, see http://www.gnu.org/licenses/.

You may contact the copyright holder through XOOPS Project:
http://xoops.org
EOT;
echo '<h4>Extracted Description</h4>';
// get the intro of the article to use as the description
$description = Metagen::generateDescription($article, 50);
echo '<p>' . $description . '</p>';
echo '<h4>SEO Slug</h4>';
// turn title into a slug
echo '<p>' . Metagen::generateSeoTitle($title) . '</p>';
// highlight keywords in article
echo '<h4>Article with Top 25 Keywords Highlighted</h4>';
// get important words from title
$title_keywords = Metagen::generateKeywords($title, 25, 3);
//Debug::dump($title_keywords);
// get top 25 keywords, but always keep keywords from title
$keywords = Metagen::generateKeywords($article, 25, 4, $title_keywords);
Debug::dump($keywords, true);
echo Highlighter::apply($keywords, $article);
// add to the page
Metagen::assignTitle($title);
Metagen::assignKeywords($keywords);
Metagen::assignDescription($description);
// dump our source
echo '<br /><h2>Source code</h2>';
\Xoops\Utils::dumpFile(__FILE__);
$xoops->footer();
Example #2
0
function debugger($input, $trace = false, $halt = fale)
{
    \Xmf\Debug::dump($input);
    if ($trace) {
        \Xmf\Debug::backtrace();
    }
    if ($halt) {
        exit;
    }
}