API event hook AJAX question

Discussion corner for Developers of Serendipity.
Post Reply
viperjason
Posts: 4
Joined: Fri Sep 14, 2007 7:35 pm

API event hook AJAX question

Post by viperjason »

Does the current system allow for using AJAX with event plugins?

My main issue seems that every call to my code seems to also combine in other plugins that I dont want.

I dont seem to be explaining what I want, so let me try again.

I would like an event based off of a 'GET' where it will only output the plugin results and not the entire page.

Something like
?serendipity[Module]=clean_display&serendipity[Action]=myPlugin

so when I hook into that event and I do
echo 'Hello';

Only hello appears on the page.

If this doesnt exist then I will add it to my site but I would like to know first if it does exist before I make changes to the base code of s9y
viperjason
Posts: 4
Joined: Fri Sep 14, 2007 7:35 pm

Post by viperjason »

Never mind, I found it....using the event external_plugin.

www.site.com/plugin/?serendipity[myplugin]=blah
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, exactly like that. Tell me if you have issues with it.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
louenlax
Posts: 1
Joined: Sat Oct 24, 2009 9:39 am

Re: API event hook AJAX question

Post by louenlax »

How would I check a mySQL database for new entires and display the results using AJAX? I'm making a website code, and I need to use a code that would check the database, and display the results. However, it needs to be as close to real time as possible. So as soon as new information is entered into the database, I need to display the results.
Last edited by louenlax on Fri Oct 30, 2009 11:01 am, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: API event hook AJAX question

Post by garvinhicking »

Hi!

Write up a simple PHP script that you can call using mysql_query() and execute a query on the serendipity_entries table. If you need it as fast as possible, don't use the s9y plugin framework for that, but a plain PHP script.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mathew
Posts: 1
Joined: Wed Nov 04, 2009 8:57 am

Re: API event hook AJAX question

Post by mathew »

Hello all
I am Mathew martin,currently I am working on mysql but i have problem of ajax cause i don't know the ajax so anyone can help me to learn it and give me some link..
Thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: API event hook AJAX question

Post by garvinhicking »

Hi Mathew!
mathew wrote:Hello all
I am Mathew martin,currently I am working on mysql but i have problem of ajax cause i don't know the ajax so anyone can help me to learn it and give me some link..
Thanks
This is a wrong forum for questions like these, you should look on php.net for general PHP forums, or simply google for "ajax tutorials".

Regards,
GArvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply