[DEV] Turn phpBB Ajax - discussion

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
_Haplo
Registered User
Posts: 587
Joined: Wed Jul 10, 2002 7:57 pm
Location: Sweden
Contact:

[DEV] Turn phpBB Ajax - discussion

Post by _Haplo » Sun Jun 12, 2005 2:12 pm

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.

http://www.ajaxpatterns.org/AJAXFrameworks

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

http://www.onlamp.com/pub/a/onlamp/2005 ... 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

<?php
//...

class Math {

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

    }


}

//...

?>
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 ;)
www.mx-publisher.com - modular CMS for phpBB
News: MXP 3.0.x released!

User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun » Sun Jun 12, 2005 5:01 pm

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.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image

Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec » Sun Jun 12, 2005 5:05 pm

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

_Haplo
Registered User
Posts: 587
Joined: Wed Jul 10, 2002 7:57 pm
Location: Sweden
Contact:

Post by _Haplo » Sun Jun 12, 2005 5:28 pm

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
http://www.mx-system.com/forum/viewtopic.php?t=6914

And here is the associated mxBB Ajax development news
http://www.mx-system.com/forum/viewtopic.php?t=7019
www.mx-publisher.com - modular CMS for phpBB
News: MXP 3.0.x released!

_Haplo
Registered User
Posts: 587
Joined: Wed Jul 10, 2002 7:57 pm
Location: Sweden
Contact:

Post by _Haplo » Sun Jun 12, 2005 7:26 pm

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

http://www.modernmethod.com/sajax/forum/

they seem to have integrated advanced types (arrays and objects) plus serialization of vars in v 0.11. :-) cool
www.mx-publisher.com - modular CMS for phpBB
News: MXP 3.0.x released!

Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec » Sun Jun 12, 2005 7:49 pm

unable to find anything about that...

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

_Haplo
Registered User
Posts: 587
Joined: Wed Jul 10, 2002 7:57 pm
Location: Sweden
Contact:

Post by _Haplo » Sun Jun 12, 2005 9:00 pm

www.mx-publisher.com - modular CMS for phpBB
News: MXP 3.0.x released!

wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric » Mon Jun 13, 2005 4:16 am

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.
Eric

Letus2001
Registered User
Posts: 22
Joined: Thu Nov 04, 2004 8:22 pm

Post by Letus2001 » Tue Jul 04, 2006 11:41 am

Hi,
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 ...)

R.

Post Reply

Return to “[2.0.x] MOD Writers Discussion”