drupal

Drupal: If statement for page.tpl.php (Depending on page section)

I want to use the if statement to select specific pages that have <body class="section-category"> and output custom content for only those pages. My PHP is not very good and I hope this is a very simple task to do. Can anyone give me a tip? ...

How can I add a summary row to a Drupal View?

I've built a view (Drupal 6.x, Views 2.x). I'd like to be able to add a summary row at the end of this view — total up several columns and include the totals in the summary row. How can I do this? Is there some Views data-altering hook I can implement, to change the constructed data (before it gets themed)? (Note that I can't use vie...

On redirection does the redirected page gets processed?

I put redirection code on the top of a page which has bootstrapping code below. Does redirection spawn a different process making the redirecting page process as a background process or it kills the current process entirely? Im using header() for redirection but surprisingly the remaining code below header() which required database con...

Drupal Node Form Incomplete POST Data

Hi buddies, I'm working on a drupal 6 site that needs multiple node forms in one page, the problem is when I submit one form posted data is not complete! I mean some fields of the form are not exist in posted data, i checked this with tamper data (firefox addon) and also print_r($_POST) at first line of index.php. but any from in its on...

Is there a way to add "send mail" functinality to Drupal on a site without SMTP server?

I have a (testing) Drupal 6 site on a free web hosting platform, which unfortunately removed SMTP support for free hostings. Does any one know whether there's a way to give Drupal the ability to send emails on a site without SMTP server, e.g. via the public Gmail's SMTP server? can "sendmail" help in this case? ...

Drupal six or seven for a new job platform - or a different framework?

For a client we are going to build a platform for specialized artists where customers can find contractors. This involves building a job board, logins and profile pages for different roles, a quite complex admin interface for managing and charging the deals. We have now done the wireframes and specification, but are still not sure about ...

Programmatically add user forum permissions in Drupal

I'd like to programmatically add user forum permissions in Drupal. Do I have to use ACL module? Is there any example out there, as the documentation is a bit thin? ...

Drupal SQL "Select count distinct"

Hi can someone help debug this? Currently my script throws this error "Parse error: syntax error, unexpected '=' in includes/common.inc(1695) : eval()'d code on line 38" and I've narrowed it down to this SQL statement. It appears that counting results rows in Drupal isn't as straight forward as I'd hoped. $sql_checkIP = "SELECT COUNT(*...

Drupal module menu item not showing in menu primary-links

I'am trying to get a menu item to show in the 'primary-links'. i've read this, but that is not working. What am I doing wrong? /** * Implementation of hook_menu(). */ function modulename_menu() { $items = array(); $items['test'] = array( 'title' => t('test'), 'description' => 'some description', ...

Best approach for RDF output CMS

Hi, Can anyone recommend a good CMS which will output PURE RDF documents (I don't just want HTML pages with RDF properties). I basically want to have a database containing some data and have the CMS format that into pure XML RDF documents. I know Drupal has limited support but this seems to just add RDF attributes to HTML elements. An...

Drupal facet change layout

Is there any way to change the layout of a facet? I know you can create a file in the template dir named: block-apachesolr_search-[field].tpl.php The problem I am having is that at this stage the html in the block variable has already been created. Is there any way to change the html or just get the elements of the facet? Thanks!! ...

Drupal is extremely slow handling simple AJAX calls

Hi, I wrote a simple AJAX callback function in Drupal that performs a query to the DB and returns a JSON formatted string. Nothing fancy, the standard AJAX declaration in the module with a modest amount of information (less than 4KB). The query to the database takes 52ms. Drupal adds around 320ms of overhead for a total of 370ms + laten...

How can I access a user role in Drupal from a separate application?

Is there a plugin/standard HTTP API for accessing user roles/permissions in a Drupal 6 instance from other applications, e.g., on different hosts? Our organization uses Shibboleth to allow easy authentication across all our hosts, but I'd like to use our central Drupal 6 installation to manage user roles rather than storing roles data i...

How do I set a MySQL field to be the dynamically generated value of another field?

I'm mucking around with drupal, and it has two fields called nid and vid on its node table. Every record I look at seems to have the same value for both nid and vid. I'm hacking around and inserting nodes the non-drupal way, and I want to make sure vid is set to whatever value nid has. For sake of explanation, here's something that I'd...

Using Javascript (Google Visualization API) with Drupal Form API

The situation I am implementing a few forms using the Drupal Form API. As a result of user selection i need to display a visualization (area chart, time line, etc) where i have to load the google's JS libraries and send data to display the visual in a div element. What I have Done: I have tried to load a local JavaScript file(this in...

Get the user id of the user you are viewing (as admin)

I'm logged in as admin, and go to view a user's account page. How can I get the id of the user I'm viewing, rather than the $user->uid (which would be the admin user id)? ...

PHP get path and all subpaths (Drupal)

I have a hard-coded menu in Drupal (as it's too complex for the standard Menu system in Drupal). I would like to be able to say: If this page is contained within the /about/ directory, apply the class "active", so that all new pages created within this directory automatically highlight the current section. Currently I have: $current_p...

AJAX + PHP from with jQtouch and drupal

Im working on a drupal site that uses jQtouch (for iphone), and im trying to make a search that doesnt reload the site. I think the javascript/ajax part isnt working. Im having problems finding out if the data from the php file is actually comming through, at the moment only the js that empties the search-results is working. Apperently j...

Sharing data with blocks

I have a page that displays some data. The source of the data is not Drupal nodes, so Views is of no use me: function mymodule_main_page($arg1, $arg2, $arg3) { $results = call_remote_api_and_get_lots_of_results($arg1, $arg2, $arg3); return theme('mymodule_page', $results, $arg1, $arg2, $arg3); } My module also displays a block. Th...

Drupal 6 - Organic Group Invites

Organic Group invites/ Is it possible for a registered user (user1) to create a Group node, but instead of (user1) becoming the admin of that group as what usually happens, (user1) has the option to send an email to a non member. The non member then has the option to register, and noce registered has the option to accept the invitation...