Skip to content

Instantly share code, notes, and snippets.

View drmmr763's full-sized avatar

Chad Windnagle drmmr763

View GitHub Profile
@drmmr763
drmmr763 / default.php
Created May 14, 2012 01:03
default.php joomla 2.5 latest news (with intro image support)
// no direct access
defined('_JEXEC') or die;
?>
<ul class="latestnews<?php echo $moduleclass_sfx; ?>">
<?php foreach ($list as $item) : ?>
<li>
<a href="<?php echo $item->link; ?>">
<?php echo $item->title; ?></a>
<?php //json decodes the image object and gets the intro image source. ?>
@drmmr763
drmmr763 / gist:2868783
Created June 4, 2012 14:37
Check view of site with PHP in Joomla
$view = JRequest::getVar('view');
if ($view == "category") {
return false;
}
if ($view == "product") {
return true;
}
@drmmr763
drmmr763 / gist:3013000
Created June 28, 2012 18:12
Set cookie attempt for forcing mobile views.
<?php
// In Mobile template index.php
// get the form value and change the cookie based on that
$fullsite = JRequest::getVar('fullsite');
// if we want the full view forced set the cookie
if($fullsite == 1) {
setcookie("fullsite", $fullsite, time() + 3600);
}
@drmmr763
drmmr763 / jessCPlus.c
Created July 11, 2012 15:36
calcRegBill Function
double calcRegBill(int a)
{
if (a <= base_R_min)
amtDue = R_Srv_Fee;
else
amtDue = R_Srv_Fee + ((a - base_R_min) * over_RbaseFee );
return amtDue;
}
@drmmr763
drmmr763 / cfunctions.c
Created July 11, 2012 15:49
stuff on functions
/* So here's the skinny on void & returns:
All functions, like double or int, should return _something_. That's why you use the return line.
The only time a function DOESN"T return a value, is when you use void. Void means the function does something, but doesn't return a value.
So for example you could have two functions: */
// simple main function. just uses two other functions to do everything
//Programming Assignment #8
// CellBillFun
//Author: Jess Darling
//Date: July 8, 2012
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <string>
@drmmr763
drmmr763 / sobipro.php
Created September 3, 2012 13:26
SobiPro element plugin for Fabrik
<?php
/**
* @package Joomla.Plugin
* @subpackage Fabrik.element.checkbox
* @copyright Copyright (C) 2005 Fabrik. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
@drmmr763
drmmr763 / gist:4204676
Created December 4, 2012 14:45
Getting extra fields
<?php
/* I used to be able to get the extra fields of
** a k2 item by doing this:
*/
$id = $item->getId();
$db = JFactory::getDBO();
$query = "SELECT extra_fields FROM #__k2_items WHERE id={$id}";
@drmmr763
drmmr763 / index.php
Created December 12, 2012 15:17
jplatform image script
<?php
/**
* An example JApplicationWeb application built on the Joomla Platform.
*
* To run this example, copy or soft-link this folder to your web server tree.
*
* @package Joomla.Examples
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
@drmmr763
drmmr763 / edit.php
Created January 5, 2013 02:12
edit.php for a front end submit form using jform. the user id field isn't working.
<?php
/**
* @package Joomla25.Bizform
* @subpackage Components
* @author Chad Windnagle
* @link http://www.chadwindnagle.com
* @license License GNU General Public License version 2 or later
*/
// No direct access to this file