Skip to content

Instantly share code, notes, and snippets.

View karlosgliberal's full-sized avatar

karlos g liberal karlosgliberal

View GitHub Profile
<?php
//tiene mas peligro que una escopeta de feria pero yo que se por guardarlo todo como las urracas
global $user;
$type = 'garden';
$node = array('uid' => $user->uid, 'name' => $user->name,
'type' => $type);
module_load_include('inc', 'node', 'node.pages');
$form = drupal_get_form($type .'_node_form', $node);
// sacado de este snipsets y cambiado las
//rutas de osc para que pille
//el programa andorid osc.
import processing.opengl.*;
import oscP5.*;
OscP5 oscP5;
float xrot = 0;
float zrot = 0;
select channel.title, channel.link, channel.item.title, channel.item.link, channel.item.description, channel.item.guid
from xml where url in( 'http://karlosgliberal.investic.net/blog/feed', 'http://miren.investic.net/blog/feed') and channel.item.title like "%post%"
#wget para hacer cron con user agent definido
wget --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" http://devinvestic.com/cron.php > /dev/null 2>&1
<?
/**
* Implementation of hook_nodeapi().
* Drupal Crear dos nodos con un campo en comun
*/
function sorteo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'insert':
//crear dos nodos de quiz relacionados por su campo de nid
if($node->type == 'quiz' && !$node->field_identificador[0]['value']){
grep "10/Dec/2009:12" access.www | awk '{print $7}'
<?php
/**
* Implementation of hook_views_query_alter().
*/
function modulename_views_query_alter(&$view, &$query) {
if ($view->name == 'viewname') {
$type_clause = FALSE;
// check to see if we already have a node.type clause
foreach ($query->where[0]['clauses'] as $clause) {
if (substr(0, 10, $clause) == 'node.type ') {
<?php if ($submitted): ?>
<span class="submitted"><?php echo format_date($node->created, 'custom', 'd M Y') ?></span>
<?php endif; ?>
<?php
$myview = views_get_view( 'og_canales' ); ///< Your views ID or name here
$display = 'feed'; ///< Your feed name here, string used 2 times
$myview ->set_display( $display );
$args = array(arg(1), 'feed'); ///< You can provide view by some arguments
$myview ->set_arguments($args);
$url = $myview ->get_url();
$title = $myview ->display[ $display ]->display_options[ 'title' ];
print theme( 'feed_icon', check_url( url($url) ), $title );
?>