Author Topic:  SSI News Side PHP Block  (Read 4071 times)


0 Members and 1 Guest are viewing this topic.

July 08, 2014, 04:31:06 PM

Offline Brian

  • Administrator
  • Jr. Member
  • *
  • Posts: 49
  • Country: us
  • Karma: 0
    • View Profile
SSI News Side PHP Block
« on: July 08, 2014, 04:31:06 PM »

(Register to disable this ad!)
If you hate the News section on the header as much as i do, here's a simple solution. Display your latest news on a side PHP block. Like the default news, it will reload different news upon browser reload.

Create a PHP block, add this code. Customize it to your needs and activate.

The CSS; add this to the index.css of your theme.

Code: [Select]
.iblock {
    font-size: 16px;
    background-color: #f9f9f9;
    border-left: 8px solid #eb6c6c;
    color: #444;
    line-height: 1.4em;
    padding: 2.8em 1.6em;
    margin: 0.1em 0 0.3em 0;
    overflow: auto;
}

The markup; add this to the PHP block:

Code: [Select]
echo '

  <div class="iblock">';
      ssi_news();

echo '
  </div>';

Remove the News bit from the Index.template.php so it does not show twice. Should look like this in most themes:

Code: [Select]
                <div class="news">';

    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news']))
        echo '
                <p>', $context['random_news_line'], '</p>';

            echo '
                </div>


HostGator
Use SMFHELP25OFF for 25% off!
Tags: