Skip navigation.

Drupal

Drupal php code snippet to find stealth spam

Another friend of mine was deeply affected by the stealth-spam problem that I described in the previous page in this booklet.

In order to help them find affected comments, I wrote the following php code snippet for their Drupal 5 web site (the code should work as is for Drupal 6).

<?php
$result = db_query("SELECT c.cid, c.nid, c.uid, c.subject, c.timestamp, u.name, n.title FROM {comments} c
JOIN {users} u ON u.uid = c.uid
JOIN {node} n ON n.nid = c.nid
WHERE c.comment LIKE '%%href%%' AND c.status = 0 ORDER BY c.timestamp DESC");

Drupal administration

Here are some notes about common administrative tasks that often confuse new Drupal administrators.

Drupal: content types

Introduction

One of the first decision to make when setting a new Drupal web site, is to decide which content types to set up.

The content types define what kind of content will be added to the web site: blog entries, forum topics, images, book reviews, etc.

By default, Drupal comes with two content types: page and story. A 'page' can be used for simple, static web pages like an about page. In a single user web site, a 'story' can be used as a blog entry.

Lean PHP with a Drupal developer

Introduction

I have no intention of writing a PHP tutorial. Many already exist around the web including, obviously at php.net.

However, as I develop Drupal sites, I often share some PHP scripts with webmasters. One has expressed the desire to learn PHP. This article is then a small guide on how to make the most of what's already available on the web, and also using my PHP code snippets as a basis for the curriculum.

Identifying various elements within a script

A PHP script that I write for a Drupal site would typically contain several of the following elements:

Choisir le bon outil pour le site communautaire (SPIP ou Drupal)

Ces dernier temps (fin 2005 - début 2006) il est beaucoup question de refaire le site communautaire de la coopérative d'hébergement Ouvaton.

Le choix qui doit être fait en premier

La première chose qui doit être décidée, c'est le CMS (Content Management System) ou outil qui sera utilisé par le site.

Ce choix est important car une fois fait, il est difficile de revenir sur sa décision et de refaire le site entier afin d'utiliser un autre CMS. Les questions de migration d'un système vers un autre sont toujours un vrai casse-tête, même pour un webmestre averti.

Donc, avant même de parler de design, look et autres fonctions accessoires, il faut:

Créer une page d'accueil en fonction des besoins du site

La plupart du temps, la page d'accueil est la première page d'un site qu'un visiteur voit.

Il y a deux sortes de visiteurs: ceux qui visitent pour la première fois et qui ne connaissent à priori pas très bien la "personnalité" du site, et ceux qui reviennent car ils trouvent le site intéressant ou utile et viennent chercher plus d'information.

Les besoins de ces deux types d'utilisateurs sont assez radicalement différents, et c'est souvent le rôle de la page d'accueil du site de pourvoir à ces besoins contradictoires et à diriger sans trop tarder les visiteurs vers les pages qu'ils recherchent.

Syndicate content