Mailing List Archive

How to edit user_rights to include Is_Sysop?
Hello there!

I'm loving the Wikipedia PHP Script, and solving my all my install
problems except one. I'm not quite sure how to edit the tinyblog
user_rights field so that I can become a sysop of my own site! Does
anyone have a php script or an SQL query to do it?

Also, this might not be the place, but I've noticed how cool the
wikipedia.com's mod_rewrite is, but I don't know how to use it? Is there
a simple setup text file on how to use mod_rewrite with Wikipedia?

Thanks in advance!
Seer


--
Seer Snively -- Network Administrator -- NetHelpNow.com
seer@nethelpnow.com "The medium is the message." -- Marshall McLuhan
Re: How to edit user_rights to include Is_Sysop? [ In reply to ]
> I'm loving the Wikipedia PHP Script, and solving my all my
> install problems except one. I'm not quite sure how to edit
> the tinyblog user_rights field so that I can become a sysop
> of my own site! Does anyone have a php script or an SQL query
> to do it?

If you're using the Phase III software (the stuff in the
"newcodebase" directory, then just use this SQL query:

UPDATE user SET user_rights='sysop,developer' WHERE user_id=X;

(where X is your user id, which you can determine with s SELECT
query). In the Phase II software, replace "sysop" and "developer"
with "is_sysop" and "is_developer". If you only want one or the
other, omit the comma.

> Also, this might not be the place, but I've noticed how cool the
> wikipedia.com's mod_rewrite is, but I don't know how to use it?
> Is there a simple setup text file on how to use mod_rewrite with
> Wikipedia?

In general, using "mod_rewrite" and "simple" in the same sentence
is a non-sequitur. The full documentation is on Apache's site.
The incantation used at wikipedia.org is this:

RewriteEngine On
RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=$1 [NE]
RewriteRule ^/w/wiki.phtml(.*) /w/wiki.phtml$1
RewriteRule ^/wiki$ /w/wiki.phtml
RewriteRule ^/$ /w/wiki.phtml
RewriteRule ^/wiki.phtml/(.*)$ /w/wiki.phtml/$1 [NE]
RewriteRule ^/wiki.phtml$ /w/wiki.phtml

This is with the software installed in the "/w" directory
(I don't like installing stuff in the document root--it's too
inflexible for later changes. But those last two lines make
it look as if it's installed at root). If you install the
scripts in a different directory, or want different URLs,
modify the above appropriately.
Re: Re: How to edit user_rights to include Is_Sysop? [ In reply to ]
>UPDATE user SET user_rights="is_sysop";
>should do it.

Um, yes, but it will also make every user in the database
a sysop. Probably not what he had in mind...
Re: How to edit user_rights to include Is_Sysop? [ In reply to ]
Seer Snively wrote:
> I'm loving the Wikipedia PHP Script, and solving my all my install
> problems except one. I'm not quite sure how to edit the tinyblog
> user_rights field so that I can become a sysop of my own site! Does
> anyone have a php script or an SQL query to do it?

UPDATE user SET user_rights="is_sysop";
should do it.

> Also, this might not be the place, but I've noticed how cool the
> wikipedia.com's mod_rewrite is, but I don't know how to use it? Is there
> a simple setup text file on how to use mod_rewrite with Wikipedia?

Here are the rewrite rules currently in use:

RewriteEngine On
RewriteRule ^/wiki/(.*)$ /w/wiki.phtml?title=$1 [NE]
RewriteRule ^/w/wiki.phtml(.*) /w/wiki.phtml$1
RewriteRule ^/wiki$ /w/wiki.phtml
RewriteRule ^/$ /w/wiki.phtml
RewriteRule ^/wiki.phtml/(.*)$ /w/wiki.phtml/$1 [NE]
RewriteRule ^/wiki.phtml$ /w/wiki.phtml

-- brion vibber (brion @ pobox.com)
Re: How to edit user_rights to include Is_Sysop? [ In reply to ]
lcrocker@nupedia.com wrote:
>>UPDATE user SET user_rights="is_sysop";
>>should do it.
>
> Um, yes, but it will also make every user in the database
> a sysop. Probably not what he had in mind...

Well, at least you don't leave anybody out that way. :)

Lee is correct, use a WHERE clause. And, I forgot that the "is_" is no
longer used on phase III. Oy! Any other misinformation I can give you?

-- brion vibber (brion @ pobox.com)