MyBB Community Forums

Full Version: Create An Professional Table with Min/Max Like Category
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, Happy New Year to all MyBB Team and Members for a great year Big Grin
But in the first day of 2011, i've a question and need to be supported Smile

Well, i've some problem and need some one can help me about create a table like category. I mean, a table with seperate tabs (about 4) and especially it must have mix/max option like a normal category. It can't be done in templates, but show me how to do it ? Write a PHP ? Please help me

Thank you Big Grin
You mean to make a table just like categories and forums/subforums ?

Add the following in any template to make a table, adjust yourself;
<table width="50%" cellpadding="6" cellspacing="1" border="0" class="tborder">
<tbody>
<tr>
<td class="thead" colspan="2">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['newbox_e']}.gif" id="newbox_img" class="expander" alt="[-]" title="[-]" /></div>
<strong><span class="smalltext">BOX_TITLE</span></strong>
</td>
</tr>
</tbody>
<tbody style="{$collapsed['newbox_e']}" id="newbox_e">  
<tr>
<td class="trow1">BOX_CODE</td>
</tr>
</tbody>
</table>
How could i add it in my template ??? For example: How to i add this {$temp_table} to other templates ? Before, i've create a template named temp_table in my current theme.
Just copy the above code and paste where ever you want to show in what ever you like in template.
you must have php knowledge to add custom template bits.

go to acp->tempaltes&styles->templates->*yourtemplate*->click "add template" on top

Template Name: enter a name
Template Set: select global or your template name (global preferred)
Add the php or html code in the box.
and save.

this is the sample index_boardstats code
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="boardstats_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>{$lang->boardstats}</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
{$whosonline}
{$birthdays}
{$forumstats}
</tbody>
</table>

and this code controls the minimizing and maximizing the box
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="X_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>X</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['X_e']}" id="X_e">

^^ replace all X with the template name you created.

By this you have created the template. Now you must call this template somewhere. So you must evaluate the template.

Open forum/index.php file and add this evaluation code at the place you want it to call. If you want it in the header, look for the header evaluation codes and add this code below them. --->
eval("\$Y = \"".$templates->get("X")."\";");

^^ replace X with the template name you created and replace Y with the name you would like to call ex:custom1

finally, if you want to call this template in header go to acp->templates&styles->templates->*your template*->header templates->header

and add this code somewhere

{$Y}

Y is the name you had given above to call it.
(2011-01-01, 04:49 PM)TheGodFather Wrote: [ -> ]-snip giant post-

Nice explanation. Smile You should add it to the Tutorial forum.
Yeah, I expected that someone will comment as what you said and you did it Toungue

Well, there is already a tutorial regarding this, but didnt mentioned the implementation of evaluation code part. So i fixed by getting help from support forum and now as NNT_ requested i wrote down what i did. Toungue
Hi, thank for your help. You're awsome Toungue Well, i'm now consider where to put the code control min/max ?

Thanks for everything
I've created it. But, do you think could i create a table like this ?
[attachment=21099]

If yes, please teach me how to do Toungue Thanks you Smile
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead colspan="5">
<tr>
<td class="thead">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="boardstats_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>{$lang->boardstats}</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
<tr>
<td> Link1 Link2 <br /> Link3 Link4 <br /> Link5 Link6 </td><td> Link1 Link2 <br /> Link3 Link4 <br /> Link5 Link6 </td><td> Link1 Link2 <br /> Link3 Link4 <br /> Link5 Link6 </td><td> Link1 Link2 <br /> Link3 Link4 <br /> Link5 Link6 </td><td> Link1 Link2 <br /> Link3 Link4 <br /> Link5 Link6 </td>
</tr>
<tr colspan="5">
<td> Ad Code </td>
</tr>
</tbody>
</table> 

i think you have a knowledge of adding url bbcode. so use that url bbcode instead of Link1, Link2, ....
replace ad code with your code
Thank for your help, but i'm still having some problems and need your help again Toungue

Here is your code
[attachment=21102]


I want this table look like a category, i mean my table should be seperated by a line (look like in the image, i also want add a title for each columns). Does mybb allow to do that ? Thanks you for everything. Big Grin

up up up, no one can help ? Please i'm really really need it now Sad
Pages: 1 2