Is anybody have code for Pop-up message archive?
or somebody may write code for archive for pop-up message?
Thanks
this is my pops.php
and my popup.php
or somebody may write code for archive for pop-up message?
Thanks
this is my pops.php
Code:
<?php
$uid = getuid_sid($sid);
$nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_pops WHERE touid='".$uid."' AND unread='1'"));
if($nopop[0]>0)
{
$sql ="SELECT * FROM ibwf_pops where touid='".$uid."' AND unread = '1' ORDER BY id LIMIT 0, 1";
$pd = mysql_query($sql);
while ($pop = mysql_fetch_array($pd))
{
$id = mysql_fetch_array(mysql_query("SELECT touid FROM ibwf_pops WHERE touid='".$uid."'"));
if($uid==$id[0])
{
$chread = mysql_query("UPDATE ibwf_pops SET unread='0' WHERE id='".$pop[0]."'");
}
$novo2 = $pop[5];
$dtop = date("d.m.y - H:i:s",$novo2);
$by = getnick_uid($pop[2]);
$msg = htmlspecialchars($pop[1]);
echo "[size="1"][b]$by:[/b] $msg - $dtop[/size]
";
echo "<input type=\"text\" name=\"msg\" maxlength=\"150\"/>
";
echo "[size="1"]<anchor>odgovori<go href=\"popup.php?action=send&sid=$sid\" method=\"post\">";
echo "<postfield name=\"who\" value=\"$pop[2]\"/>";
echo "<postfield name=\"msg\" value=\"$(msg)\"/>";
echo "</go></anchor>[/size]";
echo "
---
";
}
}
and my popup.php
Code:
<?php
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("config.php");
include("core.php");
connectdb();
$action = $_GET['action'];
$sid = $_GET['sid'];
$who = $_GET['who'];
$msg = $_POST['msg'];
if(islogged($sid)==false)
{
echo "<card id=\"main\" title=\"$sitename\">";
echo "<p align=\"center\">";
echo "You are not logged in
";
echo "Or Your session has been expired
";
echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
$uid = getuid_sid($sid);
if(isbanned($uid))
{
echo "<card id=\"main\" title=\"$sitename\">";
echo "<p align=\"center\">";
echo "<img src=\"images/notok.gif\" alt=\"x\"/>
";
echo "You are [b]Banned[/b]
";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
$remain = $banto[0]- time();
$rmsg = gettimemsg($remain);
echo "Time to finish your penalty: $rmsg
";
//echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "</card>";
echo "</wml>";
exit();
}
if($action=="send"){
addonline(getuid_sid($sid),"Sending pop-up MSG","");
echo "<card id=\"main\" title=\"Popup-PM\">";
echo "<p align=\"center\">";
echo "$getbuttons
";
$whonick = getnick_uid($who);
$byuid = getuid_sid($sid);
echo "Sending Popup-PM to ".$whonick."
";
echo "<input type=\"text\" name=\"msg\" maxlength=\"150\"/>
";
echo "[size="1"]<anchor>Send<go href=\"popup.php?action=sendto&who=$who&sid=$sid\" method=\"post\">";
echo "<postfield name=\"msg\" value=\"$(msg)\"/>";
echo "</go></anchor>[/size]";
echo "
<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if($action=="sendto")
{
addonline(getuid_sid($sid),"Sending pop-up MSG","");
echo "<card id=\"main\" title=\"Send Pop-up\">";
echo "<p align=\"center\">";
$whonick = getnick_uid($who);
$byuid = getuid_sid($sid);
$tm = time();
$res = mysql_query("INSERT INTO popup SET text='".$msg."',byuid='".$byuid."', touid='".$who."', timesent='".$tm."'");
echo "Popup Poruka Poslata za $whonick!";
echo "
========================
";
echo "[b]Online:[/b] <a href=\"index.php?action=online&sid=$sid\">".getnumonline()."</a>";
echo "
===========
";
include ('lastpost_wappyMOD2.php');
echo "
<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
?>
</wml>


Comment