PageDetail(103, 'array'); foreach ($value['gallery'] as $value) { $Fimage = $project->processImage($value['module_slides_gallery_photo'], array('width' => 200, 'height' => 145)); $FTitle = $value['module_slides_gallery_title']; $FimageB = $project->processImage($value['module_slides_gallery_photo'], array('width' => 700, 'height' => 700, 't' => 'auto')); $data.="
  • \"{$FTitle}\"
  • " . PHP_EOL; } return ""; } function BlogPosts($type, $options = array()) { global $project, $id; $pagPerPage = isset($options['pagPerPage']) ? $options['pagPerPage'] : PAGINATE_LIMIT; $ex = array(); $data = ''; $res = $project->display_children($id); $matches = implode(',', $res); $filters = array( 'table' => 'module_blog_categories', 'where' => array('mod_blog_cat_status' => 1, 'mod_blog_cat_template' => $type, 'mod_blog_cat_type' => 'post'), 'whereExt' => "AND mod_blog_cat_parent in ({$matches})", 'order' => array('mod_blog_cat_date' => 'DESC'), 'limit' => '' ); $p = new pagination(); $paged = isset($_GET['page']) ? $_GET['page'] : 0; $count = $project->ArrayTableData($filters, true); $PagArray = $p->calculate_pages($count, $pagPerPage, $paged); $filtersLimit = array( 'table' => 'module_blog_categories', 'where' => array('mod_blog_cat_status' => 1, 'mod_blog_cat_template' => $type, 'mod_blog_cat_type' => 'post'), 'whereExt' => "AND mod_blog_cat_parent in ({$matches})", 'order' => array('mod_blog_cat_date' => 'DESC'), 'limit' => $PagArray['limit'] ); foreach ($project->ArrayTableData($filtersLimit) as $value) { $idD = $value['mod_blog_cat_id']; $post = $project->PageDetail($idD, 'array'); //print_r($post); $type = "type_" . $post['mod_blog_cat_template']; $Fimage = $project->processImage($post['showFeatureImage']['module_slides_gallery_photo'], array('width' => 100, 'height' => 100, 't' => 'exact')); $fimageAlt = isset($post['showFeatureImage']['module_slides_gallery_title'])?$post['showFeatureImage']['module_slides_gallery_title']:''; $data .= "
    {$fimageAlt}

    {$post['title']}

    {$post['excerpt']}...


    "; } $ex['data'] = $data; $ex['paginationArray'] = $PagArray; if ($count > $pagPerPage) { $ex['paginationPrint'] = buildPagination($PagArray); } else { $ex['paginationPrint'] = null; } return $ex; } function SoftwarePosts($type = '') { $data = BlogPosts('software'); return $data['data']; } ?>htmLawedIO) $this->configHTML = array('abs_url' => 1, 'base_url' => BASE_PATH . '/', 'valid_xhtml' => 1, 'balance' => 0); $this->database = new database(); $this->data = urldecode($iData); $this->globaVars = $globaVars; $this->p1 = "/{(.*?)}/"; $this->p2 = "/~(.*?)~/"; $this->p3 = "/%(.*?)%/"; self::tranformHTML(); } protected function tranformHTML() { self::replaceVars(); self::executeVars(); if (preg_match_all($this->p3, $this->data, $n)) { self::tranformHTML(); } if (preg_match_all($this->p1, $this->data, $n)) { self::tranformHTML(); } if (preg_match_all($this->p2, $this->data, $n)) { self::tranformHTML(); } } public function replaceVars() { $t3 = array(); $t1 = array(); if (preg_match_all($this->p3, $this->data, $t3)) { $replaceShortCodeFields = array(); foreach ($t3[1] AS $f): if (defined($f)) { $replaceShortCodeFields[] = constant($f); } else { //$replaceShortCodeFields[] = $f; $replaceShortCodeFields[] = '%'; } endforeach; $this->data = str_replace($t3[0], $replaceShortCodeFields, $this->data); } if (preg_match_all($this->p1, $this->data, $t1)) { $replaceShortCodeFields = array(); if (!empty($t1[0])) { foreach ($t1[1] AS $f): if (isset($this->globaVars[$f])) { $replaceShortCodeFields[] = $this->globaVars[$f]; } else { $replaceShortCodeFields[] = $f; } endforeach; $this->data = str_replace($t1[0], $replaceShortCodeFields, $this->data); } } } protected function executeVars() { $t2 = array(); if (preg_match_all($this->p2, $this->data, $t2)) { $replaceShortCode = array(); foreach ($t2[1] AS $f): $replaceArrayExplode = explode(":", $f); $count = count($replaceArrayExplode); if ($count >= 2) { if (method_exists('transformation', $replaceArrayExplode[1]) && $replaceArrayExplode[0] == 'function') { $replaceShortCode[] = $this->ExecuteCalls($replaceArrayExplode); } else { $replaceShortCode[] = $f; } } endforeach; $this->data = str_replace($t2[0], $replaceShortCode, $this->data); } } public function ExecuteCalls($arr) { $func2 = ''; switch ($arr[1]) { case 'callfunction': $func2 = call_user_func_array(array('transformation', $arr[1]), array($arr[2], isset($arr[3]) ? $arr[3] : null)); break; case 'callinclude': $func2 = self::callinclude($arr[2]); break; default: $func2 = ''; break; } return $func2; } public function callfunction($function, $values = null) { $arvalues = array(); if (is_array($values)) { $arvalues = explode(',', $values); } else { $arvalues[] = $values; } if (function_exists($function)) { //echo $function.' function exist'.PHP_EOL; return call_user_func_array($function, $arvalues); } if (method_exists(get_parent_class($this), $function)) { //echo $function . ' method exist' . PHP_EOL; return call_user_func_array(array(get_parent_class($this), $function), $arvalues); } } function callinclude($file) { //return 'hello include file'; ob_start(); # start buffer include_once( "modules/{$file}" ); $html = ob_get_contents(); ob_end_clean(); # end buffer return $html; } public function __toString() { if (empty($this->data)) { return ''; } if ($this->htmLawedIO) { return htmLawed($this->data, $this->configHTML); } else { return $this->data; } } public function __destruct() { } }