Msg Alert

Started by BamBam0077, November 21, 2017, 06:57:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

n1trokidd82

#3
<?php
 $res1 
sql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " AND unread='yes'") or sqlerr(__LINE__,__FILE__);
     
    
$arr1 mysqli_fetch_row($res1);
    
    
$unread $arr1[0];
    
    
$inbox = ($unread == "$unread&nbsp;{$lang['gl_msg_singular']}"$unread&nbsp;{$lang['gl_msg_plural']}");



        
$email true;
       if ( 
$unread >= "1" ) {
           
         echo 
"<div class='box' id='box'>
               <div style='margin-top: 400px;' id='popup'>
               <text><a style='float: right;' class='close' href='#' onclick=document.getElementById('id01').style.display='none'>&times;</a></text>
               <div class='content'>
               <div style='padding: 0.3em;'></div>
               <a href='#' class='close'></a>
               <text><a color: #ffffff;' href='messages.php'>
$inbox</a></text>
               </div></div></div>
               "

       } 
?>


CSS3

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
}
.overlay:target {
  visibility: visible;
  opacity: 1;
}

.popup {
    margin-top: 590px;
  margin-left: 650px;
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  width: 30%;
  position: relative;
  transition: all 5s ease-in-out;
}

.popup h2 {
  margin-top: 0;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;
}
.popup .close {
  position: absolute;
  top: 20px;
  right: 30px;
  transition: all 200ms;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.popup .close:hover {
  color: #06D85F;
}
.popup .content {
  max-height: 30%;
  overflow: auto;
}

@media screen and (max-width: 700px){
  .box{
    width: 70%;
  }
  .popup{
    width: 70%;
  }
}
.overlay2 {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
}
.overlay2:target {
  visibility: visible;
  opacity: 1;
}

.popup2 {
  margin-left: 650px;
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  width: 30%;
  position: relative;
  transition: all 5s ease-in-out;
}

.popup2 h2 {
  margin-top: 0;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;
}
.popup2 .close {
  position: absolute;
  top: 20px;
  right: 30px;
  transition: all 200ms;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.popup2 .close:hover {
  color: #06D85F;
}
.popup2 .content2 {
  max-height: 30%;
  overflow: auto;
}

@media screen and (max-width: 700px){
  .box2{
    width: 70%;
  }
  .popup2{
    width: 70%;
  }
}

Thankyou very much dude and above is MySQLi updates 😎

BamBam0077

css + php no javascript

<?php
 $res1 
= @mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " AND unread='yes'") or sqlerr(__LINE__,__FILE__);
     
    
$arr1 mysql_fetch_row($res1);
    
    
$unread $arr1[0];
    
    
$inbox = ($unread == "$unread&nbsp;{$lang['gl_msg_singular']}"$unread&nbsp;{$lang['gl_msg_plural']}");



        
$email true;
       if ( 
$unread >= "1" ) {
           
         echo 
"<div class='box' id='box'>
               <div style='margin-top: 400px;' id='popup'>
               <text><a style='float: right;' class='close' href='#' onclick=document.getElementById('id01').style.display='none'>&times;</a></text>
               <div class='content'>
               <div style='padding: 0.3em;'></div>
               <a href='#' class='close'></a>
               <text><a color: #ffffff;' href='messages.php'>
$inbox</a></text>
               </div></div></div>
               "

       } 
?>




.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
}
.overlay:target {
  visibility: visible;
  opacity: 1;
}

.popup {
    margin-top: 590px;
  margin-left: 650px;
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  width: 30%;
  position: relative;
  transition: all 5s ease-in-out;
}

.popup h2 {
  margin-top: 0;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;
}
.popup .close {
  position: absolute;
  top: 20px;
  right: 30px;
  transition: all 200ms;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.popup .close:hover {
  color: #06D85F;
}
.popup .content {
  max-height: 30%;
  overflow: auto;
}

@media screen and (max-width: 700px){
  .box{
    width: 70%;
  }
  .popup{
    width: 70%;
  }
}
.overlay2 {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
}
.overlay2:target {
  visibility: visible;
  opacity: 1;
}

.popup2 {
  margin-left: 650px;
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  width: 30%;
  position: relative;
  transition: all 5s ease-in-out;
}

.popup2 h2 {
  margin-top: 0;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;
}
.popup2 .close {
  position: absolute;
  top: 20px;
  right: 30px;
  transition: all 200ms;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.popup2 .close:hover {
  color: #06D85F;
}
.popup2 .content2 {
  max-height: 30%;
  overflow: auto;
}

@media screen and (max-width: 700px){
  .box2{
    width: 70%;
  }
  .popup2{
    width: 70%;
  }
}

hope this help you out.

[/code]
"When Darkness Shadows Your Doubts, Deep Within Us Is Our Key, Not Success But Everything" ~ Anonymous

BamBam0077

#1
updated msg alert function:
by Myself

Deprecated Version

[b]Deprecated Version[/b]
    if ($TBDEV['msg_alert'] && $msgalert && $CURUSER)
    {
      $res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or sqlerr(__FILE__,__LINE__);
      $arr = mysql_fetch_row($res);
      $unread = $arr[0];
    }


my version:

if ( isset($CURUSER) ) {
   if ( isset($CURUSER['backend_logs']) == "yes") {
   if ( isset($TBDEV['msg_alert']) && $msgalert ) {
$res = mysqli_query("SELECT new_msg FROM messages WHERE receiver=".sqlesc($CURUSER['id'])." && unread_msg='yes') or mysqli_error(__FILE__, __LINE__);
while ( $arr = mysqli_fetch_row($res) ) {
$unread = $arr[0];
    }
   }
  }
}

should be secure enough to enjoy with running within your installed 09shoutbox give it a try.
"When Darkness Shadows Your Doubts, Deep Within Us Is Our Key, Not Success But Everything" ~ Anonymous