block

Problem with views, block and nodequeue

  1. SELECT COUNT(*) FROM (
  2.         SELECT node.nid AS nid
  3.         FROM node node
  4.         INNER JOIN nodequeue_nodes nodequeue_nodes_node
  5.                 ON node.nid = nodequeue_nodes_node.nid
  6.                 AND nodequeue_nodes_node.qid = 1

views code for current user block

  1. $view = new view;
  2. $view->name = 'pootestpoo';
  3. $view->description = 'poopoo';
  4. $view->tag = '';
  5. $view->view_php = '';
  6. $view->base_table = 'users';
  7. $view->is_cacheable = FALSE;

call template file, pass variables

  1. <?php
  2.  
  3. $text = theme('apply_template', $data);
  4. return $text;
  5.  
  6. function theme_apply_template($data) {
  7.     ob_start();
  8.     include path_to_theme().'/my-block.tpl.php';

Some code to search flickr for images

  1. function _optotrip_block_flickr() {
  2.   $termtext = _optotrip_get_block_context();
  3.   if ($termtext == '') {
  4.     return NULL;
  5.   }
  6.  
  7.   $starttime = microtime(TRUE);
  8.  
  9.   lightbox2_add_files();

block visibility code doesn't work in all regions

  1. if (drupal_is_front_page() == TRUE) {
  2.   return FALSE;
  3. } else {
  4.   return TRUE;
  5. }

Blog author information

  1. <?php
  2. // $Id$
  3.  
  4. /**
  5.  * @file
  6.  * Implements block for showing archives, user picture, and links for blog sidebars.
  7.  */
  8.  
  9. function blog_sidebar_block($op = 'list', $delta = 0, $edit = array()) {
Syndicate content