drupal

Drupal Search Behavior

I looked into the DP 6 search API and did not see a hook that would let me alter the search keys before they are passed into the search module to execute the search. I want to do keyword expansion on the string that the user entered. For instance, if the user entered 'foo', I want to execute a search for 'foo' and 'bar'. There should ul...

drupal form alter

I'm developing a module which alter display of add/edit node forms. I'm a beginner in module development. I have written following code, it is not working properly. Please tell me what's wrong with this? function hook_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'node_form') { drupal_set_message(t('some message...

How Drupal works?

I have yet to see a comprehensive overview about how Drupal really works. Most of the tutorials are about lame things, like adding a module or configuring a site. Where is a flowchart about how the page gets generated? Most of the documentation is clumsy too. What's the best resource for learning how Drupal really works? ...

Drupal and Ubercart - Add order that customer can pay for online? Bill customer's order without having them manually put it in their cart?

I am configuring a rental website to manage real estate property using Drupal and Ubercart. This site will need to accept rental payments, and IN ADDITION, will need to allow the admin to add extra billing to certain people, for fees, and certain other kinds of things. If they for example, put a huge hole in a wall, and have to pay, or ...

Drupal Form:want to show previous form value as default_value on page

My Goal is if user is submitting this form with "Product Name" value as "YYY". On submit page should reload but this time "Product Name" should show previous valye as default as in this case "YYY". Here is my code... function addnewproduct_page () { return drupal_get_form('addnewproduct_form',&$form_state); } function addnewproduct_...

Drupal - How can I use CCK to keep a local node copy of Aggregator items?

Hey, I received an learning project from my brother that includes: Create a Drupal site that employs Aggregator, CCK, and Views modules in the following way: Aggregator will fetch an RSS feed from an arbitrary source Views will allow you to create excerpts from the Aggregator materials, as well as links to orignal articles Determine i...

RSS <link> tag not appearing in <head> of Drupal view page display output

I have a Drupal 6 site with a view that has a page and a feed display. Both the page and the feed work great. The view just shows content type Story in reverse chronological order- basic blog listing page. While the RSS look good, the page display doesn't include the tag in the header for auto-discovery. I've outputting $head in my pag...

file path from sql query in drupal

I'm wanting to get the filepath ie "/sites/default/files/myfile.pdf" for my file uploads. I'm using the below $row['node_data_field_factsheet_field_factsheet_data'] this returns "a:1:{s:11:"description";s:0:"";}" How do i get the actual path? here is my sql statement. SELECT node.nid AS nid, node_data_field_factsheet.field_factshee...

Drupal Login using parameters for login and password in url

In our application, we would like to make a link to an online help site built using Drupal. The problem is that this site is password protected. We would like to put the username and password in the url, so that the login is automatically made when the user clicks on the link in our application. Is it possible and how ? ...

Drupal views require_once

I'm trying to add some sanity to the chaos that is Drupal by separating files in a fo-MVC structure. Within a Drupal view you can add Header or Footer code in textarea boxes with the option to add "PHP Code". Here is my code within the Header textarea box: Fatal error: require_once() [function.require]: Failed opening required '<pat...

How does one store and retrieve custom session variables in Drupal 6?

Drupal employs a custom session handler that changes the familiar...: $_SESSION['foo'] = 'bar'; echo $_SESSION['foo']; ...behavior. The above session variable of "foo" would not persist from page to page. Many comments and forum entries at Drupal.com raise the issue that Drupal uses a custom session handler for performance reasons an...

What is the best approach to manipulate assets in Drupal from .Net application?

I'm beginning work on a project that will access a Drupal site to create nodes on the site. This includes file uploading, as the project is to allow people to upload pictures en mass to a Drupal site with minimal ado. Note that my application is written in .Net. What I would like to know is the best approach to achieve the same? Based ...

How can I disable Theme Info module in Drupal when it takes up too much memory to access the admin>>modules page?

I'm TEN pages from finishing Using Drupal and I'm stuck. I turned on the Theme Info module to aid in theme customization. However, I can no longer access the admin>>modules page to turn on/off modules (including the Theme Info module). It brings up this white error page that says it tried to access about twice as much memory as is allowe...

Creating drupal pages (nodes) automatically from other (xml) content

Hiya, I currently have a datasource from a client in the form of XML, this XML has content for all the pages that the website we're making will contain. Now after parsing and preparing all this content, does anyone know how we can then (using) PHP automate the creation of a drupal node (including all related fields for that node i.e. C...

.htaccess rewrite of a url [help with rule]

Hiya, I'm trying to rewrite a url of this: http://www.foo.com/bar/baz to index.php?q=$1&d=baz Where bar is not a fixed value, but baz is. RewriteRule ^(.*)\/baz$ index.php?q=$1&d=baz [L,QSA] RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] What i have above kinda works but unfortunately breaks all the includes in the site (css/javas...

Do I need a full fledge content management system?

So I have this website that I'm building and they are wanting to be able to change content and pictures on any page throughout the website. I'm not too familiar with content management systems and don't know if I need a full fledged content management system( joomla/drupal ) or I should just create something. Any suggestions? Also, what ...

Embedded Views in Drupal

I'm trying to straighten out the front page of my drupal-based website. I want to display a static bit of content at the top (no link the way a sticky node would be) and then a list of the most recent posts underneath. Doing a view of all content with the 'static' node stick is pretty close, although I don't want it to summarize the ...

Does Drupal parse hooks that aren't being used?

Does Drupal parse (and/or run) hooks that are unrelated to the content being loaded by the current user? For example, say I had a module foo installed and active with the following hooks: <?php // .. stuff ... function foo_menu() { $items = array(); $items['foo/show'] = array( 'title' => t('Foo!'), 'pa...

Does the order of cases matter in PHP switch statements?

In PHP switch statements, does placing more common cases near the top improve performance? For example, say the following function is called 1,000 times: <?php function foo_user ($op) { switch ($op) { case 'after_update': //Some Stuff case 'login': //Some other Stuff } } If in 990 of the 1,000 of the tim...

How do I access node information from a view in Drupal

I have written a custom view template called "views-view-unformatted--FAQ.tpl.php. How can I access the nodes? The $rows array only holds the rendered content from the node.tpl.php template. Bottom line is this - I want to organize the FAQ's into sections by taxonomy. ...