drupal

How to get Drupal's $base_url to work on a cron job?

Hello there, How to get $base_url to show the correct url for my Drupal site when I'm running a cron job? Do I have to set the global $base_url manually for that to happen? Do I have to run the cron job as a registered user? When I run mysite.com/cron.php by hand everything seems to work fine: $base_url is set to the correct url. Ho...

Repeating escaped chars in a PHP date function, within Drupal6/Views

I am trying to make a custom php date function for use within D6 that will show dates in the correct format for Chinese. I created the date format within the Date API area of D6, something along the lines of: Y\年n\月j\日 In the Date admin area, this correctly display as "2010年10月22日". My problem occurs when I bring this over to Views w...

How to load data to db from csv using LOAD DATA INFILE in drupal

I have tried the below code for laoding the inline file in drupal db $sql = "LOAD DATA INFILE '".db_escape_string($this->file_name). "' INTO TABLE `".$this->table_name. "` FIELDS TERMINATED BY '".db_escape_string($this->field_separate_char). "' OPTIONALLY ENCLOSED BY '".db_escape_string($this->field_enclose_c...

Redirect not working for a drupal multisite installtion

I have a drupal mustisite installation and Im using drupal domain access module. I have sites like www.abc.com and www.cde.com pointing to the same codebase. However, while redirect for abc.com to www.abc.com works, redirect for cde.com to www.cde.com doesnt work? Any idea on how to fix it? Im redirecting using htaccess. ...

How to increase character length for title in views-slideshow module?

Hi All, Im maintaining this Drupal Site which is using Slideshow Views for displaying the featured posts. Its using Slideshow Thumbnailhover SlideShows contribution of 'Views Slideshow' http://drupal.org/project/views_slideshow Module for Drupal. However, even after scanning through the code and browsing though all settings, I cant figu...

Redirects in Drupal for index.php and home in htaccess

Hi All, I have been trying to create redirects for /home and /index.php to the site's base url. I have tried following rules in htaccess but without any effect RewriteRule ^(.*)\index.php$ $1 [R=301,L] RewriteRule ^home$ / Im new to it so kindly bear with me if its a trivial question for the experts Thanks in advance to the wonderf...

How to show site offline message during Drupal Site's MySQL database maintenance

Hi, I need to put my Drupal Site in offline/maintenance mode whence my SQL server is undergoing maintenance. I cant change the settings for offline mode in Drupal database because MYSQL would be inaccessible. Any other method to do it? Thanks in advance! ...

change facet field in drupals apache solr module

Hey! I have installed the apache solr module in drupal. I have the search page returning the facets. What I need to do is to change html given by the module of one of the facets. I want to change it from checkboxes to sliders (using jquery) I know how to create the sliders. What I don't know is how to change the html generated for the...

drupal SQL interface module

Hi, Is there a module out there that would would sort of allow a user to run SQL queries and simple tables to a database directly from Drupal. ? thanks Charles ...

Is it possible with Drupal Views to have AND and OR in a filter set?

I am attempting to build a view with four filters (A, B, C, D). With Views 3 it is possible to select whether you want these filters to be chained with AND statements or OR statements. Is there a way to configure views so as to chain some of them with AND and others with OR? For example, ending up with a query that is similar to: SELEC...

Drupal Form API: Create Form Elements based on the database values (Dynamic Form Creation)

Hello Everyone, I am creating a form where i have to populate "X" form elements (text-fields to be specific) based on values in the database (X number of elements, properties of each element etc). Is there a way to do this using the Drupal Form API or should i start from somewhere else. I tried using a for() loop in the form generating...

Replace %26 in htaccess to something else

Hi all, Basically I'm importing a bunch of pages that have ampersands in the title, from Mediawiki. These are encoded as %26. Drupal, for various reasons, has decided double encode the url it to have it become %2526. I simply can't create the alisis within Drupal so I have to use htaccess tl;dr: I need example.com/something_%26_else ...

Could someone please tweak this php code for me? Drupal code.

I found this code to work on my Drupal site. It outputs the taxonomy terms in a comma separated list. It successfully builds my taxonomy list to look like this: Business, Entertainment, Leisure While that's great, its using the same names to link itself in the url and so I get this: www.yourdomain.com/category/Business How can I make...

file field in drupal cck module

Hello How can I add a file field in drupal CCK ? Thanks ...

Drupal form validation functions

Is there anyway say Drupal to validate form elements like email fields, passwords, numeric fields validate automatically lets say bind a system validator $form['email] = array( '#title' => t('Email'), '#type' => 'textfield', '#validate_as' => array('email', ...), ... ); ...

drupal_render doesn't render form element

I have this code that implements hook_form_alter for durpal search form and adds couple of new elements there. I have also added theme overwrite code in my template.php for the said form. In addition to this, I also pass form elements there. Everything works fine - adds new elements, theme is used;but, here's the problem. When I try to r...

Drupal 6 Using SWF Tools to display an .swf files

Hi, I'm trying to display an .swf file (with an accompanying .flv file) using SWF Tools, which I understand is possible. So far, I have: Created the field "video". Enabled the SWF Tools module (version 6.25). At this point, I'm really stuck. I created a block in Views, but it only displays an anchor link to the .swf file. I've re...

I want to call drupal_execute() for cck fields (DateTime user_reference) but it doesn't save anything in DB

I have a content type as a todo list element. It has some cck fields like deadline (in DateTime format) and assigned_user (a user reference field). I want to use function drupal_execute to create a such node programmatically, but after a full of errors like warning: call_user_func_array() [function.call-user-func-array]: First argume...

How to add tool tip for image in Drupal? Using custom template.

I'm using Drupal 6.x. This is my code on my node-product.tpl.php template. I've created a custom jquery gallery for the products. It works great, but I'm just missing tool tips from my images (both large and small thumbnails). To upload images I'm using a CCK field named field_images. There I input the image titles when I upload the imag...

Translating "layout strings" in Drupal 6

I'm developing a site in Drupal 6 that will be translated to over 10 idioms. For the main content, I'm using CCK + i18n. But there are some text in the site's layout that I'm not sure how to translate. For example, let's suppose that it's a site that sells software. In the page that lists all available software (which are Drupal nodes),...