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

Force username to be email prefix

Hi,

I'm running a website where all the users whom I want to have access have email addresses in the format firstname.lastname@suffix.com

I've found how to restrict registration to only those with @suffix.com, but I want all the usernames to be firstname.lastname.

If it's not much more difficult ideally I'd want Firstname Lastname.

Any ideas?

Thanks

Riocard

list of posts for each user

Hi, I'm not sure if I'm doing something wrong, but when a user login into de administration panel, he can see and edit all the articles, his own and the other users... it is possible that he only may see a list of his own articles only?

By the way, hoy can I build an author's page with his data and all the articles posted?

Thanks

Question about proper way to identify if current node is home or taxonomy term listing

Hi All,

I used some custom code that I found here:

http://drupal.org/node/45050

To add next/previous links to my image galleries.

silly question about checkboxes and form api in 4.7

i hope this question is not too silly:

How do i set a checkbox to default to checked based on initial value? I have some checkboxes, and what i need to do is have them appear checked if there is an inital value. Now, i could write code to do this of course.. but there are soooooo many of them ... i dont want to write a ternary or conditional statement for each one unless i have to ... is there any help available in the api?

Use profile module with privatemsg

Hi,

I've recently set up a small site on our intranet for twenty people to work collaboratively. It's been working great, but I'm now stumped when it comes to how we set up the privatemsg.module to fit the rest of the site.

On all of our other systems we use payroll numbers to log in, so that is what we've done with drupal. I've activated the profile.module and we have two fields, profile_firstname (fid=1) and profile_lastname (fid =2). This has worked fine using the profile_load_profile function to display actual names on posts and comments.

But I'm stumped as to how to do the same with privatemsg.module!

This is the code in question:

$result = db_query("SELECT DISTINCT(name) AS name FROM {privatemsg} p, {users} u WHERE p.author = u.uid AND recipient = '%d' AND p.timestamp > (UNIX_TIMESTAMP(NOW()) - (3600 * 24 * 30)) ORDER BY name", $user->uid);
  while ($name = db_fetch_object($result)) {
    $name = check_plain($name->name);
    $form .= "<option value='$name'>$name</option>";

I have made a minor change already, which is instead of the 'contacts' dropdown displaying only those users who you have received messages from recently, it displays all users (this is fine with twenty people). The amended code looks like this:

<?php
$result = db_query("SELECT DISTINCT(name) AS name FROM {users} u ORDER BY name", $user->uid);
while ($name = db_fetch_object($result)) {

phptemplate, flexinode, and attachments

Hi all,

In the phptemplate documentation for modifying node.tpl.php, I don't see the attribute to include attachments.

I have created a file (node-flexinode-6.tpl.php) and created a custom display of the individual elements (i.e. not using the $content variable). I can get all of the information to be displayed, but my attachements are not shown.

Is there a function to call, which will display attachments if there are any? What is the best way of handling this?

Thanks!

Pages

Subscribe with RSS Subscribe to RSS - Post installation