1
Wayde
Adding a block to a template
  • 2005/5/28 22:22

  • Wayde

  • Just popping in

  • Posts: 58

  • Since: 2004/9/14


Hey guys,
What im trying to do is add a block to the bottom of my index page in newbb...

when i insert the code into the index template...
the block shows its table... but its empty..

wat do i have to do to get the block to work within the newbb index page?

Cheers

Wayde

2
ladon
Re: Adding a block to a template
  • 2005/5/28 23:32

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


What are you inserting? PHP script or plain HTML? Make sure you select the right type. It might be helpful if you could post the content yoo put in the block.

3
Wayde
Re: Adding a block to a template
  • 2005/5/29 1:11

  • Wayde

  • Just popping in

  • Posts: 58

  • Since: 2004/9/14


Hey, Thanks for the reply.

Quote:
<table class="outer" cellspacing="1">

<{if $block.disp_mode == 0}>
<tr>
<th class="head" nowrap><{$block.lang_forum}></th>
<th class="head" nowrap><{$block.lang_topic}></th>
<th class="head" align="center" nowrap><{$block.lang_replies}></th>
<th class="head" align="center" nowrap><{$block.lang_views}></th>
<th class="head" align="center" nowrap><{$block.lang_lastpost}></th>
</tr>

<{foreach item=topic from=$block.topics}>
<tr class="<{cycle values="even,odd"}>">
<td><a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a></td>
<td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>">

<{if $topic.topic_subject eq NONE}>
<{else}>
<{$topic.topic_subject}>
<{/if}>

<{$topic.title}></a><{$topic.topic_page_jump}></td>
<td align="center"><{$topic.replies}></td>
<td align="center"><{$topic.views}></td>
<td align="right"><{$topic.time}><br /><{$topic.topic_poster}>&nbsp;<{$topic.jump_post}></td>
</tr>
<{/foreach}>

<{elseif $block.disp_mode == 1}>

<tr>
<td class="head" nowrap><{$block.lang_topic}></td>
<td class="head" align="center" nowrap><{$block.lang_replies}></td>
<td class="head" align="center" nowrap><{$block.lang_lastpost}></td>
</tr>

<{foreach item=topic from=$block.topics}>
<tr class="<{cycle values="even,odd"}>">
<td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
<td align="center"><{$topic.replies}></td>
<td align="right"><{$topic.time}><br /><{$topic.topic_poster}>&nbsp;<{$topic.jump_post}></td>
</tr>
<{/foreach}>

<{elseif $block.disp_mode == 2}>

<{foreach item=topic from=$block.topics}>
<tr class="<{cycle values="even,odd"}>">
<td><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?topic_id=<{$topic.id}>&forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></td>
</tr>
<{/foreach}>

<{/if}>

</table>


Thats wat im wanting to add to just the "index" template in newbb...,.(its a block from newbb)
but when i do that... the tables are there.... but nothing shows.....
any ideas?

THanks

Wayde

4
ladon
Re: Adding a block to a template
  • 2005/5/29 9:32

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


The reason that it's emty is because you're including a if/else statement that gets no input. To add a newbbblock, look here: click. It will tell you all you need to know to achieve adding a that particular block.

5
Wayde
Re: Adding a block to a template
  • 2005/5/29 12:08

  • Wayde

  • Just popping in

  • Posts: 58

  • Since: 2004/9/14


ok... thanks for that.. not wat i was really wat i was after..
ill try and explain it more ...

What im trying to do is...
Put the rececnt topics block at the bottom of the newbb index page.
when i add the above code into the newbb index.html template..
the block in empty.. as it says in the above post that theres no input..

how can i get the recent topics block to work within the newbb index.html template?

hope that explains it a bit better wat im tryin to do..
thanks for your replys so far...

Wayde

6
pod
Re: Adding a block to a template
  • 2005/5/29 12:20

  • pod

  • Quite a regular

  • Posts: 301

  • Since: 2003/4/19


The simple answer is: It's just not that easy.

Blocks use block.variables, templates use template.variables. They arent interchangable.

A workaround might be to get the header hack from happy linux and use center-down or center-top blocks in your theme, placing one or the other where you want to insert the newbb block, then do just that.

An alternative might be to get all the template.variables you need & do-it-yourself to achieve the result you're after. A 3rd alternative might be to create template.variables yourself.
I don't know your level of XOOPS expertise but if you have no idea how to do these two latter suggestions, I suggest going w the header hack. I can't really assist ya more than that as I have never used newbb, nor do I intend to start trying.

Hope this helps a lil.

Login

Who's Online

172 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits