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

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)) {

Using Hyperlinks to set Order By for columns in a table

Okay, so I have a page that displays a table listing all the books that I have Read. A user can check a checkbox off next to each one. If they submit it the books are added to a different database. Anyways, what I need help with it is allowing the user to order the table by the columns that are shown here (on the same page). I want to just make the column titles hyperlinks at which point they can select a column heading, it'll reload the page sorted by that heading. Reverse order would be nice on second click, but not needed.

I look around for tutorials for this, but couldn't find any or at least not ones that were simple enough for me to understand and apply to my own. Help is greatly appreciated.

Oh and when I say hyperlinks, I guess I just mean look like. I heard there was a way to do it with forms which is fine for me and it basically makes a button look like a hyperlink.

My code for the page:


<?php

global $user;

$db = mysql_connect("localhost", "collin","MYPASSWORD");

mysql_select_db("mydatabase_name",$db);

//add books to database that are checked
$query="SELECT a.book, a.rarity, a.price, a.sid FROM collector_books a LEFT JOIN collector_books_read b ON a.sid = b.sid and b.uid = $user->uid WHERE b.sid IS NULL";

$result=mysql_query($query);
$num=mysql_numrows($result);

$i=0;
while ($i < $num) {
$sid=mysql_result($result,$i,"sid");

Changing the file max upload size in audio/video modules ...

How do you increase the PHP file upload limit for audio/video from 2 megs to 50 megs? (q asked drupal forums)

My server suggested I change the line in the php.ini script to allow 50 megs, and then copy this code in the audio and video module files. I tried this, and I still get the error message 'A file must be provided.' in red.

There must be a way to do this through admin, no? Please help meh!

SAM 3 Radio Website Plugin

this is basic read for starter..

SAM 3 is a radio application which has capabilities to run information to a website via mysql and php
Its runs off any Radio server (shoutcast etc) and has alotta extras

now theres a base website that comes with the program called SAMPHPWEB and has at the moment basic

NOW PLAYING
PLaylist/REQUEST SONG
I had setup more through PHPnuke (but it has a slow start up and basically the code getting old for me)

Pages

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