Skip to content

Commit

Permalink
Latest messaging system
Browse files Browse the repository at this point in the history
Needs a lot of work still but you can now manage your contact list
and send/receive messages from people so it's usable!
  • Loading branch information
moodler committed Dec 28, 2004
1 parent f7ea3a0 commit e8e2d7f
Show file tree
Hide file tree
Showing 6 changed files with 957 additions and 32 deletions.
17 changes: 17 additions & 0 deletions message/history.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php // $Id$
// For listing message histories

require('../config.php');

require_login();

/// Script parameters
$userid = required_param('id', PARAM_INT);

/// Check the user we are talking to is valid
if (! $user = get_record("user", "id", $userid)) {
error("User ID was incorrect");
}

print_heading('This script is not completed yet');
?>
36 changes: 27 additions & 9 deletions message/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,44 @@
require('../config.php');
require('lib.php');

$tab = optional_param('tab', 'contacts');
$ftab = 'message_print_'.$tab;
require_login(0, false);

/// optional variables that may be passed in
$tab = optional_param('tab', 'contacts'); // current tab - default to contacts
$addcontact = optional_param('addcontact', false); // adding a contact
$removecontact = optional_param('removecontact', false); // removing a contact
$blockcontact = optional_param('blockcontact', false); // blocking a contact
$unblockcontact = optional_param('unblockcontact', false); // unblocking a contact

if (($addcontact !== false) and confirm_sesskey()) message_add_contact($addcontact);
if (($removecontact !== false) and confirm_sesskey()) message_remove_contact($removecontact);
if (($blockcontact !== false) and confirm_sesskey()) message_block_contact($blockcontact);
if (($unblockcontact !== false) and confirm_sesskey()) message_unblock_contact($unblockcontact);


/// a print function is associated with each tab
$tabprintfunction = 'message_print_'.$tab;

print_header(get_string('messaging').' - '.$SITE->fullname);

print_header(get_string('messages', 'message').' - '.$SITE->fullname);

?>

<table cellspacing="2" cellpadding="2" border="0" bgcolor="#ffffff" align="center" width="80%">
<table cellspacing="2" cellpadding="2" border="0" align="center" width="95%">
<tr>
<th class="message_tab_selected"><a href="<?php echo $ME ?>?tab=contacts">contacts</a></th>
<th class="message_tab"><a href="<?php echo $ME ?>?tab=search">search</a></th>
<th class="message_tab"><a href="<?php echo $ME ?>?tab=settings">settings</a></th>
<th class="<?php echo ($tab == 'contacts') ? 'generaltabselected' : 'generaltab' ?>">
<a href="<?php echo $ME ?>?tab=contacts">contacts</a>
</th>
<th class="<?php echo ($tab == 'search') ? 'generaltabselected' : 'generaltab' ?>">
<a href="<?php echo $ME ?>?tab=search">search</a>
</th>
<th class="<?php echo ($tab == 'settings') ? 'generaltabselected' : 'generaltab' ?>">
<a href="<?php echo $ME ?>?tab=settings">settings</a>
</th>
</tr>
<tr>
<td colspan="3">
<?php if (function_exists($ftab)) $ftab(); ?>
<td colspan="3" bgcolor="#ffffff">
<?php if (function_exists($tabprintfunction)) $tabprintfunction(); ?>
</td>
</tr>
</table>
Expand Down
Loading

0 comments on commit e8e2d7f

Please sign in to comment.