News:

Wondering if this will always be free?  See why free is better.

Main Menu

Need border around recent post bar

Started by aw06, October 20, 2009, 12:49:27 PM

Previous topic - Next topic

aw06

OK ... I copied and placed the recent posts bar at the top of my index page .... However their is no border around it matching with the rest of the forum .. eg. the news has border around it etc/etc

This is the code for the recent post bar
// This is the "Recent Posts" bar.
if (!empty($settings['number_recent_posts']))
{
echo '
<tr>
<td class="catbg" colspan="2">', $txt[214], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=recent">
<img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" border="0" /></a>
</td>
<td class="windowbg2">';

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>
<div class="smalltext">
', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
</div>';
}
// Show lots of posts.
         elseif (!empty($context['latest_posts']))
         {
             echo '
             <table cellpadding="0" cellspacing="1" width="100%" border="0">
           <tr>
               <td class="catbg2" style="text-align:center;" colspan="2">', $txt[70] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[110] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[301] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[20] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[29] ,'</td>
               <td class="catbg2" style="text-align:right;">', $txt[317] ,'</td>
             </tr>';
             /* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
$cnt = 0;
foreach ($context['latest_posts'] as $post){
         $cnt++;
         $class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
         
        echo '
<tr>
                <td class="', $class, '"" style="text-align:center;"><img src="', $post['icon'] , '" alt="" /></td>
<td class="', $class, '"" title="', $post['preview'] ,'">', $post['link'], '</td>
                <td class="', $class, '"" style="text-align:center;">', $post['replies'], '</td>
<td class="', $class, '"" style="text-align:center;">', $post['views'], '</td>
                <td class="', $class, '"" style="text-align:center;">',$post['board']['link'], '</td>
                <td class="', $class, '"" style="text-align:center;">',$post['poster']['link'], '</td>
<td class="', $class, '"" style="text-align:right;" nowrap="nowrap">', $post['time'], '</td>
</tr>';
       }
echo '
</table>';
}
echo '
</td>
</tr>';
}


And this is the code for the one i have placed at the top of the Forums Index page
// This is the "Recent Posts" bar.
   if (!empty($settings['number_recent_posts']))
   {
      echo '
        <table cellpadding="4" cellspacing="1" border="0" width="100%">
            <tr>
               <td class="titlebg" colspan="2">', $txt[214], '</td>
            </tr>
            <tr>
               <td class="windowbg" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" /></a>
               </td>
               <td class="windowbg2">';

      // Only show one post.
      if ($settings['number_recent_posts'] == 1)
      {
         // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
         echo '
                  <b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>
                  <div class="smalltext">
                        ', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
                  </div>';
      }
       // Show lots of posts.
         elseif (!empty($context['latest_posts']))
         {
             echo '
             <table cellpadding="0" cellspacing="1" width="100%" border="0">
           <tr>
               <td class="catbg2" style="text-align:center;" colspan="2">', $txt[70] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[110] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[301] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[20] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[29] ,'</td>
               <td class="catbg2" style="text-align:right;">', $txt[317] ,'</td>
             </tr>';
             /* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
$cnt = 0;
foreach ($context['latest_posts'] as $post){
         $cnt++;
         $class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
         
        echo '
<tr>
                <td class="', $class, '"" style="text-align:center;"><img src="', $post['icon'] , '" alt="" /></td>
<td class="', $class, '"" title="', $post['preview'] ,'">', $post['link'], '</td>
                <td class="', $class, '"" style="text-align:center;">', $post['replies'], '</td>
<td class="', $class, '"" style="text-align:center;">', $post['views'], '</td>
                <td class="', $class, '"" style="text-align:center;">',$post['board']['link'], '</td>
                <td class="', $class, '"" style="text-align:center;">',$post['poster']['link'], '</td>
<td class="', $class, '"" style="text-align:right;" nowrap="nowrap">', $post['time'], '</td>
</tr>';
       }
echo '
</table>';
      }
      echo '
               </td>
            </tr>
        </table>';
echo '<BR>';
   }


I know I'm missing something hence why the themes border is not wrapping around it ...
Please Help ... My forum is >> HERE <<
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Dragooon

I don't see any issue in the page you linked, have you fixed this issue?

aw06

If you look carefully you will notice that you do not see a border with drop shadow around the recent post bar i have at the top ... look closely 8)
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

Wrap <div class="tborder"> around your table.
Holder of controversial views, all of which my own.


aw06

OK thanks .. got it ... for it to show the drop shadow had to use the code from the theme ...

<div class="tborder"></div><div class="bdc"><!-- nothing :P --></div>
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

That doesn't look right.

The entire <table> should have been preceded by <div class="tborder"> and the matching </table> followed by </div>, like the other tables in that theme.
Holder of controversial views, all of which my own.


aw06

This is the code i'm now using ....
// This is the "Recent Posts" bar.
   if (!empty($settings['number_recent_posts']))
   {
      echo '
        <div class="tborder"><table cellpadding="4" cellspacing="1" border="0" width="100%">
            <tr>
               <td class="titlebg" colspan="2">', $txt[214], '</td>
            </tr>
            <tr>
               <td class="windowbg" width="20" valign="middle" align="center">
                  <a href="', $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt[214], '" /></a>
               </td>
               <td class="windowbg2">';

      // Only show one post.
      if ($settings['number_recent_posts'] == 1)
      {
         // latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
         echo '
                  <b><a href="', $scripturl, '?action=recent">', $txt[214], '</a></b>
                  <div class="smalltext">
                        ', $txt[234], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt[235], ' (', $context['latest_post']['time'], ')<br />
                  </div>';
      }
       // Show lots of posts.
         elseif (!empty($context['latest_posts']))
         {
             echo '
             <table cellpadding="0" cellspacing="1" width="100%" border="0">
           <tr>
               <td class="catbg2" style="text-align:center;" colspan="2">', $txt[70] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[110] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[301] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[20] ,'</td>
               <td class="catbg2" style="text-align:center;">', $txt[29] ,'</td>
               <td class="catbg2" style="text-align:right;">', $txt[317] ,'</td>
             </tr>';
             /* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
$cnt = 0;
foreach ($context['latest_posts'] as $post){
         $cnt++;
         $class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
         
        echo '
<tr>
                <td class="', $class, '"" style="text-align:center;"><img src="', $post['icon'] , '" alt="" /></td>
<td class="', $class, '"" title="', $post['preview'] ,'">', $post['link'], '</td>
                <td class="', $class, '"" style="text-align:center;">', $post['replies'], '</td>
<td class="', $class, '"" style="text-align:center;">', $post['views'], '</td>
                <td class="', $class, '"" style="text-align:center;">',$post['board']['link'], '</td>
                <td class="', $class, '"" style="text-align:center;">',$post['poster']['link'], '</td>
<td class="', $class, '"" style="text-align:right;" nowrap="nowrap">', $post['time'], '</td>
</tr>';
       }
echo '
</table>';
      }
      echo '
               </td>
            </tr>
        </table></div><div class="bdc"><!-- nothing :P --></div>';
echo '<BR>';
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

Ah, essentially what I was saying. You can remove the div with class bdc though.
Holder of controversial views, all of which my own.


aw06

Quote from: Arantor on October 20, 2009, 03:33:24 PM
Ah, essentially what I was saying. You can remove the div with class bdc though.

when i remove it ... i get no drop shadow :D
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

Class bdc doesn't control the drop shadow as far as I could tell though.
Holder of controversial views, all of which my own.


aw06

Ok ... well that's the code i see being used by the theme around other tables .. so i don't know, i guess that's how the theme author calls it into the page  :-\ ..
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

End of the day if it works for you, leave it there.
Holder of controversial views, all of which my own.


aw06

I wrapped it around another table i had .. and got the same drop shadow effect
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Advertisement: