Skip to content

Instantly share code, notes, and snippets.

@2dpi
2dpi / gist:4130110
Created November 22, 2012 09:08
SEBLOD: Importer readme
SEBLOD Importer
========================================
- create/open CSV file (use first row for column titles to make editing easier)
- NB! make sure the following columns exist (id, title, catid)
-- id (joomla core auto increment if not specified)
-- title (if not specified timestamp will be used)
-- catid (set a default category else will be save as uncategorised)
-- OPTIONAL - ADD ANY OTHER ARTICLE COLUMNS
- match existing exclusive columns (i.e. LOCKED -TABLE: cck_store_form_your_content_type - storage [standard - article - field_name])
@2dpi
2dpi / vimeo_image_embed.php
Created June 20, 2012 14:20
Vimeo image embedding
<?php // USE TO CALL VIMEO IMAGES
$imgid = '30725341';
$hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/$imgid.php"));
echo '<img src="'.$hash[0]['user_portrait_huge'].'"/>';
/*
* thumbnail_large
* thumbnail_medium
* thumbnail_small
* user_portrait_huge
* user_portrait_large
@2dpi
2dpi / gist:5890113
Created June 29, 2013 06:33
SQL: joomla tag title output
<?php
// Initialiase variables.
$db = JFactory::getDbo();
foreach ($item->getValue('art_tags') as $key => $tag) {
if ($key >= 0) {
// Use following line in a model.
$query.$key = $db->getQuery(true);
// Prepare query.
$query.$key->select('u.id,u.parent_id,u.path,u.title');
@2dpi
2dpi / gist:5012040
Last active December 14, 2015 02:09
JOOMLA: date format
<?php
// change default date format
// http://docs.joomla.org/How_do_you_change_the_date_format%3F
// http://nl3.php.net/manual/en/function.date.php
echo JHtml::_('date',$yourDateVariable, JText::_('j F, Y'));
// will output 22 Month, 2013
?>
@2dpi
2dpi / php_date_format.php
Created February 22, 2013 08:52
PHP: date format
<?php
// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the
// Mountain Standard Time (MST) Time Zone
// http://nl3.php.net/manual/en/function.date.php
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
$today = date("m.d.y"); // 03.10.01
$today = date("j, n, Y"); // 10, 3, 2001
$today = date("Ymd"); // 20010310
$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
@2dpi
2dpi / gist:4492396
Created January 9, 2013 11:16
JAVASCRIPT: print web page button/link
// JAVASCRIPT - PRINT PAGE
// =======================
// http://javascript.about.com/library/blprint.htm
// Add a link to locally hosted file
// <link rel=alternate media=print href="printversion.pdf">
window.print();return false;
// HTML link
// <a href="#" onclick="window.print();return false;">Print This Page</a>
@2dpi
2dpi / gist:4425610
Created January 1, 2013 06:43
SEBLOD: adding related article fields to search
SEBLOD - ADDING RELATED ARTICLE FIELDS TO SEARCH
================================================
http://www.seblod.com/support/forum/Content-Types--Forms/29682-SOLVED-Relate-product-to-manufacturer-be-able-to-search-products-by-manufacturers-fields.html#29784
- CCK (* required core field)
(1) Variation = Hidden
(2) Live = Default | Live value = yourContentType (for related article)
(3) Match = Exact
(4) Stage = 1st
@2dpi
2dpi / gist:4175357
Created November 30, 2012 11:56
CSS: override inline-style
div[style] {
background: yellow !important;
}
@2dpi
2dpi / gist:4161470
Created November 28, 2012 13:55
SEBLOD: module form validation issue fix
<?
// add to from module code to avoid submission issues
if ( ( JCck::getConfig_Param( 'validation', 2 ) > 1 ) && $config['validation'] != '' ) {
}
;?>
@2dpi
2dpi / joomla_language_overrides.txt
Created August 14, 2012 13:14
Joomla Language Overrides
The new xx-XX.override.ini file has been created to avoid this issue. Instead of changing the original file, one can add in a file tagged to the language chosen (en-GB.override.ini for example) any key already existing somewhere among all ini files and a specific value.
The file has to be placed in:
administrator/languages/overrides/en-GB.override.ini
or
languages/overrides/en-GB.override.ini for frontend.
For example, if you add the following value to the override.ini file: