Please, help in template variables
Please, help in template variables
Hi everbody, i'm a brazilian guy from phpBBrasil.com and i am doing a template for phpBB3 x.
I want to add new things, and one of them is to show this in overall_header:
Welcome to phpBBrasil {USERNAME}, the best portuguese phpBB support.
But there is the problem, in some pages, like profile and ucp, the variable shows the name, like that:
Welcome to phpBBrasil Caio Reis, the best portuguese phpBB support.
But this only works in thats pages than already has that code, like ucp and profile.
But in the pages that no show that code, like index.php, where doesn't have {USERNAME} code, shows this:
Welcome to phpBBrasil , the best portuguese phpBB support.
I am not very good in english, but i need help, someone knows how to help me??
Thanks a lot
I want to add new things, and one of them is to show this in overall_header:
Welcome to phpBBrasil {USERNAME}, the best portuguese phpBB support.
But there is the problem, in some pages, like profile and ucp, the variable shows the name, like that:
Welcome to phpBBrasil Caio Reis, the best portuguese phpBB support.
But this only works in thats pages than already has that code, like ucp and profile.
But in the pages that no show that code, like index.php, where doesn't have {USERNAME} code, shows this:
Welcome to phpBBrasil , the best portuguese phpBB support.
I am not very good in english, but i need help, someone knows how to help me??
Thanks a lot
Re: Please, help in template variables
includes/functions.php
add after
add
Code: Select all
'USERNAME' => $user->data['username'],
Code: Select all
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
Re: Please, help in template variables
you can also just use another variable:
jojobarjo32 wrote: The username is already available in every pageUse the variable {S_USERNAME}
However, if you want the colored username with link to the profile, you must add in functions.php, in the page_header function (line ~3935, after the S_USERNAME declaration):Code: Select all
'S_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
Re: Please, help in template variables
Thanks a lot man, can you just bring me the code to do the same thing with avatar??
Thanks
Thanks
Re: Please, help in template variables
add after
add after
Code: Select all
// Grab Avatar Info
$avatar_img = '';
$sql = 'SELECT
user_id,
user_avatar,
user_avatar_type,
user_avatar_width,
user_avatar_height
FROM
' . USERS_TABLE . "
WHERE
user_id = " . $user->data['user_id'];
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
if ($row['user_avatar'] && $user->optionget('viewavatars'))
{
$avatar_img = '';
switch ($row['user_avatar_type'])
{
case AVATAR_UPLOAD:
$avatar_img = $config['avatar_path'] . '/';
break;
case AVATAR_GALLERY:
$avatar_img = $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $row['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="' . $username . '" title="' . $username . '" />';
}
}
$db->sql_freeresult($result);
Code: Select all
// Which timezone?
$tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']));
Code: Select all
'USER_AVATAR' => $avatar_img,
Code: Select all
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
- Handyman
- Registered User
- Posts: 522
- Joined: Thu Feb 03, 2005 5:09 am
- Location: Where no man has gone before!
- Contact:
Re: Please, help in template variables
GeoFreak, this is the wrong place.
Mods aren't supported here yet.
Mods aren't supported here yet.
My phpBB3 Mods || My Mod Queue
Search Engine Friendly (SEO) URLs || Profile link on Avatar and/or Username || AJAX Chat
Display Posts Anywhere || CashMod || AJAX Quick Edit || AJAX Quick Reply

Search Engine Friendly (SEO) URLs || Profile link on Avatar and/or Username || AJAX Chat
Display Posts Anywhere || CashMod || AJAX Quick Edit || AJAX Quick Reply
Re: Please, help in template variables
Well mods won't matter as nobody is using them on an open board.
Besides, I really wouldn't call this a mod...
Besides, I really wouldn't call this a mod...
- karlsemple
- Registered User
- Posts: 480
- Joined: Mon Jan 23, 2006 8:49 am
- Location: Hereford
- Contact:
Re: Please, help in template variables
geoffreak wrote: Well mods won't matter as nobody is using them on an open board.![]()
Besides, I really wouldn't call this a mod...![]()
Any alteration of the codebase no matter how small is a modifications and thus not supported during the beta stages and not in the styles forum either way
Re: Please, help in template variables
karlsemple wrote:geoffreak wrote: Well mods won't matter as nobody is using them on an open board.![]()
Besides, I really wouldn't call this a mod...![]()
Any alteration of the codebase no matter how small is a modifications and thus not supported during the beta stages and not in the styles forum either way
Alright.
My apologies
-
- Posts: 108
- Joined: Sun Nov 27, 2005 12:25 am
Re: Please, help in template variables
Why are we yelling at Geoffreak? He didn't start the topic, he just answered it.
alphaPORTAL
phpBB3 Integration MOD:
Create Pages in phpBB3
Portal
Many Modules including Login, Welcome, Search, Top Posters, Online Now, Menu, Offsite Links, and more
phpBB3 Integration MOD:
Create Pages in phpBB3
Portal
Many Modules including Login, Welcome, Search, Top Posters, Online Now, Menu, Offsite Links, and more