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 | |
$db = JFactory::getDBO(); | |
$query = $db->getQuery(true); | |
$query | |
->select($db->quoteName(array('a.id'))) | |
->from($db->quoteName('#__content', 'a')) | |
->join('INNER', $db->quoteName('#__categories', 'b') . ' ON (' . $db->quoteName('b.id') . ' = 38)');//static category id | |
$db->setQuery($query); | |
$results = $db->loadObjectList(); |
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
# Moving your whole site to SSL | |
# First rewrite to HTTPS: | |
# Don't put www. here. If it is already there it will be included, if not | |
# the subsequent rule will catch it. | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# Now, rewrite any request to the wrong domain to use www. | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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
<!-- Make the Joomla Modal Popup Responsive --> | |
<!-- 1. Import following library at the start of the page. --> | |
<?php JHTML::_('behavior.modal', 'a.modal'); ?> | |
<!-- This ensures that the modal.js script and the modal.css style sheets are loaded, plus the mootools javascript framework which the script requires, and initialises the modal window. Note that from Joomla 3.3x onwards using JQuery might be a better idea. --> | |
<!-- 2. Add following function in javascript --> |
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 | |
jimport('joomla.application.module.helper'); | |
// this is where you want to load your module position | |
$modules = JModuleHelper::getModules('header'); | |
foreach($modules as $module) | |
{ | |
echo JModuleHelper::renderModule($module); | |
} | |
?> |
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 | |
//IE8 compatibility | |
if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])) | |
{ | |
JFactory::getDocument()->addScript('https://html5shiv.googlecode.com/svn/trunk/html5.js'); | |
} | |
?> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>jQuery Cascading Dropdown</title> | |
<script type='text/javascript' src='//code.jquery.com/jquery-1.10.1.js'></script> | |
</head> | |
<body> | |
<label class="page1">Country</label> | |
<div class="tooltips" title="Please select the country that the customer will primarily be served from"> |
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
Find C:\xampp\apache\conf\extra\httpd-vhosts.conf | |
// Apache below 2.4 | |
<VirtualHost *:80> | |
DocumentRoot "C:/xampp/htdocs/testsite" | |
ServerName testsite.dev | |
ServerAlias www.testsite.dev | |
<Directory "c:/xampp/htdocs/testsite"> | |
Order allow,deny |
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 | |
// no direct access | |
defined('_JEXEC') or die; | |
/* | |
* Display K2 2 articles in 1 row (you can change to 3 or 4 or whatever - don't forget to change bootstrap col class) | |
*/ | |
?> |
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
## Situation: you want to load web font or other asset from subdomain | |
# Because of the cross origin access policy, you get an error | |
# Put this is in .htaccess file inside your root folder and this limitation will be gone | |
## | |
Header add Access-Control-Allow-Origin "*" | |
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type" | |
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | |
<title>Online PHP Script Execution</title> | |
<link href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css' rel='stylesheet' type='text/css'> | |
<style> | |
body {padding: 1em;} | |
.video-container {position: relative;padding-bottom: 56.25%;padding-top: 30px;height: 0;overflow: hidden;} |