I createad a custom profile field called Achievements under 'admin/user/profile'
I want to create a dynamic link to edit this field, based on which user is clicking on it. Only logged in users will ever see this link.
Currently, for a user to edit this Achievements field they have to click their Profile, click edit, then click achievements. I want to bring those 3 actions down to one single hyperlink click, because the Achievements field will be changed very frequently.
A dynamic link to edit this field (based on which user is clicking the link) would be AWESOME.
For example:
For User #30 to edit their Achievements field, they click 3 times (and wait for 3 page loads) to get to this URL:
/user/30/edit/Achievements
I want to make a dynamic link to function something like this:
/user/%user/edit/Achievements
Some kind of custom menu might work, but I plan on putting this link inside book pages (where it would be most convenient).
I actually tried using '/user/%user/edit/Achievements' as a hyperlink, and of course it was total lolfail.
I am hoping there is a small snippet of PHP code I can use for the link or something, or maybe a module that can fit the bill.
I've looked around the forums and googled and haven't found a solution so I thought I'd try posting. There are an abundance of smart people around here so I figure someone would know how to do this lol. Thanks!
Comments
Did you try
using "%userid" instead of "%user"?
I just tried that and it also
I just tried that and it also didn't work =\
It was a good idea though, thank you for your input :)
Something strange though... using either one of those in an actual page as an actual hyperlink and then clicking on it, NOTHING HAPPENS. At all.
I am currently at work and only have access to IE7, so perhaps that could be the issue too.
Another possibility is that the proxy server here won't allow links like that or something. Could this be an issue? I guess I can find out for sure when I get home.
I found a thread that might
I found a thread that might have some of the answer:
http://drupal.org/node/692554
I dont' really know php, but I know a little C++ and I'm trying to modify some of that php code to work.
This is the code I'm trying to adapt:
figured it out
I figured it out... I basically had to teach myself a little php and it only took 2.5 hours lol
In case someone else could find this useful, this is what I ended up doing:
<a href="http://www.yoursite.com/user/<?php global $user; print $user->uid; ?>/edit/Achievements/">Achievements</a>Without the "http://www.yoursite.com/" in the hyperlink URL, "/content/" was automatically being added to the front of the url and messing it up.
It's basically just a hyperlink with some php inside to print the userid.
I don't know if thats a totally noobish or insecure way to do it, but it works. I figure its ok since the php inside the hyperlink doesn't even show up in the page's source code.
This helped a lot! I was
This helped a lot! I was looking on how to do pretty much the same thing! Thanks