You are here

Drupal 7

Drupal 7 xmlsitemap problems solved

Wiki Terms: 

Did you get a nasty error from your Drupal 7 sitemap module that looked like this:

db_query in Drupal 7

Wiki Terms: 

Here's a linkback for a nice guy who's made a db_query cheat sheet for Drupal 7.

http://www.drupaler.co.uk/blog/drupal-7-cheat-sheet-database/493

Also here is a simple drupal 7 query:

I'm releasing a Wall module for Drupal

Wiki Terms: 

Today I will release a copy of The Wall for Drupal. It mimics Facebook Wall functionality. It utilizes the user relationships module so you and your friends can each have a wall to follow each other. A screenshot is attached. This module is being refined but it is very usable already. It will be used at Babson College.

To install lamp with PDO on Ubuntu (worked on rackspace server)

Wiki Terms: 

To install lamp with PDO on Ubuntu (worked on rackspace server)
http://churchit.com/php-pdo-errors-while-installing-ubuntu-10-4-php-5-3-... (here's a linkback for this guy that saved me from loosing even more time on this since apt-get didn't install pdo)

sudo tasksel install lamp-server
sudo a2enmod rewrite (to enable mod rewrite)

Drupal 7 update a user using rest, curl and services module

Wiki Terms: 

Again there's a bug it seems that the first element of the array I pass in to the services module gets thrown away.

Drupal 7 create a user using rest and curl

Wiki Terms: 
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://base_url/user/login");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP script');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "name=username&pass=password&form_id=user_login");
ob_start();  //dont print out this output 
curl_exec ($ch);

curl_setopt($ch, CURLOPT_URL,"http://base_url/drupal7/test_endpoint/users");

Drupal 7 connect to Drupal with curl and use rest services

Wiki Terms: 
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://base_drupal_url/drupal7/user/login");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP script');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 
"name=username&pass=password&form_id=user_login");
ob_start();  //dont print out this output
curl_exec ($ch);

Writing regular old JQuery the regular way in Drupal 7

Wiki Terms: 

This doesn't use the Drupal behaviors or attach detach stuff, just plain old jquery straight up:

(function($) {
   $().ready(function() {
     alert('hello');
   });
   $('#submit').live('click', function(){
	      alert('ack!');
	    });
})(jQuery);

this works and says hello to you on page load, and upon clicking a submit button wrapped in a div with an id of #submit:
it says 'ack!' to you

Note you only need to wrap your javascript one time with the

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer