drupal-6

Drupal CCK: how to output a node teaser with its fields?

Hi, In a module of mine, I'd like to output the node teaser. The node has CCK fields, and I'd like them to be displayed accordingly to the visibility settings you can choose in the content types / field settings administration area. But when I do: $html = theme('node', $n); the resulting teaser won't contain the CCK fields, only tit...

Removing a single CSS element for one URL; Drupal 6

I have my Drupal theme set up with a notebook spine image in the middle, giving it a 50/50 page split. The problem is, on a few pages, I want to get rid of that notebook spine and use the whole page. I have looked around on Drupal.org, but no luck. Would this be an edit to the page.tpl or style.css? Thanks, Tim ...

How to display a list of nodes and details of a single node in Drupal

I would like a page that displays a list of nodes (I can do this part with the Views module) and then also displays the details of a single node below the list. Ideally the details will update via Ajax when a node in the list is clicked, but reloading the page would be fine for a start. I'm just starting to get into Drupal and the numbe...

How do I validate file type in Drupal 6 with file_save_upload?

I am working on a module that takes a user-uploaded CSV file. Code looks like this: function foo_form_submit($form_id, &$form_state) { $validators = array(); $dest = 'sites/phoenix.dev/files'; $uploaded_file = file_save_upload('upload', $validators, $dest); //some other stuff } As you can see, I don't pass anything in to validat...

Drupal 6: Altering a CCK form on a page created by the menu system

Hello, I'm a drupal newbie (but experienced with PHP). I've created some functions to display pages and mapped them onto urls using menu functions. In one of these functions, I'd like to grab a form for a CCK content type, have my way with it, and spit it out onto a template. So I have a function projectadmin_create_page(), which gra...

Customize WebForm module in Drupal

I'm new to Drupal 6.10 CMS and PHP too. I'm creating my website with drupal and I have found a module called Webform I like it, it's pretty easy to create forms with different types of fields and file uploading. The one thing that i can't figure out is how to add Rich Text before all fields. Something like introduction to the form. This...

how to print custom values in custom template in drupal

HI i have created a content type call "mycontent" it has 2 fields Label: MyText , Name: mytext , type: Text Label: MyImage , Name: myimage , type: Image All good so far, I have create a custom theme and inside this i have included 'node-mycontent.tpl.php' my quesiton is, how do i get at the variables. I wish to $mytext I can rende...

Drupal 6 Views: Constraining fields which are not the "primary" node

I'm making a custom list of nodes and their comments. I'd like to be able to both constrain the number of nodes (easy: Items per page refers to nodes in this case) but also constrain the number of comments displayed per node (e.g. the 5 most recent): Node number one Comment 1-3 Comment 1-2 Comment 1-1 Node number two Comment 2-7 Com...

Drupal 6 won't send email, for account activation etc.

I'm running my own LAMP server locally. Something i need to setup? Should it be able to send email using php-mail, without havin to configure smtp. ...

Unique id on the 'a' tag of a menu item in Drupal

I'm trying to generate unique id's on the 'a' tag of the menu item so that I can implement Popups API. This is what my function in template.php looks like: function phptemplate_menu_item_link($link) { if (empty($link['options'])) { $link['options'] = array(); } // If an item is a LOCAL TASK, render it as a tab if ($link['t...

How to validate a cck field before printing?

I have a custom content-type with a text field that has several allowed values. There also is a printer friendly link to print.node-XXXX.tpl.php. If one particular allowed value is selected, I do not want the user to be able to print the content without going back and editing / re-selecting a different value. How can I set up a valida...

Making Drupal 6 reverse node order via code in the front page.

I'm trying to get Drupal 6 to reverse the order in which the nodes appear in the frontpage. I'm pretty much using "Story"s as a blog engine and so far it has done it's job pretty well. I'm a bit annoyed though at the fact that nodes are listed in reverse chronological order. I mean, granted, if you want to display multiple node previews ...

Drupal vote_up_down module reporting incorrect points

I am working on a project using Drupal 6 (6.11 at the moment, haven't yet upgraded to 6.12) and part of the core functionality is the ability to vote on nodes. I'm having some rather weird behaviour that has taken me an age to track down and now I have, I still can't fix it. This is what I've managed to figure out so far: The template...

Where do i 'setcookie' to record http_referer in Drupal 6?

I've got my php working to set a cookie storing the http_referer the visitor came from, but how(or where) do i put this code in my Drupal theme/installation, to make it set cookie when a visitor first lands on my Drupal site? ...

Drupal node_save no longer returns $nid, so how do I get it?

I have code like this: ... setup $issue object ... $node = node_save($issue); print_r($node); The node is created successfully, and everything works fine...but nothing it returned from save_node(). Older docs indicate that it returns $nid. Several discussions and tickets indicate that in recent Drupal versions the node object is re...

Drupal OG Profile

Is it possible to make a group profile page as for users in Drupal 6.x? if so, how? thanx ...

Drupal node_seach

I'm working on a RSS feed where full text search has to be offered - you search from some box, and get the result as a RSS. I've been trying to get node_search and do_search working but I'm missing something... but what? As far as I can tell, something like $find = node_search('search', 'type:article'); should give me a result containin...

Drupal 6 and Backlinks

Just installed Drupal 6, CCK 2.3 and Views 2.5 and I'm trying to get backlinks. Every tutorial I see says that there is a backlinks view by default and I should activate it, but there is none. The only available views are: archive, comments_recent, frontpage, glossary, taxonomy_term & tracker :( ...

Weird IE7 js issue in Drupal

In IE 7 when I click on any javascript link for example "< a href="#" onclick="toggleGroup(); return false;" id="slick-toggle">View Classrooms" the page will refresh. This is occuring in a drupal project I inherited. This problem doesn't happen in IE7 when I run the same script outside of drupal. Even in the drupal admin onclick event...

Add fields to the Site information section on Drupal 6.12

Hiya, I've been shifting through the drupal documentation and forums but it's all a little daunting. If anyone has a simple or straight forward method for adding fields to the Site information page in the administration section i'd really appreciate it. As a background, i'm just trying to add user customizable fields site wide fields/...