1
DefJef
Pop up a "you have a new private message" when inbox has new msg?
  • 2005/8/17 15:00

  • DefJef

  • Just popping in

  • Posts: 53

  • Since: 2005/8/8 2


How could we Pop up a "you have a new private message" window when inbox has new msg? Know what i mean?

-Jeff

2
talunceford
Re: Pop up a "you have a new private message" when inbox has new msg?

I doubt that would be too hard at all. It can be easily done with an "if" statement in your theme.html file.

<{php}> GLOBAL $xoopsUser$pm_handler =& 
                                      
xoops_gethandler('privmessage'); $uid 
                                      
$xoopsUser->getVar('uid'); $criteria = new 
                                      
CriteriaCompo(new Criteria('read_msg'0)); 
                                      
$criteria->add(new Criteria('to_userid'
                                      
$uid)); $msgcount $pm_handler->getCount($criteria); 
                                      
$GLOBALS['xoopsTpl']->assign('msgcount'
                                      
$msgcount); <{/php}>
                                      
                                       <{if 
$msgcount }>
                                      <
table><tr><td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" onload="MM_popupMsg('You have a new Private Message')" /></td></tr></table>
                                      <{else}>
                                       <
table><tr><td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" /></td></tr></table>
                                       <{/if}>


Here is an example of the theme.html file that I use for tswn.com

<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<meta name="robots" content="<{$xoops_meta_robots}>" />
<meta name="keywords" content="<{$xoops_meta_keywords}>" />
<meta name="description" content="<{$xoops_meta_description}>" />
<meta name="rating" content="<{$xoops_meta_rating}>" />
<meta name="author" content="<{$xoops_meta_author}>" />
<meta name="copyright" content="<{$xoops_meta_copyright}>" />
<meta name="generator" content="XOOPS" />
<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_url}>/xoops.css" />
<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_themecss}>" />
<!-- RMV: added module header -->
<body leftmargin="0" topmargin="00" marginwidth="0" marginheight="0">
<{$xoops_module_header}> 
<script type="text/javascript">







<!--







<{$xoops_js}>







//-->







</script>
<script>







function handleError() {







   return false;







}







</script>
<script>







<!--






/////////////////////////////////////  POPUP CODE////////////
function MM_popupMsg(msg) { //v1.0







  alert(msg);







}
///////////////////////END POPUP JS CODE//////////////////














function MM_findObj(n, d) { //v4.01







try {







    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {







    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}







    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];







    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);







    if(!x && d.getElementById) x=d.getElementById(n); return x;







}catch(err) {







    handleError;







}























function MM_showHideLayers() { //v3.0







try {







  var i,p,v,obj,args=MM_showHideLayers.arguments;







  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];







    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }







    obj.visibility=v; }







}catch(err) {







    handleError;







}







}















function MM_changeProp(objName,x,theProp,theValue) { //v6.0







try {







  var obj = MM_findObj(objName);







  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){







    if (theValue == true || theValue == false)







      eval('obj.'+theProp+'="'+theValue+'"');







    else eval('obj.'+theProp+'="'+theValue+'"');







  }







}catch(err) {







    handleError;







}







}















function MM_preloadImages() { //v3.0







try {







  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();







    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)







    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}







}catch(err) {







}







}















function MM_swapImgRestore() { //v3.0







try {







  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;







}catch(err) {







    handleError;







}







}















function MM_swapImage() { //v3.0







try {







  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)







   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}







}catch(err) {







    handleError;







}







}







function MM_swapImage2() { //v3.0







try {







  var i,j=0,x,a=MM_swapImage2.arguments; document.MM_sr2=new Array; for(i=0;i<(a.length-2);i+=3)







   if ((x=MM_findObj(a[i]))!=null){document.MM_sr2[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}







}catch(err) {







    handleError;







}







}















function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0







try {







  var obj=MM_findObj(objStr);







  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');







}catch(err) {







    handleError;







}







}















function MM_goToURL() { //v3.0







try {







  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;







  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");







}catch(err) {







    handleError;







}







}















function MM_displayStatusMsg(msgStr) { //v1.0







try {







  status=msgStr;







  document.MM_returnValue = true;







}catch(err) {







    handleError;







}







}























function MM_setTextOfLayer(objName,x,newText) { //v4.01







  if ((obj=MM_findObj(objName))!=null) with (obj)







    if (document.layers) {document.write(unescape(newText)); document.close();}







    else innerHTML = unescape(newText);







}







//-->







</script>
<script language="javascript" type="text/javascript">







<!--







/****************************************************







     Author: Eric King







     Url: http://redrival.com/eak/index.shtml







     This script is free to use as long as this info is left in







     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)







****************************************************/







var win=null;







