php

block node visibility

  1. <?php
  2. if (arg(0) == 'user' && arg(1) == $user->uid) {
  3.   return true;
  4. }
  5. ?>

Blow, Blow, Thou Winter Wind – by Shakespeare

  1. <?php
  2. /**
  3.  * Blow, Blow, Thou Winter Wind.
  4.  *
  5.  * Blow, blow, thou winter wind,
  6.  * Thou art not so unkind
  7.  * As man's ingratitude;
  8.  * Thy tooth is not so keen
  9.  * Because thou art not seen,
  10.  *

test php

  1. <?php
  2. echo "Hello World";
  3. ?>

test

  1. <?php test123232 ?>
  2. <?
  3.  
  4.  
  5. ../..
  6.  
  7. <?
  8.  
  9. glglglglgkgkhkhkhkhkhkhkhkhkhkh

Testing

  1. This is some php code
  2.  
  3.  
  4. <?php
  5. abstract class testing {
  6.   public function __construct() {
  7.  
  8.  }
  9. }
  10. ?>

Fix for if image is there show it but if video is there, hide the image

  1.  <?php $video = $node->field_hero_video[0]['view']; ?>
  2. <div class="art-Post">
  3.     <div class="art-Post-body">
  4. <div class="art-Post-inner">
  5. <h2 class="art-PostHeader"> <?php echo art_node_title_out

if image is there show it but if video is there, hide the image

  1. <div class="art-Post">
  2.     <div class="art-Post-body">
  3. <div class="art-Post-inner">
  4. <h2 class="art-PostHeader"> <?php echo art_node_title_output($title, $node_url, $page); ?>
  5. </h2>
  6. <div><?php pri

WSOD error from menu_execute_active_handler() - on homepage (using Panels

  1. menu_execute_active_handler(): returned NULL - it's very bad!
  2. WSOD detected!

PHP code put into views repeats for all users on site, opposed to just being displayed once

  1. <?php
  2. global $user;
  3. $rtid = 1; //Relationship type ID.
  4. $max = 1; //The amount of users to show on the block.
  5.  
  6. $user_rel = db_query("
  7. SELECT u.uid
  8. FROM {users} u
  9. LEFT JOIN {user_relationships}

printing a list, instead of a table header

  1. function honu_preprocess_forum_topic_list(&$variables) {
  2.   global $forum_topic_list_header;
  3.  
  4.   // Create the tablesorting header.
  5.   $ts = tablesort_init($forum_topic_list_header);
  6.   $header = '';
Syndicate content