|
#1
|
|||
|
|||
Recent News 09
Code:
$adminbutton = ''; if (get_user_class() >= UC_ADMINISTRATOR) $adminbutton = " <span style='float:right;'><a href='admin.php?action=news'><img title='Add News' width='20' height='20' src='pic/plus.png'/></a></span>\n"; echo " <div style='margin-top: -20px;margin-left: -25px;padding: 1em;max-width: 900px;' class='mCol'> <div class='myBlock'><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='margin-left: -815px;font-weight:bold;font-size:12pt;'>News</span>{$adminbutton}</div></div> <div style='padding: 5px;margin-top: -3px;margin-left: 0px;max-width: 900px;box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);'></div> <br />"; $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 = "<div style='float:right;'><a href='admin.php?action=news&mode=edit&newsid={$array['id']}'><img style='margin-top: -5px;' width='20' height='20' src='pic/edit.png' title='Edit'/></a> <a href='admin.php?action=news&mode=delete&newsid={$array['id']}'><img style='margin-top: -5px;' width='20' height='20' src='pic/trash.png' title='Delete'/></a></div>"; } echo "<div style='margin-top: -13px;margin-left: 0px;max-width: 900px;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='margin-left: -732px;font-size:8pt;color: #FFF;'> {$array['headline']}</span> {$button}</div></div> <div style='padding: 5px;margin-top: -3px;margin-left: 0px;max-width: 900px;box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);'></div>\n"; echo "<div style='margin-top: -15px;margin-left: 0px;max-width: 900px;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"; echo "<div style='margin-top: -8px;border: 1px solid #222;color: #b9b9b9;' class='myBlock-con'>".format_comment($array['body'])."</div><div></div></div><div style='padding: 1.5em;'></div><div style='margin-top: -30px;'></div>"; } } echo "</div></div></div>\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; } 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:
<div class="clickToShowInfo"> <div class="info"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua </div> Click here to show info </div> Code:
$adminbutton = ''; if (get_user_class() >= UC_ADMINISTRATOR) $adminbutton = " <span style='float:right;'><a href='admin.php?action=news'><img title='Add News' width='20' height='20' src='pic/plus.png'/></a></span>\n"; echo " <div style='margin-top: -20px;margin-left: -25px;padding: 1em;max-width: 900px;' class='mCol'> <div class='myBlock'><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='margin-left: -815px;font-weight:bold;font-size:12pt;'>News</span>{$adminbutton}</div></div> <div style='padding: 5px;margin-top: -3px;margin-left: 0px;max-width: 900px;box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);'></div> <br />"; $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 = "<div style='float:right;'><a href='admin.php?action=news&mode=edit&newsid={$array['id']}'><img style='margin-top: -5px;' width='20' height='20' src='pic/edit.png' title='Edit'/></a> <a href='admin.php?action=news&mode=delete&newsid={$array['id']}'><img style='margin-top: -5px;' width='20' height='20' src='pic/trash.png' title='Delete'/></a></div>"; } echo "<div style='margin-top: -13px;margin-left: 0px;max-width: 900px;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='margin-left: -732px;font-size:8pt;color: #FFF;'> {$array['headline']}</span> {$button}</div></div> <div style='padding: 5px;margin-top: -3px;margin-left: 0px;max-width: 900px;box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);'></div>\n"; echo "<div style='margin-top: -15px;margin-left: 0px;max-width: 900px;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"; echo "<div style='margin-top: -8px;border: 1px solid #222;color: #b9b9b9;' class='myBlock-con'> <div class="clickToShowInfo"> <div class="info">".format_comment($array['body'])."</div></div></div><div></div></div><div style='padding: 1.5em;'></div><div style='margin-top: -30px;'></div>"; } } echo "</div></div></div>\n"; Bump: Code:
echo "<div style='margin-top: -13px;margin-left: 0px;max-width: 900px;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'> <div class="clickToShowInfo"> <div class="info"> <span style='margin-left: -732px;font-size:8pt;color: #FFF;'> {$array['headline']}</span> {$button}</div></div> <div style='padding: 5px;margin-top: -3px;margin-left: 0px;max-width: 900px;box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);'></div>\n"; echo "<div style='margin-top: -15px;margin-left: 0px;max-width: 900px;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"; echo "<div style='margin-top: -8px;border: 1px solid #222;color: #b9b9b9;' class='myBlock-con'> ".format_comment($array['body'])."</div></div></div><div></div></div><div style='padding: 1.5em;'></div><div style='margin-top: -30px;'></div>"; Bump: CREDITS: https://stackoverflow.com/questions/13630229/can-i-have-an-onclick-effect-in-css Bump: echo "<div style='margin-top: -13px;margin-left: 0px;max-width: 900px;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'> <div class="clickToShowInfo"> <div class="info"> <span style='margin-left: -732px;font-size:8pt;color: #FFF;'> {$array['headline']}</span> {$button}</div></div> <div style='padding: 5px;margin-top: -3px;margin-left: 0px;max-width: 900px;box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);'></div>\n"; echo "<div style='margin-top: -15px;margin-left: 0px;max-width: 900px;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"; echo "<div style='margin-top: -8px;border: 1px solid #222;color: #b9b9b9;' class='myBlock-con'> ".format_comment($array['body'])."</div></div></div><div></div></div><div style='padding: 1.5em;'></div><div style='margin-top: -30px;'></div>"; Bump: Bump: echo "<div style='margin-top: -13px;margin-left: 0px;max-width: 900px;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'> <div class="clickToShowInfo"> <div class="info"> <span style='margin-left: -732px;font-size:8pt;color: #FFF;'> {$array['headline']}</span> {$button}</div></div> <div style='padding: 5px;margin-top: -3px;margin-left: 0px;max-width: 900px;box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);'></div>\n"; echo "<div style='margin-top: -15px;margin-left: 0px;max-width: 900px;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"; echo "<div style='margin-top: -8px;border: 1px solid #222;color: #b9b9b9;' class='myBlock-con'> ".format_comment($array['body'])."</div></div>test_c0de_cl1ck_me_v1eW_NewS</div><div></div></div><div style='padding: 1.5em;'></div><div style='margin-top: -30px;'></div>"; NOT |
Tags |
09 , news , recent |
|
|