function NewWindow(mypage,myname,w,h,scroll,nav,rsize){







if (!rsize) {







    rsize = "0";







}else {







    if (rsize == "yes") {







        rsize = "1";







    }else if (rsize == "no") {







        rsize = "0";







    }else if (rsize == "ie") {







        if (navigator.appName == "Microsoft Internet Explorer") {







            rsize = "1";







        }else {







            rsize = "0";







        }







    }







}







pos='center'







if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}







if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}







else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}







settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',status=no,scrollbars='+scroll+',scroll='+scroll+',resize='+rsize+',resizable='+rsize+',location=no,directories=no,menubar=no,toolbar='+nav+'';







win=window.open(mypage,myname,settings);}







// -->







</script>
<script language="JavaScript1.2">







<!--







/* No Context */







function clickIE() {if (document.all) {(message);return false;}}







function clickNS(e) {if 







(document.layers||(document.getElementById&&!document.all)) {







if (e.which==2||e.which==3) {(message);return false;}}}







if (document.layers) 







{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}







else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}























-->







</script>
<script>







//Hide status bar msg II script- by javascriptkit.com







//Visit JavaScript Kit (http://javascriptkit.com) for script







//Credit must stay intact for use















function hidestatus(){







    window.status='';







    return true;







}















if (document.layers)







document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)















document.onmouseover=hidestatus







document.onmouseout=hidestatus







</script>
<script language="JavaScript" type="text/JavaScript">







<!--







-->







</script>
<script language="javascript" type="text/javascript">







<!--































function MM_preloadImages() { //v3.0







  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();







    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)







    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}







}







//-->







</script></head>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> 
<TABLE WIDTH=100% height="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
  <TR> 
    <TD width="50%" rowspan="4" ><TABLE WIDTH=100%  height="100%"BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/l1.jpg" WIDTH=100% HEIGHT=100%  bgcolor="#6D6F6D" style="background-repeat:repeat-x; background-position:top "></TD>
        </TR>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/l2.jpg" WIDTH=100% HEIGHT=132 ALT=""></TD>
        </TR>
      </TABLE></TD>
    <TD><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="766" height="286">
        <param name="movie" value="<{$xoops_imageurl}>flash/main.swf">
        <param name="quality" value="high">
        <embed src="<{$xoops_imageurl}>flash/main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="766" height="286"></embed> 
      </object></TD>
    <TD width="50%" rowspan="4" ><TABLE WIDTH=100%  height="100%"BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/r1.jpg" WIDTH=100% HEIGHT=100%  bgcolor="#6D6F6D" style="background-repeat:repeat-x; background-position:top "></TD>
        </TR>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/l2.jpg" WIDTH=100% HEIGHT=132 ALT=""></TD>
        </TR>
      </TABLE></TD>
  </TR>
  <TR> 
    <TD> <IMG SRC="<{$xoops_imageurl}>images/2.jpg" WIDTH=766 HEIGHT=13 ALT=""></TD>
  </TR>
  <TR> 
    <TD> <TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <TR> 
          <TD  height="100%"> <TABLE WIDTH=68 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="100%">
              <TR> 
                <TD background="<{$xoops_imageurl}>images/bak1.jpg" WIDTH=68 HEIGHT=100%> 
                  <IMG SRC="<{$xoops_imageurl}>images/3.jpg" WIDTH=68 HEIGHT=319 ALT=""></TD>
              </TR>
              <TR> 
                <TD> <IMG SRC="<{$xoops_imageurl}>images/4.jpg" WIDTH=68 HEIGHT=59 ALT=""></TD>
              </TR>
            </TABLE></TD>
          <TD height="100%"> <TABLE WIDTH=628 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="100%">
              <TR> 
                <TD background="<{$xoops_imageurl}>images/5t1.jpg" WIDTH=628 HEIGHT=34 ALT=""> 
                  <div style="padding-top:13px; padding-left:40px; font-weight: bold; color: #C7C4C0; font-size: 10px; text-transform:uppercase"></div></TD>
              </TR>
              <TR> 
                <TD background="<{$xoops_imageurl}>images/5bak1.jpg"  WIDTH=628 HEIGHT=100% ><table background="<{$xoops_imageurl}>images/5t2.jpg" WIDTH=628 HEIGHT=100% style="background-repeat:no-repeat "   border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td> <div style="padding-top:10px;padding-left:12px; padding-right:12px "> 
                          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="100%" height="37" valign="top"><font color="#999999"> 
                                <{if $xoops_isuser}> </font> <table width="100%" height="37" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tbody>
                                    <tr> 
                                      <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" height="37" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/user.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Your Account<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>

<!--  BEGIN MESSAGE CODE
                                      <{php}> GLOBAL $xoopsUser; $pm_handler =& 
                                      xoops_gethandler('privmessage'); $uid = 
                                      $xoopsUser->getVar('uid'); $criteria = new 
                                      CriteriaCompo(new Criteria('read_msg', 0)); 
                                      $criteria->add(new Criteria('to_userid', 
                                      $uid)); $msgcount = $pm_handler->getCount($criteria); 
                                      $GLOBALS['xoopsTpl']->assign('msgcount', 
                                      $msgcount); <{/php}>
                                      
                                       <{if $msgcount > 0 }>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" onload="MM_popupMsg('You have a new Private Message')" /></td>
                                      <{else}>
                                       <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" /></td>
                                       <{/if}>
