Changeset 24892
- Timestamp:
- 11/20/08 20:29:05 (7 weeks ago)
- Location:
- branches/zikula-1.0
- Files:
-
- 8 modified
-
modules/Members_List/pnblocks/membersonline.php (modified) (1 diff)
-
modules/Members_List/pntemplates/memberslist_block_membersonline.htm (modified) (1 diff)
-
modules/Members_List/pntemplates/memberslist_user_online.htm (modified) (2 diffs)
-
modules/Members_List/pntemplates/memberslist_user_recent.htm (modified) (2 diffs)
-
modules/Members_List/pntemplates/memberslist_user_view.htm (modified) (2 diffs)
-
modules/Members_List/pnuserapi.php (modified) (1 diff)
-
modules/Members_List/pnuser.php (modified) (3 diffs)
-
system/Theme/plugins/function.pncountnewmessages.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/zikula-1.0/modules/Members_List/pnblocks/membersonline.php
r24342 r24892 92 92 $pnRender = pnRender::getInstance('Members_List', false); 93 93 94 // check if pnMessages is available and add the necessary info 95 $pnmessages = pnModAvailable('pnMessages'); 96 $pnRender->assign('pnmessages', $pnmessages); 97 if ($pnmessages && pnUserLoggedIn()) { 98 pnModLangLoad('pnMessages', 'user'); 99 $pnRender->assign('messages', pnModAPIFunc('pnMessages', 'user', 'getmessagecount')); 94 // check which messaging module is available and add the necessary info 95 $msgmodule = pnModAPIFunc('Members_List', 'user', 'getmessagingmodule'); 96 $pnRender->assign('msgmodule', $msgmodule); 97 if (!empty($msgmodule) && pnUserLoggedIn()) { 98 $pnRender->assign('messages', pnModAPIFunc($msgmodule, 'user', 'getmessagecount')); 100 99 } 101 100 -
branches/zikula-1.0/modules/Members_List/pntemplates/memberslist_block_membersonline.htm
r23454 r24892 6 6 <li> 7 7 <a href="<!--[pnmodurl modname=Profile func=view uname=$user.uname]-->" title="<!--[$user.uname]-->"><!--[$user.unameshort]--></a> 8 <!--[if $ pnmessages]-->8 <!--[if $msgmodule eq 'pnMessages']--> 9 9 <!--[if $user.uid eq $uid]--> 10 10 (<a href="<!--[pnmodurl modname="pnMessages" func="inbox"]-->" title="<!--[pnml name='_PNMESSAGES_UNREAD']-->"><!--[$messages.totalin]--></a> | <a href="<!--[pnmodurl modname="pnMessages" func="inbox"]-->" title="<!--[pnml name='_PNMESSAGES_TOTAL']-->"><!--[$messages.unread]--></a>) 11 11 <!--[/if]--> 12 <a href="<!--[pnmodurl modname="pnMessages" func="newpm" uname="`$user.uname`"]-->" title="<!--[pnml name='_PNMESSAGES_PM']--> <!--[$user.uname]-->"><!--[pnimg modname=pnMessages src='pm.gif' alt=_PNMESSAGES_PM altml=true style='vertical-align:middle; margin-left:2px;']--></a> 12 <a href="<!--[pnmodurl modname="pnMessages" func="newpm" uid="`$user.uid`"]-->" title="<!--[pnml name='_PNMESSAGES_PM']--> <!--[$user.uname]-->"><!--[pnimg modname=pnMessages src='pm.gif' alt=_PNMESSAGES_PM altml=true style='vertical-align:middle; margin-left:2px;']--></a> 13 <!--[/if]--> 14 <!--[if $msgmodule eq 'InterCom']--> 15 <!--[if $user.uid eq $uid]--> 16 (<a href="<!--[pnmodurl modname="InterCom" func="inbox"]-->" title="<!--[pnml name='_IC_UNREAD']-->"><!--[$messages.totalin]--></a> | <a href="<!--[pnmodurl modname="InterCom" func="inbox"]-->" title="<!--[pnml name='_IC_TOTAL']-->"><!--[$messages.unread]--></a>) 17 <!--[/if]--> 18 <a href="<!--[pnmodurl modname="InterCom" func="newpm" uid="`$user.uid`"]-->" title="<!--[pnml name='_IC_PM']--> <!--[$user.uname]-->"><!--[pnimg modname=InterCom src='pm.gif' alt=_IC_PM altml=true style='vertical-align:middle; margin-left:2px;']--></a> 13 19 <!--[/if]--> 14 20 </li> -
branches/zikula-1.0/modules/Members_List/pntemplates/memberslist_user_online.htm
r24862 r24892 9 9 <th><!--[pnml name="_USERNAME"]--></th> 10 10 <th><!--[pnml name="_UREALNAME"]--></th> 11 <!--[if $ pnmessages eq true]-->11 <!--[if $msgmodule eq 'pnMessages']--> 12 12 <th><!--[pnml name="_PNMESSAGES_PM"]--></th> 13 <!--[/if]--> 14 <!--[if $msgmodule eq 'InterCom']--> 15 <th><!--[pnml name="_IC_PM"]--></th> 13 16 <!--[/if]--> 14 17 <th><!--[pnml name="_URL"]--></th> … … 25 28 <!--[ /if ]--> 26 29 <td><strong><!--[$user.uname|userprofilelink]--></strong></td> 27 <td><!--[$user s._UREALNAME|default:" "]--></td>28 <!--[if $pnmessages eq true]-->30 <td><!--[$user._UREALNAME|default:" "]--></td> 31 <!--[if $msgmodule eq 'pnMessages']--> 29 32 <td><a href="<!--[pnmodurl modname="pnMessages" func="newpm" uid="`$user.uid`"]-->"><!--[pnimg modname=core set=icons/extrasmall src="mail_new.gif" alt=_PNMESSAGES_SENDPM altml=true]--></a></td> 33 <!--[/if]--> 34 <!--[if $msgmodule eq 'InterCom']--> 35 <td><a href="<!--[pnmodurl modname="InterCom" func="newpm" uid="`$user.uid`"]-->"><!--[pnimg modname=core set=icons/extrasmall src="mail_new.gif" alt=_IC_SENDPM altml=true]--></a></td> 30 36 <!--[/if]--> 31 37 <td> -
branches/zikula-1.0/modules/Members_List/pntemplates/memberslist_user_recent.htm
r24862 r24892 13 13 <th><!--[pnml name="_UREALNAME"]--></th> 14 14 <!--[/if]--> 15 <!--[if $ pnmessages eq true]-->15 <!--[if $msgmodule eq 'pnMessages']--> 16 16 <th><!--[pnml name="_PNMESSAGES_PM"]--></th> 17 <!--[/if]--> 18 <!--[if $msgmodule eq 'InterCom']--> 19 <th><!--[pnml name="_IC_PM"]--></th> 17 20 <!--[/if]--> 18 21 <!--[ if @in_array('_YOURHOMEPAGE', $dudarray) ]--> … … 45 48 <td><!--[$users[users]._UREALNAME|default:" "]--></td> 46 49 <!--[/if]--> 47 <!--[if $ pnmessages eq true]-->50 <!--[if $msgmodule eq 'pnMessages']--> 48 51 <td><a href="<!--[pnmodurl modname="pnMessages" func="newpm" uid="`$users[users].uid`"]-->"><!--[pnimg modname=core set=icons/extrasmall src="mail_new.gif" alt=_PNMESSAGES_SENDPM altml=true]--></a></td> 52 <!--[/if]--> 53 <!--[if $msgmodule eq 'InterCom']--> 54 <td><a href="<!--[pnmodurl modname="InterCom" func="newpm" uid="`$users[users].uid`"]-->"><!--[pnimg modname=core set=icons/extrasmall src="mail_new.gif" alt=_IC_SENDPM altml=true]--></a></td> 49 55 <!--[/if]--> 50 56 <!--[ if @in_array('_YOURHOMEPAGE', $dudarray) ]--> -
branches/zikula-1.0/modules/Members_List/pntemplates/memberslist_user_view.htm
r24862 r24892 29 29 <th><!--[pnml name="_UREALNAME"]--></th> 30 30 <!--[ /if ]--> 31 <!--[if $ pnmessages eq true]-->31 <!--[if $msgmodule eq 'pnMessages']--> 32 32 <th><!--[pnml name="_PNMESSAGES_PM"]--></th> 33 <!--[/if]--> 34 <!--[if $msgmodule eq 'InterCom']--> 35 <th><!--[pnml name="_IC_PM"]--></th> 33 36 <!--[/if]--> 34 37 <!--[ if @in_array('_YOURHOMEPAGE', $dudarray) ]--> … … 60 63 <td><!--[$users[users]._UREALNAME|pnvarprepfordisplay|default:" "]--></td> 61 64 <!--[ /if ]--> 62 <!--[if $ pnmessages eq true]-->65 <!--[if $msgmodule eq 'pnMessages']--> 63 66 <td><a href="<!--[pnmodurl modname="pnMessages" func="newpm" uid="`$users[users].uid`"]-->"><!--[pnimg modname=core set=icons/extrasmall src="mail_new.gif" alt=_PNMESSAGES_SENDPM altml=true]--></a></td> 67 <!--[/if]--> 68 <!--[if $msgmodule eq 'InterCom']--> 69 <td><a href="<!--[pnmodurl modname="InterCom" func="newpm" uid="`$users[users].uid`"]-->"><!--[pnimg modname=core set=icons/extrasmall src="mail_new.gif" alt=_IC_SENDPM altml=true]--></a></td> 64 70 <!--[/if]--> 65 71 <!--[ if @in_array('_YOURHOMEPAGE', $dudarray) ]--> -
branches/zikula-1.0/modules/Members_List/pnuserapi.php
r24847 r24892 495 495 return $items; 496 496 } 497 498 /** 499 * Utility function to find out which messages module is installed 500 * can find pnMessages and InterCom 501 * @author Frank Schmmertz 502 * @return string name of the messaging module found, empty if none 503 */ 504 function Members_List_userapi_getmessagingmodule() 505 { 506 $modname = ''; 507 if (pnModAvailable('pnMessages')) { 508 pnModLangLoad('pnMessages', 'user'); 509 $modname = 'pnMessages'; 510 } else if (pnModAvailable('InterCom')) { 511 pnModLangLoad('InterCom'); 512 $modname = 'InterCom'; 513 } 514 return $modname; 515 } -
branches/zikula-1.0/modules/Members_List/pnuser.php
r24847 r24892 147 147 pnModLangLoad('Profile', 'user'); 148 148 149 // check if pnMessages is available and add the necessary info 150 $pnmessages = pnModAvailable('pnMessages'); 151 $pnRender->assign('pnmessages', $pnmessages); 152 if ($pnmessages) { 153 pnModLangLoad('pnMessages', 'user'); 154 } 149 // check which messaging module is available and add the necessary info 150 $pnRender->assign('msgmodule', pnModAPIFunc('Members_List', 'user', 'getmessagingmodule')); 155 151 156 152 // Assign the values for the smarty plugin to produce a pager … … 231 227 pnModLangLoad('Profile', 'user'); 232 228 233 // check if pnMessages is available and add the necessary info 234 $pnmessages = pnModAvailable('pnMessages'); 235 $pnRender->assign('pnmessages', $pnmessages); 236 if ($pnmessages) { 237 pnModLangLoad('pnMessages', 'user'); 238 } 229 // check which messaging module is available and add the necessary info 230 $pnRender->assign('msgmodule', pnModAPIFunc('Members_List', 'user', 'getmessagingmodule')); 239 231 240 232 // get all active profile fields … … 286 278 pnModLangLoad('Profile', 'user'); 287 279 288 // check if pnMessages is available and add the necessary info 289 $pnmessages = pnModAvailable('pnMessages'); 290 $pnRender->assign('pnmessages', $pnmessages); 291 if ($pnmessages) { 292 pnModLangLoad('pnMessages', 'user'); 293 } 280 // check which messaging module is available and add the necessary info 281 $pnRender->assign('msgmodule', pnModAPIFunc('Members_List', 'user', 'getmessagingmodule')); 294 282 295 283 // get all active profile fields -
branches/zikula-1.0/system/Theme/plugins/function.pncountnewmessages.php
r24342 r24892 32 32 unset($params); 33 33 34 $ newmessages= 0;34 $unread = 0; 35 35 if (pnUserLoggedIn()) { 36 if (pnModAvailable('Messages')) { 37 $dbconn = pnDBGetConn(true); 38 $pntable = pnDBGetTables(); 39 $column = &$pntable['priv_msgs_column']; 40 // get unread messages 41 $result = $dbconn->Execute("SELECT count(*) FROM $pntable[priv_msgs] WHERE $column[to_userid]='" . DataUtil::formatForStore(pnUserGetVar('uid')) . "' AND $column[read_msg]='0'"); 42 list($newmessages) = $result->fields; // new messages 43 $result->Close(); 36 if (pnModAvailable('pnMessages')) { 37 $messages = pnModAPIFunc('pnMessages', 'user', 'getmessagecount'); 38 $unread = $messages['unread']; 39 } else if (pnModAvailable('InterCom')) { 40 $messages = pnModAPIFunc('InterCom', 'user', 'getmessagecount'); 41 $unread = $messages['unread']; 44 42 } 45 43 } 46 44 47 45 if (isset($assign)) { 48 $smarty->assign($assign, $ newmessages);46 $smarty->assign($assign, $unread); 49 47 } else { 50 return $ newmessages;48 return $unread; 51 49 } 52 50 }
