How to create new Blocks

From MemHT Wiki

Jump to: navigation, search

Creating blocks is very easy, only few rows are needed, that ensures that the file cannot be opened directly
Important: Remember to indicate the block file name in the block header


<?php
 
if (stristr(htmlentities($_SERVER['PHP_SELF']), "block_blockname.php")) {
      die("Error: This file cannot be opened directly!");
}
 
echo "Hi, this is the block content";
 
?>


Note: The variable called $title is reserved, it should not be used in blocks


Image:Globe.png Languages العربيةBahasa IndonesiaBosanskiБългарскиDanskDeutschEnglishEspañolفارسیFrançaisGalegoעבריתItalianoMagyarМакедонскиNederlandsPortuguêsРусскийСрпски/SrpskiSvenskaTürkçeУкраїнськаTiếng Việt
Personal tools