<!-- end message code

                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/viewpmsg.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Inbox (<span style="color:#CCCC99; font-weight: bold;"><{$msgcount}></span>)<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/user.php?op=logout';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Logout<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/notifications.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Notifications<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_1" onclick="parent.window.location='<{$xoops_url}>';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center"><img src="<{$xoops_imageurl}>images/home.jpg" /><br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <{/if}> <{if $xoops_isadmin}> 
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/admin.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Admin Menu<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                    </tr>
                                  </tbody>
                                </table>
                                <font color="#999999"><{else}> </font> <table width="100%" height="37" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <form action="<{$xoops_url}>/user.php" method="post" name="login" id="login">
                                    <tbody>
                                      <tr> 
                                        <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></td>
                                        <td align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/user.php#lost';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                          <div align="center">Lost Password<br />
                                          </div></td>
                                        <td width="2" align="center" valign="middle"><div align="center"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></div></td>
                                        <td align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/register.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                          <div align="center">Register<br />
                                          </div></td>
                                        <td width="2" align="center" valign="middle"><div align="center"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></div></td>
                                        <td height="37" align="right" valign="middle" class="topNav_0"><div align="center"><span class="left" align="bottom"> 
                                            </span> nick: 
                                            <input type="text" name="uname" size="7" value="<{$block.unamevalue}>" class="logintextbox"/>
                                            password: 
                                            <input name="pass" type="password" class="logintextbox" size="7"/>
                                            <input type="hidden" name="xoops_redirect" value="<{$xoops_requesturi}>" />
                                            <input type="hidden" name="op" value="login" />
                                            <br />
                                          </div></td>
                                        <td align="left" valign="middle" class="topNav_0"><input name="login_button" type="image" id="login_button" src="<{$xoops_imageurl}>images/login.gif" alt="Login" align="top" border="0" /> 
                                          <input name="rememberme" type="checkbox" class ="formButton" value="On" checked="checked" />
                                          Remember Me </td>
                                        <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></td>
                                      </tr>
                                    </tbody>
                                  </form>
                                </table>
                                <font color="#999999"><{/if}></font>
                                <table width="460" border="0" align="center" cellpadding="1" cellspacing="0">
                                  <tr> 
                                    <td><div align="center"><{$xoops_banner}>&nbsp;</div></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table>
                          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="a">
                            <tr> 
                              <td align="center" valign="top" class="center_block"><table class="a" width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr> 
                                    <td width="140" valign="top" id="leftcolumn"><{if 
                                      $xoops_lblocks}> <table border="0" cellpadding="0" cellspacing="0">
                                        <!--DWLayoutTable-->
                                        <!-- NewsFlash / Top area -->
                                        <tbody>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_top.gif" width="32" /></td>
                                            <td class="mainlevel" background="<{$xoops_imageurl}>images/top.gif" width="100%"><div align="center"><strong> 
                                                NAVIGATION</strong></div></td>
                                            <td><img src="<{$xoops_imageurl}>images/r_top.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td valign="top" background="<{$xoops_imageurl}>images/l_side.gif"><img src="<{$xoops_imageurl}>images/l_side_lrg.gif" /></td>
                                            <td class="mainpage" background="<{$xoops_imageurl}>images/c-bg.gif"><table border="0" cellpadding="0" cellspacing="1" width="100%">
                                                <tbody>
                                                  <tr> 
                                                    <td valign="top"><font color="#999999"><br>
                                                      <{foreach item=block from=$xoops_lblocks}><{include 
                                                      file="tswn_gaming/theme_blockleft.html"}> 
                                                      <{/foreach}> 
                                                      <!-- End left blocks loop -->
                                                      </font></td>
                                                  </tr>
                                                </tbody>
                                              </table></td>
                                            <td valign="top" background="<{$xoops_imageurl}>images/r_side.gif"><img src="<{$xoops_imageurl}>images/r_side_lrg.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_bottom.gif" /></td>
                                            <td background="<{$xoops_imageurl}>images/bottom.gif" width="100%"></td>
                                            <td><img src="<{$xoops_imageurl}>images/r_bottom.gif" /></td>
                                          </tr>
                                          <!-- Main Content Section -->
                                        </tbody>
                                      </table>
                                      <{/if}></td>
                                    <td valign="top" id="centerCcolumn"><{if $xoops_contents}> 
                                      <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <!--DWLayoutTable-->
                                        <!-- NewsFlash / Top area -->
                                        <tbody>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_top.gif" /></td>
                                            <td class="mainlevel" background="<{$xoops_imageurl}>images/top.gif" width="100%"><!--DWLayoutEmptyCell-->&nbsp;</td>
                                            <td><img src="<{$xoops_imageurl}>images/r_top.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td valign="top" background="<{$xoops_imageurl}>images/l_side.gif"><img src="<{$xoops_imageurl}>images/l_side_lrg.gif" /></td>
                                            <td class="mainpage" background="<{$xoops_imageurl}>images/c-bg.gif"><table border="0" cellpadding="0" cellspacing="1" width="100%">
                                                <tbody>
                                                  <tr> 
                                                    <td valign="top"> <p><font color="#999999"><{$xoops_contents}></font></p></td>
                                                  </tr>
                                                </tbody>
                                              </table></td>
                                            <td valign="top" background="<{$xoops_imageurl}>images/r_side.gif"><img src="<{$xoops_imageurl}>images/r_side_lrg.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_bottom.gif" /></td>
                                            <td background="<{$xoops_imageurl}>images/bottom.gif" width="100%"></td>
                                            <td><img src="<{$xoops_imageurl}>images/r_bottom.gif" /></td>
                                          </tr>
                                          <!-- Main Content Section -->
                                        </tbody>
                                      </table>
                                      <{/if}> <font color="#999999"><{foreach 
                                      item=block from=$xoops_ccblocks}><{include 
                                      file="tswn_gaming/theme_blockcenter_c.html"}> 
                                      <{/foreach}> 
                                      <!-- End center-center blocks loop -->
                                      </font></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table>
                        </div></td>
                    </tr>
                  </table></TD>
              </TR>
              <TR> 
                <TD> <IMG SRC="<{$xoops_imageurl}>images/5t3.jpg" WIDTH=628 HEIGHT=15 ALT=""></TD>
              </TR>
            </TABLE></TD>
          <TD height="100%"> <TABLE WIDTH=70 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="100%">
              <TR> 
                <TD background="<{$xoops_imageurl}>images/bak2.jpg" WIDTH=70 HEIGHT=100%> 
                  <IMG SRC="<{$xoops_imageurl}>images/5.jpg" WIDTH=70 HEIGHT=319 ALT=""></TD>
              </TR>
              <TR> 
                <TD> <IMG SRC="<{$xoops_imageurl}>images/6.jpg" WIDTH=70 HEIGHT=59 ALT=""></TD>
              </TR>
            </TABLE></TD>
        </TR>
      </TABLE></TD>
  </TR>
  <TR> 
    <TD background="<{$xoops_imageurl}>images/1.jpg" WIDTH=766 HEIGHT=73 ALT=""><div style="padding-top:20px; color: #5C5E5C;" align="center"> 
      </div></TD







    >
  </TR>
  <TR> 
    <TD background="<{$xoops_imageurl}>images/l3.jpg" width="50%" height="100%"></TD>
    <TD background="<{$xoops_imageurl}>images/bot.jpg" WIDTH=766 HEIGHT=100% ALT=""></TD>
    <TD background="<{$xoops_imageurl}>images/r3.jpg" width="50%" height="100%"> 
  </TR>
