User login

Living Conversations

Change comment authorname and date in Drupal

In Drupal, you can set the user (author) and date of a comment to something other than yourself and that moment, if you have administer comments permission– just not while posting.

If you click the edit link for the comment after posting, there will be a collapsed "Administration" section where you can change the username and posting timestamp, just like you can for a node.

Any call for allowing this on posting as well?

Resolution

Overriding Fivestar star images with just CSS (and, well, graphics)

Copy this (from fivestar's CSS) into your theme's styles.css file, and change the background url to match your own graphic file:

div.fivestar-widget-static .star {
  float: left;
  width: 17px;
  height: 15px;
  overflow: hidden;
  text-indent: -999em;
  background: url(widgets/default/star.gif) no-repeat 0 0px;
}

Variables available in _phptemplate_variables for node templates

The variables you get to play with while setting new variables are nice.

So you can do switch or if statements on $var['type'] to only provide certain variables to certain node types.

<?php
function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'node':
        drupal_set_message('<pre>'.print_r($vars,TRUE).'</pre>');
        break;
  }
  return $vars;
}
?>

IE6 Transparent PNG Fix the Drupal Way

This is the IM conversation on implementing a jQuery ie6 PNG fix. Dan's elegant solution will go below... i don't quite follow where he put everything...

dan:
http://jquery.andreaseberhard.de/pngFix/

just dump it in the theme folder?

benjamin melançon:
yeah

and http://api.drupal.org/api/function/drupal_add_js/5

A silly trip through the innards of views theming: output plain link with no HTML

Spoiler: if you want a plain value of a field to be output plain without surrounding <div class="field-item"> tags, make sure to select "Do not group multiple values".

Now for the masochists, let's follow how I found this out the really, really, really hard way!

Amazing what's available to a simple view in Drupal 5.

A views-list-agaric_view_name.tpl.php with the following sole contents:

Use just the body field in the view of a CCK node

This requires theming the view. Views does not know about or provide just the raw body, so you have to theme the view, load the node, and grab the body field.

In your view-....tpl.php:

<?php
 
$fullnode = node_load($node->nid);
print check_markup($fullnode->body, $fullnode->format, FALSE);
?>

THIS HAS SIGNIFICANT PERFORMANCE IMPLICATION FOR MANY NODES WITH MANY FIELDS

Display a Drupal login form anywhere with PHP, including in page content

Update: I gave slightly incorrect code, I'm pretty sure swapping out 'user_register' to put in 'user_login' will work just fine:

dan hak 3:08
whats the code for the login block

benjamin melançon 3:09

Filter a view on the existence of an image for an imagefield field

No this won't work, I do not think filtering per-result row can be done through arguments:

<?php
if (!$field_user_picture) {
  $view->filter[0]['value'] = TRUE;
}
return $args;  // not that this will do anything!
?>

Begin the journey in #drupal-support

ben-agaric:
how can one filter a view based on the value (given or empty) of a CCK field -- CCK image in this case -- ?

Escalating directly to #drupal-views:

Syndicate content