Skip to content

Instantly share code, notes, and snippets.

View codeboxr's full-sized avatar
🎯
Focusing

Codeboxr codeboxr

🎯
Focusing
View GitHub Profile
@codeboxr
codeboxr / gist:6171227
Created August 7, 2013 04:40
Com_k2 default open graph fix
//Go to(windows style path) joomla root/components/com_k2/views/item/view.html.php
// and comment line from 445 to 455
/*
$document->setMetaData('og:url', $uri->toString());
$document->setMetaData('og:title', htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8'));
$document->setMetaData('og:type', 'Article');
$facebookImage = 'image'.$params->get('facebookImage', 'Small');
if ($item->$facebookImage && JFile::exists(JPATH_SITE.$item->$facebookImage))
{
$image = substr(JURI::root(), 0, -1).str_replace(JURI::root(true), '', $item->$facebookImage);
else if(JRequest::getCmd('option') == 'com_content') {
//var_dump($context);
if(!($context == 'com_content.article' || $context == 'com_content.category')) {return; }
$comcontent = true;
if($this->_floatcontent && (JRequest::getCmd('view') == 'article') && $float){$float = true;}else{$float = false;}
$this->_floatpos = $this->_floatposcontent;
$this->_floathmargin = $this->_floathmargincontent;
$this->_floatvmargin = $this->_floatvmargincontent;
//$this->_floatdistance = $this->_floatdistancecontent;
### Function: Add Download Query Vars
add_filter('query_vars', 'cbreport_query_vars');
function cbreport_query_vars($public_query_vars) {
$public_query_vars[] = "report_ids";
return $public_query_vars;
}
add_action('template_redirect', 'reportdownload_file', 5);
Simple shortcode
{cbscrollpane}
text here
{/cbscrollpane}
For width and left align
@codeboxr
codeboxr / gist:5894857
Created June 30, 2013 11:40
Make Radio Switch button in joomla frontend
/**
* @package Joomla.Administrator
* @subpackage Templates.isis
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @since 3.0
*/
(function($)
{
@codeboxr
codeboxr / gist:5820826
Last active December 18, 2015 17:49
Sending Customized User Registration Email Alert to Admin in Moodle - Step1 From My blog post: http://codeboxr.com/blogs/sending-customized-user-registration-email-alert-to-admin-in-moodle
$string['emailconfirmationtoadmin'] = 'Hi {$a->supportname},
A new account \'{$a->firstname}\' has been requested at \'{$a->sitename}\'
{$a->admindata}';
@codeboxr
codeboxr / gist:5820819
Last active December 18, 2015 17:49
Sending Customized User Registration Email Alert to Admin in Moodle step2 From My blog post: http://codeboxr.com/blogs/sending-customized-user-registration-email-alert-to-admin-in-moodle
/**
* Send email to specified user with confirmation text and activation link.
*
* @global object
* @param user $user A {@link $USER} object
* @return bool Returns true if mail was sent OK and false if there was an error.
*/
//update by codeboxr
function send_confirmation_email($user) {
function codex_custom_init() {
$labels = array(
'name' => 'Books',
'singular_name' => 'Book',
'add_new' => 'Add New',
'add_new_item' => 'Add New Book',
'edit_item' => 'Edit Book',
'new_item' => 'New Book',
'all_items' => 'All Books',
'view_item' => 'View Book',
@codeboxr
codeboxr / gist:11138240
Last active August 29, 2015 14:00
showing avg rating using direct function call
/**
* Show avg rating for multiple posts for same form id,
* calls from shortcode or direct function call or from widget
*
* @param $option
* @param int $show_title
* @param int $show_form_id
* @param int $show_text
* @param int $show_star
* @param int $show_single
@codeboxr
codeboxr / css for rating system, if theme 20-14
Created February 18, 2014 12:20
css for rating system, if theme 20-14
$postid = $post->ID;
$rating = standalonePostingRatingSystem('4', $postid);
echo '<div style="left-margin:200px;">'.$rating.'</div>';
adjust the margin .
in other theme hopefully you dont have to do anything.