</TABLE>
</BODY>
</HTML>


Just copy the second code group and edit it in your favorite html editor, and you will see at about line 1625 where the code goes.
Tim
www.tswn.com | www.bf2online.com | aquaria.tswn.com | www.bf2142online.org

3
DefJef
Re: Pop up a "you have a new private message" when inbox has new msg?
  • 2005/8/18 3:20

  • DefJef

  • Just popping in

  • Posts: 53

  • Since: 2005/8/8 2


Thanks for the help!

So...insert that entire code into any place in my theme.html?

Sorry it was a little unclear.

Thanks again,
Jeff

4
talunceford
Re: Pop up a "you have a new private message" when inbox has new msg?

Well, that code is just an example of how to do it. You will probably have to customize the code to suit your own theme.html file.
Tim
www.tswn.com | www.bf2online.com | aquaria.tswn.com | www.bf2142online.org

5
piroman
Re: Pop up a "you have a new private message" when inbox has new msg?
  • 2005/8/18 6:05

  • piroman

  • Just popping in

  • Posts: 87

  • Since: 2004/9/7 2


Hi talunceford,

could you comment the code, so we can alter it to suit our needs?

Kinda FAQ for priv msg. popup :)
regs
Piroman

visit our cicihlid gallery:
gallery.ciklidi.org

6
talunceford
Added Additional Code

Quote:

talunceford wrote:
I doubt that would be too hard at all. It can be easily done with an "if" statement in your theme.html file.

<{php}> GLOBAL $xoopsUser$pm_handler =& 
                                      
xoops_gethandler('privmessage'); $uid 
                                      
$xoopsUser->getVar('uid'); $criteria = new 
                                      
CriteriaCompo(new Criteria('read_msg'0)); 
                                      
$criteria->add(new Criteria('to_userid'
                                      
$uid)); $msgcount $pm_handler->getCount($criteria); 
                                      
