Kathleen Borja | 1 Sep 2009 17:06
Picon
Favicon

Re: Conflict on submit buttons

Roan Kattouw <roan.kattouw <at> gmail.com> writes:

> A blank page typically indicates a PHP error of some kind. Check your
> error logs or enable error display in the browser, see [1]. Also, you
> should really be asking these questions on wikitech-l; this list is
> about the bot API.
> 
> Roan Kattouw (Catrope)
> 
> [1] http://www.mediawiki.org/wiki/How_to_debug#PHP_errors
> 

Thanks for your help. I solved them with your help. ^_^ I wanted to ask some
more questions here. As much as possible, I am getting fast responses. I hope
you would allow me. Thanks.

I have a problem in fetching the actual raw data or the original article text in
a wiki page.

I looked into the database table 'wbt_searchindex' in mediawiki. I fetch
'si_text' knowing that it's the right one in fetching the original text of an
article page. But, it's used for search function. What i wanted to fetch is the
original text so i could use it in my Bikol Thesaurus. 

-How can I fetch the original article text on a wiki page?
-In what database table is the original article text located?

In the 'searchindex' table, the 'si_text' contains the u800 unicode character. 

-What does u800 really means?
(Continue reading)

Roan Kattouw | 1 Sep 2009 17:12
Picon

Re: Conflict on submit buttons

2009/9/1 Kathleen Borja <jane88borj <at> yahoo.com>:
> I have a problem in fetching the actual raw data or the original article text in
> a wiki page.
>
> I looked into the database table 'wbt_searchindex' in mediawiki. I fetch
> 'si_text' knowing that it's the right one in fetching the original text of an
> article page. But, it's used for search function. What i wanted to fetch is the
> original text so i could use it in my Bikol Thesaurus.
>
> -How can I fetch the original article text on a wiki page?
> -In what database table is the original article text located?
>
searchindex contains, well, the search index, which means it's not the
complete content and some things like short words and non-ASCII
characters get encoded so they can be found more easily. For getting
the content, you should do something like:

$title = Title::newFromText("Main Page"); // Or use some other way of
obtaining a Title object
$article = new Article($title);
$content = $article->getContent();

Note that getContent() has the annoying side effect of returning a
"This page does not exist"-like message if the page doesn't exist, so
you'll wanna check for $title->exists() as well.

Roan Kattouw (Catrope)
Platonides | 1 Sep 2009 17:16
Picon

Re: Conflict on submit buttons

Kathleen Borja wrote:
> Thanks for your help. I solved them with your help. ^_^ I wanted to ask some
> more questions here. As much as possible, I am getting fast responses. I hope
> you would allow me. Thanks.
> 
> I have a problem in fetching the actual raw data or the original article text in
> a wiki page.
> 
> I looked into the database table 'wbt_searchindex' in mediawiki. I fetch
> 'si_text' knowing that it's the right one in fetching the original text of an
> article page. But, it's used for search function. What i wanted to fetch is the
> original text so i could use it in my Bikol Thesaurus. 
> 
> -How can I fetch the original article text on a wiki page?
> -In what database table is the original article text located?

The real text is stored in the table text, or in some location pointed
from there. Don't access the table directly!
You must create a Title, from which you instantiate an Article object
and call getContent() to retrieve its text.

> In the 'searchindex' table, the 'si_text' contains the u800 unicode character. 
> 
> -What does u800 really means?
> -What does u800 do?
> -What does u800 represents?

A character outside of ascii which are escaped so mysql search can find it.
It's an implementation detail, you shouldn't touch the searchindex table
unless you're creating a search extension (also note that if the wiki
(Continue reading)

Kathleen Borja | 1 Sep 2009 17:51
Picon
Favicon

Re: Conflict on submit buttons

Platonides <platonides <at> gmail.com> writes:

