Hi,
if stored some Patterns for new Articles in a specialnamespace called Patterns:...
So know i wanna recieve the content to load this in in a textfield.
But i've no idea how to recieve the content.
'select * from pages where page_namespace=100' gives no stored content back!
thanks mic
On 20/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
Hi,
if stored some Patterns for new Articles in a specialnamespace called Patterns:...
So know i wanna recieve the content to load this in in a textfield.
But i've no idea how to recieve the content.
'select * from pages where page_namespace=100' gives no stored content back!
When you say you get nothing back, do you get 0 rows, or an error? You should really be using the functions in Database.php instead of doing manual queries. At the very least, you need to use Database::tableName() to get the correct name for the table (with the prefix, for example) if you aren't already.
Thomas Dalton schrieb:
On 20/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
Hi,
if stored some Patterns for new Articles in a specialnamespace called Patterns:...
So know i wanna recieve the content to load this in in a textfield.
But i've no idea how to recieve the content.
'select * from pages where page_namespace=100' gives no stored content back!
When you say you get nothing back, do you get 0 rows, or an error? You should really be using the functions in Database.php instead of doing manual queries. At the very least, you need to use Database::tableName() to get the correct name for the table (with the prefix, for example) if you aren't already.
No missunderstandig ...
with the staement i recieve an array of pages. Butthere are no stored article contents.
at the moment i test like this ... but not correct it seems
$data=$this->naw_functs->_nawPatterns(); $title=Title::newFromID($data[0]['page_id']); $article=new Article($title);
regards mic
Michael Heyder schrieb:
Thomas Dalton schrieb:
On 20/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
Hi,
if stored some Patterns for new Articles in a specialnamespace called Patterns:...
So know i wanna recieve the content to load this in in a textfield.
But i've no idea how to recieve the content.
'select * from pages where page_namespace=100' gives no stored content back!
When you say you get nothing back, do you get 0 rows, or an error? You should really be using the functions in Database.php instead of doing manual queries. At the very least, you need to use Database::tableName() to get the correct name for the table (with the prefix, for example) if you aren't already.
No missunderstandig ...
with the staement i recieve an array of pages. Butthere are no stored article contents.
at the moment i test like this ... but not correct it seems
$data=$this->naw_functs->_nawPatterns(); $title=Title::newFromID($data[0]['page_id']); $article=new Article($title);
regards mic
Hi,
I did it this way
$data=$this->naw_functs->_nawPatterns(); $title=Title::newFromID($data[2]['page_id']); $article=new Article($title); $mArticle =& $article; $mArticle->fetchContent();
I hope it's the right way regards mic
$data=$this->naw_functs->_nawPatterns(); $title=Title::newFromID($data[2]['page_id']); $article=new Article($title); $mArticle =& $article; $mArticle->fetchContent();
I'm not sure why you've created a new variable, does $article->fetchContent() not work?
Mic said: -------------- I did it this way
$data=$this->naw_functs->_nawPatterns(); $title=Title::newFromID($data[2]['page_id']); $article=new Article($title); $mArticle =& $article; $mArticle->fetchContent();
I hope it's the right way regards mic ---------------------------
Hi Mic,
It was suggested that you use revisions instead of article to retrieve content. I'd give credit where it is due, but I only saved the part of that email I wanted to use.
"Because Article::getContent() is horrible and should never be used by anybody outside of internal code that does article views. :)
For clean behavior, use the Revision class:
$rev = Revision::newFromTitle( $rev ); if( $rev ) { $content = $rev->getText(); } else { // Maybe do a nice error message here? $content = ''; } "
mediawiki-l@lists.wikimedia.org