diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2005-08-07 17:41:18 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2005-08-07 17:41:18 +0000 |
| commit | 49e1c6d5e943688ec6c50b647fd348ce508ce661 (patch) | |
| tree | 4c021d66bc2cd51a2abcb41fc1a5d9e47d83d6a7 | |
| parent | cf0e9b1c3f80ae05fc53d3de8cdd374ebd49c385 (diff) | |
| download | messages-49e1c6d5e943688ec6c50b647fd348ce508ce661.tar.gz messages-49e1c6d5e943688ec6c50b647fd348ce508ce661.tar.bz2 messages-49e1c6d5e943688ec6c50b647fd348ce508ce661.zip | |
merge recent changes from R1 to HEAD
| -rw-r--r-- | broadcast.php | 4 | ||||
| -rw-r--r-- | messu_lib.php | 24 | ||||
| -rw-r--r-- | modules/mod_unread_messages.tpl | 4 | ||||
| -rw-r--r-- | templates/messu_broadcast.tpl | 4 | ||||
| -rw-r--r-- | templates/messu_mailbox.tpl | 4 | ||||
| -rw-r--r-- | templates/messu_message_notification.tpl | 2 | ||||
| -rw-r--r-- | templates/messu_nav.tpl | 6 | ||||
| -rw-r--r-- | templates/messu_read.tpl | 32 |
8 files changed, 40 insertions, 40 deletions
diff --git a/broadcast.php b/broadcast.php index 64e274b..1818be8 100644 --- a/broadcast.php +++ b/broadcast.php @@ -3,7 +3,7 @@ * message package modules * * @author -* @version $Header: /cvsroot/bitweaver/_bit_messages/broadcast.php,v 1.3 2005/08/01 18:41:08 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_messages/broadcast.php,v 1.4 2005/08/07 17:41:17 squareing Exp $ * @package messages * @subpackage functions */ @@ -107,7 +107,7 @@ if (isset($_REQUEST['send'])) { foreach ($all_users as $a_user) { if (!empty($a_user)) { if ($messulib->user_exists($a_user)) { - if ($messulib->get_user_preference($a_user, 'allowMsgs', 'y')) { + if ($messulib->getPreference('allowMsgs', 'y',$a_user )) { $users[] = $a_user; } else { // TODO: needs translation as soon as there is a solution for strings with embedded variables diff --git a/messu_lib.php b/messu_lib.php index cc3dcd9..79bb176 100644 --- a/messu_lib.php +++ b/messu_lib.php @@ -3,7 +3,7 @@ * message package modules * * @author -* @version $Revision: 1.4 $ +* @version $Revision: 1.5 $ * @package messages */ @@ -36,7 +36,7 @@ class Messu extends BitBase { // Prevent duplicates $hash = md5($subject . $body); - if ($this->getOne("select count(*) from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? and `from_user_id`=? and `hash`=?", array( $userInfo['user_id'], $gBitUser->mUserId, $hash ) ) ) { + if ($this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? and `from_user_id`=? and `hash`=?", array( $userInfo['user_id'], $gBitUser->mUserId, $hash ) ) ) { $this->mErrors['compose'] = $pToLogin.' '.tra( 'has already received this message' ); } else { @@ -44,7 +44,7 @@ class Messu extends BitBase { $query = "INSERT INTO `".BIT_DB_PREFIX."messu_messages` (`to_user_id`, `from_user_id`, `msg_to`, `msg_cc`, `msg_bcc`, `subject`, `body`, `date`, `is_read`, `is_replied`, `is_flagged`, `priority`, `hash` ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"; - $this->query( $query, array( $userInfo['user_id'], $gBitUser->mUserId, $to, $cc, $bcc, $subject, $body,(int) $now,'n','n','n',(int) $priority,$hash ) ); + $this->mDb->query( $query, array( $userInfo['user_id'], $gBitUser->mUserId, $to, $cc, $bcc, $subject, $body,(int) $now,'n','n','n',(int) $priority,$hash ) ); // Now check if the user should be notified by email $foo = parse_url($_SERVER["REQUEST_URI"]); @@ -100,10 +100,10 @@ class Messu extends BitBase { $query = "SELECT uu.`login` AS `user`, uu.`real_name`, uu.`user_id`, mm.* from `".BIT_DB_PREFIX."messu_messages` mm INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON( mm.`from_user_id`=uu.`user_id` ) WHERE `to_user_id`=? $mid - ORDER BY ".$this->convert_sortmode($sort_mode).",".$this->convert_sortmode("msg_id_desc"); + ORDER BY ".$this->mDb->convert_sortmode($sort_mode).",".$this->mDb->convert_sortmode("msg_id_desc"); $query_cant = "select count(*) from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? $mid"; - $result = $this->query($query,$bindvars,$maxRecords,$offset); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -125,14 +125,14 @@ class Messu extends BitBase { if (!$msg_id) return false; $query = "update `".BIT_DB_PREFIX."messu_messages` set `$flag`=? where `to_user_id`=? and `msg_id`=?"; - $this->query($query,array($val,$pUserId,(int)$msg_id)); + $this->mDb->query($query,array($val,$pUserId,(int)$msg_id)); } function delete_message($pUserId, $msg_id) { if (!$msg_id) return false; $query = "delete from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? and `msg_id`=?"; - $this->query($query,array($pUserId,(int)$msg_id)); + $this->mDb->query($query,array($pUserId,(int)$msg_id)); } function get_next_message($pUserId, $msg_id, $sort_mode, $find, $flag, $flagval, $prio) { @@ -159,7 +159,7 @@ class Messu extends BitBase { } $query = "select min(`msg_id`) as `nextmsg` from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? and `msg_id` > ? $mid "; - $result = $this->query($query,$bindvars,1,0); + $result = $this->mDb->query($query,$bindvars,1,0); $res = $result->fetchRow(); if (!$res) @@ -190,7 +190,7 @@ class Messu extends BitBase { $bindvars[] = $findesc; } $query = "select max(`msg_id`) as `prevmsg` from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? and `msg_id` < ? $mid"; - $result = $this->query( $query, $bindvars, 1, 0 ); + $result = $this->mDb->query( $query, $bindvars, 1, 0 ); $res = $result->fetchRow(); if (!$res) @@ -202,7 +202,7 @@ class Messu extends BitBase { function get_message( $pUserId, $msg_id ) { $bindvars = array( $pUserId, (int)$msg_id ); $query = "select * from `".BIT_DB_PREFIX."messu_messages` WHERE `to_user_id`=? and `msg_id`=?"; - $result = $this->query($query,$bindvars); + $result = $this->mDb->query($query,$bindvars); $res = $result->fetchRow(); $content = new LibertyContent(); $res['parsed'] = $content->parseData( $res['body'], PLUGIN_GUID_TIKIWIKI ); @@ -215,7 +215,7 @@ class Messu extends BitBase { /*shared*/ function user_unread_messages( $pUserId ) { - return $this->getOne( "select count( * ) from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? and `is_read`=?",array( $pUserId,'n' ) ); + return $this->mDb->getOne( "select count( * ) from `".BIT_DB_PREFIX."messu_messages` where `to_user_id`=? and `is_read`=?",array( $pUserId,'n' ) ); } } diff --git a/modules/mod_unread_messages.tpl b/modules/mod_unread_messages.tpl index 06d46e7..9cde826 100644 --- a/modules/mod_unread_messages.tpl +++ b/modules/mod_unread_messages.tpl @@ -1,7 +1,7 @@ -{* $Header: /cvsroot/bitweaver/_bit_messages/modules/mod_unread_messages.tpl,v 1.1 2005/06/19 04:56:31 bitweaver Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_messages/modules/mod_unread_messages.tpl,v 1.2 2005/08/07 17:41:18 squareing Exp $ *} {if $gBitUser->isRegistered() and $gBitSystem->isPackageActive( 'messu') and $gBitUser->hasPermission( 'bit_p_messages' )} {bitmodule title="$moduleTitle" name="messages_unread_messages"} - <a href="{$gBitLoc.MESSU_PKG_URL}message_box.php"> + <a href="{$smarty.const.MESSU_PKG_URL}message_box.php"> {tr}You have <strong>{$unreadMsgs} unread</strong> {if $unreadMsgs eq '1'}message{else}messages{/if}{/tr} </a> {/bitmodule} diff --git a/templates/messu_broadcast.tpl b/templates/messu_broadcast.tpl index 76501ab..7068d82 100644 --- a/templates/messu_broadcast.tpl +++ b/templates/messu_broadcast.tpl @@ -1,7 +1,7 @@ <div class="floaticon">{bithelp}</div> <div class="contain usermessages"> <div class="header"> -<h1><a href="{$gBitLoc.MESSU_PKG_URL}broadcast.php">{tr}Broadcast message{/tr}</a></h1> +<h1><a href="{$smarty.const.MESSU_PKG_URL}broadcast.php">{tr}Broadcast message{/tr}</a></h1> </div> {include file="bitpackage:users/my_bitweaver_bar.tpl"} @@ -12,7 +12,7 @@ {if $sent} {$message} {else} -<form action="{$gBitLoc.MESSU_PKG_URL}broadcast.php" method="post"> +<form action="{$smarty.const.MESSU_PKG_URL}broadcast.php" method="post"> <table class="panel"> <tr> <td><label for="broadcast-group">{tr}Group{/tr}:</label></td> diff --git a/templates/messu_mailbox.tpl b/templates/messu_mailbox.tpl index ba86af4..ab2ac0d 100644 --- a/templates/messu_mailbox.tpl +++ b/templates/messu_mailbox.tpl @@ -16,7 +16,7 @@ <input type="hidden" name="flagval" value="{$flagval|escape}" /> <input type="hidden" name="priority" value="{$priority|escape}" /> - <a class="floaticon" href="{$gBitLoc.MESSU_PKG_URL}compose.php">{biticon ipackage=messu iname=send_mail iexplain="{tr}Compose Message{/tr}"}</a> + <a class="floaticon" href="{$smarty.const.MESSU_PKG_URL}compose.php">{biticon ipackage=messu iname=send_mail iexplain="{tr}Compose Message{/tr}"}</a> {assign var=displayName value=$gBitSystem->getPreference("display_name","real_name") } <table class="data"> <tr> @@ -33,7 +33,7 @@ <td><input type="checkbox" name="msg[{$items[user].msg_id}]" /></td> <td>{if $items[user].is_flagged eq 'y'}{biticon ipackage=messu iname=flagged iexplain="Flagged"}{/if}</td> <td>{displayname hash=$items[user]}</td> - <td><a href="{$gBitLoc.MESSU_PKG_URL}read.php?offset={$offset}&flag={$flag}&priority={$priority}&flagval={$flagval}&sort_mode={$sort_mode}&find={$find}&msg_id={$items[user].msg_id}">{$items[user].subject}</a></td> + <td><a href="{$smarty.const.MESSU_PKG_URL}read.php?offset={$offset}&flag={$flag}&priority={$priority}&flagval={$flagval}&sort_mode={$sort_mode}&find={$find}&msg_id={$items[user].msg_id}">{$items[user].subject}</a></td> <td style="text-align:right;">{$items[user].date|bit_short_datetime}</td> <td style="text-align:right;">{$items[user].len|kbsize}</td> </tr> diff --git a/templates/messu_message_notification.tpl b/templates/messu_message_notification.tpl index fc7a549..ef74ff8 100644 --- a/templates/messu_message_notification.tpl +++ b/templates/messu_message_notification.tpl @@ -1,5 +1,5 @@ {tr}Hi, -A new message was posted to you. To respond, please visit http://{$gBitLoc.BIT_ROOT_URL}{$gBitLoc.MESSU_PKG_URL}message_box.php +A new message was posted to you. To respond, please visit http://{$smarty.const.BIT_ROOT_URL}{$smarty.const.MESSU_PKG_URL}message_box.php From: {$mail_from} Subject: {$mail_subject} diff --git a/templates/messu_nav.tpl b/templates/messu_nav.tpl index 4d2c109..36ec1cf 100644 --- a/templates/messu_nav.tpl +++ b/templates/messu_nav.tpl @@ -1,9 +1,9 @@ <div class="navbar"> <ul> - <li><a href="{$gBitLoc.MESSU_PKG_URL}message_box.php">{tr}Mailbox{/tr}</a></li> - <li><a href="{$gBitLoc.MESSU_PKG_URL}compose.php">{tr}Compose{/tr}</a></li> + <li><a href="{$smarty.const.MESSU_PKG_URL}message_box.php">{tr}Mailbox{/tr}</a></li> + <li><a href="{$smarty.const.MESSU_PKG_URL}compose.php">{tr}Compose{/tr}</a></li> {if $bit_p_broadcast eq 'y'} - <li><a href="{$gBitLoc.MESSU_PKG_URL}broadcast.php">{tr}Broadcast{/tr}</a></li> + <li><a href="{$smarty.const.MESSU_PKG_URL}broadcast.php">{tr}Broadcast{/tr}</a></li> {/if} </ul> </div> diff --git a/templates/messu_read.tpl b/templates/messu_read.tpl index bd6736c..5418694 100644 --- a/templates/messu_read.tpl +++ b/templates/messu_read.tpl @@ -13,20 +13,20 @@ {else} {assign var=read_id value=$msg_id} {/if} - <div class="navbar"> - <ul> - {if $msg.is_flagged eq 'y'} - <li>{biticon ipackage=messu iname=flagged iexplain=Flagged} {smartlink ititle="Unflag Message" offset=$offset act=is_flagged actval=n msg_id=$msg_id sort_mode=$sort_mode find=$find flag=$flag priority=$priority flagval=$flagval}</li> - {else} - <li>{smartlink ititle="Flag Message" offset=$offset act=is_flagged actval=y msg_id=$msg_id sort_mode=$sort_mode find=$find flag=$flag priority=$priority flagval=$flagval}</li> - {/if} - <li>{smartlink ititle="Delete" msg_id=$read_id offset=$offset msgdel=$msg_id sort_mode=$sort_mode find=$find flag=$flag priority=$priority flagval=$flagval}</li> - {if $prev}<li>{smartlink ianchor=top ititle="Previous message" ibiticon="liberty/nav_prev" sort_mode=$sort_mode msg_id=$prev find=$find flag=$flag priority=$priority flagval=$flagval}</li>{/if} - {if $next}<li>{smartlink ianchor=top ititle="Next message" ibiticon="liberty/nav_next" sort_mode=$sort_mode msg_id=$next find=$find flag=$flag priority=$priority flagval=$flagval}</li>{/if} - </ul> - </div> - <div class="body"> + <div class="navbar"> + <ul> + {if $msg.is_flagged eq 'y'} + <li>{biticon ipackage=messu iname=flagged iexplain=Flagged} {smartlink ititle="Unflag Message" offset=$offset act=is_flagged actval=n msg_id=$msg_id sort_mode=$sort_mode find=$find flag=$flag priority=$priority flagval=$flagval}</li> + {else} + <li>{smartlink ititle="Flag Message" offset=$offset act=is_flagged actval=y msg_id=$msg_id sort_mode=$sort_mode find=$find flag=$flag priority=$priority flagval=$flagval}</li> + {/if} + <li>{smartlink ititle="Delete" msg_id=$read_id offset=$offset msgdel=$msg_id sort_mode=$sort_mode find=$find flag=$flag priority=$priority flagval=$flagval}</li> + {if $prev}<li>{smartlink ianchor=top ititle="Previous message" ibiticon="liberty/nav_prev" sort_mode=$sort_mode msg_id=$prev find=$find flag=$flag priority=$priority flagval=$flagval}</li>{/if} + {if $next}<li>{smartlink ianchor=top ititle="Next message" ibiticon="liberty/nav_next" sort_mode=$sort_mode msg_id=$next find=$find flag=$flag priority=$priority flagval=$flagval}</li>{/if} + </ul> + </div> + {if $legend} {$legend} {else} @@ -106,7 +106,7 @@ {* <table class="panel"> <tr class="panelsubmitrow"><td> - <form method="post" action="{$gBitLoc.MESSU_PKG_URL}read.php"> + <form method="post" action="{$smarty.const.MESSU_PKG_URL}read.php"> <input type="hidden" name="offset" value="{$offset}" /> <input type="hidden" name="find" value="{$find|escape}" /> <input type="hidden" name="sort_mode" value="{$sort_mode}" /> @@ -125,7 +125,7 @@ </form> </td> <td> - <form method="post" action="{$gBitLoc.MESSU_PKG_URL}compose.php"> + <form method="post" action="{$smarty.const.MESSU_PKG_URL}compose.php"> <input type="hidden" name="offset" value="{$offset}" /> <input type="hidden" name="msg_id" value="{$msg_id}" /> <input type="hidden" name="find" value="{$find|escape}" /> @@ -140,7 +140,7 @@ </form> </td> <td> - <form method="post" action="{$gBitLoc.MESSU_PKG_URL}compose.php"> + <form method="post" action="{$smarty.const.MESSU_PKG_URL}compose.php"> <input type="hidden" name="offset" value="{$offset}" /> <input type="hidden" name="find" value="{$find|escape}" /> <input type="hidden" name="msg_id" value="{$msg_id}" /> |
