This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# block visitors referred from semalt.com | |
RewriteEngine on | |
RewriteCond %{HTTP_REFERER} semalt\.com [NC] | |
RewriteRule .* – [F] | |
# End semalt block | |
# block referer spam buttons for website | |
RewriteEngine On | |
RewriteCond %{HTTP_REFERER} buttons\-for\-website\.com | |
RewriteRule ^.* - [F,L] | |
# End buttons for website block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Each plugin type has its own set of events that trigger these plugins to execute. Each plugin can use one or more event triggers but there is no need to use all the event triggers available, just pick out the ones you need. You also have the freedom to create your own custom plugin event triggers in your components, however, that is also outside the scope of this book. The following table summarizes the types of plugins available and their respective event triggers: | |
Plugin type Event trigger | |
Authentication onUserAuthenticate | |
onUserAuthorisationFailure | |
Captcha onCheckAnswer | |
onDisplay | |
onInit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyController extends JController | |
{ | |
function someTask() | |
{ | |
// Get the application object. | |
$app = JFactory::getApplication(); | |
// Get the model. | |
$model = $this->getModel('MyModel'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Method to create thumbnails from the current image and save them to disk. It allows creation by resizing | |
* or croppping the original image. | |
* | |
* @param mixed $thumbSizes string or array of strings. Example: $thumbSizes = array('150x75','250x150'); | |
* @param integer $creationMethod 1-3 resize $scaleMethod | 4 create croppping | |
* @param string $thumbsFolder destination thumbs folder. null generates a thumbs folder in the image folder | |
* | |
* @return array | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> | |
<title>localhost</title> | |
</head> | |
<body> | |
<h1>It Works!</h1> | |
<ul> | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// joomla 2.5 | |
$app = JFactory::getApplication(); | |
$link = 'http://www.domain.com/'; | |
$msg = 'You have been redirected to domain.com'; | |
$app->redirect($link, $msg, $msgType='message'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Removing Mootools | |
$head = $doc->getHeadData(); | |
//Unset Mootools for unregistered users | |
if($user->guest){ | |
$head=$this->getHeadData(); | |
reset($head['scripts']); | |
unset($head['scripts'][$this->baseurl . '/media/system/js/core.js']); | |
unset($head['scripts'][$this->baseurl . '/media/system/js/mootools.js']); | |
unset($head['scripts'][$this->baseurl . '/plugins/system/mtupgrade/mootools.js']); | |
unset($head['scripts'][$this->baseurl . '/media/system/js/mootools-core.js']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @version $Id: router.php 1618 2012-09-21 11:23:08Z lefteris.kavadas $ | |
* @package K2 | |
* @author JoomlaWorks http://www.joomlaworks.net | |
* @copyright Copyright (c) 2006 - 2012 JoomlaWorks Ltd. All rights reserved. | |
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html | |
*/ | |
// no direct access |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// no direct access | |
defined('_JEXEC') or die; | |
// Variables | |
$doc = JFactory::getDocument(); | |
$user = JFactory::getUser(); | |
$template = 'templates/' . $this->template; | |
// get html head data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# index.php :: load the global joomla header | |
# between <head> and </head> | |
<jdoc:include type="head" /> | |
# index.php :: output of the system messages | |
# between <body> and </body> | |
<jdoc:include type="message" /> | |
# index.php :: article and component output | |
# between <body> and </body> |