Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 25th April 2015, 18:22
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
Default [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.

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 = "&nbsp;<span style='float:right;'><a href='admin.php?action=news'>News page</a></span>\n";
          
    $HTMLOUT .= "<div style='text-align:left;width:80%;border:1px solid blue;padding:5px;'>
    <div style='background:lightgrey;height:25px;'><span style='font-weight:bold;font-size:12pt;'>{$lang['news_title']}</span>{$adminbutton}</div><br />";
      
    $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 = "<div style='float:right;'><a href='admin.php?action=news&amp;mode=edit&amp;newsid={$array['id']}'>{$lang['news_edit']}</a>&nbsp;<a href='admin.php?action=news&amp;mode=delete&amp;newsid={$array['id']}'>{$lang['news_delete']}</a></div>";
        }
        
        $HTMLOUT .= "<div style='background:lightgrey;height:20px;'><span style='font-weight:bold;font-size:10pt;'>{$array['headline']}</span></div>\n";
        
        $HTMLOUT .= "<span style='color:grey;font-weight:bold;text-decoration:underline;'>".get_date( $array['added'],'DATE') . "</span>{$button}\n";
        
        $HTMLOUT .= "<div style='margin-top:10px;padding:5px;'>".format_comment($array['body'])."</div><hr />\n";
        
      
      }
     
    }

    $HTMLOUT .= "</div><br />\n";
Replace With:
Code:
    $adminbutton = '';
    
    if (get_user_class() >= UC_ADMINISTRATOR)
          $adminbutton = "&nbsp;<span style='float:right;'><a href='admin.php?action=news'>News page</a></span>\n";
          
    $HTMLOUT .= "
    <div style='margin-left: -15px;padding: 1em;width: 1085px;' class='mCol'>
    <div class='myBlock'>
    <div class='myBlock-cap'><span style='font-weight:bold;font-size:12pt;'>{$lang['news_title']}</span>{$adminbutton}</div><br />";
      
    $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 = "<div style='float:right;'><a href='admin.php?action=news&amp;mode=edit&amp;newsid={$array['id']}'><img style='margin-top: -5px;' width='20' height='20' src='http://i.imgbox.com/gWUsBcEZ.png' title='Edit'/></a>&nbsp;<a href='admin.php?action=news&amp;mode=delete&amp;newsid={$array['id']}'><img style='margin-top: -5px;' width='20' height='20' src='http://i.imgbox.com/fe48nYbb.png' title='Delete'/></a></div>";
        }
        
        $HTMLOUT .= "<div style='margin-top: -10px;margin-left: 5px;width: 1045px;box-shadow: 0 3px 10px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);'>
                     <div class='myBlock-cap'><span style='font-size:8pt;color: #FFF;'>".get_date( $array['added'],'DATE') . " &nbsp;&nbsp;{$array['headline']}</span>{$button}</div></div>\n";
        
        $HTMLOUT .= "<div style='margin-top: -15px;margin-left: 5px;width: 1045px;box-shadow: 0 3px 10px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);'>
                     <div class='myBlock-con'></div>\n";
        
        $HTMLOUT .= "<div class='myBlock-con'>".format_comment($array['body'])."</div><div></div></div><br />\n";
        
      
      }
     
    }

    $HTMLOUT .= "</div></div></div>\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.

Look:
Click the image to open in full size.
Reply With Quote
  #2  
Old 25th April 2015, 18:54
Demon-Cod3rs Demon-Cod3rs is offline
Banned
 
Join Date: Apr 2015
P2P
Posts: 47
Default
yes this looks very nice ill add it to my forum site like it
Reply With Quote
The Following 2 Users Say Thank You to Demon-Cod3rs For This Useful Post:
BamBam0077 (25th April 2015), DarkSnow (2nd September 2015)
  #3  
Old 25th April 2015, 19:00
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
interesting.. good starting point to build a dark theme :)
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
The Following 2 Users Say Thank You to DND For This Useful Post:
BamBam0077 (25th April 2015), DarkSnow (2nd September 2015)
  #4  
Old 25th April 2015, 19:10
Demon-Cod3rs Demon-Cod3rs is offline
Banned
 
Join Date: Apr 2015
P2P
Posts: 47
Default
DND true
Reply With Quote
  #5  
Old 25th April 2015, 19:12
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
Default
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:
<div class='myBlock-cap'><span style='font-weight:bold;font-size:12pt;'>{$lang['news_title']}</span>{$adminbutton}</div>
then replace with:

Code:
<div style='margin-top: 5px;box-shadow: 0 3px 10px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);'>
    <div class='myBlock-cap'><span style='font-weight:bold;font-size:12pt;'>{$lang['news_title']}</span>{$adminbutton}</div></div>
it should make it appear like this:

Click the image to open in full size.

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

Small Fix:

Find:
Code:
 $HTMLOUT .= "<div class='myBlock-con'>".format_comment($array['body'])."</div><div></div></div><br />\n";
Replace With:
Code:
$HTMLOUT .= "<div class='myBlock-con'>".format_comment($array['body'])."</div><div></div></div><div style='padding: 1.5em;'></div><div style='margin-top: -35px;'></div>";
OutCome -
Click the image to open in full size.

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

Last edited by BamBam0077; 25th April 2015 at 21:55. Reason: Added Small Fix
Reply With Quote
The Following 2 Users Say Thank You to BamBam0077 For This Useful Post:
DarkSnow (2nd September 2015), Demon-Cod3rs (25th April 2015)
Reply

Tags
news , recent , tbdev09

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 15:38. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.