> From: Brion Vibber <brion(a)pobox.com>
> Date: February 21, 2007 5:52:38 PM EST
> To: MediaWiki announcements and site admin list <mediawiki-
> l(a)lists.wikimedia.org>
> Subject: Re: [Mediawiki-l] DB query: Articles of a given Category
> Reply-To: MediaWiki announcements and site admin list <mediawiki-
> l(a)lists.wikimedia.org>
>
> Vernon Thommeret wrote:
>> I'm trying to come up with code that can tell me whether or not a
>> given category has articles or not. Naturally, I borrowed some code
>> from CategoryPage.php. This is what I got up to:
>>
>> $res2 = $dbr->select(
>> array( 'page', 'categorylinks' ),
>> array( 'page_title' ),
>> array( 'cl_from = page_id', 'cl_to' => $title->getArticleID()),
>
> Ok, your first problem is that cl_to contains the target _name_,
> not ID.
> So you'll want to use $title->getDbKey() here.
>
>> $fname,
>> array('LIMIT' => 1 ));
>> echo $res2;
>> echo $dbr->fetchObject($res2);
>>
>> The "echo $res2" spouts off a "Resource #12" or whatever, but the
>> second echo doesn't leave anything.
>
> fetchObject() returns false when there are no more rows to fetch. The
> boolean false value when coerced to string (as when echo'ing) turns
> into
> a nice empty "", so you see nothing.
>
> If you got a result here you'd get an object ID or something dumped to
> output.
>
> Also, consider using $dbr->selectRow() here, so you won't have to call
> fetchObject() and freeResult() manually for your single-row result.
>
> - -- brion vibber (brion @ pobox.com / brion @ wikimedia.org)
Thanks for your help. I got the code working perfectly. One thing,
however, is that the category will never update on their own. I have
to modify LocalSettings.php, and then it reparses the page. Is this
something I have to live with?
Thanks again,
Vernon
I am using the method described here:
http://meta.wikimedia.org/wiki/Using_a_very_short_URL
And it works well. But it only applies to article links. So other
links appear like:
http://.../index.php?title=Category:Movies&action=edit
even though, because of .htaccess, the following works:
http://.../Category:Movies&action=edit
I tried changing $wgScript to "", and that seemed to provide
functioning urls of the form:
http://.../Main_page?title=Category:Movies&action=edit
Where Main_page is the current page. It works, but the url doesn't
make very much sense.
Help? Thanks,
Vernon
Separate question from my last post:
How do you prevent a random person from accessing the images directory
directly (i.e. going to www.wiki_url.com/images)?
This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message.
Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]
This comment is from
http://meta.wikimedia.org/wiki/My_MediaWiki_Site_was_hacked._How%3F_What
_should_I_do%3F:
"Here's another problem: It seems that a number of users are leaving the
/images directory set at 777 - globally writable. This permits malicious
users to take advantage of this and overwriting existing images with
their own spiteful images. It should be noted that this is not a
MediaWiki issue so much as it is a general permissions issue."
My question is: What is the recommended minimum permission setting?
This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message.
Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]
When I upload a picture I see an empty frame.
Under the frame I see:
Ght.jpg (104KB, MIME type: application/x-archive)
At the gallerypage (special pages) I also see empty frames.
If I try to include these pictures in articles I just see a link to the
picture.
I have pictures which works fine (these are uploaded long time ago)
The description is correct:
Picture.jpg (41KB, MIME type: image/jpeg)
And these pictures shows up in the gallery.
This is a link to the gallerypage:
http://wikithailand.dk/index.php/Speciel:Newimages
It seems like the wiki can not recognise uploaded files as pictures/jpg.
My host recently upgraded from php4 to php 5.
Can this cause problems ?
Safe mode is on (but this did not cause problems before)
images and thumb, archive, temp subdirectories are writeable
I have (successfully!) written a small extension that allows embedding
of Quicktime .mov files, using a <qtmov> tag:
<qtmov>320 240 my_movie.mov</qtmov>
I'd now like to write a template to wrap this so that if the extension
changes (more arguments get added, etc.) I can just change the template
in a way that all the previously written qt embedding using that
template will still be valid. So, I want to do a template Template:QTMov
that looks something like (at its simplest):
<qtmov>{{{1}}} {{{2}}} {{{3}}}</qtmov>
However, it turns out that the template parameters aren't expanded! If
in a document I write:
{{QTMov|320|240|my_movie.mov}}
Then literals '{{{1}}}' etc are passed to the qtmov extension, and so
the generated HTML ends up being something like:
<embed width="{{{1}}}" . . . >
Is there a way to avoid this, or do I simply have to use the tag
directly? If the latter, is there a way to give default values to
extension args, and to pass them by name?
Once I've tested, prettified, and (hopefully) gotten the template
working, I'll post the code to the group.
Thanks,
Ken
Hello,
I'm trying to move mediawiki to another server. Everything was fine until i discovered that all special characters on wiki_page table were messed up. I really don't know what is going on because on the other tables all those special characters like ã or ó are ok.
On the old server i'm using MySQL 5.0.24 and on the new server i have 5.0.27.
What should i do?
Thanks!
http://www.mediawiki.org/wiki/Extension:ProcessCite
ProcessCite.php is an extension to Cite.php. It
- makes it easier to add citations to the biomedical literature by
fetching reference info based on PMID from PubMed
- allows storing lists of shortcuts|references in a wiki page
(default is "$wgSitename Reference Library")
- makes the reference style consistent - using a style I arbitrarily
chose ;) -
- disambiguates some different ways to make a citation.
ProcessCite.php requires adding a hook to Cite.php. I've requested
the addition of this hook on bugzilla
http://bugzilla.wikimedia.org/show_bug.cgi?id=9091
To see ProcessCite in action, see:
http://ecoliwiki.net/colipedia/index.php/Help:References
Hope this is useful to someone and that the real programmers can help
me make it better!
Jim Hu
=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054
Hi,
I am just curious if Wikimedia plans to implement a WYSIWYG editor. We
have noticed that the default editor in Wikimedia is not very user
friendly and has slowed its adoption.
As of current, I was wondering if there was anyone who have implemented
a WYSIWYG editor and if you could share this with us.
Thank you.
Best Regards,
Azel