forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Tue Apr 24, 2018 6:42 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Feb 06, 2010 9:54 pm 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
Firstly, this is a hack. It's not well written and so really there are better ways of doing it.
Last tested implementation had a minor bug, but hopefully this is corrected for this code. (to be checked by Oli soon)
Sorry for the format of this, I'm not used to patch submission standards so here goes.

Action: Displays a warning in the notifications bar when you have a new PM
Modify : lib/html.php
Location: Within function gameNotifyBlock ()
Line: Line number subject to change with other modifications, so simply replace the line saying
Code:
$gameNotifyBlock = '';

, which is #453 in the current version at time of writing, with:
Code:
      $gameNotifyBlock = '';
      if( !isset($_SESSION['lastSeenHome']) || $_SESSION['lastSeenHome'] < $User->timeLastSessionEnded )
                       $_SESSION['lastSeenHome']=$User->timeLastSessionEnded;
      $newMsg = $DB->sql_row("SELECT timeSent FROM wD_Notices WHERE toUserID=".$User->id."
                        AND type='PM' AND SUBSTRING(linkName,1,3)!='To:'
                        AND timeSent>'".$_SESSION['lastSeenHome']."' LIMIT 1;");
      if ($newMsg)
         $gameNotifyBlock =  '<span class="variantClassic"><a class="country5" href="index.php?notices=on"><img title="Unread" alt="Not received" src="images/icons/alert.png"> New PM <img src="images/icons/mail.png" alt="New messages" title="New messages!"></a></span>';
 


Top
 Profile  
 
PostPosted: Fri Apr 02, 2010 9:00 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Good to see a patch, but on a busy server this'd be too much extra work. It'll have to be done by having some session table/cached json which is set when a person gets a new PM, rather than checking the PMs table


Top
 Profile  
 
PostPosted: Sun Apr 11, 2010 12:16 pm 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
Agreed. I think the next big change would be to rewrite the user interface to load & compile from a number of cached files.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group