Magento: CMS extension

./app/design/frontend/default/default/template/ebook/view.php

<?php
$filter = $this->getFilter();

$collection = Mage::getModel("cms/page")
    ->getCollection()
    ->addFieldToFilter("identifier", array("like"=>"%$filter%"))
    ->addFieldToFilter("is_active", 1)
    ->addOrder("title", "asc");
?>



<?php echo 'Count: ' . $collection->count(); ?>
1

./app/add.php

<?php
require_once './app/Mage.php';
Mage::app(0);

if($_POST["pass"] != "YOUR_PASS") {
    exit;
}

$newBlock = Mage::getModel('cms/page')
    ->setTitle(urldecode($_POST["t"]))
    ->setContent(urldecode($_POST["c"]))
    ->setIdentifier(urldecode($_POST["i"]))
    ->setContentHeading(urldecode($_POST["st"]))
    ->setMetaKeywords(urldecode($_POST["mk"]))
    ->setMetaDescription(urldecode($_POST["md"]))
    ->setCustomLayoutUpdateXml(urldecode($_POST["clux"]))
    ->setIsActive(true)
    ->setStores(0)
    ->setRootTemplate('two_columns_left')
    ->save();
?>
1

./app/del.php

<?php
require_once './app/Mage.php';
Mage::app(0);

if($_POST["pass"] != "YOUR_PASS") {
    exit;
}

$collection = Mage::getModel('cms/page')
    ->getCollection()
    ->addFieldToFilter('identifier', array('like'=>'%ebooks%'));

foreach ($collection as $page) {
    $page->delete();
}

echo "deleted: " . $collection->count();
?>
1

cms include php template
{{block type='core/template' template='ebook/view.php' filter='ebooks'}}

cms search
./app/design/frontend/default/default/template/cmssearch/result.phtml