FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Adding pages to "watch"
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Adding pages to "watch" [message #159813] Sat, 27 June 2009 12:21 Go to next message
Tesla Rider is currently offline  Tesla Rider   United States
Messages: 20
Registered: June 2009
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Doen at the bottom of the main screen of the forum, there is a feature that allows you to see what other users are doing. Is there a way to add pages to this? I have a javascript applet on my site that I'd like to know when people are running.
Re: Adding pages to "watch" [message #159817 is a reply to message #159813] Sat, 27 June 2009 13:22 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
It's quite easy from PHP, but with JavaScript you will have to implement AJAX, which will slightly complicate matters.
Re: Adding pages to "watch" [message #159821 is a reply to message #159817] Sat, 27 June 2009 23:07 Go to previous messageGo to next message
Tesla Rider is currently offline  Tesla Rider   United States
Messages: 20
Registered: June 2009
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Are you saying it's easy to watch PHP code (from PHP) but not Java?

The applet I'm talking about is launched by a link installed in usercp.tmpl.

Would that require AJAX?
Re: Adding pages to "watch" [message #159825 is a reply to message #159821] Sun, 28 June 2009 02:03 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Not it it's invoked from PHP. Look at how the ses_update_status() function is implemented in FUDforum's code:

ses_update_status($usr->sid, 'Start my javascript code');
Re: Adding pages to "watch" [message #159858 is a reply to message #159825] Mon, 29 June 2009 14:46 Go to previous messageGo to next message
Tesla Rider is currently offline  Tesla Rider   United States
Messages: 20
Registered: June 2009
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
How would I access this function in usercp.tmpl?

How would the PHP code know when the javascript applet terminated, in order to remove the record in the fud_ses table?

I am guessing the fud_ses table probably expects uid to be unique, that the system expects each user can only be doing one thing at a time. This makes my idea a bit more complicated since the java applet runs in the background. The user will continue to do things in FUDforum while the java applet runs.
Re: Adding pages to "watch" [message #159859 is a reply to message #159858] Mon, 29 June 2009 14:54 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Tesla Rider wrote on Mon, 29 June 2009 20:46
How would I access this function in usercp.tmpl?


Put it in the usercp.inc.t.

Tesla Rider wrote on Mon, 29 June 2009 20:46
How would the PHP code know when the javascript applet terminated, in order to remove the record in the fud_ses table?


It won't, unless you implement an AJAX callback.

Tesla Rider wrote on Mon, 29 June 2009 20:46
I am guessing the fud_ses table probably expects uid to be unique, that the system expects each user can only be doing one thing at a time. This makes my idea a bit more complicated since the java applet runs in the background. The user will continue to do things in FUDforum while the java applet runs.


The function will clear the user's previous action and updates the table with the user's new action.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: YouTube on FUDforum
Next Topic: Attachments to NNTP Postings
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Oct 24 01:52:55 EDT 2017

Total time taken to generate the page: 0.00646 seconds