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

Home » FUDforum » How To » Adding pages to "watch"
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Adding pages to "watch" [message #159813] Sat, 27 June 2009 16:21 Go to next message
art is currently offline  art   United States
Messages: 35
Registered: June 2009
Karma: 0
Member
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 17:22 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
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] Sun, 28 June 2009 03:07 Go to previous messageGo to next message
art is currently offline  art   United States
Messages: 35
Registered: June 2009
Karma: 0
Member
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 06:03 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
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 18:46 Go to previous messageGo to next message
art is currently offline  art   United States
Messages: 35
Registered: June 2009
Karma: 0
Member
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 18:54 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: YouTube on FUDforum
Next Topic: Attachments to NNTP Postings
Goto Forum:
  

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

Current Time: Tue Dec 03 17:53:49 GMT 2024

Total time taken to generate the page: 0.05425 seconds