$GLOBALS['xoopsTpl']->assign('msgcount'
                                      
$msgcount); <{/php}>
                                      
                                       <{if 
$msgcount }>
                                      <
table><tr><td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" onload="MM_popupMsg('You have a new Private Message')" /></td></tr></table>
                                      <{else}>
                                       <
table><tr><td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" /></td></tr></table>
                                       <{/if}>


Here is an example of the theme.html file that I use for tswn.com

<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<{$xoops_langcode}>" lang="<{$xoops_langcode}>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<meta http-equiv="content-language" content="<{$xoops_langcode}>" />
<meta name="robots" content="<{$xoops_meta_robots}>" />
<meta name="keywords" content="<{$xoops_meta_keywords}>" />
<meta name="description" content="<{$xoops_meta_description}>" />
<meta name="rating" content="<{$xoops_meta_rating}>" />
<meta name="author" content="<{$xoops_meta_author}>" />
<meta name="copyright" content="<{$xoops_meta_copyright}>" />
<meta name="generator" content="XOOPS" />
<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
<link href="<{$xoops_url}>/favicon.ico" rel="SHORTCUT ICON" />
<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_url}>/xoops.css" />
<link rel="stylesheet" type="text/css" media="all" href="<{$xoops_themecss}>" />
<!-- RMV: added module header -->
<body leftmargin="0" topmargin="00" marginwidth="0" marginheight="0">
<{$xoops_module_header}> 
<script type="text/javascript">







<!--







<{$xoops_js}>







//-->







</script>
<script>







function handleError() {







   return false;







}







</script>
<script>







<!--






/////////////////////////////////////  POPUP CODE////////////
function MM_popupMsg(msg) { //v1.0







  alert(msg);







}
///////////////////////END POPUP JS CODE//////////////////














function MM_findObj(n, d) { //v4.01







try {







    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {







    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}







    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];







    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);







    if(!x && d.getElementById) x=d.getElementById(n); return x;







}catch(err) {







    handleError;







}























function MM_showHideLayers() { //v3.0







try {







  var i,p,v,obj,args=MM_showHideLayers.arguments;







  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];







    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }







    obj.visibility=v; }







}catch(err) {







    handleError;







}







}















function MM_changeProp(objName,x,theProp,theValue) { //v6.0







try {







  var obj = MM_findObj(objName);







  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){







    if (theValue == true || theValue == false)







      eval('obj.'+theProp+'="'+theValue+'"');







    else eval('obj.'+theProp+'="'+theValue+'"');







  }







}catch(err) {







    handleError;







}







}















function MM_preloadImages() { //v3.0







try {







  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();







    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)







    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}







}catch(err) {







}







}















function MM_swapImgRestore() { //v3.0







try {







  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;







}catch(err) {







    handleError;







}







}















function MM_swapImage() { //v3.0







try {







  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)







   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}







}catch(err) {







    handleError;







}







}







function MM_swapImage2() { //v3.0







try {







  var i,j=0,x,a=MM_swapImage2.arguments; document.MM_sr2=new Array; for(i=0;i<(a.length-2);i+=3)







   if ((x=MM_findObj(a[i]))!=null){document.MM_sr2[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}







}catch(err) {







    handleError;







}







}















function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0







try {







  var obj=MM_findObj(objStr);







  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');







}catch(err) {







    handleError;







}







}















function MM_goToURL() { //v3.0







try {







  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;







  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");







}catch(err) {







    handleError;







}







}















function MM_displayStatusMsg(msgStr) { //v1.0







try {







  status=msgStr;







  document.MM_returnValue = true;







}catch(err) {








    handleError;







}







}























function MM_setTextOfLayer(objName,x,newText) { //v4.01







  if ((obj=MM_findObj(objName))!=null) with (obj)







    if (document.layers) {document.write(unescape(newText)); document.close();}







    else innerHTML = unescape(newText);







}







//-->







</script>
<script language="javascript" type="text/javascript">







<!--







/****************************************************







     Author: Eric King







     Url: http://redrival.com/eak/index.shtml







     This script is free to use as long as this info is left in







     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)







****************************************************/







var win=null;







function NewWindow(mypage,myname,w,h,scroll,nav,rsize){







if (!rsize) {







    rsize = "0";







}else {







    if (rsize == "yes") {







        rsize = "1";







    }else if (rsize == "no") {







        rsize = "0";







    }else if (rsize == "ie") {







        if (navigator.appName == "Microsoft Internet Explorer") {







            rsize = "1";







        }else {







            rsize = "0";







        }







    }







}







pos='center'







if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}







if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}







else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}







settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',status=no,scrollbars='+scroll+',scroll='+scroll+',resize='+rsize+',resizable='+rsize+',location=no,directories=no,menubar=no,toolbar='+nav+'';







win=window.open(mypage,myname,settings);}







// -->







</script>
<script language="JavaScript1.2">







<!--







/* No Context */







