Drupal is up and running but how do I ...?

Help with login_destination

hi all,

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");
}

What I am getting is that no matter what role a person is, they get sent to http://localhost/node/%24node-%3Eid

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.

Google Adsense not working

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.

If you want to take a look at my site, it's Heebie Sudoku

No file upload for CCK?

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.

Or am I missing something?

Error using Events Module - Warning: array_keys(); Warning: implode(); Warning: You have an error in your SQL syntax

Howdy all;

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

Optimizing Server Performance

For those that have control over their server configuration here goes my suggestion:

- Install APC Cache;
- Activate MySQL's Query Cache.

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

Imporrt Styles to Template.php?

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.

Pages

Subscribe with RSS Subscribe to RSS - Post installation