I have defined 3 roles - admin, tutor and student. I am also using og so that each student is in two og groups - a community group and their class group. I would like it so that when a student logs in he/she is directed to their class group homepage. I have installed login_destination and have written the following:
function login_destination_get_destination() {
global $user;
$path = 'blog/1'; // default login destination
$rid = 4; // 4 = student role number
$cgrp = 6; // 6 = community group id number
// Get the current student's class group id number
$result = db_query("SELECT g.nid FROM {og_uid} g INNER JOIN {users_roles} r ON g.uid=r.uid WHERE r.rid=$rid AND r.uid=$user->uid AND g.nid<>$cgrp");
if ($result) {
$node = db_fetch_object($result); // get group
$path = "node/$node->id"; // send student to the class group page
}
return url($_GET['q'], "destination=$path");
}
I'm using 4.7.3, local install with xampp (php4) on a pc. Ultimately, I would like the same behaviour when a student clicks on the site logo. Could anyone offer some hints as to why the above code is not working? Thanks in advance.
I've installed the Google Adsense module, and have put a block in, but just the placeholder and not the actual ads are showing up. I've entered in my pubisher id for Adsense for Content starting with pub-xxxxxxxxxxxxxxxxxx.
I can't see a field that I can add to help people upload a file. Sure, the node system provides an attachment field by default, but you can't add any instructions to it. This seems an oversight.
Please help. Everytime I click on an event in the Event calendar, I get the following error message:
Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/media911/public_html/drupal-4.7.2/modules/user.module on line 349
Warning: implode() [function.implode]: Bad arguments. in /home/media911/public_html/drupal-4.7.2/modules/user.module on line 349
I did this yesterday and the results where dramatic!
Before changing this settings: 20.16% CPU, 3.27% Memory, 1.4 MySQL Processes
After changing this settings: 3.67% CPU, 2.86% Memory, 0.3 MySQL Processes
My theme’s style.css file is quickly growing into something monstrous. So I would like to break it apart into easy to manage, custom style sheets that control specific elements, such as type.css, color.css, graphics.css, etc. My question is:
How do I add (import) custom style sheets to my themes template.php file.
Is that a PHP function? What would that code look like?
All comments and suggestions would be greatly appreciated.