11
farshid
Re: an Ajax approach in xoops
  • 2007/4/1 9:48

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


Dear xguide;

I have found the postload and I am learning it, thanks.


Dear phppp;

It is nice to meet you here, I will be glad if you drop a line about what you think about this Ajax thing.

Thanks all.



12
farshid
Re: an Ajax approach in xoops
  • 2007/3/31 8:40

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


I have started a new project on dev.xoops.org
the home is: http://dev.xoops.org/modules/xfmod/project/?ajaxedxoops
I have not managed anything there yet but I will do just as soon, so please report bugs and requests there so that we can manage things better.
thanks all.

Dear Giba;

managing the blocks to be remembered by cookies is a good idea, but I am thinking of some changes in user profile to bring a better concept of personalization to xoops, to do so I think it will be good to have an extra field for user profile in the db, which contains the blocks weights in a serialized format, holding the blocks data for each user and could be unserialized every time needed, what is your opinion about it?
Of course cookies will be used for anonymous user.

and about bringing the theme.html XML out put part to some where else I completely agree with you, we should put it some where else, are you saying to put it in kernel or theme class?

Dear xguide;
I am looking around the forum you mentioned, I will contact you just as soon to have some conversations; thanks.



13
farshid
Re: an Ajax approach in xoops
  • 2007/3/30 10:50

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


Hi all;
Here is some instructions, wish help you to configure what is going on at all:

The main script is called ajaxer.js containing all the necessary code. It then uses RICO(openrico.org) based on prototype.js to make the Ajax calls and drag and drop facilities with some JavaScript effects.
XoopsDragAndDropDraggable.js , XoopsDragAndDropDropzone.js and XoopsDragAndDropManager.js contain are RICO’s extended objects for ricoDraggable, ricoDropDropzone and ricoDragAndDropManager, created to do the drag and drop part of blocks.

This is a XOOPS hack, these files has been changed:
1) header.php
2) class/theme_blocks.php
3) class/xoopsblock.php
4) include/functions.php
5) modules/system/templates/system_redirect.html
And the theme: ajaxedxoops which contains the scripts, and a change in theme.html which out puts an xml required by RICO to map the sent data to some objects in ajaxer.js, for page(module/core) the object is: page_obj and for blocks: block_obj, there is also a page_hisotry_obj object which is responsible to make page and blocks cache and track them.

How it works?
1) first when the page is loaded some JavaScript functions will start to work:
a. createJavascriptMirror
creates the page_blocks_handler object and calls createDraggableBlocks methis on it to make the dragable blocks.
b. sanitizeATags
called when ever we need to make a tags call RICO functions
1- create and attach proper onClick attribute
2- remove the href
3- some criteria should exict as we need some links not changed (ex. xoops_url/admin.php)
c. sanitizeFormTags
called when ever we need to make form tags call rico functions
d. roundElements
this function will be called on page load, to make blocks title and content divs rounded.
e. createDropZones
it is a good idea to make diferent drop zones for each block side, so that left and right blocks could be changed while center blocks could change places judt in center part of the page.

2) So now all a tags will call needed functions to load the page via Ajax when a link is clicked it will send the request to server, then in header.php we will see if the page is requested for Ajax content, if so we will omit the block part, if the request is sent to get left or right blocks then we send them and exit the script so that module code do not run. so is for forms,
3) In theme.html again we check if the request is for a page or block, then we send the proper xml to the browser.
4) When the browser gets the response it will map it to the proper JavaScript object and calls sanitizeATags and sanitizeFormTags again to make the new data act Ajaxy too.


This job is not complete and needs much more work. Any suggestion and idea is welcome.

@Giba
Thanks for your comment, you are completely right about it, I am working on it a little more to make what you mean, we should not load the parts(blocks) that are already loaded, we need that comparation you mentioned, I think we can send the block ids already loaded to the page and make server know what we have, then server could send us the proper block data, I wish I have got what you meant! if I am wrong please correct me, thanks.



14
farshid
Re: an Ajax approach in xoops
  • 2007/3/30 9:34

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


I have uploaded the files HERE

before downloading the file please read this:

WARNING: Please do not use this code at any production site, it is incomplete and you may get serious problems using it in a live site,
This piece of code is still a child, it could evolve if we all find it useful
This is just a demo Package to show you some abilities of this code. Many parts may not work properly.

