Incomplete

User Profile Page

Last modified: August 23, 2009 - 15:19

<?php if($user->picture): ?>
<div class="picture">
  <img src="/<?php print $user->picture ?>" />
</div>
<?php endif; ?>
/** If you are using this snippet with Drupal version 4.7.x or 5.x use the
* following line to display a user picture instead
* <?php  if($user->picture) {print theme('user_picture', $user);}?>
*/
<div class="custom_profiles">
  <div class="fields">City: <?php print check_plain($user->profile_city); ?></div>
  <div class="fields">Country: <?php print check_plain($user->profile_country) ;?></div>
  <div class="fields">Postcode: <?php print check_plain($user->profile_postcode); ?></div>
</div>

<?php if($user->profile_postcode) { ?>
<div class="fields">Postcode: <?php print check_plain($user->profile_postcode) ?></div>
<?php }?>

XSPF Playlist

Last modified: July 10, 2009 - 14:27

XSPF Playlist generates a playlist feed in the standard XSPF format from files that are attached to a piece of content. XSPF files are used by audio and video players to present playlists--displays of media a user can view or listen to.

The module was designed for Jeroen Wijering's flash player, though it should work with other flash players. The administrative interface allows the administrator to select what node types it works on, choose a default thumbnail file to use, and configure support for CCK fields. The module supports multiple file types (audio, video, flash).

This module is partially supported by CivicActions.

Overview: Associating media files with content

Playlists are specially formatted xml files. They are constructed by XSPF Playlist module from media files associated with a piece of content (a node). Files can be associated in various methods, including:

  • Using the Upload module (part of Drupal core). Enable the upload module, configure one or more content types to accept uploads, and upload files associated with content. Sample configurations:

Do not count views of administrators or creators

Last modified: September 5, 2009 - 00:12

This mini module prevents the statistics module to increase the view counter if an administrator or the author of the node has viewed a node.

Download: http://e-faux.com/node/45

<?php
// $Id$

/**
* Implementation of hook_exit().
*
* Decrement counter of current viewed node if user is admin or author of node.
*/
function noadmincount_exit() {
  global
$user;

 
// Check if we are counting views.
 
if (variable_get('statistics_count_content_views', 0)) {
   
// Check if current page displays a node in viewing mode.
   
if ((arg(0) == 'node') && is_numeric(arg(1)) && arg(2) == '') {
     
// Check if the user is admin or author.
     
if (user_access('administer nodes') || $user->uid == node_load(arg(1))->uid) {
       
// Decrement total view count and day view count of current node.
       
db_query('UPDATE {node_counter} SET daycount = daycount - 1, totalcount = totalcount - 1, timestamp = %d WHERE nid = %d', time(), arg(1));
      }
    }
  }
}

/**
* Implementation of hook_cron().
*
* Delete entries with zero views. Such entries may exist because noadmincount_exit()
* does not delete zero viewed lines.
*/
function noadmincount_cron() {
 
db_query('DELETE FROM {node_counter} WHERE totalcount = 0');
}
?>

Alternatives

Modules which provide similar functionality:

Views 2 (Drupal 6)

Last modified: March 6, 2009 - 01:17

Views 2 Introduction by Rob Safuto (Learn By The Drop, Awakened Voice)

A 10-minute video that will give you an excellent introduction to using the new version of Views. This video is a bit older and some of the interface is different compared to the current release. However, if you want a quick overview, this is the video for you.
Play Video (Length: 09:52, Format: Flash)

Mastering Views 2 by greggles (Mastering Drupal)

This screencast provides a 34 minute overview of the new features that Views 2 offers. This video shows off not all the new features, but it is a good starting point if you want to learn how to use Views 2.
Play Video | Blog Post (Length: 34:00, Format: Flash, Blip.tv)

Understanding Views 2 Relationships by Andrew Morton (Drewish)

Custom Filter

Last modified: July 1, 2009 - 13:00

Custom filter is a module that allows you to create your own filters based on regular expressions. When you need some input filter that is not available from drupal.org/project/modules, and you don't want to write your own module, you can create your own filter with this module. What you need is regular expressions, and optionally PHP programming ability.

CVS FAQ

Last modified: December 6, 2009 - 04:45

This page is the future home for a list of Frequently Asked Questions about Drupal's CVS repositories.

Some initial thoughts on questions this should answer:

It there a book on CVS?

You can download the pdf from http://cvsbook.red-bean.com/ or buy it through that page.

How do I add my code to CVS?

  1. First you need to apply for a CVS account. Make sure you read and understand the application page and the CVS Usage Policy.

How do I "move" my checkout?

Your local CVS checkout is simply one "instance" of the code in the central repository. If you would like to have your checkout "moved" elsewhere you only need to do a regular checkout of your module from the new location, but make sure you do that with your CVS account information and not as anonymous. Otherwise you won't be able to commit any code.You can follow the directions as shown in the Logging in to CVS section of the Quickstart guide and then do a straight checkout command:

cvs checkout -d MODULE_DIRECTORY contributions/modules/MODULE_DIRECTORY

I originally created a dev release (e.g. 6.x-1.x-dev) that points HEAD. Now I

Syndicate content