drupal-6

How do I 'unhide' menu links to unauthorized content in Drupal 6?

The Drupal 6 menu module hides links to content that the current user does not have permission to access. This makes sense, but there are times when you may want links to be shown and go to a 'you are not authorized to view this content' page (e.g. for marketing purposes). Is there an easy way to get these links to show? I understand t...

Drupal - Relationship of CCK fields and content types to performance?

Hello, I am helping someone with a Drupal 6 installation, and they are very distressed by the performance of the site, even though they are only in the phase of defining content types. Just loading the Modules list can take over 30 seconds, and importing a content type took close to 3 minutes. This is installed on a large shared UNIX s...

Running hook_cron with administrator privileges in Drupal 6

Is there a way to allow hook_cron to run with administrator privileges -- e.g a sort of sudo hook_cron() as it were? This question is a follow up to my earlier question trying to diagnose why hook_cron() functions invoked by /drupal/cron.php run differently that the same functions invoked by /admin/reports/status/run-cron. My particul...

drupal hook functions and their arguments

I'm reading through Pro Drupal development right now, and an example on page 82 uses the following function: function menufun_menu_link_alter(&$item, $menu){ if ($item['link_path'] == 'logout'){ $item['link_title'] = 'Sign off'; } } I understand that I can find out what parameters "hook_menu_link_alter" takes by looking ...

How can we enable user's thumbnails on their drupal content?

Hi, everyone. I am going on making a Drupal site matches with my requirement. A requirement describes that on each node, such as Blog or Forum, except publisher's name and published date below the node's title, should show the user's thumbnail (similar to avatar in Facebook or Twitter) too. I thing there is an existing module for this ...

Theming Views 2 Exposed Filter pointers needed

How can I theme the Filters Exposed in Views 2 ? As of now the input fields (text fields) of the filters exposed are too long and protruding out of the webpage. Please Suggest of some way to do this. While this can still be taken care of I also wish to know if its possible to somehow .. have drop downs, checkboxes etc displayed for the e...

Drupal: where to display custom search results

Hi, I built a simple block module with a select box (where a user can select a certain type of user or project or og group) and can fill in a search term. At submit it queries the nodes that have theses tags. The results, links to user profiles or nodes, have to be printed on the page. I dont know how to print the results. I want to...

Get Drupal Paths During node 'insert' operation with Pathauto enabled?

I'm writing a module that interfaces with Google Base. It needs to insert a link to the page that the item is on, however, this item has no path until pathauto runs. How can I either make sure pathauto runs its hooks before my module does, or get the path that will result from pathauto?. The solution needs to be generic enough to wo...

Pushing/Migrating your local Drupal site to a live-site.

I have installed drupal on my localmachine(ubuntu, Xampp), at localhost. Path and Pathauto modules are active (a module to produce friendly URLs). Migrating/Pushing my local install to the www.mysite.com Exported SQL from phpMyadmin(localhost). Made a new DB at live site (I think a different name from the localhost-DB does not cre...

print_r to get object methods in PHP?

I'm working with Views 2 in Drupal 6, and I am having difficulty finding documentation on the methods of the View object. Is there any PHP function like print_r that outputs methods as well as fields? ...

Drupal 6: Programmatically Altering User Values (how do you use profile_save_profile??)

I've been trying to figure this out for quite some time without success. foreach ($users as $user) { //list of users to act on $by_user = views_get_view_result('attendance', 'page_3', array($user->uid)); //view containing info about this user $edit = array('profile_attendance_short_term' => substr(count($by_user) / count($general), 0,...

How can I rewrite a specific URL?

I want to rewrite the following urls: node/add node/edit etc To be something like - content/add - content/edit I also use the prepopulation model, and would love to able to rewrite this URL: node/add/single-gallery-image?edit[field_gallery_node_reference][0][nid]=48 To something like this: content/add/image?n=48 Is this po...

Encode ALL urls in Drupal?

Is there any way to encode ALL urls in Drupal? I.e. Instead of something like this: - www.mysite.com/node/add/blog Will turn the URL into: - www.mysite.com/9595kfjfj4fmvmvk4m4mfmkfk44kfk ? ...

Drupal 6: Hook for altering help field in a form

I have a form, and want to programmatically alter the help text that displays at the top of the page. Is there a hook available to do this? EDIT: by "help text", I mean the text entered into the CCK form at: admin/content/node-type/sample-form Above the textbox, it is labeled: Explanation or submission guidelines: The textarea h...

Organizing a Department based site in Drupal

I'd like to migrate a large set of static pages to a Drupal site. The first problem I'm coming up against is that most content is structured under a department. A department page would have a list of most content in the center and then up to 3 sidebars, with the department info, additional links and maybe one more sidebar with some ...

Drupal 6 Views 2: Setting Date Arguments

Passing uid as an argument works fine with this code: $bouts = views_get_view_result('Results', 'page_1', array($user->uid)); The key line in views_get_view_result that sets arguments is: $view->set_arguments($args); But what about passing date ranges? Also, if something is specified as a filter on a view, is there a way to proram...

drupal 6 how to automatically add content type to parent in menu

Is there a way to make every content type default to the parent in the menu. ie say i have content type called "cats" . How do i make all "cats" automatically sit inside "pet" menu item. Also can i alphabetically sort "cats" in the menu ...

BCC option not working in Drupal Mass Contact v6.x-1.x-dev

Hello all, I'm having the following problem and was wondering if anyone is also and what they did to fix it. I'm trying to use the Mass Contact module in Drupal to send out emails to all users of my site but hiding the users' emails. I can get it to send without using the BCC option but when I have it checked, the drupal message says...

Drupal 6: how to create a block that displays random images from a folder?

im trying to create a block that shows a random image from a pool of 20 in a dedicated folder, inside /files/. the first step i guess is creating a view that outputs a block. but afaik its only possible to display cck fields in this block, and not make it read from a folder on the server? if not, what's the best way to go about this? F...

How to store session/cookie in Drupal 6 on the computer of the visitor

Hi, I have created a search for a client website using Finder module in conjunction with Views module. The problem is that my client wants that each time a user selects and searches for the businesses in a certain area, then the same should be stored as session or cookie on the computer of the visitor. This would ensure that a repeat vi...