Does anyone know how to create this link? I want my menu that is only shown to logged in users to contain a direct link to their "my recent posts" page, but anything you fill in in the path field does not parse php code or a [uid] parameter, so how would I hack this up?

Thanks in advance,
JR

Comments

jurriaanroelofs’s picture

can anyone at least point me in the right direction?

-------------------------------
http://www.sooperthemes.com/#-Drupal-Themes

Kato’s picture

4.6 or 4.7?

-------------------------------------------------------
http://gamersides.com
http://ngl.gamersides.com

jurriaanroelofs’s picture

4.6
I'm not going to upgrade with all my sites either because I use VbDrupal

-------------------------------
http://www.sooperthemes.com/#-Drupal-Themes

NerdsPC’s picture

I added a menu item "my recent posts" that points to the non-existent page: tracker/user

Then I added the following to my themes/theme_name/template.php:

<?php
if (arg(0)=="tracker" && arg(1) =="user") {     
    global $user;
    $location = "Location: /tracker/" . $user->uid;
    header($location); }
?>
jurriaanroelofs’s picture

lol, it seems that every time I post a question on these forums, I get an answer right after I find the solution myself.

I just found out the the views module can generate a view that displays all posts that are authored by "current user". Using this views you can create a block that lists "my recent posts" and you can link to a views page that organises your recent posts.

Thanks for your code though, that will be useful on my VbDrupal site until I can finally hack views to work with userids in VbDrupal.

-------------------------------
http://www.sooperthemes.com/#-Drupal-Themes