Exemplo n.º 1
0
 public function loadArticleByAlias($articleAlias, $routerId, $routerView, $routerCategoryParentId, $routerBase)
 {
     //Create new instance of the Joomla\Database Class
     $db = new Joomla\Database();
     //Create new instance of the Joomla\Router class
     $router = new Joomla\Router();
     //Select all table names from database
     //Remove table prefix and build variables for each table name in the database
     //e.g. -- $this->content woud output the content table name with the correct table prefix
     $db->tables();
     //Set function variables to class variables
     //routerView can ether be article OR category OR categories
     $this->routerView = $routerView;
     //routerId can be one of two things
     //id of the article (if the routerView == article) OR category id (if the routerView == category OR categories)
     $this->routerId = $routerId;
     //articleAlias is the alias of the article
     //The alias is the title of the article but everything is converted to lowercase
     //All spaces converted into dashes
     //All speical characters are stripped as well
     $this->articleAlias = $articleAlias;
     //routerCategoryParentId is the categories parent id
     //If routerCategoryParentId is equal to 1 then use routerId
     $this->routerCategoryParentId = $routerCategoryParentId;
     //routerBase is the root url of the project
     //Where the Joomla files are located
     $this->routerBase = $routerBase;
     $query = $db->q("SELECT * FROM `{$db->content}` WHERE alias = '{$this->articleAlias}'");
     //Loop through results from above query
     //Create variables for each column for access in the required file
     foreach ($query as $articleResultsKey => $articleResult) {
         foreach ($articleResult as $articleColumn => $articleData) {
             $this->{$articleColumn} = $articleData;
         }
     }
     //Get the category alias by the cat id variable generated from above in the foreach loop
     $query = $db->q("SELECT alias FROM `{$db->categories}` WHERE id = '{$this->catid}'");
     //Assign a variable for the category alias
     $this->categoryAlias = $query[0]['alias'];
     //Build the routed path by the category alias and article alias
     //Stick the path inside of require
     require $router->buildArticleRoute($this->categoryAlias, $this->articleAlias);
 }
Exemplo n.º 2
0
//use Pelago\Emogrifier;
use MatthiasMullie\Minify;
$minifier = new Minify\JS(__DIR__ . '/bower/jquery/dist/jquery.min.js');
$minifier->add(__DIR__ . '/bower/matchHeight/jquery.matchHeight-min.js');
$minifier->add(__DIR__ . '/bower/jquery.tap/jquery.tap.min.js');
$minifier->add(__DIR__ . '/bower/gsap/src/minified/jquery.gsap.min.js');
$minifier->add(__DIR__ . '/bower/gsap/src/minified/easing/EasePack.min.js');
$minifier->add(__DIR__ . '/bower/gsap/src/minified/plugins/CSSPlugin.min.js');
$minifier->add(__DIR__ . '/bower/gsap/src/minified/TweenLite.min.js');
$minifier->add(__DIR__ . '/bower/wallop/js/Wallop.min.js');
$minifier->add(__DIR__ . '/bower/leviathan/src/js/init.js');
$minifier->add(__DIR__ . '/bower/leviathan/src/js/accordion.js');
$minifier->add(__DIR__ . '/bower/leviathan/src/js/facebook.js');
$minifier->add(__DIR__ . '/scripts/app.js');
$minifier->minify(__DIR__ . '/scripts/load.js');
$router = new Joomla\Router();
$menu = new Joomla\Menu();
$db = new Joomla\Database();
//$emogrifier = new Pelago\Emogrifier();
$string = new Framework\String();
$h = new Framework\Html();
$module = new Joomla\Module();
$article = new Joomla\Article();
$router->load(JRequest::getVar('id'), ROUTE, JRequest::getVar('option'), JRequest::getVar('view'), JRequest::getVar('layout'), JFactory::getConfig(), JUri::getInstance(), JURI::base());
//$emogrifier->setHtml($router->init());
//$emogrifier->setCss(file_get_contents(__DIR__.'/css/load.css'));
?>
<!DOCTYPE html>
<html lang="en">
  <head>
	<?php