phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Simple or not-so? ._.


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Sun May 31, 2009 9:18 pm 
Post subject: Simple or not-so? ._.

I'd like to know how to enable a simple tag that generates the user's account ID when called.

Say, for instance, you put {PROFILE_ID} somewhere and it relayed the number assigned to your account.

I really need something like this. Is there a Mod that does this/does someone know how?
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Sun May 31, 2009 10:18 pm 
Post subject: Re: Simple or not-so? ._.

Not sure to entirely understand what you're asking for, but maybe adding simply in includes/overall_header.php something like that:
Code:
$tpl->assign_vars(array(
   'USER_ID' => $userdata ? intval($userdata['user_id']) : 0,
));
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Mon Jun 01, 2009 8:45 pm 
Post subject: Re: Simple or not-so? ._.

Code:
$template->assign_var('PROFILE_ID', $userdata['user_id']);

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Mon Jun 01, 2009 9:29 pm 
Post subject: Re: Simple or not-so? ._.

Okay, two totally different codes. D;

Would they both work?


(And DogCow, where would that code go? Same as where Ptirhiik said?)
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Mon Jun 01, 2009 10:23 pm 
Post subject: Re: Simple or not-so? ._.

Quote:

Would they both work?

Probably, yes. But mine has a better chance of working for you.

Quote:

(And DogCow, where would that code go? Same as where Ptirhiik said?)

Yes.

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
Acaria
Board Member



Joined: 20 Feb 2009

Posts: 238



PostPosted: Tue Jun 02, 2009 12:23 am 
Post subject: Re: Simple or not-so? ._.

Tried both of your codes and both worked perfectly!

Thank you both! <3
Back to top
Ptirhiik
Board Member



Joined: 19 Nov 2008

Posts: 114


flag
PostPosted: Tue Jun 02, 2009 5:53 am 
Post subject: Re: Simple or not-so? ._.

> Dog cow: not to start an argue, but just to pinpoint the method assign_var() is only used within Template classes, never outside. You can consider it a "private" method (php5 way). I know some mods have made an extensive use of it, but it is not appropriate icon_wink.gif.
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Tue Jun 02, 2009 9:50 pm 
Post subject: Re: Simple or not-so? ._.

Ptirhiik wrote:
> Dog cow: not to start an argue, but just to pinpoint the method assign_var() is only used within Template classes, never outside. You can consider it a "private" method (php5 way). I know some mods have made an extensive use of it, but it is not appropriate icon_wink.gif.

I never knew that. I've used it a few times around my site where I just want to assign a single variable. (often the META token). There's no indication in the template.php file that I shouldn't be using it. icon_redface.gif

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0200 seconds using 15 queries. (SQL 0.0019 Parse 0.0006 Other 0.0175)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo