Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 07-06-18, 04:39
BamBam0077's Avatar
BamBam0077 BamBam0077 is offline
Support
 
Join Date: Jul 2013
P2P
Posts: 279
Default popup message
hey guys,


I been fiddling with css and php to get a popup alert and I got this solution:


Code:
  <?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 == 1 ? "$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>
               "; 
       } 
?>
when unread messages is lower then 1 it shall look like this:


Click the image to open in full size.


else when you get message alert pops up:


Click the image to open in full size.

CSS:
Code:
.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.


BamBam0077

Last edited by BamBam0077; 07-06-18 at 08:40. Reason: Corrected Images, Corrected <?php tags
Reply With Quote
  #2  
Old 09-06-18, 03:55
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,058
Default
on this peace of code
Code:
<text><a color: #ffffff;' href='messages.php'>$inbox</a></text>
You forgot to add the style tag for this
Code:
 color: #ffffff;'
so it should look like this
Code:
<text><a style='color: #ffffff;' href='messages.php'>$inbox</a></text>
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Managerô forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
The Following User Says Thank You to joeroberts For This Useful Post:
BamBam0077 (09-06-18)
  #3  
Old 23-06-18, 12:05
BamBam0077's Avatar
BamBam0077 BamBam0077 is offline
Support
 
Join Date: Jul 2013
P2P
Posts: 279
Default
Just seen remove
Code:
$email = true;
That was for a demo version.
Reply With Quote
Reply

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 21:38. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2018, vBulletin Solutions Inc.