I've recently upgraded to drupal 5.1 and installed the latest adsense module. I believe I followed the instructions exactly however I cannot get my site to display the ads.
I'm trying to find out if there is a module or other "hack" to allow the following situation:
I have setup a role on my website that is allowed access to certain features that normal users are not allowed to access.
What I would like to do is to have a feature where, upon registration, if a user enters a special code (like a bonus code) they get added to this special role (and therefore have access to these special features).
I've got a module on the go that requires listing of content in database tables. I want to create a function where I just give it the table and fields I want, and it will return a nicely formatted HTML table.
Like so:
/* In my code */
$table = {mymodule_table};
$fields = "name:age:weight";
$output = mymodule_display_table($table, $fields);
/* The function */
function mymodule_display_table($table, $fields) {
// use the parameters passed to identify which fields we want to retrieve.
$fields_array = explode(":", $fields);
$header = array_values($fields_array);
foreach($fields_array as &$value) {
$value = '$row->' . $value;
}
$query = "SELECT * FROM " . $table;
$queryResult = db_query($query);
while ($row = db_fetch_object($queryResult)) {
$rows[] = $fields_array; //Here's where the trouble is... This outputs the correct stuff from $fields_array, but as a set of strings, not as variables.
}
$fullTable = theme_table($header, $rows);
return $fullTable;
}
My questions are:
1.) Is there a 'more drupally' way of doing this? If so, how?
2.) My difficulty lies in the fact that I'm working with two arrays - I need to generate an array of fields to be passed to the $rows[] array, which will then generate an array of rows for the HTML table.
I have two roles in my website. For one role I want them to create account automatically, without pending approval by any administrator. BUT, for the other role, I want them to be pending to approval by administrator.
I am using rolesignup.module so I am able to catch different roles when they create their accounts in the website. Actually, previously they choose what role they want to be. And, depending on what you chose, I want you to approve your account or not.