function clickIE() {if (document.all) {(message);return false;}}







function clickNS(e) {if 







(document.layers||(document.getElementById&&!document.all)) {







if (e.which==2||e.which==3) {(message);return false;}}}







if (document.layers) 







{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}







else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}























-->







</script>
<script>







//Hide status bar msg II script- by javascriptkit.com







//Visit JavaScript Kit (http://javascriptkit.com) for script







//Credit must stay intact for use















function hidestatus(){







    window.status='';







    return true;







}















if (document.layers)







document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)















document.onmouseover=hidestatus







document.onmouseout=hidestatus







</script>
<script language="JavaScript" type="text/JavaScript">







<!--







-->







</script>
<script language="javascript" type="text/javascript">







<!--































function MM_preloadImages() { //v3.0







  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();







    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)







    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}







}







//-->







</script></head>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> 
<TABLE WIDTH=100% height="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
  <TR> 
    <TD width="50%" rowspan="4" ><TABLE WIDTH=100%  height="100%"BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/l1.jpg" WIDTH=100% HEIGHT=100%  bgcolor="#6D6F6D" style="background-repeat:repeat-x; background-position:top "></TD>
        </TR>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/l2.jpg" WIDTH=100% HEIGHT=132 ALT=""></TD>
        </TR>
      </TABLE></TD>
    <TD><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="766" height="286">
        <param name="movie" value="<{$xoops_imageurl}>flash/main.swf">
        <param name="quality" value="high">
        <embed src="<{$xoops_imageurl}>flash/main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="766" height="286"></embed> 
      </object></TD>
    <TD width="50%" rowspan="4" ><TABLE WIDTH=100%  height="100%"BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/r1.jpg" WIDTH=100% HEIGHT=100%  bgcolor="#6D6F6D" style="background-repeat:repeat-x; background-position:top "></TD>
        </TR>
        <TR> 
          <TD background="<{$xoops_imageurl}>images/l2.jpg" WIDTH=100% HEIGHT=132 ALT=""></TD>
        </TR>
      </TABLE></TD>
  </TR>
  <TR> 
    <TD> <IMG SRC="<{$xoops_imageurl}>images/2.jpg" WIDTH=766 HEIGHT=13 ALT=""></TD>
  </TR>
  <TR> 
    <TD> <TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <TR> 
          <TD  height="100%"> <TABLE WIDTH=68 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="100%">
              <TR> 
                <TD background="<{$xoops_imageurl}>images/bak1.jpg" WIDTH=68 HEIGHT=100%> 
                  <IMG SRC="<{$xoops_imageurl}>images/3.jpg" WIDTH=68 HEIGHT=319 ALT=""></TD>
              </TR>
              <TR> 
                <TD> <IMG SRC="<{$xoops_imageurl}>images/4.jpg" WIDTH=68 HEIGHT=59 ALT=""></TD>
              </TR>
            </TABLE></TD>
          <TD height="100%"> <TABLE WIDTH=628 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="100%">
              <TR> 
                <TD background="<{$xoops_imageurl}>images/5t1.jpg" WIDTH=628 HEIGHT=34 ALT=""> 
                  <div style="padding-top:13px; padding-left:40px; font-weight: bold; color: #C7C4C0; font-size: 10px; text-transform:uppercase"></div></TD>
              </TR>
              <TR> 
                <TD background="<{$xoops_imageurl}>images/5bak1.jpg"  WIDTH=628 HEIGHT=100% ><table background="<{$xoops_imageurl}>images/5t2.jpg" WIDTH=628 HEIGHT=100% style="background-repeat:no-repeat "   border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td> <div style="padding-top:10px;padding-left:12px; padding-right:12px "> 
                          <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="100%" height="37" valign="top"><font color="#999999"> 
                                <{if $xoops_isuser}> </font> <table width="100%" height="37" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tbody>
                                    <tr> 
                                      <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" height="37" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/user.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Your Account<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>

<!--  BEGIN MESSAGE CODE
                                      <{php}> GLOBAL $xoopsUser; $pm_handler =& 
                                      xoops_gethandler('privmessage'); $uid = 
                                      $xoopsUser->getVar('uid'); $criteria = new 
                                      CriteriaCompo(new Criteria('read_msg', 0)); 
                                      $criteria->add(new Criteria('to_userid', 
                                      $uid)); $msgcount = $pm_handler->getCount($criteria); 
                                      $GLOBALS['xoopsTpl']->assign('msgcount', 
                                      $msgcount); <{/php}>
                                      
                                       <{if $msgcount > 0 }>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" onload="MM_popupMsg('You have a new Private Message')" /></td>
                                      <{else}>
                                       <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" width="2" height="37" /></td>
                                       <{/if}>
