TorrentFlux.com Hey, OppTupacShakur, you have 11 messages, 0 are new.
05-07-2007, 12:20:34
Home Help Search Profile Logout donate chat
News:


+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  Ajax the index page [Updated v3]
« previous next »
Pages: 1 2 [3] 4 5 ... 8 Go Down Reply Notify of replies Send this topic Print
Author Topic: Ajax the index page [Updated v3]  (Read 15876 times)
steveholt
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 60


Debian Packager





View Profile WWW Email Personal Message (Offline)
« Reply #30 on: 04-21-2006, 20:56:04 » Reply with quote

As to torrentjax.com, well....you sneaky monkey, I shouldn't have bothered to blur out the URL should I? :-p

As dedicated as I have been to development of TJ, I have had ZERO time to develop any sort of website or install a forum for it............yet.

Oops, maybe I shouldn't have mentioned the URL. It seemed pretty safe though, there's just nothing there yet. I actually just got it by googling torrentjax after I saw the name on your screenshot. Sorry if it causes any trouble.

You know you don't have to setup any of that stuff yourself. In TorrentFlux's case, I believe it was IHateMyISP who setup these forums (I think, I could be wrong). I've seen that happen in many other cases too. That's one of the greatest benefits of open-source communities.
Report to moderator   Logged

AthlonXP 2400+ | 3x300GB | 512MB RAM | Debian Testing | TF 2.3 | Python 2.4.4 | Apache 2.2.3 | PHP 5.2.0 (module)
Mistar Muffin
Newbie
*
Offline Offline

Posts: 23

mistar_muffin@hotmail.com Mistar_Muffin Mistar+Muffin



View Profile Email Personal Message (Offline)
« Reply #31 on: 04-21-2006, 21:37:17 » Reply with quote

As to torrentjax.com, well....you sneaky monkey, I shouldn't have bothered to blur out the URL should I? :-p

As dedicated as I have been to development of TJ, I have had ZERO time to develop any sort of website or install a forum for it............yet.

Oops, maybe I shouldn't have mentioned the URL. It seemed pretty safe though, there's just nothing there yet. I actually just got it by googling torrentjax after I saw the name on your screenshot. Sorry if it causes any trouble.

You know you don't have to setup any of that stuff yourself. In TorrentFlux's case, I believe it was IHateMyISP who setup these forums (I think, I could be wrong). I've seen that happen in many other cases too. That's one of the greatest benefits of open-source communities.

No...no problems. Didn't realize google even had it indexed. And the forum really isn't what I'm worried about, thats a matter of unzipping phpBB or SMF (such as TF) but more so the accompanying website. I'm a website designer and PHP coder by career, so I'm somewhat a perfectionist in that regard, and I really don't feel like stressing myself with my own OCD right now by trying to design a site. :-)

-Muffin

PS:

Have you had a chance to check out the alpha copy I sent you?
« Last Edit: 04-21-2006, 21:41:38 by Mistar Muffin » Report to moderator   Logged
steveholt
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 60


Debian Packager





View Profile WWW Email Personal Message (Offline)
« Reply #32 on: 04-21-2006, 22:13:41 » Reply with quote

Hi Muffin,

Thanks for the alpha.

I haven't finished installing it yet. I'm looking at it now, but it'll probably be at least tomorrow before I'm finished. I'll email you my thoughts on it when I'm done.
Report to moderator   Logged

AthlonXP 2400+ | 3x300GB | 512MB RAM | Debian Testing | TF 2.3 | Python 2.4.4 | Apache 2.2.3 | PHP 5.2.0 (module)
ryaner
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 918





View Profile Personal Message (Offline)
« Reply #33 on: 04-22-2006, 06:51:20 » Reply with quote

Your right in saying that TF doesn't use cache'd image (or anything else for that matter). It's caused by the headers generated by using php sessions. It can be overriden BUT it's highly unadviseable in a system with a login like this.

Interesting, I was not quite aware of this. Can you link me to any documentation on why this is the case, and the pro's and con's of enabling the cache with a login system like this?

Code:
; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache

Thats the default in php.ini and causes the following headers to be sent.
Code:
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

Enabling full caching means that if logging out isn't totally secure as people can still hit back in the browser and gain access to the site, sometimes far enough back to re-auth on the system. There is a few other benefits to disabling the cache such as knowing your always seeing an upto date copy but the cache thing really comes down to security.

Report to moderator   Logged

