// ------------------------------------------------------------------------ //
// XOOPS 2.0.x Basic Modules AJAX Hack Project Stage5 //
// Just enjoy! Internet for everyone!! //
// wanikoo <
http://www.wanisys.net/ > /
// ------------------------------------------------------------------------ //
// Based on XOOPS 2.0.x Basic Modules //
// ------------------------------------------------------------------------ //
## XOOPS 2.0.x Basic Modules AJAX Hack Project ##
-----------------------
PREFACE (sorry...just some chat ^^;; )
-----------------------
Yeah...another AJAX story!!! ^^;;
anyway....
Umm...
Have you ever thought that...
it's very inconvenient and inefficient that whole page(with many blocks)is refreshed/reloaded whenever we click any link in any module?
For example,
Let's assume we play with newbb module with many side blocks!
Ok..now...we click a topic! Whoops! Page refreshed with many side blocks(not related with this click-job) !
and...we click another topic! Whoops! refresh again with many side blocks!
and click! refresh! click! refresh! ............--;;
#OOPS# it!
Whenever we click a link, why does this whole page(with many side blocks) have to be refreshed/reloaded??!!
It's really inefficient!
Don't you think so?
IMHO,
We can solve this problem BY.....
1) redesigning the architecture of XOOPS (Cube).
( Umm...another fork of XOOPS..?!..^^;; )
2) making each module ajax-based( without page-refresh )
3) etc.
^^//
as for 1)redesigning the architecture of XOOPS (Cube),
it means we need
to abandon old phpnuke-style architecture(based on module with blocks).
and separate presentation part from logical-process part completely!
Umm...
If we want to do this, we'd better make another fork of XOOPS(Cube)!
(....^^;; tough story for lazy person like me....--;; )
OK! Next!
When it comes to 2) making each module ajax-based( without page-refresh ),
Umm....
maybe...we can do this easily....compared with 1)redesigning the architecture of XOOPS (Cube).
(...Umm....maybe...Umm...perhaps...Ummm....)
...
Anyway...
this project is all related with
2) making each module ajax-based( without page-refresh ).
and
this topic!
Related topic:XOOPS Cube Default Theme Drag&Drop&Resizing Version
http://xoopscube.org/modules/xhnewbb/viewtopic.php?topic_id=81&post_id=514#forumpost514
Yeah!!!
Let's make basic modules of XOOPS(Cube).... ajax-based(without page-refresh).
Project Start!!!!
(...btw as you know, I am very lazy person ...
so..I can't guarantee this project will keep going on without stop/quit! )
-----------------
-----------------
################################
Download:(stage5 release)
http://dev.xoops.org/modules/xfmod/project/showfiles.php?group_id=1189&release_id=978&dl=2413
################################
-----------------
<change>
-----------------
--project stage5--(2006/4/29)
.All remaining modules AJAX-ized experimentally, too !!!! (except admin section and comment section )
( news mod, sections mod, xoopsfaq mod, xoopsmembers mod, xoopspartners mod, xoopspoll mod. )
.some bugs fixed!
(ex: You couldn't insert into or update DB with Firefox becasue of Referer problem!
Umm...It works well with IE...but not with Firefox!
Anyway..I modified prototype.js to fix it. )
.All changes/fix of XOOPS 2.0.14 RC are applied to this Ajax-ized modules.
.Now,you can see Ajax Processing Indicator(await.gif) during Ajax Process.
(For this function, you need to modify your theme.html!
------------
From:
<div id="content">
<{$xoops_contents}>
</div>
To:
<div id="ajax-process"></div>
<div id="content">
<{$xoops_contents}>
</div>
-------------
(^^I mean you have to add <div id="ajax-process"></div> to your theme.html)
.UI(User Interface) and functions of some modules improved to help users navigate each modules.
.etc.
--project stage4--(2006/4/15)
.newbb module AJAX-ized experimentally, too !!!! (except admin section)
( Umm..it was quite a tough job!!
Not perfect yet..but I will continue to improve it more and more! )
.To prevent IE from caching result-data(sent by XX_action.php), random string(&ajaxrandom=xxxxxx )is added to parameter.
( Umm...If you want to make IE cache it, use old update()( in old smarty_ajax.js )instead of new one. )
. some change in page header(of XX_action.php )
(^^.. I fogot to change it in the previous version. ^^..)
from:
header('Content-Type:text/html; charset='._CHARSET);
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
//header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: private, no-cache');
header('Pragma: no-cache');
to:
header('Content-Type:text/html; charset='._CHARSET);
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
.message_header() (in functions.php) redesigned
(^^;; the previous one had logical error! anyway...fixed! )
.some tiny bugs/typos fixed!
.etc
--project stage3--(2006/4/13)
.mylinks module AJAX-ized experimentally, too !!!! (except admin section and comment section )
(yeah...it was easy job because it's a kind of clone of mydownloads module! )
.some bugs(of mydownloads module) fixed!
(ex: sorting(in viewcat) didn't work properly because of my typo. anyway..fixed!! )
--project stage2--(2006/4/11)
.mydownloads module AJAX-ized experimentally, too !!!! (except admin section and comment section )
(yeah...it was tough job compared with contact module...as expected.
but..,as you know,mylinks module is very similar with mydownloads module fortunately and thankfully.
so..in effect,I've already made 4 modules ajax-based!! ^^// )
.some bugs of contact module fixed!
(...it failed to handle multi-bytes character such as Korean,Japanese properly. anyway..FIXED!! )
--project stage1--(2006/4/9)
Umm...
Experimentally,
I made contact and xoopsheadline ajax-based yesterday..(except admin section)
and confirmed it works well.
(why...contact and xoopsheadline?...because they are easy to play with ^^//)
------------------
-----------------------------------------------------------------
-WARNING-
This project is still in the stage of EXPERIMENT!
and this package is just Beta Version!
Don't use this in your production environment!
------------------------------------------------------------------
-----------------------------------------------------------------
-NOTICE-
----------
(1)
as for x2t theme and cube_default theme , they don't have id="content"
<div class="content">
<{$xoops_contents}>
</div>
so we have to replace class with id like this!!
<div id="content">
<{$xoops_contents}>
</div>
------------
If your theme has <div class="content">, You must replace it with <div id="content"> !!!!!
(2)
These Ajax-ized modules are just for XOOPS 2.0.x.( I modified modules of XOOPS 2.0.13.x)
(so..maybe some of them won't work properly on XOOPS 2.O.x JP because of the difference of One-Time Token System.
the package for XOOPS 2.0.x JP already exits because I already released it!)
##XOOPS 2.0.x JP(Cube) Basic Modules AJAX Hack Project##
http://xoopscube.org/modules/xhnewbb/viewtopic.php?viewmode=flat&topic_id=86&forum=2
(3)
If you want to test these ajax-ized modules with my DD&Resize&Window themes,
You must replace prototype.js of theme with prototype.js of module!!(because I changed some codes for this project.)
And delete prototype.js of each module!!!
Otherwise, it won't work properly on IE because it's already included in page-header of my themes.
( Just delete prototype.js of each module!!
ex: in case of ajax-ized mydownloads module, Just delete mydownloads/include/prototype.js and it will work well on IE !!)
## XOOPS Cube/XOOPS Default Theme Drag&Drop&Resize&Window Version ##
https://xoops.org/modules/newbb/viewtopic.php?topic_id=48487&forum=14
-----------------------------------------------------------------
-------------------------------
How to install?!
---------------------------------
Simple!
First(of All),
we need to copy this three smarty plugins
block.ajax_formupdate.php
block.ajax_form.php
function.ajax_update.php
to smarty's plugin dir,html/class/smarty/plugins/
And..
Install each of them like normal modules!
That's all!
---------------------------
-------------------------------
How to upgrade?!
---------------------------------
more simple!
Overwrite and upgrade each module through Admin menu.
---------------------------
---------------------------
Basic Idea
-------------------------
Simple!
Using Ajax,
we refresh/rewrite only Content section(id="content")(I mean module section of theme) instead of whole page.
ex)
/themes/default/themes.html
<div id="content">
<{$xoops_contents}>
</div>
------------------------
------------------------------
Now, let's check how they work!
------------------------------
(in case of contact)
1) access ~/modules/contact/
2) fill the contact form!
3) Click Send button!
Ha..Ha
No refresh!!
How is it possible?
Simple!
With Ajax,
we refresh/rewrite only Content section(id="content")(I mean module section of theme) instead of whole page.
ex)
/themes/default/themes.html
<div id="content">
<{$xoops_contents}>
</div>
----------------
(in case of xoopsheadline)
1) access ~/modules/xoopsheadline/
2) select/click your favorite feed!
Ha..Ha
No Page-Refresh!!
click other feed!
No Page-Refresh!!
Just refresh of Content section( I mean <div id="content"><{$xoops_contents}></div> )
Don't you think it's interesting and more efficient than Page-refresh ?
--------------------
(in case of mydownloads, mylinks ,newbb and etc. )
..Just browse it!!! and you can understand how it works !!
--------------------
------------------------------
files and scripts used for this project!
------------------------------
prototype.js
/* Prototype JavaScript framework
* (c) 2005 Sam Stephenson <sam@conio.net>
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site:
http://prototype.conio.net/*
(modified for this project by wanikoo )
/*--------------------------------------------------------------------------*/
Smarty_ajax plugins
(modified for this project by wanikoo and based on AJAX-enabled Smarty plugins,author Dmytro Shteflyuk (GPL))
--------------------------------
-------------------------------------
Support Forum:
XOOPS 2.0.x JP(Cube) Basic Modules AJAX Hack Project
http://xoopscube.org/modules/xhnewbb/viewtopic.php?viewmode=flat&topic_id=86&forum=2
Related Project:
XOOPS Cube/XOOPS Default Theme Drag&Drop&Resize&Window Version
http://xoopscube.org/modules/xhnewbb/viewtopic.php?viewmode=flat&topic_id=81&forum=3
https://xoops.org/modules/newbb/viewtopic.php?topic_id=48487&forum=14
---------------------------------------
---------------------------------------
PS:
With Ajax, we can control output of any module more detailedly.
but...I think it just could make code very complicated and make us modify more files.
...
By refreshing/reloading the module content section of theme,
We can
easily make basic modules ajax-based
and
reuse/recycle most files of basic modules with little modification.
--------------------------------------------
From wanikoo
the most educational site, wanisys.net