Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript
Author Message
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Tue Apr 11, 2006 1:16 pm Reply with quote

My 850 members have sent approx 80,000 IMs since 2003. They would not be happy campers without this module. I'm working on the upgrade for the production site and would like to have as few errors as possible before the final data set.

And maybe this module has some bad 7.6/3.x standards too. It's spooky putting old apps on Raven's beautiful new distro without a clear clue how to upgrade. (btw, SM at FN was once free and is not now. And the forums were deactivated on the support site. There hasn't been an update since 2003.)

I'm buggy eyed and clueless for a solution to a js Object Expected error at modules.php?name=Site_Messenger


Viewing source points to the divEvent() at the end of the data table output.

Here is the function from functions.php
Code:
function divEvent() {

        if(nc) document.captureEvents(Event.MOUSEMOVE);
        document.onmousemove = divPos;
        }



It is implemented in the module/index.php like this:

Code:
if ($havemessages) {

                echo "&nbsp;<input type=\"image\" src=\"$url_button/delete.gif\" name=\"delete_messages\" value=\"delete_messages\" style=\"border: 0px\" width=\"103\" height=\"20\" alt=\""._PMSDELETE."\">";
                echo "<input type=\"hidden\" name=\"total_messages\" value=\"$total_messages\">";
                echo "<input type=\"hidden\" name=\"op\" value=\"delete_messages\">\n";
                }
        echo "</td>\n</tr>\n</table>\n</form>";
        if ($havemessages) {
                echo "<scr ipt language=\"JavaScript1.2\" type=\"text/javascript\">\n<!--\n divEvent()\n //-->\n</scr ipt>";
                }


The error occurs when viewing the "Your Messages" table.

A tiny example of view source for the last table row and script tag.
(from my test site)
Code:
<tr>

        <td bgcolor="#EDD1EF" width="2%" align="center"><input type="checkbox" onclick="CheckCheckAll();" name="msg_id[8]" value="3" style="background-color: transparent;"></td>
        <td width="5%" align="center" bgcolor="#EDD1EF">&nbsp;        <td bgcolor="#EDD1EF" width="10%"><font class="content" color="#735288">User</font></td>
        <td bgcolor="#F3E6F8"><a href="modules.php?name=Site_Messenger&op=read&id=3" onmouseover="on('ebene8')" onmouseout="off('ebene8')"><font class="tiny" color="#735288">Re: heh, heh</font></a></td>
        <td bgcolor="#EDD1EF" align="center" width="18%"><font class="tiny" color="#735288">06-04-01 01:27 01:27:58 PM</font></td>
</tr>
<tr bgcolor="#EFDEF6">
        <td colspan="6"><a href="modules.php?name=Site_Messenger"><img src="modules/Site_Messenger/images/buttons/english/index.gif" width="55" height="20" border="1" alt="You can click here to reload your instant messages." align="right"></a> <a href="modules.php?name=Site_Messenger&op=send"><img src="modules/Site_Messenger/images/buttons/english/senden.gif" border=0 width="103" height="20"></a> &nbsp;<input type="image" src="modules/Site_Messenger/images/buttons/english/delete.gif" name="delete_messages" value="delete_messages" style="border: 0px" width="103" height="20" alt="Delete Message"><input type="hidden" name="total_messages" value="9"><input type="hidden" name="op" value="delete_messages">
</td>
</tr>
</table>
</form><scr ipt language="JavaScr ipt1.2" type="text/javascr ipt">
<!--
 divEvent()
 //-->
</scr ipt>
<!-- end Site_Messenger output -->

</td>
</table>


I suspected a conflict with a block, so did a search for all instances of divEvent() in public_html/ and only found it in the above two files.


If anyone has a moment to help me rid myself and users of this error I'd be most grateful and take you to lunch if you're ever in Victoria.

Have a happy nuking day.

Cool

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Apr 12, 2006 6:27 am Reply with quote

CodyG, may I see the two functions "on" and "off" where they are defined? See this line of code:


<td bgcolor="#F3E6F8"><a href="modules.php?name=Site_Messenger&op=read&id=3" onmouseover="on('ebene8')" onmouseout="off('ebene8')"><font class="tiny" color="#735288">Re: heh, heh</font></a></td>

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
CodyG







PostPosted: Wed Apr 12, 2006 11:39 am Reply with quote

oh right ... I was playing around with this bit of code .... Sad I knew there was something to do with off and on somewhere ... it's in the block-Site_Messenger.php file. Which is totally confuddling because the error only appears when accessing the module/index.php.

Code:


SCR IPT LANGUAGE="javascr ipt" TYPE="text/javascr ipt">
        <!--
     if (document.images){
               BC_on = new Image();
                BC_on.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/copyrighta.gif" ?>";
                BC_off = new Image();
                BC_off.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/copyright.gif" ?>";
          B0_on = new Image();
                B0_on.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/b0a.gif" ?>";
                B0_off = new Image();
                B0_off.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/b0.gif" ?>";
          B1_on = new Image();
                B1_on.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/b1a.gif" ?>";
                B1_off = new Image();
                B1_off.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/b1.gif" ?>";
          B2_on = new Image();
                B2_on.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/b2a.gif" ?>";
                B2_off = new Image();
                B2_off.src = "<?php echo "modules/$pm_module_name/images/Themes/$themename/b2.gif" ?>";
        }
     function off(offImageArray){
             if (document.images){
                     for (i=0;i<offImageArray.length;i++){
                             document[offImageArray[i]].src = eval(offImageArray[i] + "_off.src");
                     }
             }
     }
     function on(onImageArray){
             if (document.images){
                     for (i=0;i<onImageArray.length;i++){
                             document[onImageArray[i]].src = eval(onImageArray[i] + "_on.src");
                     }
             }
     }
     //-->
     </SCR IPT>

 
montego







PostPosted: Fri Apr 14, 2006 10:51 am Reply with quote

CodyG,
Not sure if this is it, but I am wondering about the two lines that are like this:

document[offImageArray[i]].src

doesn't this need to be:

document.[offImageArray[i]].src

I think it needs to have the "dot"?
 
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Fri Apr 14, 2006 9:02 pm Reply with quote

What I'm thinking is that its supposed to change the images source path

So that would be
document.images[offImageArray[i]].src

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
CodyG







PostPosted: Sat Apr 15, 2006 10:57 am Reply with quote

In block-Site_Messenger.php I added dots..
Code:


function off(offImageArray){
             if (document.images){
                     for (i=0;i<offImageArray.length;i++){
                             document.[offImageArray[i]].src = eval(offImageArray[i] + "_off.src");
                     }
             }
     }
     function on(onImageArray){
             if (document.images){
                     for (i=0;i<onImageArray.length;i++){
                             document.[onImageArray[i]].src = eval(onImageArray[i] + "_on.src");
                     }
             }
     }


That's not working for me ... and now gives me a new js error on the home page, not just at the modules/Site_Messenger/index.php.

The error is: Expected identifier.

The script has this thing where it changes images according to some state of the block... on and off ... and this is configurable in the module config file. I turned it off. Maybe I should try turning it on.

Thanks for helping.
 
CodyG







PostPosted: Sat Apr 15, 2006 11:02 am Reply with quote

I tried turning it, it is an animated gif as part of the block file, I put it ON ... but it doesn't help, it looks funny. Sad
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> JavaScript

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©