Page 1 of 1

[DEV] Turn phpBB Ajax - discussion

Posted: Sun Jun 12, 2005 2:12 pm
by _Haplo
Being excited when realizing wGEric has done some Ajax experimentingwith some phpBB posting methods, i open this general Ajax discussion thread.
_Haplo wrote: nice work eric
we are currently implementing ajax (or at least trying out different ajax approaches) for our mxBB portal adminCP. So i have evaluated JPSpan, Sack and RICO.

May I ask what are your approach for this ajax addon (sure i could study your code, but i would rather fancy a discussion)

LarryH has outlined "all" different ajax techniques available in 3 articles, and finally this lead to his JPSpan Project
A more technical reference is given here ... quest.html

Are you writing these snippets from scratch, or are you building on existing frameworks?

This is all very interesting, and this Ajax adventure is slowly beginning to spread around the web as a "plaugue". Therefore i think we should quickly develope some general phpBB Ajax addons, defining standard phpBB interacting javascript libraries for accessing the database and porting output via our $template class to the client - to avoid tons of branched and too specialized solutions. Such a library would surely make phpBB stand out in the community world :-)

Some initial ideas:
JPSpan is a new and powerful ajax lib for reusing native php classes within javascripts, and thus having all phpBB methods accesible by the client on the fly.
The objective is to make connecting a Javascript client with a PHP server as painless and error-free as possible. To this end JPSpan allows you to define a class in PHP and call it’s methods directly (and remotely) from Javascript. That means if you have a PHP class like;

Code: Select all


class Math {

    function multiply($x, $y) {
        return $x * $y;




You can use this class “natively” from JavaScript on the client-side, calling it like this:

Code: Select all

var m = new math();
alert( m.multiply(2,2) );
The intent is to make building “sticky” DHTML or web-based XUL applications, where the user interface remains static (not reloaded) in the users web browser, while data can be fetched dynamically from a remote web server, in response to user events.

What do you think?

I will keep this updated with our related mxBB work, since we code for the same php backend ;)

Posted: Sun Jun 12, 2005 5:01 pm
by drathbun
Thank you for starting this topic! I've not started experimenting with the new technique yet, but I find it interesting. It would be nice to see a "standard" phpBB AJAX library built.

Posted: Sun Jun 12, 2005 5:05 pm
by Swizec
I agree with drathbun, a standard ajax class would be awesome

edit: I think I'll start using JPSpan in my webapps insted of sajax, seems like ti can do more stuff

Posted: Sun Jun 12, 2005 5:28 pm
by _Haplo
Yes, and hopefully the Olympus gurys will consider this during their redefinition of the phpBB world - i mean since they are objectifying most of good-old procedure based code, some nice Ajax support would be "easy" to implement ;)

Another easy example: the native phpBB message_die() function could deploy its data to a (default hidden) DIV located in the overall_header, thus avoiding many reloads

...problem is current phpBB hasn't any generic methods for creating navigation links and handling POST data, so switching between Ajax and plain navigation (based on client browser javascript status) is not straight forward. And unfortunately current standard phpBB approach mixing output and db handling within the same procedure coded file (index.php, viewforum.php and viewtopic.php) instead of having an extended db class also for db actions (inserting post, editing post etc) force us to duplicate such code for Ajax usage. But this will all change for olympus (i trust)...

This is all even more interesting for portals, since here you typically want to update only parts (blocks) on the page, but any commonly repeated action could be simplified - especially in the adminCP area.

Btw, here's a link to the mxBB adminCP development news

And here is the associated mxBB Ajax development news

Posted: Sun Jun 12, 2005 7:26 pm
by _Haplo
Swizec wrote: I agree with drathbun, a standard ajax class would be awesome

edit: I think I'll start using JPSpan in my webapps insted of sajax, seems like ti can do more stuff

not so sure anymore, from reading announcements and progress reports over in the SAJAX user forums

they seem to have integrated advanced types (arrays and objects) plus serialization of vars in v 0.11. :-) cool

Posted: Sun Jun 12, 2005 7:49 pm
by Swizec
unable to find anything about that...

when's 0.11 out anyways?
coding with 0.10 is a pain :)

Posted: Sun Jun 12, 2005 9:00 pm
by _Haplo

Posted: Mon Jun 13, 2005 4:16 am
by wGEric
I've moved this to the MOD Writers forum since I feel this would be a better place for it.

This is a good idea and I would use it. Just need to make sure everything works normally if javascript is disabled.

Posted: Tue Jul 04, 2006 11:41 am
by Letus2001
AJAX is just AMAZING approach to play with ! Just to give you an idea : our forum runs like wiki, as a huge catalogue of weapons and military events. To allow users to link between forums and content they are writing, I added script which opens a window with all forums from given category, and category dropdown select. By clicking on one of the forums, the [ URL ] like link has been created in originating window.

But now, with AJAX, we just moved ahead - now its only need to highlight the text you want to make link of, and right click by mouse - a DIV pops up with the search result for the highlighted word, showing all the forums having the word in its title ! Click, and the link is done. Fast as lightning !

I'm planning to create set of "right click funcions" using AJAX, with specific functions over specific areas of PHPBB page (post edit, moderate, navigation, smilies ...)