This file contains 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 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 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 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 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
################################################################################# | |
### The perfect Varnish configuration for Joomla (& other CMS based) websites ### | |
################################################################################# | |
# USE: Place the contents of this configuration inside the main | |
# Varnish configuration file, located in: /etc/varnish/default.vcl (root server access required - obviously) | |
# IMPORTANT: The following setup assumes a 2 minute cache time. You can safely increase | |
# this to 5 mins for less busier sites or drop it to 1 min or even 30s for high traffic sites. |
This file contains 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 | |
/* WordPress Template Hierarchy as of WordPress 4.4 | |
is_404() ---------------------------------------------------------------------------------------------------> 404.php | |
is_search() ------------------------------------------------------------------------------------------------> search.php | |
is_front_page() --------------------------------------------------------------------------------------------> front-page.php | |
is_home() --------------------------------------------------------------------------------------------------> home.php |
This file contains 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
function remove_category_prefix_from_archive_title( $title ) { | |
if ( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} elseif ( is_tag() ) { | |
$title = single_tag_title( '', false ); | |
} elseif ( is_author() ) { | |
$title = '<span class="vcard">' . get_the_author() . '</span>' ; | |
} |
This file contains 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
if (isset($category)) { | |
$cat_name = $category->name; | |
$cat_alias = $category->alias; | |
$cat_description = $category->description; | |
$cat_alter_name = $category->params->get('content.category_title'); | |
$cat_subtitle = $category->params->get('content.category_subtitle'); | |
$cat_teasertext = $category->params->get('content.category_teaser_text'); | |
} |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<modification> | |
<name>Featured module name replace</name> | |
<code>featuredmodulenamebyagatha65</code> | |
<version>1.0</version> | |
<author>agatha65.com</author> | |
<link>http://agatha65.com/services/opencart-extensions</link> | |
<file path="catalog/controller/extension/module/featured.php"> | |
<operation> |
This file contains 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 | |
/** | |
* Output Post Format icons | |
* | |
* Outputs an icon for each post format. Set up to use Fontawesome, | |
* but can be used with anything, or you can just use CSS. | |
* | |
* @return string | |
*/ | |
function post_format_icon() { |