Pm As Popup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    for those who dnt wona go thru the mobizonez script
    usage where u want the popup to be shown
    Code:
     getalert($sid);
    in ur cpanel or where ppl can turn on the allerts
    Code:
    if (alertstat($sid)==0){
    echo "<a href=\"index.php?action=alert&amp;sid=$sid\">&#187;Turn alerts on</a><br/>";
    }
    else{
    echo "<a href=\"index.php?action=alert&amp;sid=$sid\">&#187;Turn alerts off</a><br/>";
    }
    any place in the index
    Code:
    /////////////////////////////turn alerts on or off////////////////////
    else if($action=="alert")
    {
    addonline($uid,"Toggling alerts","index.php?action=$action");
    gettimebar();
    getnewmsg($sid);
    getalert($sid);
    getshouts($sid);
    boxstart("Toggle Alerts");
    $userwa = $uid;
    if(alertstat($sid)==0){
            mysql_query("UPDATE ibwf_users SET alert=1 WHERE id=$userwa");
            echo "<p>Alerts have been successfully activated<br/>";
    }
    else if(alertstat($sid)==1){
            mysql_query("UPDATE ibwf_users SET alert=0 WHERE id=$userwa");
            echo "<p>Alerts have been successfully de-activated<br/>";
    }
    echo "</p>";
    boxend();
    getfooter($sid);
    }
    in core.php
    Code:
     function getalert($sid){
    
    	if (alertstat($sid)==1){
    
    	$userid = getuid_sid($sid);
    
    		$count = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_private WHERE touid = $userid AND unread='1'"));
    
    		if($count[0]>0){
    
    	$lastmsg_id = mysql_fetch_array(mysql_query("SELECT MIN(id) FROM ibwf_private WHERE touid = $userid AND unread='1'"));
    
    		$pminfo = mysql_fetch_array(mysql_query("SELECT text, timesent, byuid, reported FROM ibwf_private WHERE id = $lastmsg_id[0]"));
    
    	if(isonline($pminfo[2])){
    
    $iml = "<img src=\"images/onl.gif\" alt=\"On\"/>";
    
    }else{
    
    $iml = "<img src=\"images/ofl.gif\" alt=\"Off\"/>";
    
    }
    
    $msgtxt = "
    
    	<div class=\"boxed\">
    
          <div class=\"boxedTitle\">
    
            <h1 align=\"center\" class=\"boxedTitleText\"><b>Message Alert</b>
    
    	</h1>
    
          </div>
    
          <div class=\"boxedContent\">
    
    ";
    
    $msgtxt .= "<small><b>From</b>: $iml<a href=\"index.php?action=viewuser&amp;who=$pminfo[2]&amp;sid=$sid\">".getnick_uid($pminfo[2])."</a><br/>";
    
    $tmstamp = $pminfo[1] + addhours();
    
    $tmdt = date("d/m/Y h:i:s A", $tmstamp);
    
    $diff1=time()-$pminfo[1];
    
    $msgtxt .= "<b>Sent</b>: $tmdt<br/>".gettimemsg($diff1)."<br/>";
    
    $pmtext = parsepm($pminfo[0], $sid);
    
    if(isspam($pmtext)){
    
    if(($pminfo[3]=="0") && ($pminfo[2]!=1)){
    
    mysql_query("UPDATE ibwf_private SET reported='1' WHERE id='".$pmid."'");
    
    }
    
    }
    
    $msgtxt .= "<b>Message</b>:<br/>".$pmtext;
    
    $msgtxt .= "<u><br/>Reply:</u>:<br/>";
    
    $msgtxt .= "<form action=\"inbxproc.php?action=sendpm&amp;who=$pminfo[2]&amp;sid=$sid\" method=\"post\"><textarea id=\"inputText\" name=\"pmtext\"></textarea><br/>";
    
    $msgtxt .= "<input id=\"inputButton\" type=\"submit\" value=\"Send\"/>";
    
    $msgtxt .= "</form>";
    
    $msgtxt .= "<br/><a href=\"inbox.php?action=main&amp;sid=$sid\">Go to Inbox</a><br/></small></div></div>";
    
    mysql_query("UPDATE ibwf_private SET unread='0' WHERE id = $lastmsg_id[0]");
    
    echo $msgtxt;
    
    return;
    
    }
    
    else {
    
    	return "";
    
    }
    
    }
    
    else {
    
    	return "";
    
    }
    
    }function getppp($uid){
    
    	$ppp = mysql_fetch_array(mysql_query("SELECT ppp FROM ibwf_users WHERE id = $uid"));
    
    	return $ppp[0];
    
    }
     function alertstat($sid){
    
    	$userid=getuid_sid($sid);
    
    	if(!$userid){
    
    		return 0;
    
    	}
    
    $alerstat = mysql_fetch_array(mysql_query("SELECT alert FROM ibwf_users WHERE id = $userid"));
    
    return $alerstat[0];
    
    }
    here are the sql add in ibwf_user
    Code:
      `alert` int(1) NOT NULL default '0',
    i think thats all for the popup pm enjoy

    Comment


      #17
      easy to code with alert pm but i cant code in a popup way using JAVA sCRIPT lol

      Comment

      Working...
      X