Mathias Conradt schrieb:
Ok, so if it needs to be standalone and cannot include any wiki files for db support, you can implement your own code to retrieve the database connection - taking the DB settings from the LocalSettings.php, which would mean you at least have to include them. Or hard code them again into the Response.php.
I don't exactly see where the problem is? You want to avoid implementing your own code for the database connection retrieval? You want to avoid storing the connection info (username, pw, etc.) in two different places?
(Why does it need to be standalone in the first place? Wouldn't it make things easier using the Wiki classes? We use the SpecialPage as well to handle the Ajax requests, not a complete standalone page)
On 9/12/07, Michael Heyder Info@hafenvolleyballer.de wrote:
Mathias Conradt schrieb:
Use the wfGetDB function in response.php to retrieve the data (i.e. articles) from the database.
... $theDoc->updateTitle(); ... public function updateTitle() { $dbr = wfGetDB( DB_SLAVE ); $theData = array(); $theData['title'] = $this->title; $theWhere = array('id='.$this->uid); $dbr->update('page_make_up', $theData,$theWhere); $dbr->commit(); } ...
Thats the problem: the response.php is a standalone file. No claases are integrated. It's only called from the ajax request. So none global vars and/or claases are implemented.
Hope someone can understand my problem.
regards mic
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
------------------------------- We use the SpecialPage as well to handle the Ajax requests, not a complete standalone page)
I tried it, but failes
require_once './includes/WizardBase.php'; $wgAutoloadClasses['naw_WizardFunctions']='./extensions/NewArticleWizard/NewArticleWizardFunctions.php';
class NewArticleWizard extends SpecialPage implements WizardBase { function __construct() { global $wgRequest, $wgUser, $wgParser, $wgTitle,$wgOut; } } and my wizard.js var myAjax = new Ajax.Request('/wiki/extensions/NewArticleWizard/NewArticleWizard.php', { method: 'post', postBody: 'title='+elem1.value, onSuccess: function(e) { $('edit_title').innerHTML= e.responseText;
} }); return false; } regards