Getting uid of current profile page
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi @all Lets assume, that i want to something like: <?php $currentProfileUser="Here happens some magic" print("<H3> $currentProfileUser is Member of ...</H3>"); ?> in the file: /drupal/modules/user/user-profile.tpl.php Can someone provide my some ideas how to get the uid from the current user profile page? I do not need the uid from the logged in viewing user, i need the uid from the user displayed at the current profile page. Thanks a lot for help! regards Andreas - -- ========================================================================= _____________ / ___________/ Andreas Laesser / //_// /____/ Signal Proc.& Speech Communication Lab. __/ /___/ / __ Graz University of Technology /___//____//___/ Inffeldgasse 16c/EG | A-8010 Graz | Austria http://www.spsc.tugraz.at Tel: +43 (0)316 873 -4443 Fax: DW 104439 ========================================================================= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAk9Z+7QACgkQ1nmbrmNF2lN2bQCfa5kiat9cXkmiSbs1KEcX7NEi 4KYAoIRQm8l2z7lepHoCbs+FisMmK/zp =xAq1 -----END PGP SIGNATURE-----
On Fri, Mar 9, 2012 at 7:46 AM, Andreas Laesser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi @all
Lets assume, that i want to something like:
<?php $currentProfileUser="Here happens some magic"
print("<H3> $currentProfileUser is Member of ...</H3>"); ?>
in the file: /drupal/modules/user/user-profile.tpl.php
Can someone provide my some ideas how to get the uid from the current user profile page? I do not need the uid from the logged in viewing user, i need the uid from the user displayed at the current profile page.
global $user The $user variable is an object of user information. See api.drupal.org and search for user for a list of user functions. The search form on that page should suggest items as you type. -- Earnie -- https://sites.google.com/site/earnieboyd
http://api.drupal.org/api/drupal/modules!user!user-profile.tpl.php/7 suggests you could check the content of $user_profile --Jørn On Fri, Mar 9, 2012 at 1:46 PM, Andreas Laesser <andreas.laesser@tugraz.at> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi @all
Lets assume, that i want to something like:
<?php $currentProfileUser="Here happens some magic"
print("<H3> $currentProfileUser is Member of ...</H3>"); ?>
in the file: /drupal/modules/user/user-profile.tpl.php
Can someone provide my some ideas how to get the uid from the current user profile page? I do not need the uid from the logged in viewing user, i need the uid from the user displayed at the current profile page.
Thanks a lot for help! regards Andreas
- -- ========================================================================= _____________ / ___________/ Andreas Laesser / //_// /____/ Signal Proc.& Speech Communication Lab. __/ /___/ / __ Graz University of Technology /___//____//___/ Inffeldgasse 16c/EG | A-8010 Graz | Austria
http://www.spsc.tugraz.at Tel: +43 (0)316 873 -4443 Fax: DW 104439 ========================================================================= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAk9Z+7QACgkQ1nmbrmNF2lN2bQCfa5kiat9cXkmiSbs1KEcX7NEi 4KYAoIRQm8l2z7lepHoCbs+FisMmK/zp =xAq1 -----END PGP SIGNATURE-----
Assuming user/[uid], it would be arg(1). Then you could use user_load() to get the object. On 3/9/12 7:46 AM, Andreas Laesser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi @all
Lets assume, that i want to something like:
<?php $currentProfileUser="Here happens some magic"
print("<H3> $currentProfileUser is Member of ...</H3>"); ?>
in the file: /drupal/modules/user/user-profile.tpl.php
Can someone provide my some ideas how to get the uid from the current user profile page? I do not need the uid from the logged in viewing user, i need the uid from the user displayed at the current profile page.
Thanks a lot for help! regards Andreas
- -- ========================================================================= _____________ / ___________/ Andreas Laesser / //_// /____/ Signal Proc.& Speech Communication Lab. __/ /___/ / __ Graz University of Technology /___//____//___/ Inffeldgasse 16c/EG | A-8010 Graz | Austria
http://www.spsc.tugraz.at Tel: +43 (0)316 873 -4443 Fax: DW 104439 ========================================================================= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAk9Z+7QACgkQ1nmbrmNF2lN2bQCfa5kiat9cXkmiSbs1KEcX7NEi 4KYAoIRQm8l2z7lepHoCbs+FisMmK/zp =xAq1 -----END PGP SIGNATURE-----
To edit page: hook_user_view_alter To get current user: global $user; edit $user->uid; - Erlend Den 15:01 9. mars 2012 skrev Aaron Winborn <winborn@advomatic.com> følgende:
Assuming user/[uid], it would be arg(1). Then you could use user_load() to get the object.
On 3/9/12 7:46 AM, Andreas Laesser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi @all
Lets assume, that i want to something like:
<?php $currentProfileUser="Here happens some magic"
print("<H3> $currentProfileUser is Member of ...</H3>"); ?>
in the file: /drupal/modules/user/user-profile.tpl.php
Can someone provide my some ideas how to get the uid from the current user profile page? I do not need the uid from the logged in viewing user, i need the uid from the user displayed at the current profile page.
Thanks a lot for help! regards Andreas
- -- ========================================================================= _____________ / ___________/ Andreas Laesser / //_// /____/ Signal Proc.& Speech Communication Lab. __/ /___/ / __ Graz University of Technology /___//____//___/ Inffeldgasse 16c/EG | A-8010 Graz | Austria
http://www.spsc.tugraz.at Tel: +43 (0)316 873 -4443 Fax: DW 104439 ========================================================================= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAk9Z+7QACgkQ1nmbrmNF2lN2bQCfa5kiat9cXkmiSbs1KEcX7NEi 4KYAoIRQm8l2z7lepHoCbs+FisMmK/zp =xAq1 -----END PGP SIGNATURE-----
Current User != Current Profile Page User This is a frequent mistake made, ends up showing site administrators their own information instead of the user they are reviewing. On Sat, Mar 10, 2012 at 4:19 AM, Erlend Klakegg Bergheim <erlend@klakegg.net
wrote:
To edit page: hook_user_view_alter
To get current user: global $user; edit $user->uid;
- Erlend
Den 15:01 9. mars 2012 skrev Aaron Winborn <winborn@advomatic.com> følgende:
Assuming user/[uid], it would be arg(1). Then you could use user_load() to get the object.
On 3/9/12 7:46 AM, Andreas Laesser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi @all
Lets assume, that i want to something like:
<?php $currentProfileUser="Here happens some magic"
print("<H3> $currentProfileUser is Member of ...</H3>"); ?>
in the file: /drupal/modules/user/user-profile.tpl.php
Can someone provide my some ideas how to get the uid from the current user profile page? I do not need the uid from the logged in viewing user, i need the uid from the user displayed at the current profile
page.
Thanks a lot for help! regards Andreas
- --
=========================================================================
_____________ / ___________/ Andreas Laesser / //_// /____/ Signal Proc.& Speech Communication Lab. __/ /___/ / __ Graz University of Technology /___//____//___/ Inffeldgasse 16c/EG | A-8010 Graz | Austria
http://www.spsc.tugraz.at Tel: +43 (0)316 873 -4443 Fax: DW 104439
=========================================================================
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAk9Z+7QACgkQ1nmbrmNF2lN2bQCfa5kiat9cXkmiSbs1KEcX7NEi 4KYAoIRQm8l2z7lepHoCbs+FisMmK/zp =xAq1 -----END PGP SIGNATURE-----
participants (6)
-
Aaron Winborn -
Adam B. Ross -
Andreas Laesser -
Earnie Boyd -
Erlend Klakegg Bergheim -
Jørn Fauske