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

12
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?

13
xguide
Re: an Ajax approach in xoops
  • 2007/3/22 13:48

  • xguide

  • Just popping in

  • Posts: 43

  • Since: 2005/5/11


Rico getElementsByClassName and dom effects have to be used carefully as request should be serialized for less securities issues with XOOPS (fail to protect user data). And also to reduce redundancy and user time waiting. Without core development here, 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.

Good luck.

14
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]

15
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

16
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]

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

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

19
xguide
Re: an Ajax approach in xoops
  • 2007/3/30 11:10

  • xguide

  • Just popping in

  • Posts: 43

  • Since: 2005/5/11


Hello farshid,

You have found many issues with this method. XOOPS authentication's not secure.
If it interacts with data without security this will create more vulnerabilities.
Visit the following forum:
http://xoopscube.org/modules/xhnewbb/viewforum.php?forum=9

And search "postload". You will find how to operate on content instead data.
It is exactly what you need to release a new render system ajax with smarty and a litle more secure.

Good Luck.

20
xguide
Re: an Ajax approach in xoops
  • 2007/3/30 20:53

  • xguide

  • Just popping in

  • Posts: 43

  • Since: 2005/5/11


Important security issue with XOOPS 2.0.16 if you suppose admin connect, configuration has a limited time predefined, then one can get data if limited time not expired because there is not a layer security authentication's method on XOOPS 2.0.16

Yes. you can get users password, not usual process but with minimum creativity. It is one important problem to make one choose the layout content possibility and make a new render system instead work directly on data of XOOPS 2.0.16

Good Luck.

Login

Who's Online

124 user(s) are online (73 user(s) are browsing Support Forums)


Members: 0


Guests: 124


more...

Donat-O-Meter

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

Latest GitHub Commits