SimplePortal

Customization => Custom Coding => Topic started by: fdr77 on November 17, 2010, 08:51:36 PM

Title: Link in a block " recent topic "
Post by: fdr77 on November 17, 2010, 08:51:36 PM
I have this block  "recent topic"
I would like  a block where to add a link back to the previous topic.....As in the picture
topic number displayed  =    10
the link will =     http://www.myforum/index.php?action=recenttopics

Can you help please?
I tried a lot but I have not found anything to help me
thanks
Title: Re: Link in a block " recent topic "
Post by: fdr77 on November 18, 2010, 04:42:59 PM
Resolved with block in the block but if you can give me the code for a single block there would be grateful

Thanks
Title: Re: Link in a block " recent topic "
Post by: AngelinaBelle on November 19, 2010, 08:26:55 AM
Please explain more:
Resolved with block in the block but if you can give me the code for a single block there would be grateful
Please show your solution -- I think it would help me to understand your question (below).
 
 
I would like  a block where to add a link back to the previous topic.....As in the picture
I do not understand "link back to the previous topic".  Maybe this is a translation difficulty.
 
 
 
Title: Re: Link in a block " recent topic "
Post by: fdr77 on November 20, 2010, 08:49:15 AM
this is the code " block in the block " used
Code: [Select]
$columns = 1;
$block_ids = array(40 ,216);

$block_data = array();
foreach ($block_ids as $block)
{
   $block_data[$block] = current(getBlockInfo(false, $block, false, false));
   $block_data[$block]['style'] = sportal_parse_style('explode', $block_data[$block]['style'], true);
}

echo '
<table style="width: 195px;">
   <tr>';

$counter = 0;
foreach ($block_data as $data)
{
   if ($counter != 0 && $counter % $columns == 0)
   {
      echo '
   </tr>
   <tr>';
   }

   echo '
      <td style="width: ', ceil((100 / $columns)), '%; vertical-align: top;">
         ', template_block($data), '
      </td>';

   $counter++;
}

echo '
   </tr>
</table>';

Where id 40 is a block recent post- topic

and the id 216 is a block html
Code: [Select]
<a href="http://www.discusrewind.net/index.php?action=recenttopics"><font color="navy" size="3" face="book antiqua">Post precedenti </font></a>
<hr>

You can do everything in a single block?
Thank you Angelina

the result is this
Title: Re: Link in a block " recent topic "
Post by: AngelinaBelle on November 22, 2010, 04:50:47 PM
You just want to get rid of the boxes around the two blocks?
Or you want to do the one-line HTML of block 216 without having to create a block for it?
Title: Re: Link in a block " recent topic "
Post by: fdr77 on November 22, 2010, 04:58:07 PM
I would like to have a single block
I now have three blocks.....a containig block, that has within it one block htlm and one block " recent-posts topics"
Title: Re: Link in a block " recent topic "
Post by: AngelinaBelle on November 23, 2010, 09:09:12 AM
Here is what I think is easiest, to use the work you have already done:
 
For the two blocks, choose "no title" and "no body".  This will get rid of the title bar and also the block background.
 
You will still have three blocks, but it will look like only one block.
 
If you wish a "previous topic" heading for the HTML block, you can put it into the HTML of the block.
 
 
SimplePortal 2.3.8 © 2008-2024, SimplePortal