AJAX and Dragonfly - Where and how?
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexAdd-Ons & Blocks
Author Message
greenday2k
Forum Admin


Joined: Aug 11, 2005
Posts: 484
Location: CO

PostPost subject: AJAX and Dragonfly - Where and how?
Posted: Tue Aug 25, 2009 3:46 am
Reply with quote

That is, i'm thinking about adding AJAX to my website (Only for Reg Users), until now I've chosen to use AJAX on:

- Private Messages: Deleting PM's.
- On Comments Deletion (for the comment Class written by www.cmsdreams.co.uk ).
- Adding / deleting a friend on the "Buddys" Module.
- Poll Block: View Results on Demand or After Voting.
- Auto suggest Country / City for the location field on Your_Account Module.

AND

- Send a New PM, auto suggesting usernames (already done).
For this, I've just a written a PHP File that creates a plain text file on includes/somecrazyname.js with the usernames sorted by Alphabetical order. A Javascript command does the auto/suggestion/completion.

My question is there a risk of having a complete list of users on a plain text file?

the file is a JavaScript and looks like:

Code:
var usernames = ["_Whatsername" ,"_LUXI_" ,"_KERPLUNK_" ,"_Estragon_" ,"_ArgentinianIdiot_"];




I'm not planning to turn my website into a Bloated Ajaxed site.
But certainty simplifying some actions performed by the users (to improve the user experience!!! Laughing ).

My second Question is: What are the "right" places to implement Ajax on a Dragonfly Powered Website? Where is useful?




The simplest setup to use AJAX using the core functions of DragonFlys should be (something to):
PHP:
<?php

<?require_one('includes/cmsinit.inc');
ajax_detection_and perfom_basic_task ();
echo
$ajax_response;
die();
?>

is it right?

Thanks.

_________________
www.greenday2k.net



greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
Emsland-Party.de
Nice poster


Joined: May 24, 2005
Posts: 74
Location: Lummer Land (Germany)

PostPost subject: Re: AJAX and Dragonfly - Where and how?
Posted: Tue Aug 25, 2009 9:18 am
Reply with quote

Hy!!

Yes, its useful!!

I have Ajax in Dragonfly/Coppermine.


Emsland-Party.de's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / PHP: 4.4.1 / SQL: 5.0.18-log (client: 5.0.18) / 9.1.0.8 CVS
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer


Joined: Jun 29, 2004
Posts: 3677
Location: Melbourne, AU

PostPost subject: Re: AJAX and Dragonfly - Where and how?
Posted: Tue Aug 25, 2009 10:58 am
Reply with quote

1. Not really a big issue but I wouldn't like to give all usernames away so easily ... why am I saying "easily"?

AJAX requests can be seen, debugged and reproduced within the same session and reaching the file would be a joke.

Long story short ...
  • your AJAX should call a php script
  • your AJAX should send a header request
  • .htaccess protect the php file but allow the request if the AJAX header is set
  • change txt to inc, using php tags deny direct access to the file if not called by DF
  • your php script will need to validate the header sent and is_user()
  • your php script may finally load the inc file

At this point its not going to be easy anymore, just a little harder.

2. Its fine but again read above.

NOTE: all this if we don't want to touch core files, otherwise we could skip a couple of steps

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
MySQL 5.1 / PHP 5.3 / NextGen()
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexAdd-Ons & Blocks All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 1.2264 seconds with 16 DB Queries in 0.2622 seconds
Memory Usage: 2.87 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy