Skip to content

Instantly share code, notes, and snippets.

View loxK's full-sized avatar

Laurent Dinclaux loxK

View GitHub Profile
@loxK
loxK / gist:863384
Created March 10, 2011 01:12
Better wp-ecommerce regitration process: register then checkout
Index: wpsc-includes/misc.functions.php
===================================================================
--- wpsc-includes/misc.functions.php (révision 357938)
+++ wpsc-includes/misc.functions.php (copie de travail)
@@ -92,6 +92,7 @@
}
$credentials = array( 'user_login' => $user_login, 'user_password' => $user_pass, 'remember' => true );
$user = wp_signon( $credentials );
+ wp_set_current_user($user->ID);
return $user;
@loxK
loxK / gist:863446
Created March 10, 2011 02:15
Allows unlimited files downloads for wp-e-commerce 3.8
Index: wpsc-includes/ajax.functions.php
===================================================================
--- wpsc-includes/ajax.functions.php (révision 357938)
+++ wpsc-includes/ajax.functions.php (copie de travail)
@@ -958,10 +958,10 @@
// strip out anything that isnt 'a' to 'z' or '0' to '9'
ini_set('max_execution_time',10800);
$downloadid = preg_replace( "/[^a-z0-9]+/i", '', strtolower( $_GET['downloadid'] ) );
- $download_data = $wpdb->get_row( "SELECT * FROM `" . WPSC_TABLE_DOWNLOAD_STATUS . "` WHERE `uniqueid` = '" . $downloadid . "' AND `downloads` > '0' AND `active`='1' LIMIT 1", ARRAY_A );
+ $download_data = $wpdb->get_row( "SELECT * FROM `" . WPSC_TABLE_DOWNLOAD_STATUS . "` WHERE `uniqueid` = '" . $downloadid . "' AND (`downloads` > '0' OR `downloads` < '0') AND `active`='1' LIMIT 1", ARRAY_A );
Index: wpsc-admin/includes/display-items-functions.php
===================================================================
--- wpsc-admin/includes/display-items-functions.php (révision 357938)
+++ wpsc-admin/includes/display-items-functions.php (copie de travail)
@@ -841,6 +841,8 @@
$product_data['meta'] = $product_meta = maybe_unserialize( $product_data['_wpsc_product_metadata'][0] );
$upload_max = wpsc_get_max_upload_size();
+
+ ob_start();
Index: wpsc-admin/includes/display-items-functions.php
===================================================================
--- wpsc-admin/includes/display-items-functions.php (révision 357938)
+++ wpsc-admin/includes/display-items-functions.php (copie de travail)
@@ -841,6 +841,8 @@
$product_data['meta'] = $product_meta = maybe_unserialize( $product_data['_wpsc_product_metadata'][0] );
$upload_max = wpsc_get_max_upload_size();
+
+ ob_start();
Index: wpsc-admin/includes/display-items-functions.php
===================================================================
--- wpsc-admin/includes/display-items-functions.php (révision 357938)
+++ wpsc-admin/includes/display-items-functions.php (copie de travail)
@@ -841,6 +841,8 @@
$product_data['meta'] = $product_meta = maybe_unserialize( $product_data['_wpsc_product_metadata'][0] );
$upload_max = wpsc_get_max_upload_size();
+
+ ob_start();
--------- beginning of /dev/log/system
D/VoldCmdListener( 110): asec path com.google.android.apps.chrometophone-1
D/VoldCmdListener( 110): asec path antris.gameblasters.classic-1
D/VoldCmdListener( 110): asec path com.adobe.flashplayer-2
D/VoldCmdListener( 110): asec path com.natenai.glowhockey-1
if( ! function_exists('get_called_class') ) :
function get_called_class($bt = false,$l = 1) {
if (!$bt) $bt = debug_backtrace();
if (!isset($bt[$l])) throw new Exception("Cannot find called class -> stack level too deep.");
if (!isset($bt[$l]['type'])) {
throw new Exception ('type not set');
}
else switch ($bt[$l]['type']) {
case '::':
$lines = file($bt[$l]['file']);
<?php
if( ! function_exists('get_called_class') ) :
function get_called_class($bt = false,$l = 1) {
if (!$bt) $bt = debug_backtrace();
if (!isset($bt[$l])) throw new Exception("Cannot find called class -> stack level too deep.");
if (!isset($bt[$l]['type'])) {
throw new Exception ('type not set');
}
else switch ($bt[$l]['type']) {
@loxK
loxK / recovery.log
Created November 17, 2011 00:10
Recovery error
cat recovery.log
Starting recovery on Thu Nov 17 00:08:21 2011
framebuffer: fd 4 (480 x 800)
ClockworkMod Recovery v5.0.2.0
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /recovery emmc /dev/block/mmcblk0p7 (null)
2 /boot emmc /dev/block/mmcblk0p5 (null)
3 /cache ext3 /dev/block/mmcblk0p2 (null)
$ sudo ./install
DRIVER COPY START
STA_PATH_FLAG=.
STA_PATH_FULL=/home/pi/driver/install
START_PATH_DRIVER=/home/pi/driver
CURRENT install from ./install
INSTALL_PATH is not set ,auto install
INSTALL_PATH=/usr/local/Mobile_Partner
INSTALL_PATH is another path
rm /usr/local/Mobile_Partner/driver