SERVER: Debian Sarge 2.6.16| AMD XP2000+ | 1.5GB Ram  | 1.6T - Raid 5 | TF 2.1 | Apache 2.0.54 | PHP 4.3.10 | MySQL 4.1.11 | Mod/Hacks: XFER Transfer Stats/Multi Torrent Delete/Seed Time Hack/Ajax Details/Torrent Details/RSS Hack
Mistar Muffin
Newbie
*
Offline Offline

Posts: 23

mistar_muffin@hotmail.com Mistar_Muffin Mistar+Muffin



View Profile Email Personal Message (Offline)
« Reply #34 on: 04-22-2006, 09:02:37 » Reply with quote

Code:
; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache

Thats the default in php.ini and causes the following headers to be sent.
Code:
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

Enabling full caching means that if logging out isn't totally secure as people can still hit back in the browser and gain access to the site, sometimes far enough back to re-auth on the system. There is a few other benefits to disabling the cache such as knowing your always seeing an upto date copy but the cache thing really comes down to security.



Thanks for the info, but since (at least according to my apache logs) the images are indeed being cached by the browser and the HTML is all that is updated.

-Muffin
Report to moderator   Logged
ryaner
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 918





View Profile Personal Message (Offline)
« Reply #35 on: 04-22-2006, 12:35:06 » Reply with quote

Images are not given the no cache headers in most php situations. Alot of it depends on the php install, web server and web browser.

Btw, your ajax interface, does it update if someone addes a torrent to the interface without having to wait for the polling interval?
Report to moderator   Logged

SERVER: Debian Sarge 2.6.16| AMD XP2000+ | 1.5GB Ram  | 1.6T - Raid 5 | TF 2.1 | Apache 2.0.54 | PHP 4.3.10 | MySQL 4.1.11 | Mod/Hacks: XFER Transfer Stats/Multi Torrent Delete/Seed Time Hack/Ajax Details/Torrent Details/RSS Hack
steveholt
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 60


Debian Packager





View Profile WWW Email Personal Message (Offline)
« Reply #36 on: 04-22-2006, 20:23:11 » Reply with quote

I have updated this hack.

As suggested I made it so that it now does a full page refresh when it detects that it needs one (a torrent is added/started/topped/deleted/etc...). If there is no need to do a full refresh it will continue using Ajax to update until the ajax_full_refresh number of seconds is reached. As this is not really essential anymore, I now recommend setting this value to a high number (I use 3600, which is 1 hour).

I also added new functionality that allows for Ajax refreshing to be turned off, similar to the way page refreshing can be turned off. At the bottom of the index page it now says "Turn ON/OFF Page Refresh" and right beside it "Turn ON/OFF Ajax". If you turn off page refresh, ajax refresh goes off too (so you get no refreshes). I also created a new setting for this, which you should add to the tf_settings table in the database, called "use_ajax" which specifies whether the default when you first visit the page should be to automatically use ajax (1) or not (0). I set it to 0 to mimic the old behaviour and not mess up anyone without JavaScript, but you can use whichever default you want.

To prevent any problems with people who haven't added the correct new entries to the settings table in the database I also set it up to use defaults for the new settings. The defaults currently are "5" for "ajax_refresh", "3600" for "ajax_full_refresh", and "0" for "use_ajax".

To update your install of this hack, copy the two new versions of the files attched over the old ones, and add the "use_ajax" setting to the settings table in the database.

Thanks to everyone who tested this hack!

* indexAjax.php (38.05 KB - downloaded 191 times.)
* functionsAjax.php (36.95 KB - downloaded 178 times.)
Report to moderator   Logged

AthlonXP 2400+ | 3x300GB | 512MB RAM | Debian Testing | TF 2.3 | Python 2.4.4 | Apache 2.2.3 | PHP 5.2.0 (module)
coprophiliac
Newbie
*
Offline Offline

Posts: 2



View Profile Personal Message (Offline)
« Reply #37 on: 04-22-2006, 20:55:05 » Reply with quote

I like this hack even better :-)
Goes soft on my already stressed router box ... its not running debian tho

Thanks for this great hack. Also admired the nice tj interface in the battle before that latest response. All that Ajax works is going to make this interface even better.
Report to moderator   Logged
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #38 on: 04-22-2006, 23:11:42 » Reply with quote

I think you may have the right way to go, as creating a fork using ajax is probably easier than trying to allow torrentflux to have both ajax and non-ajax options. This way people can decide whether they want ajax or not, and install whichever they like. I just hope your not going to stray too far from the original, so that new functionality in torrentflux will make it's way into torrentjax and vice versa. Smiley