> 
> The real text is stored in the table text, or in some location pointed
> from there. Don't access the table directly!
> You must create a Title, from which you instantiate an Article object
> and call getContent() to retrieve its text.
> 
> 
> A character outside of ascii which are escaped so mysql search can find it.
> It's an implementation detail, you shouldn't touch the searchindex table
> unless you're creating a search extension (also note that if the wiki
> uses a search extension instead of the default mysql search, searchindex
> will be empty).
> 

Thanks to you guys. ^_^ Yeepee! Finally, I tried the getContent() method and it
worked! Hmmm..now I am thinking if how will i use that method given the selected
titles that i'll be using from the database table wbt_page. The page_title has
underscores. I am thinking that i'll just strip off those underscores and
replace them with spaces so it will look like title. Is it right? I think that
there will be no differences with that, isn't it?

And also, thanks for the information on the u800.

Thanks. ^_^
Roan Kattouw | 1 Sep 2009 17:53
Picon

Re: Conflict on submit buttons

2009/9/1 Kathleen Borja <jane88borj <at> yahoo.com>:
> Thanks to you guys. ^_^ Yeepee! Finally, I tried the getContent() method and it
> worked! Hmmm..now I am thinking if how will i use that method given the selected
> titles that i'll be using from the database table wbt_page. The page_title has
> underscores. I am thinking that i'll just strip off those underscores and
> replace them with spaces so it will look like title. Is it right? I think that
> there will be no differences with that, isn't it?
>
> And also, thanks for the information on the u800.
>
You can use Title::newFromRow($row) to create a Title object from a
database row object.

Roan Kattouw (Catrope)
Kathleen Borja | 1 Sep 2009 18:30
Picon
Favicon

Re: Conflict on submit buttons

Roan Kattouw <roan.kattouw <at> gmail.com> writes:

> You can use Title::newFromRow($row) to create a Title object from a
> database row object.
> 
> Roan Kattouw (Catrope)
> 

I'll be trying the Title::newFromRow($row) method. ^_^ Thanks. I am thinking of
using a foreach loop right now. Is it right?
Kathleen Borja | 1 Sep 2009 23:18
Picon
Favicon

Re: Conflict on submit buttons

Kathleen Borja <jane88borj <at> yahoo.com> writes:

> 
> Roan Kattouw <roan.kattouw <at> gmail.com> writes:
> 
> > You can use Title::newFromRow($row) to create a Title object from a
> > database row object.
> > 
> > Roan Kattouw (Catrope)
> > 
> 
> 

I tried using the Title::newFromRow($row) method. Some titles are not fetched.
Only some are displayed. I'll try to debug them. I hope you could still help me
with this.

Anyway, thanks a lot. ^_^
Kathleen Borja | 2 Sep 2009 15:36
Picon
Favicon

Re: Conflict on submit buttons

Roan Kattouw <roan.kattouw <at> gmail.com> writes:

> You can use Title::newFromRow($row) to create a Title object from a
> database row object.
> 
> Roan Kattouw (Catrope)
> 

I am still working on the Title::newFromRow($row) method to fetch the article
titles. Anyway, how can i know the username logged in mediawiki? How can i use
it in the php code? I would like to insert that value to a table field in my
thesaurus.

Thanks.^_^ 
Platonides | 2 Sep 2009 16:44
Picon

Re: Conflict on submit buttons

Kathleen Borja wrote:
> I am still working on the Title::newFromRow($row) method to fetch the article
> titles. Anyway, how can i know the username logged in mediawiki? How can i use
> it in the php code? I would like to insert that value to a table field in my
> thesaurus.
> 
> Thanks.^_^ 

global $wgUser is an User object which contain the current user.
Kathleen Borja | 2 Sep 2009 21:07
Picon
Favicon

Re: Conflict on submit buttons

Platonides <platonides <at> gmail.com> writes:

> 
> global $wgUser is an User object which contain the current user.
> 

Thanks. I used the User object. So, I have something like this:
        global $wgUser;
        $user = $wgUser->getName();
	$wgOut->addHTML($user);

I have another question but it's about special pages. Can i change the layout of
a particular special page? I made a special page to be pop up window. I wanted
to make a new layout for it. how can i make it? is it possible? 

Gmane