<!-- end message code

                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/viewpmsg.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Inbox (<span style="color:#CCCC99; font-weight: bold;"><{$msgcount}></span>)<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/user.php?op=logout';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Logout<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/notifications.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Notifications<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_1" onclick="parent.window.location='<{$xoops_url}>';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center"><img src="<{$xoops_imageurl}>images/home.jpg" /><br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <{/if}> <{if $xoops_isadmin}> 
                                      <td width="2" align="center" valign="middle"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                      <td width="110" align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/admin.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                        <div align="center">Admin Menu<br />
                                          <img src="<{$xoops_imageurl}>images/spacer.gif" height="10" width="1" /> 
                                        </div></td>
                                      <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="37" width="2" /></td>
                                    </tr>
                                  </tbody>
                                </table>
                                <font color="#999999"><{else}> </font> <table width="100%" height="37" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <form action="<{$xoops_url}>/user.php" method="post" name="login" id="login">
                                    <tbody>
                                      <tr> 
                                        <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></td>
                                        <td align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/user.php#lost';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                          <div align="center">Lost Password<br />
                                          </div></td>
                                        <td width="2" align="center" valign="middle"><div align="center"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></div></td>
                                        <td align="center" valign="middle" background="site_data/site_top.jpe" class="topNav_0" onclick="parent.window.location='<{$xoops_url}>/register.php';" onmouseover="this.className='topNav_1'" onmouseout="this.className='topNav_0'"> 
                                          <div align="center">Register<br />
                                          </div></td>
                                        <td width="2" align="center" valign="middle"><div align="center"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></div></td>
                                        <td height="37" align="right" valign="middle" class="topNav_0"><div align="center"><span class="left" align="bottom"> 
                                            </span> nick: 
                                            <input type="text" name="uname" size="7" value="<{$block.unamevalue}>" class="logintextbox"/>
                                            password: 
                                            <input name="pass" type="password" class="logintextbox" size="7"/>
                                            <input type="hidden" name="xoops_redirect" value="<{$xoops_requesturi}>" />
                                            <input type="hidden" name="op" value="login" />
                                            <br />
                                          </div></td>
                                        <td align="left" valign="middle" class="topNav_0"><input name="login_button" type="image" id="login_button" src="<{$xoops_imageurl}>images/login.gif" alt="Login" align="top" border="0" /> 
                                          <input name="rememberme" type="checkbox" class ="formButton" value="On" checked="checked" />
                                          Remember Me </td>
                                        <td width="2"><img src="<{$xoops_imageurl}>images/site_top_div.gif" height="35" width="2" /></td>
                                      </tr>
                                    </tbody>
                                  </form>
                                </table>
                                <font color="#999999"><{/if}></font>
                                <table width="460" border="0" align="center" cellpadding="1" cellspacing="0">
                                  <tr> 
                                    <td><div align="center"><{$xoops_banner}>&nbsp;</div></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table>
                          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="a">
                            <tr> 
                              <td align="center" valign="top" class="center_block"><table class="a" width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr> 
                                    <td width="140" valign="top" id="leftcolumn"><{if 
                                      $xoops_lblocks}> <table border="0" cellpadding="0" cellspacing="0">
                                        <!--DWLayoutTable-->
                                        <!-- NewsFlash / Top area -->
                                        <tbody>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_top.gif" width="32" /></td>
                                            <td class="mainlevel" background="<{$xoops_imageurl}>images/top.gif" width="100%"><div align="center"><strong> 
                                                NAVIGATION</strong></div></td>
                                            <td><img src="<{$xoops_imageurl}>images/r_top.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td valign="top" background="<{$xoops_imageurl}>images/l_side.gif"><img src="<{$xoops_imageurl}>images/l_side_lrg.gif" /></td>
                                            <td class="mainpage" background="<{$xoops_imageurl}>images/c-bg.gif"><table border="0" cellpadding="0" cellspacing="1" width="100%">
                                                <tbody>
                                                  <tr> 
                                                    <td valign="top"><font color="#999999"><br>
                                                      <{foreach item=block from=$xoops_lblocks}><{include 
                                                      file="tswn_gaming/theme_blockleft.html"}> 
                                                      <{/foreach}> 
                                                      <!-- End left blocks loop -->
                                                      </font></td>
                                                  </tr>
                                                </tbody>
                                              </table></td>
                                            <td valign="top" background="<{$xoops_imageurl}>images/r_side.gif"><img src="<{$xoops_imageurl}>images/r_side_lrg.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_bottom.gif" /></td>
                                            <td background="<{$xoops_imageurl}>images/bottom.gif" width="100%"></td>
                                            <td><img src="<{$xoops_imageurl}>images/r_bottom.gif" /></td>
                                          </tr>
                                          <!-- Main Content Section -->
                                        </tbody>
                                      </table>
                                      <{/if}></td>
                                    <td valign="top" id="centerCcolumn"><{if $xoops_contents}> 
                                      <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <!--DWLayoutTable-->
                                        <!-- NewsFlash / Top area -->
                                        <tbody>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_top.gif" /></td>
                                            <td class="mainlevel" background="<{$xoops_imageurl}>images/top.gif" width="100%"><!--DWLayoutEmptyCell-->&nbsp;</td>
                                            <td><img src="<{$xoops_imageurl}>images/r_top.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td valign="top" background="<{$xoops_imageurl}>images/l_side.gif"><img src="<{$xoops_imageurl}>images/l_side_lrg.gif" /></td>
                                            <td class="mainpage" background="<{$xoops_imageurl}>images/c-bg.gif"><table border="0" cellpadding="0" cellspacing="1" width="100%">
                                                <tbody>
                                                  <tr> 
                                                    <td valign="top"> <p><font color="#999999"><{$xoops_contents}></font></p></td>
                                                  </tr>
                                                </tbody>
                                              </table></td>
                                            <td valign="top" background="<{$xoops_imageurl}>images/r_side.gif"><img src="<{$xoops_imageurl}>images/r_side_lrg.gif" /></td>
                                          </tr>
                                          <tr> 
                                            <td><img src="<{$xoops_imageurl}>images/l_bottom.gif" /></td>
                                            <td background="<{$xoops_imageurl}>images/bottom.gif" width="100%"></td>
                                            <td><img src="<{$xoops_imageurl}>images/r_bottom.gif" /></td>
                                          </tr>
                                          <!-- Main Content Section -->
                                        </tbody>
                                      </table>
                                      <{/if}> <font color="#999999"><{foreach 
                                      item=block from=$xoops_ccblocks}><{include 
                                      file="tswn_gaming/theme_blockcenter_c.html"}> 
                                      <{/foreach}> 
                                      <!-- End center-center blocks loop -->
                                      </font></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table>
                        </div></td>
                    </tr>
                  </table></TD>
              </TR>
              <TR> 
                <TD> <IMG SRC="<{$xoops_imageurl}>images/5t3.jpg" WIDTH=628 HEIGHT=15 ALT=""></TD>
              </TR>
            </TABLE></TD>
          <TD height="100%"> <TABLE WIDTH=70 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="100%">
              <TR> 
                <TD background="<{$xoops_imageurl}>images/bak2.jpg" WIDTH=70 HEIGHT=100%> 
                  <IMG SRC="<{$xoops_imageurl}>images/5.jpg" WIDTH=70 HEIGHT=319 ALT=""></TD>
              </TR>
              <TR> 
                <TD> <IMG SRC="<{$xoops_imageurl}>images/6.jpg" WIDTH=70 HEIGHT=59 ALT=""></TD>
              </TR>
            </TABLE></TD>
        </TR>
      </TABLE></TD>
  </TR>
  <TR> 
    <TD background="<{$xoops_imageurl}>images/1.jpg" WIDTH=766 HEIGHT=73 ALT=""><div style="padding-top:20px; color: #5C5E5C;" align="center"> 
      </div></TD







    >
  </TR>
  <TR> 
    <TD background="<{$xoops_imageurl}>images/l3.jpg" width="50%" height="100%"></TD>
    <TD background="<{$xoops_imageurl}>images/bot.jpg" WIDTH=766 HEIGHT=100% ALT=""></TD>
    <TD background="<{$xoops_imageurl}>images/r3.jpg" width="50%" height="100%"> 
  </TR>
