Skip to content

Instantly share code, notes, and snippets.

View MaxLynam's full-sized avatar

Max MaxLynam

  • Melbourne, Victoria, Australia
View GitHub Profile
@MaxLynam
MaxLynam / addToTemplateMain_IndexPHP.php
Last active October 5, 2015 19:47
Joomla - Custom CSS dependant on active menu item & children
<!-- START - class decalaration as well as check itemID, frontpage, etc - Max Lynam | @MaxOnTheHill -->
<?php
/* get current active page */
$active = JFactory::getApplication()->getMenu()->getActive();
?>
<body
<?php if ($itemId): ?> id="item<?php echo $itemId; ?>" <?php endif; ?>
class="<?php echo $active->alias; ?>
<?php if ($isFrontpage): ?>frontpage <?php endif; ?>"
>
@MaxLynam
MaxLynam / Readme.txt
Created June 4, 2012 00:22
Joomla - Create module position on the fly, within content
To create a new module position within content, so a module can be assigned to display in that exact position, simply put into the text (in a P tag is ok):
{loadposition slideshow} with slideshow being the new module position in this example.
@MaxLynam
MaxLynam / sql_updates
Created October 7, 2012 15:31
SQL to replace all values of a column
UPDATE my_table SET my_field = 'my url or other entry'
@MaxLynam
MaxLynam / php.ini
Created October 10, 2012 12:29
Joomla3 - php.ini to make sure magic quotes are OFF
upload_max_filesize = 10M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
Line: 154
Originally:
$this->_url = substr(JURI::base(), 0, -1)."/".strstr($this->_path, 'index.php');
I modified it as follows:
// IF using SEF, this will return false.
@MaxLynam
MaxLynam / custom.css
Last active October 13, 2015 19:58
Twitter Bootstrap - Padding Left Reset / Override
/* reset first left margin when styled within a containing span */
[class*="span"] > [class*="span"] {
margin-left: 0;
}
@MaxLynam
MaxLynam / gist:5087848
Created March 5, 2013 03:46
add FB Open Graph & Twitter Cards META to Joomla insert into the appropriate com_content files
if (isset($images->image_intro) and !empty($images->image_intro))
{
$timage= htmlspecialchars(JURI::root().$images->image_intro);
}
elseif (isset($images->image_fulltext) and !empty($images->image_fulltext))
{
$timage= htmlspecialchars(JURI::root().$images->image_fulltext);
}
else
{
@MaxLynam
MaxLynam / gist:5385142
Created April 15, 2013 01:47
Joomla Template Class Code based on code from NormDouglas ... so all credit to him for sharing { Thanks }
<!-- The following section should be placed somewhere high up in your index.php of your template.
Note that some templates will not use the index.php for the main file -->
<!-- ********** CODE START ********** -->
<?php
$active = JFactory::getApplication()->getMenu()->getActive();
?>
<?php
$menu = &JSite::getMenu();
$active = $menu->getActive();
$menuname = $active->title;
@MaxLynam
MaxLynam / custom.css
Last active December 20, 2015 09:19
CSS Greyscale Image hover to full color - CSS3 Cross Browser Supported Has images displayed as greyscale on normal display and then when hover displays the full color image :)
element img {
filter: alpha(opacity=100);
opacity: 1.0;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
element img:hover, element img:focus {
filter: alpha(opacity=100);
opacity: 1.0;
@MaxLynam
MaxLynam / gist:6271895
Created August 19, 2013 17:40
Rs Forms RWD normalisation
.rsform .formControlLabel {
float: left;
width: 25%;
}
.rsform input, .rsform textarea, .rsform .uneditable-input {
margin-right: 4%;
width: 65%;
}