There are many bugs, so please report any bugs and suggestions in this forum or email me: farshid DOT pourlatifi AT gmail.com

Instructions:
1) First install a clean XOOPS 2.0.16, after installation is complete:
2) Unpack the files in this package and copy all files to the XOOPS root path, overwrite every thing.
3) Go to admin area and update system module once
4) In admin area, select the theme: ajaxedxoops
5) Go to your site front and give it a try.

I will post the instructions in detail here as soon as possible, the comments in the files are not complete, but there is some!

Thanks all.



15
farshid
Re: an Ajax approach in xoops
  • 2007/3/29 12:42

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


I have added some kind off caching to page and blocks, there is now an object called pageHisotryObject which is responsible for the page cache, give it a test:
http://www.fanafzar.com/xoops/
The page cache will be deleted every 2 minutes.

I am waiting for your comments and ideas, tell me what you think about this and what you think is needed?

[edit]
I changed cache time to 5 minutes, so that we can test it better!
[/edit]



16
farshid
Re: an Ajax approach in xoops
  • 2007/3/27 11:57

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


Hi;

Please check the demo site, I have updated some drag and drop effects, and let me know your opinions about it, and if there is any problems with it, I have found some myself, the most important to solve is when the block has a form to submit, it loses the pointer to it's form so the form will submit with wrong data, I will work on it later.

just remember to clear the cache



17
farshid
Re: an Ajax approach in xoops
  • 2007/3/24 16:13

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


I have added some drag and drop! it works fine for now, but it needs more work.
take a look at it:
http://www.fanafzar.com/xoops/

Quote:

xguide wrote:
I read at xoopscube.org some interesting possibilities to create new render for XOOPS and some work to implement ajax was done by Mr. Wanikoo with XOOPS default modules.


well I will be glad if you can give me some links,
thanks.

[edit]oops, if you find things not working well, just try clearing your cache![/edit]



18
farshid
Re: an Ajax approach in xoops
  • 2007/3/22 13:12

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


I have updated the demo site with some more effects, but one more important thing is the Google bot!, go to: http://www.google.com/search?q=site:fanafzar.com/xoops to see the Google indexes of the demo site, about 19 results, not too bad for a demo site!

so what?
it is working, Google has indexed our web site while we can brows it Ajaxy!

by the way, no one has told me what download module to use, any suggestions?



19
farshid
Re: an Ajax approach in xoops
  • 2007/3/20 8:18

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


I have tested newbb 2.02 and it was OK, I have install it to test and put the instructions there.
Now I need a download module, what do you suggest, as I am working mostly on XOOPS 2.2.3/2.2.4 branch, I usually use a customized version of wf-downloads, which is not compatible with XOOPS 2.0.16, so if any one working mostly on 2.0.16 could suggest a download compatible with this version I will be glad to use that.

@xguide
thanks for your comment on "getElementsByClassName", but I think the problem is the number of tags to be worked on by RICO, I have put all .head, .odd, .even, .foot, in the .outer class and .itemhead, .itesminfo and .itemfoot in the .item class to be rounded in each request, which took a long time to be processed and some times make the screen to flicker, now I think I will remove the effect and use it just for some theme parts, but I will hold it in the javascript part commented.



20
farshid
Re: an Ajax approach in xoops
  • 2007/3/18 16:32

  • farshid

  • Just popping in

  • Posts: 34

  • Since: 2004/11/9


Hi all;

I have updated the demo site, you can view it now: http://www.fanafzar.com/xoops/

use:
user: admin
pass: admin
to login as the administrator and see the debug results.
there are many changes in this version:

1- I have designed a new theme, which is table free. some Rico round corners are also applied, wish you like theme.
using this round corners will reduce the bandwidth traffic but it gets extra process time to show the page, any idea about it?
2- now we can send a request to get just one block, this way it seems we are getting ready to have some kind of service server!

and so ...

my next step would be creating another instance of XOOPS so that we can communicate between two XOOPS portals.

I will add some comments and put the files for you to download just as soon.




TopTop
« 1 (2) 3 4 »



Login

Who's Online

134 user(s) are online (59 user(s) are browsing Support Forums)


Members: 0


Guests: 134


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits