Are functions created in a special way or the basic php way?
Also what is the piece of code that will display the user's username if he is logged in?
Thanks,
Elias
Functions + username
- EY
- Supporter
- Posts: 204
- Joined: 05 Nov 2006, 23:13
- Real name: Elias
- Location: Montreal [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Functions + username
Never Say Never!
- igorw
- Past Contributor
- Posts: 1967
- Joined: 01 Jun 2006, 20:48
- Real name: Igor [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Functions + username
Functions are created in a normal way, but you best put your functions into a separate file and not the phpBB files. Like this it's easy to update your MODs.
As for the second question: $user->data['username']. If you're using it in a function, make sure $user is globaled.
As for the second question: $user->data['username']. If you're using it in a function, make sure $user is globaled.
- we're poor!
- EY
- Supporter
- Posts: 204
- Joined: 05 Nov 2006, 23:13
- Real name: Elias
- Location: Montreal [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Functions + username
Never Say Never!
- igorw
- Past Contributor
- Posts: 1967
- Joined: 01 Jun 2006, 20:48
- Real name: Igor [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Functions + username
- we're poor!
Return to “phpBB Development discussion”
Who is online
Users browsing this forum: No registered users and 10 guests