</TABLE>
</BODY>
</HTML>


Just copy the second code group and edit it in your favorite html editor, and you will see at about line 1625 where the code goes.
Tim
www.tswn.com | www.bf2online.com | aquaria.tswn.com | www.bf2142online.org

7
WarDick
Re: Added Additional Code
  • 2005/8/18 12:23

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


There is a module call pmblock that is produced by brandycoke. I have just visited his website it is no longer listed.

I have it working with both of the latest versions of xoops. I will not post a link because of the hack attacks. If you would like a copy pm me.
Urging XOOPS to be the Best It Can Be.
Richard......

8
mitsugari
Re: Added Additional Code
  • 2005/8/18 13:49

  • mitsugari

  • Just popping in

  • Posts: 22

  • Since: 2005/8/11


With talunceford's code I am getting a "member function on a non-object" type of error. Must be something with the way $xoopsUser is accessed? Can someone post corrected code that works with XOOPS 2.2.2?

9
Mithrandir
Re: Added Additional Code

$uid = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

10
DefJef
Re: Added Additional Code
  • 2005/8/26 3:30

  • DefJef

  • Just popping in

  • Posts: 53

  • Since: 2005/8/8 2


I use XOOPS 2.2.2

Is there any way I can insert a code snippet into a file that would popup a "You have a new Private Message" window? The format could be html or even one of those alert windows. Whatever is easiest. I feel this is an important part of a website. Also, an email alert of a new private message (something i believe there is another topic about.)

OK, Thanks!

Sincerely,
Jeff

You can reply to this topic, it is on my notificiations list

Login

Who's Online

234 user(s) are online (153 user(s) are browsing Support Forums)


Members: 0


Guests: 234


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits