Templating ... a simple guide
- Highway of Life
- Registered User
- Posts: 1399
- Joined: Tue Feb 08, 2005 10:18 pm
- Location: I'd love to change the World, but they won't give me the Source Code
- Contact:
Re: Templating ... a simple guide
No problem.
Sort?!?
OH, well... you would want to run a small query and left join the ranks table to pull the rank image and text.
Sort?!?
OH, well... you would want to run a small query and left join the ranks table to pull the rank image and text.
Re: Templating ... a simple guide
if i need custom database-tables i don't get around using php, do i?
- Handyman
- Registered User
- Posts: 522
- Joined: Thu Feb 03, 2005 5:09 am
- Location: Where no man has gone before!
- Contact:
Re: Templating ... a simple guide
to create custom database tables, you wouldn't need to use php… unless you wanted to use them.
So no, you wouldn't get around it.
So no, you wouldn't get around it.
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: Templating ... a simple guide
i mean if i create a new table and want to work with the data in my templates, i would need php for that, right?
- Handyman
- Registered User
- Posts: 522
- Joined: Thu Feb 03, 2005 5:09 am
- Location: Where no man has gone before!
- Contact:
Re: Templating ... a simple guide
yes Darth.DarsVaeda wrote:i mean if i create a new table and want to work with the data in my templates, i would need php for that, right?
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: Templating ... a simple guide
edit: I ended up putting my own <!-- URLENCODE whatevervar --> into the template functions. Somehow I think this will bite me in the ass later.
Hi, I have an odd question... might there be any way to, say, do something like this:
<!-- URLENCODE -->{SOME_PHPBB_VARIABLE}<!-- ENDURLENCODE -->
A friend and I are creating some wild template which uses some flash elements and all has gone well up until the point where I want to send some PHPBB variables to the swf via the query string. In cases such as when things like ?f=22&t=1481are included in the variable I'm sending through the query string, it interprets that & as being the start of a new variable rather than part of the variable itself and is truly a nightmare to think about working around.
I don't mind modding the board software to achieve this though I really would like to avoid it. I kind of doubt what I want is already built in. I thought the <!--PHP--> tags would be a godsend but as it turns out you can't include phpbb variables within the php tags.
Any ideas?
Hi, I have an odd question... might there be any way to, say, do something like this:
<!-- URLENCODE -->{SOME_PHPBB_VARIABLE}<!-- ENDURLENCODE -->
A friend and I are creating some wild template which uses some flash elements and all has gone well up until the point where I want to send some PHPBB variables to the swf via the query string. In cases such as when things like ?f=22&t=1481are included in the variable I'm sending through the query string, it interprets that & as being the start of a new variable rather than part of the variable itself and is truly a nightmare to think about working around.
I don't mind modding the board software to achieve this though I really would like to avoid it. I kind of doubt what I want is already built in. I thought the <!--PHP--> tags would be a godsend but as it turns out you can't include phpbb variables within the php tags.
Any ideas?
Re: Templating ... a simple guide
HiHighway of Life wrote:Try adding...to the functions file.Code: Select all
'USER_RANK' => ($user->data['user_rank']) ? $user->data['user_rank'] : '',
im trying to add on my header a profile menu with the avatar so i tried the avatar mod on index and using your advice i added into functions before line:
Code: Select all
if (!$online_userlist)
{
$online_userlist = $user->lang['NO_ONLINE_USERS'];
}
Code: Select all
// Avatar on Index and Default Avatar for Guest MOD --Version 2 Beta
$avatar_img = $user_avatar_size = $user_avatar_thumb = $size = '';
if ($user->data['user_avatar'] && $user->optionget('viewavatars'))
{
switch ($user->data['user_avatar_type'])
{
case AVATAR_UPLOAD:
$avatar_img = $phpbb_root_path . "download.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $user->data['user_avatar'];
$avatar_width = $user->data['user_avatar_width'];
$avatar_height = $user->data['user_avatar_height'];
$user_avatar_thumb = '<img src="' . $avatar_img . '" style="' . $size . '" alt="" />';
$avatar_img = '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="" />';
}
// Avatar on Index and Default Avatar for Guest MOD --Version 2 Beta
Code: Select all
'S_USERNAME' => $user->data['username'],
Code: Select all
// avatar mod
'USER_AVATAR' => ( $user->data['user_avatar'] ) ? get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']) : '',
'USER_AVATAR_THUMB' => ( $user->data['user_avatar']) ? get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], ( $user->data['user_avatar_width'] > $user->data['user_avatar_height']) ? 60 : (60 / $user->data['user_avatar_height']) * $user->data['user_avatar_width'], ( $user->data['user_avatar_height'] > $user->data['user_avatar_width']) ? 60 : (60 / $user->data['user_avatar_width']) * $user->data['user_avatar_height']) : '',
// avatar mod
-
- Registered User
- Posts: 3
- Joined: Sat Apr 12, 2008 11:53 pm
Re: Templating ... a simple guide
Wonderful Guide.
Most of it I knew, but its easy to follow for those who do not.
Most of it I knew, but its easy to follow for those who do not.
Re: Templating ... a simple guide
OK. I have no idea where else to turn, so I am turning here. I hope this is the correct place, otherwise please direct me!
OK. So, I am trying to build a module for the ACP. Through the documentation and looking through the modules already there I have figured out how things are supposed to be, but it is still not working. Makes me think that I am doing something wrong.
When I go to the module I created in the ACP, it displays everything. There is the problem, the if-then-else block logic is not being executed on the template, meaning the sections for everything are displayed. Is there some special setting somewhere to allow it, or do I need some variable or something? Nothing I seem to do works. If I view the page source, the comments with block logic are still on the page, whereas they do not show in the source when I view the other modules. Again, my only guess is that for some reason the template file is not running through whatever parsing it runs through to get the block logic.
The most confusing part of it all is the fact that the variables I set in $template->assign_vars ARE parsed (they show up), yet the block logic isn't?
EDIT3: In the interest of length, I have removed the code. Saves some length while reading this sh**.
OK. So, I am trying to build a module for the ACP. Through the documentation and looking through the modules already there I have figured out how things are supposed to be, but it is still not working. Makes me think that I am doing something wrong.
When I go to the module I created in the ACP, it displays everything. There is the problem, the if-then-else block logic is not being executed on the template, meaning the sections for everything are displayed. Is there some special setting somewhere to allow it, or do I need some variable or something? Nothing I seem to do works. If I view the page source, the comments with block logic are still on the page, whereas they do not show in the source when I view the other modules. Again, my only guess is that for some reason the template file is not running through whatever parsing it runs through to get the block logic.
The most confusing part of it all is the fact that the variables I set in $template->assign_vars ARE parsed (they show up), yet the block logic isn't?
EDIT3: In the interest of length, I have removed the code. Saves some length while reading this sh**.
Last edited by Ethrel on Sat May 17, 2008 3:06 am, edited 1 time in total.
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: Templating ... a simple guide
You don't split those up on to 3 lines. It has to be exactly like shown in the first post,
<!-- IF () -->A<!-- ELSE -->
B
<!-- ENDIF -->
You can not put the <!-- IF --> or <!-- ELSE -->, etc on multiple lines.
<!-- IF () -->A<!-- ELSE -->
B
<!-- ENDIF -->
You can not put the <!-- IF --> or <!-- ELSE -->, etc on multiple lines.