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 exclude_writepanels_posts($where){ | |
| global $wpdb, $parent_file; | |
| if( $parent_file != 'edit.php' ) return $where; | |
| if (empty($_GET['filter-posts'])){ | |
| $where = $where . " AND 0 = (SELECT count($wpdb->postmeta.meta_value) | |
| FROM $wpdb->postmeta WHERE $wpdb->postmeta.post_id = $wpdb->posts.ID and $wpdb->postmeta.meta_key = '_mf_write_panel_id')"; | |
| } | |
| return $where; |
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 | |
| /** | |
| * Magic Fields's debug Class | |
| * | |
| * @package Magic Fields | |
| * @subpackage tools | |
| */ | |
| class Debug{ | |
| /** |
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 | |
| //old way (and with this doesn't work the drag and drop order feature) | |
| $my_group = getGroupDuplicates("some_field"); | |
| for($i=1;$i <= $my_group;$i++){ | |
| echo get('some_Field',$i); | |
| } | |
| //new way | |
| $the_order = getGroupOrder('some_field'); |
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
| def recu(x): | |
| li = [] | |
| lista = [] | |
| li.append('numero') | |
| while x > 1: | |
| if x % 2: | |
| x = x * 3 + 1 | |
| lista.append(x) | |
| else: | |
| x = x / 2 |
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
| #getting all posts related with a write panel in magicfields | |
| select * from wp_posts where wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') AND 0 < (SELECT count(wp_postmeta.meta_value) FROM wp_postmeta WHERE wp_postmeta.post_id = wp_posts.ID and wp_postmeta.meta_key = '_rc_cwp_write_panel_id' and wp_postmeta.meta_value = '{$write_panel_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
| <?php | |
| $my_field_order = getGroupOrder('field'); | |
| foreach($my_field_order as $value){ | |
| $element = get('field',$value); | |
| } | |
| ?> |
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 | |
| function getGroupOrder($field){ | |
| global $post,$wpdb; | |
| $elements = $wpdb->get_results("SELECT group_count FROM ".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." AND field_name = '{$field}' ORDER BY order_id ASC"); | |
| foreach($elements as $element){ | |
| $order[] = $element->group_count; | |
| } |
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
| #!/usr/bin/env python | |
| import re | |
| import urllib2 | |
| class get_ip: | |
| def __init__(self): | |
| pass | |
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
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| #Author: David Valdez | |
| #Correo: david.valdez210[arroba]gmail.com | |
| #Commands: | |
| # rola.py | |
| version = "1.0" |
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
| //Amarramos a las anchors un evento | |
| $(document).ready(function(){ | |
| $("a").livequery('click',function(event){ | |
| alert("hola mundo!"); | |
| }); | |
| }); | |
| //Con livequery unicamente nos preocupamos por hacer nuesta llamada | |
| //live query se encarga de re-ligar los eventos :D | |
| $.ajax({ |