Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   [TBDEV09] New Recent News Look (http://www.bvlist.com/showthread.php?t=10353)

BamBam0077 25th April 2015 18:22

[TBDEV09] New Recent News Look
 
Hey Guys,

I know this code is old an all but I have just been fiddling with code here and there for something to do on a daily bases, well actually this new look is being used currently on a site of mine and I thought what the hell people should like it just as much as I did creating it. :gum:

I really hope you do like it and I have not really touched anything on the news module I have just moved the code around and added what I seen fit that needed to be added or removed.

Edit index.php or if you have created your own block for news then edit that.

Here We Go!

Replace:
Code:

    $adminbutton = '';
   
    if (get_user_class() >= UC_ADMINISTRATOR)
          $adminbutton = " News page\n";
         
    $HTMLOUT .= "

   
{$lang['news_title']}{$adminbutton}
";
     
    $res = mysql_query("SELECT * FROM news WHERE added + ( 3600 *24 *45 ) >
                    ".time()." ORDER BY added DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
                   
    if (mysql_num_rows($res) > 0)
    {
      require_once "include/bbcode_functions.php";

      $button = "";
     
      while($array = mysql_fetch_assoc($res))
      {
        if (get_user_class() >= UC_ADMINISTRATOR)
        {
          $button = "";
        }
       
        $HTMLOUT .= "
{$array['headline']}
\n";
       
        $HTMLOUT .= "".get_date( $array['added'],'DATE') . "{$button}\n";
       
        $HTMLOUT .= "
".format_comment($array['body'])."

\n";
       
     
      }
   
    }

    $HTMLOUT .= "
\n";

Replace With:
Code:

    $adminbutton = '';
   
    if (get_user_class() >= UC_ADMINISTRATOR)
          $adminbutton = " News page\n";
         
    $HTMLOUT .= "
   

   

   
{$lang['news_title']}{$adminbutton}
";
     
    $res = mysql_query("SELECT * FROM news WHERE added + ( 3600 *24 *45 ) >
                    ".time()." ORDER BY added DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
                   
    if (mysql_num_rows($res) > 0)
    {
      require_once "include/bbcode_functions.php";

      $button = "";
     
      while($array = mysql_fetch_assoc($res))
      {
        if (get_user_class() >= UC_ADMINISTRATOR)
        {
          $button = "
 
";
        }
       
        $HTMLOUT .= "

                   
".get_date( $array['added'],'DATE') . "   {$array['headline']}{$button}
\n";
       
        $HTMLOUT .= "

                   
\n";
       
        $HTMLOUT .= "
".format_comment($array['body'])."
\n";
       
     
      }
   
    }

    $HTMLOUT .= "
\n";
Then Add into your css ( default.css ):
Code:

.myBlock {
    display: block;
    background-color: #151515;
    background-repeat: repeat-x;
    background-position: top;
    width: 100%;
    border: 1px solid #222;
    margin: 0px;
    padding: 0px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);       
}
.myBlock-cap {
    display: block;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #FFF;
    margin: 0px;
    background-color: #333333;
    line-height: 200%;
    position: relative;
    bottom: 4px
}
.myBlock-con {
    display: block;
    padding: 7px;
}

I seriously hope you like it also if doesn't turn out like it does in the image I can help you out and tweak it best suit your site or I could give you my outer css part and will sit perfect inside but if your game enough to experiment on your own then go ahead no one is going to judge you for taking a step forward or making a mistake. :ok:

Look:
http://i.imgbox.com/sZ3pSs36.png

Demon-Cod3rs 25th April 2015 18:54

yes this looks very nice ill add it to my forum site like it:drink:

DND 25th April 2015 19:00

interesting.. good starting point to build a dark theme :)

Demon-Cod3rs 25th April 2015 19:10

DND true :drink:

BamBam0077 25th April 2015 19:12

a little bit to make it a tad interesting if people think that the main area is to flat above all the news just go find the following:

Code:

{$lang['news_title']}{$adminbutton}

then replace with:

Code:


   
{$lang['news_title']}{$adminbutton}

it should make it appear like this:

http://i.imgbox.com/XXNkFjjH.png

then it should kinda look more appealing well it does in my eyes. :friend:

Small Fix:

Find:
Code:

$HTMLOUT .= "
".format_comment($array['body'])."
\n";
Replace With:
Code:

$HTMLOUT .= "
".format_comment($array['body'])."
";
OutCome -
http://i.imgbox.com/No1ssCKf.png

You will notice it makes the bottom more neater and brings it up closer then using
tags as you will have noticed it gave it a massive gap at bottom well that shouldn't be a issue anymore ;)


All times are GMT +2. The time now is 11:32.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.