Skip to content

Instantly share code, notes, and snippets.

/*
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
*/
/* =Containers
--------------------------------------------------------------------------------*/
@foxp2
foxp2 / 1-create table.sql
Last active December 21, 2015 15:29
hierarchy tree on table self referencing
DROP TABLE IF EXISTS categories;
CREATE TABLE IF NOT EXISTS categories (
id int(11) NOT NULL AUTO_INCREMENT,
parent_id int(11) DEFAULT NULL,
level text,
categories_name varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY cat (id,parent_id),
KEY IDX_3AF34668727ACA70 (parent_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
@foxp2
foxp2 / 1-PublicadminController.php
Last active December 20, 2015 20:48
E-portofolio FoxP2Projects chargement & affichage des données.
<?php
private function _getGithubGistFiles($id_gist) {
$service = $this->container->get('github_api');
$gists = $service->getClient();
/* commentaire : identifiant en dur pour test */
$id_gist = '5947930';
@foxp2
foxp2 / test.php
Last active December 20, 2015 15:19
test de mise à jour
<?php
/**
* osCommerce Online Merchant 2.4 with twig !
*
* @copyright Copyright (c) 2013 osCommerce; http://www.oscommerce.com
* @copyright (c) 2013, James W Burke
* @copyright Copyright (c) 2013 modified by FoxP2; http://www.oscommerce.fr
* @license GNU General Public License; http://www.oscommerce.com/gpllicense.txt
*/
class TwigModules extends Twig_Extension
@foxp2
foxp2 / article1.sql
Created August 3, 2013 00:30
SQL for osc 2.4
select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity,
p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_template, p.products_gallery, s.specials_new_products_price,
from products p left outer join specials s on s.products_id = p.products_id inner
join products_description pd on pd.products_id = p.products_id and p.products_id = 16 and
p.products_status = 1 and (s.status = 1 or s.status IS NULL) and pd.language_id = 1 limit 1;
Traitement en 0.0007 sec
requête originale :
select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity,
@foxp2
foxp2 / configuration.php
Last active December 19, 2015 11:29
Extract data from configuration_group and configuration tables.
<?php
/*
* osCommerce Online Merchant 2.4 with twig !
*
* @copyright Copyright (c) 2013 osCommerce; http://www.oscommerce.com
* @copyright Copyright (c) 2013 FoxP2; http://www.oscommerce.fr
* @license GNU General Public License; http://www.oscommerce.com/gpllicense.txt
*/
require('includes/application_top.php');
/*
bxGallery v1.1
Plugin developed by: Steven Wanderski
http://bxgalleryplugin.com
http://stevenwanderski.com
Released under the GPL license:
http://www.gnu.org/licenses/gpl.html
*/
(function($) {
@foxp2
foxp2 / database.sql
Last active December 17, 2015 03:38
ALTER TABLE `categories` ADD `categories_template` varchar(255) NULL;
ALTER TABLE `categories_description` ADD `categories_short_description` TEXT NULL;
ALTER TABLE `categories_description` ADD `categories_long_description` TEXT NULL;
ALTER TABLE `products` ADD `products_template` varchar(255) NULL;
ALTER TABLE `products` ADD `products_gallery` varchar(255) NULL;
ALTER TABLE `products_description` ADD `products_short_description` TEXT NULL;
ALTER TABLE `products_images` ADD `thumb` varchar(255) NULL;
ALTER TABLE `products_options` ADD `products_options_template` varchar(255) DEFAULT 'classic_dropdown';
ALTER TABLE `products_options` ADD `products_options_required` INT(1) DEFAULT 1;
ALTER TABLE `products_options_values` ADD `products_options_values_description` TEXT NULL;
@foxp2
foxp2 / main.html.twig
Last active December 16, 2015 17:28
osCommerce 2.4 shopping cart with Twig
{# Copyright (c) 2013 FoxP2; http://www.oscommerce.fr #}
{# file: includes/apps/cart/view/template/classic/main.html.twig #}
{% extends "base.html.twig" %}
{% block appcontent %}
<div id="bodyContent" class="span{{ GridContentWidth }}">
{% block shoppingcarttitle %}
<h1 class="title-app">{{ constant('HEADING_TITLE') }}</h1>
{% endblock %}
{{ form('cart_quantity', link('cart', 'update'), 'post', null, true) | raw }}
{% for hf in hidden_field %}
@foxp2
foxp2 / base.html.twig
Last active December 15, 2015 15:58
automactic & smart loader for each column. Example with twig_bm_categories extending bm_categorie class and its template file
{% block columnleft %}
<div id="columnTwigLeft" class="span{{ GridColumnWidth }}">
{% for boxe in boxes %}
{% if boxe.boxe != null and boxe.group == 'boxes_column_left' %}
{% include [boxe.boxe, TwigExtension]|join with{'data': boxe.data, 'title' : boxe.title } %}
{% endif %}
{% endfor %}
</div>
{% endblock %}