View Single Post
  #1  
Old 8th September 2010, 02:40
daffy's Avatar
daffy daffy is offline
Senior Member
 
Join Date: Mar 2009
United Kingdom
Posts: 550
Default annoying pm pop up
was a little annoying when a user pms you and cant navigate away till you read it, well i changed this so only poped up on pm page. even that was doing my head in, so now its simpler.


open theme/****/main.php

find and delete
Code:
$has_newpm = false;
$sql = "SELECT id FROM ".$db_prefix."_private_messages WHERE recipient = '".$user->id."' AND is_read = 'false' LIMIT 1;";
$res = $db->sql_query($sql) or btsqlerror($sql);
$has_newpm = ($db->sql_numrows($res) > 0) ? true : false;
$db->sql_freeresult($res);
if ($has_newpm)
{
  echo "<script type=\"text/javascript\" language=\"JavaScript\">";
  echo "sPath = window.location.pathname;";
  echo "sPage = sPath.substring(sPath.lastIndexOf('/') + 1);";
  
  echo "if (sPage != \"pm.php\"){ var answer = confirm (\""._jscriptconfirmtext."\");";
  echo "if (answer) window.location=\"pm.php?op=inbox\";";
  echo "}";
  echo "</script>";

}
find
Code:
// WARN things START
if ($user->user) {
if ($user->downloaded > 0){
include ("./ratiowarn.php");
}
}
and add above
Code:
$has_newpm = false;
$sql = "SELECT id FROM ".$db_prefix."_private_messages WHERE recipient = '".$user->id."' AND is_read = 'false' LIMIT 1;";
$res = $db->sql_query($sql) or btsqlerror($sql);
$pmcount = $db->sql_numrows($res);
$has_newpm = ($pmcount > 0) ? true : false;
$db->sql_freeresult($res);
if ($has_newpm)
{
 print("<center><p><table border=0 cellspacing=0 cellpadding=0 bgcolor=green><tr><td style='padding: 10px; background: red'>\n");
 print("<a href=pm.php?op=inbox><font color=white><u>You Have <B>".$pmcount."</b> New Message!</U></font></a>");
 print("</td></tr></table></p></center>\n");
}
Click the image to open in full size.
__________________
"FFS PPL READ GOD DAMMIT, WHAT AM I GOOGLE?"
"I Kill You!" simples


http://i.imgur.com/DtcRfH5.gif

I also Setup And Modify Trackers PM For Details
Reply With Quote
The Following User Says Thank You to daffy For This Useful Post:
romano1 (23rd January 2012)