This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

db_query

I am creating a module and need to send a prepared sql sting to the database but im having trouble with db_query.

For example, if I have the database.4.1.mysql in a sting, how can I send that to the database so a new database can be created.

Is there another way to send long multiline sql commands to the database?

E-commerce Module With Gallery2

I'm putting together a new site using Drupal and Gallery2, and I've been running in circles trying to figure out how to effectively sell photographic prints through the site.

Location module not saving any data

I searched for an hour and can't find anything(although I've tried everything).

Actions for user roles?

What I want to do is have a simple way for a registered user to request a role assignment. Out of the box it looks like Drupal makes this a manual process in that the administrator can edit the user and assign a role, but there's no specified process whereby the user makes the role assignment request.

My use case is that I have some content types which I want certain user roles to be able to create. The content types are defined using CCK. There could easily be hundreds of users for which the role applies. Since there are so many users I'm leery of the burden of manually editing all those users to have the role, and would rather have a streamlined process.

Hence, the actions module offers a way to streamline processes.

But the thing I notice is ... the actions module seems focused on nodes, not users. Since a $user object is not a $node object then the actions module is probably not applicable to users. In particular the Actions and Workflow video at the lullabot podcast series is not applicable, since they show the actions magically appearing in the edit form of a $node.

Ideas?

BTW, I have a workaround of using the contact form, and specifying a contact type of "I am a X" where X represents the role in question. I'd still have to manually edit the user however, but at least it offers a method to clearly state to the users ... if you want to do X then go to the contact form and say "I am an X".

looking for an autolink module

Hello everyone,

Is there any module out there that will automatically generate links (either to nodes or external) for every instance of a certain word on a site. For example, I want all the instances of th word 'Drupal' to link to http://drupal.org. Does something like this exist for 4.7.2?

Adding Search to the Aggregator

In answer to a thread in general discussion, I shared code that enables search for the aggregator, but it's flawed in numerous ways:

With a version of 4.6 it was possible to add search to the aggregator by implementing a search hook in aggregator.module:

<?php
/*
* Implementation of hook_search().
*/

function aggregator_search($op = 'search', $keys = null) {
switch ($op) {
case 'name':
return t('Philadelphia Blogs');
case 'search':
$find = array();
// Replace wildcards with MySQL/PostgreSQL wildcards.
$keys = preg_replace('!\*+!', '%', $keys);
$words = explode(",", $keys);
foreach ($words as $word) {
$word = trim($word);
$title_filter[] = "lower(i.title) LIKE '%" . $word . "%'";
$feed_filter[] = "lower(f.title) LIKE '%" . $word . "%'";
$content_filter[] = "lower(i.description) LIKE '%" . $word . "%'";
}
$filter_query = implode(" OR ", $feed_filter) . ' OR ' .implode(" OR ", $title_filter) . ' OR ' . implode(" OR ", $content_filter);

$result = db_query_range("
SELECT i.*, f.link AS feed_link, f.title AS feed_title, f.url AS feed_rss
FROM {aggregator_item} i
LEFT JOIN {aggregator_feed} f
ON i.fid = f.fid
WHERE (". $filter_query . ")
ORDER BY timestamp DESC", 0, 200);

while ($posting = db_fetch_object($result)) {

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions