Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Recent News 09 (http://www.bvlist.com/showthread.php?t=11773)

BamBam0077 4th October 2018 12:05

Recent News 09
 
https://images2.imgbox.com/c7/3c/L3IlaPuy_o.png


Code:

$adminbutton = ''; 
   
    if (get_user_class() >= UC_ADMINISTRATOR)
          $adminbutton = " \n";
         
    echo "
   

   

   
News{$adminbutton}

   

    ";
     
    $res = sql_query("SELECT * FROM news WHERE added + ( 3600 *24 *45 ) >
                    ".time()." ORDER BY added DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
                   
    if (mysqli_num_rows($res) > 0)
    {
      require_once "include/bbcode_functions.php";

      $button = "";
     
      while($array = mysqli_fetch_assoc($res))
      {
        if (get_user_class() >= UC_ADMINISTRATOR)
        {
          $button = "
 
";
        }
       
      echo "

                   
  {$array['headline']}  {$button}

                   
\n";
       
      echo "

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

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-left: 0px;
    background-color: #333333;
    line-height: 200%;
    position: relative;
    bottom: 4px
}
.myBlock-con {
    display: block;
    padding: 7px;
}

Bump:
Code:

/* Outer div - needs to be relative so we can use absolute positioning */
    .clickToShowInfo {
        position: relative;
    }
    /* When clicking outer div, make inner div visible */
    .clickToShowInfo:active .info { visibility: visible; }
    /* And hold by staying visible on hover */
    .info:hover {
        visibility: visible;
    }
    /* General settings for popup */
    .info {
        position: absolute;
        top: -10;
        visibility: hidden;
        z-index: 100;
        background-color: white;
        box-shadow: 5px 5px 2px #aaa;
        border: 1px solid grey;
        padding: 8px;
        width: 220px;
        height: 200px;
    }
    /* If we want clicking on the popup to close, use this */
    .info:active {
        visibility: hidden;    /* Doesn't work because DCEvent is :active as well */
        height: 0px;
        width: 0px;
        left: -1000px;
        top: -1000px;
    }

Code:


   

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
   

    Click here to show info

edit code above to suit your needs

Code:

$adminbutton = ''; 
   
    if (get_user_class() >= UC_ADMINISTRATOR)
          $adminbutton = " \n";
         
    echo "
   

   

   
News{$adminbutton}

   

    ";
     
    $res = sql_query("SELECT * FROM news WHERE added + ( 3600 *24 *45 ) >
                    ".time()." ORDER BY added DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
                   
    if (mysqli_num_rows($res) > 0)
    {
      require_once "include/bbcode_functions.php";

      $button = "";
     
      while($array = mysqli_fetch_assoc($res))
      {
        if (get_user_class() >= UC_ADMINISTRATOR)
        {
          $button = "
 
";
        }
       
      echo "

                   
  {$array['headline']}  {$button}

                   
\n";
       
      echo "

                   
\n";
       
      echo "


   
".format_comment($array['body'])."
";
       
     
      }
   
    }
    echo "
\n";
NOT TESTED SHOULD WORK, click on $array['news_body '] to open close then if that worked modify html code so when they click $array['news_headline'] for example it should collapse $array['news_body']. Using purely CSS to open/close rather than using old java_klappe.js code. :wave:

Bump:
Code:

echo "

                   


   

  {$array['headline']}  {$button}

                   
\n";
       
      echo "

                   
\n";
       
      echo "

".format_comment($array['body'])."
";
NOT TESTED YET!!, SHOULD COLLAPSE ONCLICK HEADLINE SHOULD COLLAPSE ENTIRE NEWS POSTED // SHARED NOW :welcome:

Bump: CREDITS: https://stackoverflow.com/questions/13630229/can-i-have-an-onclick-effect-in-css

Bump: echo "




  {$array['headline']} {$button}

\n";

echo "

\n";

echo "

".format_comment($array['body'])."
";

Bump:

Bump: echo "




  {$array['headline']} {$button}

\n";

echo "

\n";

echo "

".format_comment($array['body'])."
test_c0de_cl1ck_me_v1eW_NewS
";
NOT


All times are GMT +2. The time now is 03:29.

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