This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// mappress-api.php ~ 277 | |
// now: | |
$this->mapid = (int)$wpdb->get_var("SELECT LAST_INSERT_ID()"); | |
// proposed: | |
$this->mapid = (int)$wpdb->insert_id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Canonical redirect for Apache | |
# BEGIN Canonical Redirect | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] ## will match any domain that's not our main domain | |
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] | |
</IfModule> | |
# END Canonical Redirect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class av_sitemap{ | |
private $args; | |
public $transient_id; | |
public $transient_data; | |
function __construct( $args ){ | |
$this->args = wp_parse_args( $args, array( | |
'main_menu' => 'principal', | |
'skip' => null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== modified file 'htdocs/wp-content/plugins/limit-login-attempts/limit-login-attempts.php' | |
--- htdocs/wp-content/plugins/limit-login-attempts/limit-login-attempts.php 2012-05-16 14:12:30 +0000 | |
+++ htdocs/wp-content/plugins/limit-login-attempts/limit-login-attempts.php 2012-05-16 15:05:44 +0000 | |
@@ -75,6 +75,9 @@ | |
/* If notify by email, do so after this number of lockouts */ | |
, 'notify_email_after' => 4 | |
+ | |
+ /* A list of IPs that won't be blocked, one per line */ | |
+ , 'exclude_ips' => '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
// obtener resultados para una consulta cualquiera | |
// el parámetro ARRAY_N indica que wpdb debe retornar los resultados | |
// como un array con índices numéricos | |
$entries = $wpdb->get_results("SELECT * FROM $wpdb->contact_form ORDER BY id DESC", ARRAY_N); | |
if ( $entries ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# originally seen on: http://psoug.org/snippet/Grouping_rows_by_frequency_299.htm | |
SELECT DISTINCT field_name, COUNT(*) AS num | |
FROM table_name | |
GROUP BY field_name | |
ORDER BY num DESC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="footer-admin"> | |
<div class="center"> | |
<img src="images/logo/clerk-footer.gif"> | |
<div class="menu-footer-admin"> | |
<ul> | |
<li class="active"> | |
<a title="Dashboard" href="/dashboard">Dashboard</a> | |
</li> | |
<li> | |
<a title="Reservas" href="/bookings">Reservas</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// versión re-escrita | |
function array_to_object($array = array()) { | |
try { | |
throw new flv_exception_deprecated( __FUNCTION__ ); | |
} catch ( flv_exception_deprecated $e ) { | |
flv_handle_exceptions( $e ); | |
return (object)$array; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$(document).ready(function(){ | |
$('a[href$=".pdf"]').click(function(){ | |
var trackers = _gat._getTrackers(), | |
specific_tracker = trackers[ trackers.length - 1 ], // assuming that the last tracker it's the one where you want to track the events | |
dl_url = $(this).attr('href'), | |
tracked = specific_tracker._trackEvent('Downloads', 'PDF', dl_url); | |
if ( typeof console.log == 'function' ) console.log( specific_tracker._getName(), tracked, dl_url ); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$menu_items = array(); | |
foreach ( $menus[$menu] as $item ) $menu_items[] = $item['id']; | |
$placeholders = implode(', ', array_fill(0, count($menu_items), '%s')); | |
$query = "SELECT post_name, ID, post_title FROM $wpdb->posts WHERE post_name IN($placeholders)"; | |
$results = $wpdb->get_results( $wpdb->prepare($query, $menu_items), OBJECT_K ); |