Skip to content

Instantly share code, notes, and snippets.

View kricore's full-sized avatar

Krikor Boghossian kricore

  • Greece
View GitHub Profile
@kricore
kricore / gist:eecb43d52de3b2c8883e
Last active August 29, 2015 13:56
SocialConnect responsive styles. A simple addition to SocialConnect compact template.
/* Force load the module on the right (optional) */
#modSocialConnectCompact .socialConnectLeft { right: 0; left: auto; }
#modSocialConnectCompact .socialConnectLeft:after, #modSocialConnectCompact .socialConnectLeft:before { right: 50%; left: auto; }
/* responsive styling */
@media screen and (max-width: 600px) {
#modSocialConnectCompact .socialConnectSignInBlockContainer { max-width: 100%; }
#modSocialConnectCompact .socialConnectSignInBlock, #modSocialConnectCompact .socialConnectServicesBlock { float: none; clear: both; width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
#modSocialConnectCompact .socialConnectLink { float: left; }
@kricore
kricore / template.css.php
Last active August 29, 2015 13:57
Responsive: FPSS SIMPLE template - NO sidebar
<?php
if(!isset($fpssTemplateIncluded)){
header("Content-type: text/css; charset: utf-8");
$width = (int) $_GET['width'];
$height = (int) $_GET['height'];
$sidebarWidth = (int) $_GET['sidebarWidth'];
$thumbnailViewportWidth = (int) $_GET['thumbnailViewportWidth'];
$thumbnailViewportHeight = (int) $_GET['thumbnailViewportHeight'];
$timer = (bool) $_GET['timer'];
$mid = (int) $_GET['mid'];
@kricore
kricore / gist:8a29c65f724f9ead1860
Last active August 29, 2015 13:57
Responsive: TT template with navigation
<?php
if(!isset($fpssTemplateIncluded)){
header("Content-type: text/css; charset: utf-8");
$width = (int) $_GET['width'];
$height = (int) $_GET['height'];
$sidebarWidth = (int) $_GET['sidebarWidth'];
$thumbnailViewportWidth = (int) $_GET['thumbnailViewportWidth'];
$thumbnailViewportHeight = (int) $_GET['thumbnailViewportHeight'];
$timer = (bool) $_GET['timer'];
$mid = (int) $_GET['mid'];
@kricore
kricore / classic.css
Last active August 29, 2015 14:07
Simple Image Gallery Pro's classic template without the image background.
/**
* @version 3.0.x
* @package Simple Image Gallery Pro
* @author JoomlaWorks - http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
* @license http://www.joomlaworks.net/license
*/
/* --- Generic Styling --- */
a:active,a:focus { outline:0; }
@kricore
kricore / gist:7abc76e04c1bc9235ce2
Created May 14, 2015 15:59
Cleaning up K2 extrafields.
<?php
$safe = array("", "");
$nonsafe = array("'", "\"");
$custometa = $this->item->extraFields->NAME->value;
$safemeta = str_replace( $nonsafe, $safe, $custometa);
echo $safemeta; ?>
@kricore
kricore / gist:2c9a5434748c5f5f6cf9
Created May 15, 2015 12:42
K2 custom meta based on extrafields
<?php
// Option 1 - content is already cleaned up.
// if AAA is set use it, else use BBB
$metacontent = ( isset($this->item->extraFields->AAA->value) && $this->item->extraFields->AAA->value != '' ) ? $this->item->extraFields->AAA->value : $this->item->extraFields->BBB->value;
$doc->addCustomTag('<meta name="anything" content="'.$metacontent.'" />');
?>
<?php // option two the content needs cleaning
// Clean the content prior to the assignment
@kricore
kricore / default.php
Last active September 24, 2015 11:17 — forked from anonymous/default.php
Based on @buntom's gist. Removes the K2 item you are browsing from the list.
<?php
/**
* @version 2.6.x
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
@kricore
kricore / K2 Extrafields loop.
Last active January 3, 2016 23:59
Just a normal K2 extrafields loop with the addition of icon fonts for social links instead of simple links.. It requires the use of the extrafields aliases (eg twitter, facebook etc). The icon- and -circled prefix and suffixed are based on the Entypo icon font from Fontello.
<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
<!-- Item extra fields -->
<div class="itemExtraFields">
<?php /*<h3><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h3>*/ ?>
<ul>
<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
<?php if($extraField->value != ''): ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<?php // Check if it is a social link
$ealias = $extraField->alias;
@kricore
kricore / view.feed.php
Created January 27, 2016 17:58
Hack: Add an extrafield to K2 feed items' title. Part of the view.feed.php item
$fields = json_decode($item->extra_fields);
$item->title = $this->escape($item->title);
if ($fields[0]->value && $fields[0]->value !== '')
{
$item->title = html_entity_decode($item->title.' - '.$fields[0]->value);
}
else
{
$item->title = html_entity_decode($item->title);
}
@kricore
kricore / The inline player module
Last active June 6, 2016 15:13
Radiowave porting to other services
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio-stream" role="application" aria-label="media player">
<div class="jp-type-single">
<div class="jp-gui jp-interface">
<ul class="jp-controls">
<li>
<a href="javascript:;" style="display:block;" class="jp-play" title="Play"><i class="icon-play"></i><span>Listen Live</span></a>
<a href="javascript:;" style="display:none;" class="jp-pause" title="Pause"><i class="icon-pause"></i><span>Listen Live</span></a>
</li>
<li>