Author Topic: how to call member id in template?  (Read 10284 times)

0 Members and 1 Guest are viewing this topic.

Offline 131

  • Newbie
  • *
  • Posts: 13
    • View Profile
how to call member id in template?
« on: November 25, 2007, 07:45:34 PM »
Hello
Like in topic
I woudl like to call loged member id {user_id} in template, ive try few things which should works but no results or results are random id.

I need something like index.php?template=xxx&member={user_id}

regards
for any help

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: how to call member id in template?
« Reply #1 on: November 25, 2007, 08:37:05 PM »
If install this:

http://www.4homepages.de/forum/index.php?topic=8141.msg37488#msg37488

is possible. ;)

I help after for user id.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline 131

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: how to call member id in template?
« Reply #2 on: November 26, 2007, 10:07:53 AM »
calling template its not a problem, I made something ages ago and still works.
so template=xxx works well, and static text with dynamic blocks like {header} works (FAQ, TERMS, etc)

main problem is calling user ID and user Name, looks like they are "remeber" from last "visitors?" last "random photo?".

when I use {user_id} i recive random ID - dont know where comes from :(

We can start from displaying user name and ID in loged user panel, I'll try do rest my self ;)

regards

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: how to call member id in template?
« Reply #3 on: November 26, 2007, 02:21:38 PM »
Quote
when I use {user_id} i recive random ID - dont know where comes from

You no say if you install MOD from V@no ... if so - is easy to code from includes/sessions.php with $user_info[$user_table_fields['user_id']] or format_text(trim($user_info[$user_table_fields['user_name']]), 2) . ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline 131

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: how to call member id in template?
« Reply #4 on: November 26, 2007, 02:39:40 PM »
hmmm ...
Dont works or I do something wrong
in login template (user_logininfo.html) I just put for tests (without calling template - just home.html/main site):


<li><a href="member.php?action=showprofile&user_id=
<?php 
echo format_text(trim($user_info[$user_table_fields['user_name']]), 2);
?>">Profil</a></li>
<li><a href="{url_control_panel}">Edit myProfil</a></li>
<li><a href="user_id/
<?php
echo "user_id=".$user_info[$user_table_fields['user_id']];
?>


Could You check this? mayby its works for You, I dont have any data on both fx.

regards

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: how to call member id in template?
« Reply #5 on: November 26, 2007, 02:48:13 PM »
Ohh ! so you want PHP use in HTML ? You no say before. ;)

Ok so if no have PHP in HTML enable (includes/constants.php file) - is ok.

Try this:

Code: [Select]
<li><a href="{url_member}?action=showprofile&user_id={user_id}">{user_name}</a></li>
<li><a href="{url_control_panel}">Edit myProfil</a></li>

This line :

Code: [Select]
<li><a href="user_id/ ...

I no get why is there ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline 131

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: how to call member id in template?
« Reply #6 on: November 26, 2007, 03:00:46 PM »
I try this before, just start with this template tags, but I recive random names and Ids - look before
Could You confirm that this works for You after refreshing page and still have this same id/name ?

Now Im loged as a admin -> id=1, with your code I have {user_id} from user which upload random image. I dont remeber it is mod or bulid fx, I use&set 4images ages ago.

Mayby You could show my where {user_id} can by changed by fx coping/modyfing to something like {logged_user_id}

_______
php is enabled in templates - I try to integrte now 4images and wordspressmu, so urls are strange :)

regards
Pawel



Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: how to call member id in template?
« Reply #7 on: November 26, 2007, 03:07:14 PM »
Ok so you want same for this:

http://www.4homepages.de/forum/index.php?topic=19374.0

I add in TODO list before. I code later. Thank for posting. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?