Drupal is up and running but how do I ...?

snippet help: if no news image uploaded print default picture

I'm trying to write a snippet that will check if an image has been loaded into a cck image field and if not then print a default image. I've been having a look at the user image code in the user module to try get some clues but am a bit stuck on how to apply the same principals to get what i need - i'm afraid this is my first attempt at php coding and i would really appreciate any help!

This is the section of code from the user module that performs the kind of thing i want but i'm not entirely sure how to adapt it:

function theme_user_picture($account) {
  if (variable_get('user_pictures', 0)) {
    if ($account->picture && file_exists($account->picture)) {
      $picture = file_create_url($account->picture);
    }
    else if (variable_get('user_picture_default', '')) {
      $picture = variable_get('user_picture_default', '');
    }

    if (isset($picture)) {
      $alt = t('%user\'s picture', array('%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous')));
      $picture = theme('image', $picture, $alt, $alt, '', false);
      if (!empty($account->uid) && user_access('access user profiles')) {
        $picture = l($picture, "user/$account->uid", array('title' => t('View user profile.')), NULL, NULL, FALSE, TRUE);
      }

      return "<div class=\"picture\">$picture</div>";
    }
  }
}

and this is the section of code in my cck template that printed out my news image:

<head> How Do I get access to the head tags?? </head>

Hi,

Sorry, this may be a bit of a dumb question, but i've searched the forums with no luck, and had a squizz through the handbook, but cannot find what I need to know.

How/Where can I add some code to the tags??

I need to add a small parsing script so I can track dynamic pages with my tracking script.

Any help would be hugely appreciated!

Thank you for your time!

book page with additional data

I have a list of contestants, each in a book page for easy navigation. I want to add to the individual's page a list (title+teaser) of his recent posts (blog,stories, whatever).

I can get a list of ALL the posts (of all contestants), but how do I get the userid of the "currently viewed" contestant to make the connection ? Each contestant has a profile page as well; no prob to get the same data in his profile using the code in node 26478 (Custom user profile page with (x) latest weblog entries of that user). I cannot seem to port the code to do this on the book page.

Users

Migrating Users from database i m using to drupal database using version 4.7

Embed Filter ?

I see there is an embed filter now for places like ifilm etc but i'm really wondering why. I can embed these directly already so am i missing something here ?

Also i'm wondering about the security of enabling

, and in my html filter. Is there a potential security risk here ?

How to get e-mail updates of forom posts?

Hello guys.

Can I get e-mail notifications of certain forum posts in Drupal? I'd like to do that on drupal.org (So I can get e-mails when people answer my posts). But I'd also like to enable this to my own drupal users.

Seems like such a basic requirements or forums. Can I do that in Drupal??

Ron.

Pages

Subscribe with RSS Subscribe to RSS - Post installation