Actually, TorrentFlux will be including Ajax in the future -- of some sort.   Also, changes to the entire layout are also planned.   Honestly, I don't see a need for a fork, unless someone just wants to take a pet project under their wing.

Glad to see steveholt sharing his awesome work.   Thanks.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
steveholt
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 60


Debian Packager





View Profile WWW Email Personal Message (Offline)
« Reply #39 on: 04-22-2006, 23:47:52 » Reply with quote

Hi Qrome,

Do you already have something in the works for using Ajax, or do you think something like what I have done here will eventually be merged into the code? I'm just wondering if I'm wasting my time or not.

Having seen what Muffin has done with the fork, I'm not sure anymore which is the right way to go. His work is good and impressive, but I was hoping it would be more like torrentflux but with some different functionality. He seems to be doing a complete fork, and it will be difficult to keep the two  branches related enough that code can be shared. We'll just have to wait and see though.

No worries though, I'm with TorrentFlux for the long haul. Smiley
Report to moderator   Logged

AthlonXP 2400+ | 3x300GB | 512MB RAM | Debian Testing | TF 2.3 | Python 2.4.4 | Apache 2.2.3 | PHP 5.2.0 (module)
Qrome
Administrator
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 2587


TorrentFlux.com





View Profile Personal Message (Offline)
« Reply #40 on: 04-23-2006, 02:08:09 » Reply with quote

As of yet, it is only in the plan.   I will probably looking into your code.   Thanks for sharing.
Report to moderator   Logged

Check out the new FireFox Extension by IceWind for TorrentFlux called TorrentFlux Add -- right click on torrents and have them added to your TorrentFlux list.
charlie
Newbie
*
Offline Offline

Posts: 1



View Profile Email Personal Message (Offline)
« Reply #41 on: 04-29-2006, 04:39:33 » Reply with quote

Is torrentjax.com meant to be logged into by anyone? I'd like to login and see how it looks if that's possible. The screen shot you posted isn't showing up for me. Thanks for posting all the information!
Report to moderator   Logged
lysip
Jr. Member
**
Offline Offline

Posts: 53


lysip92

View Profile Email Personal Message (Offline)
« Reply #42 on: 04-30-2006, 20:30:17 » Reply with quote

wow, wonderful work... id love to see your work, or even just some more community involvment. id love to host a temp fourm for you (real web space, no domain ofcourse), just drop me a pm.
Report to moderator   Logged

CentOS 4.2 (kernel: 2.6.9-22.ELsmp)
TorrentFlux version - 2.1
Python version - 2.4.1
PHP Version - 4.3.9
Webserver software and version - Apache 2.0
Add-ons/Hacks - rememberme, multiup
Sir-Uli
Newbie
*
Offline Offline

Posts: 3



View Profile Personal Message (Offline)
« Reply #43 on: 05-01-2006, 06:19:56 » Reply with quote

g00d job Cheesy

Just one thing: perhaps you want to add this to your discription:
Quote
INSERT INTO tf_settings (tf_key, tf_value) VALUES ('ajax_refresh', '5')
INSERT INTO tf_settings (tf_key, tf_value) VALUES ('ajax_full_refresh', '3600')
INSERT INTO tf_settings (tf_key, tf_value) VALUES ('use_ajax', '1')
Would be easier to some people to integrate your hack.

If you don't mind i've integrated it into the Premodded Version of b4rt ( http://www.torrentflux.com/forum/index.php/topic,1265.msg9458.html#msg9458 ). Drop me a line, if thats not ok.

Greetz
Report to moderator   Logged
kanchke
Newbie
*
Offline Offline

Posts: 24




View Profile Personal Message (Offline)
« Reply #44 on: 05-04-2006, 07:03:51 » Reply with quote

Steveholt,

Thanx for your great work with AJAX, I was wondering if you could just add one option more : the estimated seeding time.

The hack allready exists and was posted by iBheat on this thread :
http://www.torrentflux.com/forum/index.php/topic,235.msg1729.html#msg1729

Could you import/migrate/implement this hack in your version ?

Thanx,
k.
Report to moderator   Logged

P3 733 | FreeBSD6.0 | 128MB RAM

Lighttpd 1.4.11 | PHP 5.1.2 (cgi-fcgi) | Postgres8.1 | Python 2.3.4

TF 2.1 w/ AJAX on indexpage| MRTG statistics
Pages: 1 2 [3] 4 5 ... 8 Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


Powered by MySQL Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Powered by PHP