Hi guys,

Three questions for you. Thanks in advance

1. I am trying to print the blog link of a user as text.
It should look like: www.website.com/blog/username
Here is the code I have... not sure how to add the username part:

<?php print ("http://www.website.com/blog/". $user->uid)?>

2. I am trying to display a link if two things are true: user doesn't have a picture and the profile page is being viewed by the person whos profile it is.

<?php if(!$user->picture && // WHAT GOES IN HERE): ?>

3. When using TinyMCE, why when you press enter does it skip a line?

BTW, is there a drupal php for dummies guide I could take a look at?

THANKS!

Comments

atticus’s picture

#1 - Regarding the path name...

If you are on apache, you can enable "clean urls" in setting page--NOTE: you may need to update your .htacess file (the .htaccess file in the default drupal directory has some instructions). Search drupal.org for more instructions on that.

Once that's working, you can use the pathauto module:

http://drupal.org/node/17345

This lets you set how the path names for node types as new nodes are created. Should do what you want.

Best,
Brent
Wanderings.net

sepeck’s picture

There is a solution that makes it safe for when clean_urls are off. I couldn't find it in my quick search.

PHP Snippets section of the handbook can be a wealth of knowledge. http://drupal.org/node/39282

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

potential’s picture

Oh no, sorry guys, I guess I didn't explain myself well.

That is how the addresses already appear b/c I have clean urls and path auto on. I simply want to print that address as text on the page (aka. this is the direct link to your blog: www.website.com/blog/username) I'm trying to make it as user friendly as possible.

In regards to Q#3, I just had to go to Tiny MCE settings and set new lines as break instead of paragraph.

However, im still stumped on #1 and #3.

andremolnar’s picture

If I understand what you are asking for - I think the link function would help.

http://drupaldocs.org/api/head/function/l

andre