Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: AJAX call of the CENTER function  (Read 5115 times)

Armen

  • Sr. Member
  • ****
  • Karma: 41
  • Posts: 338
    • http://www.funnydays.ru
AJAX call of the CENTER function
« on: December 05, 2006, 06:43:10 PM »

I guess you all know the beauty of AJAX.

But does anyone know how one can call parameters for the CENTER function to load an article, for example, asynchronously (without calling anything else and refreshing the page)?

Could you help? Any example or something? I need to know the way of sending parameters to snews to get only CENTER. Can this be done without creating a small CENTER-devoted copy of sNews.php file?
« Last Edit: October 04, 2008, 05:12:38 PM by philmoz »
Logged
Now ogres, oh, they're much worse. They'll make a suit from your freshly peeled skin. They'll shave your liver, squeeze the jelly from your eyes... Actually, it's quite good on toast.

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1716
    • http://www.snewscms.com
Re: AJAX call of the CENTER function
« Reply #1 on: December 05, 2006, 07:23:13 PM »

Yes this can be done. But in order to make this a mod there would be a lot of modding cause everything inside function center is called relatively. Making an AJAX alternative would mean changing all links inside snews.php.

Something similar with what we went through when implementing SEF URL's.

I know it can be done cause I'm working on Phoorum, an AJAX Forum coded the same way as sNews with a touch of AJAX.
Logged

Armen

  • Sr. Member
  • ****
  • Karma: 41
  • Posts: 338
    • http://www.funnydays.ru
Re: AJAX call of the CENTER function
« Reply #2 on: December 05, 2006, 09:31:11 PM »

Quote from: Luka
I know it can be done cause I'm working on Phoorum, an AJAX Forum coded the same way as sNews with a touch of AJAX.
Oh, yes, I've heard of that. Keep up, Luka. =)

But still. If function center calls everything, it's not a big problem. The problem (for me) is finding
a way to call snews.php quietly, through an AJAX script. To do this I need to know the center calling routine.
SEF's are good but, I guess real index.php?STUFF is needed here. Am I right, Luka?
« Last Edit: October 04, 2008, 05:13:28 PM by philmoz »
Logged
Now ogres, oh, they're much worse. They'll make a suit from your freshly peeled skin. They'll shave your liver, squeeze the jelly from your eyes... Actually, it's quite good on toast.

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1716
    • http://www.snewscms.com
Re: AJAX call of the CENTER function
« Reply #3 on: December 05, 2006, 09:37:08 PM »

Quote from: SerpantiN
routine[/b].
SEF's are good but, I guess real index.php?STUFF is needed here. Am I right, Luka?
Yup, you need the ?action=something but I believe it can be done by using the normal SEF URLs.

I'll need to investigate this more cause I believe there could be a very simple solution for this. And since I managed to do the AJAX thing within 1 file in Phoorum I suppose we can do the same thing here.
Logged

Armen

  • Sr. Member
  • ****
  • Karma: 41
  • Posts: 338
    • http://www.funnydays.ru
Re: AJAX call of the CENTER function
« Reply #4 on: December 05, 2006, 09:45:12 PM »

Quote from: Luka
Yup, you need the ?action=something but I believe it can be done by using the normal SEF URLs.

I'll need to investigate this more cause I believe there could be a very simple solution for this. And since I managed to do the AJAX thing within 1 file in Phoorum I suppose we can do the same thing here.
That would be terrific.
I can see it now: fast, light-weight script getting even faster and even more comfortable for the end-user
by implementing AJAX support. That's the REAL Web 2.0...
Man, that would kill a lot of rival CMS systems dead ;)

Thank you for your help.
Logged
Now ogres, oh, they're much worse. They'll make a suit from your freshly peeled skin. They'll shave your liver, squeeze the jelly from your eyes... Actually, it's quite good on toast.

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1716
    • http://www.snewscms.com
Re: AJAX call of the CENTER function
« Reply #5 on: December 05, 2006, 09:56:25 PM »

Let me do some work on that matter and I'll get back tomorrow :)
Logged

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
Re: AJAX call of the CENTER function
« Reply #6 on: December 06, 2006, 06:32:06 AM »

I've seen two ajax cms engines so far and the result is - not good :( (no back button, no permalinks...)
The keyword is "over use", maybe because their developers haven't read this:
http://www.sourcelabs.com/blogs/ajb/2005/12/10_places_you_must_use_ajax.html
http://swik.net/Ajax/Places+To+Use+Ajax
http://www.baekdal.com/articles/Usability/XMLHttpRequest-guidelines/
(.. and a lot more..)
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version