Skip to content

Instantly share code, notes, and snippets.

View loxK's full-sized avatar

Laurent Dinclaux loxK

View GitHub Profile
@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 );
@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:863256
Created March 9, 2011 23:40
Patch for WP-e-commerce 3.8-developpement to enable users registration notice
Index: wpsc-includes/misc.functions.php
===================================================================
--- wpsc-includes/misc.functions.php (révision 357938)
+++ wpsc-includes/misc.functions.php (copie de travail)
@@ -90,6 +90,11 @@
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !', 'wpsc' ), get_option( 'admin_email' ) ) );
return $errors;
}
+
+ if ( get_option('registration_notice') === '1' ) {
@loxK
loxK / fixes-notices.patch
Created February 24, 2011 04:35
Fixes contact form 7 error notice when executing wp-cron.php from command line
Index: includes/controller.php
===================================================================
--- includes/controller.php (révision 350190)
+++ includes/controller.php (copie de travail)
@@ -3,10 +3,10 @@
add_action( 'init', 'wpcf7_init_switch', 11 );
function wpcf7_init_switch() {
- if ( 'GET' == $_SERVER['REQUEST_METHOD'] && isset( $_GET['_wpcf7_is_ajax_call'] ) ) {
+ if ( isset($_SERVER['REQUEST_METHOD']) && 'GET' == $_SERVER['REQUEST_METHOD'] && isset( $_GET['_wpcf7_is_ajax_call'] ) ) {
Index: includes/controller.php
===================================================================
--- includes/controller.php (révision 350190)
+++ includes/controller.php (copie de travail)
@@ -3,10 +3,10 @@
add_action( 'init', 'wpcf7_init_switch', 11 );
function wpcf7_init_switch() {
- if ( 'GET' == $_SERVER['REQUEST_METHOD'] && isset( $_GET['_wpcf7_is_ajax_call'] ) ) {
+ if ( isset($_SERVER['REQUEST_METHOD']) && 'GET' == $_SERVER['REQUEST_METHOD'] && isset( $_GET['_wpcf7_is_ajax_call'] ) ) {
@loxK
loxK / gist:841744
Created February 24, 2011 04:20
Auto-thixkbox patch for error notices and useless ?> at the end of php files
Index: auto-thickbox-info.php
===================================================================
--- auto-thickbox-info.php (révision 350190)
+++ auto-thickbox-info.php (copie de travail)
@@ -6,4 +6,3 @@
__('Image', 'auto-thickbox');
__('of', 'auto-thickbox');
__('Close', 'auto-thickbox');
-?>
\ No newline at end of file
A user PM pointed me to the Readme file inside the rom package:
[quote]
# Cronos Contact: feeyo@nixdevs.com
# Are u interested in the sources used in this full rom?
# Please send me an email requesting information about these sources on specified email address.
# Please include in the subject line: "Cronos Sources"
##################################################################
# Cronos Scheduler and Governor are both Closed source.
##################################################################
A user PM pointed me to the Readme file inside the rom package:
[quote]
# Cronos Contact: feeyo@nixdevs.com
# Are u interested in the sources used in this full rom?
# Please send me an email requesting information about these sources on specified email address.
# Please include in the subject line: "Cronos Sources"
##################################################################
# Cronos Scheduler and Governor are both Closed source.
##################################################################
pick 56f6e37 More properties overrides
pick 6ad0799 Libcamera sources (from SteelBytes)
pick 407b60d Builds libcamera
pick 18af184 Working libsensors. TODO: remove proximity sensor
pick fbd0cfd Htc usb switch for tethering
pick 0511823 Should make libcamera to build
pick b6907df Corrected omx packages to include
pick da097fc Inherit from full_base
pick 3a78b83 Removed TARGET_NO_RECOVERY
pick b667f89 wcdma first
# Cronos Contact: feeyo@nixdevs.com
# Are u interested in the sources used in this full rom?
# Please send me an email requesting information about these sources on specified email address.
# Please include in the subject line: "Cronos Sources"
##################################################################
# Cronos Scheduler and Governor are both Closed source.
##################################################################
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991