MediaWiki - User Table - mediawiki

I'd like to include a table with all registered users on a page in my MediaWiki but the only user list I can find is the special page "Active users list".
Is it possible to include this (or a similar list with e.g. the entered real name) on a wiki page?
Thanks in advance for your help.

You can use the Special:ListUsers special page for this. It's a list of all users registered in your wiki.
You can include some special pages just like templates. So, to include the Special:ListUsers page on any wiki, you just need to paste the following wikitext code into the page where you want to show the user list:
{{Special:ListUsers}}
The limit for the list is 50 (iirc), so if you want to increase the length of the list, you can pass the limit parameter to the inclusion syntax:
{{Special:ListUsers|limit=100}}
However, I don't think that Special:ListUsers provides a way to show the real names of users, sorry.

Related

Upload Text File Containing Long List of Tags to WordPress

I have a text file with about 6700 tags that I would like to add to my Word Press site. Of course, it is not efficient to do this manually. Is it possible to automate the insertion of these tags?
I tried a few plugins like Smart Tag Insert, but these are ineffective and have low review scores. Additionally, I see that tags in my MyPHPAdmin panel are stored in the table wp_terms. I wanted to write an SQL script that does what I need. However, the table also stores a series of other values (like menu names). There is no way to identify rows in this table as tags and not something else (like the name of a menu). So, I am also confused about that too.
Thank you for your time and help!
You should loop through all the tags in the file and then use the wp_insert_term function to insert the tags into the database.
Documentation : https://developer.wordpress.org/reference/functions/wp_insert_term/
So the first argument is the tag term and the second one is post_tag.
Exemple:
wp_insert_term(
'tag_name', // the term
'post_tag', // the taxonomy
);

How to get list of Wikipedia pages need edit based on categories selection?

How to take a list of pages which need edit based on categories and sub-categories by using MediaWiki API?
If assuming that all Wikipedia pages that need edit include Template:Cleanup, which means that all they will be placed in Category:All articles needing cleanup, to get a list of all them by using MediaWiki API you have two variants:
Variant 1: Get all articles which include Template:Cleanup with embeddedin:
https://en.wikipedia.org/w/api.php?action=query&list=embeddedin&einamespace=0&eititle=Template:Cleanup
Variant 2: Get all articles from Category:All articles needing cleanup with categorymembers:
https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmnamespace=0&cmtitle=Category:All articles needing cleanup

Retrieving id from database displayed and passing onto other page

I'm displaying the contents of a database on a particular page(recipe names).
I'd like each recipe to be a link which opens to another page. I understand I would have to obtain the recipe id for that particular recipe, pass the id to another page and print the recipe contents onto that page. I would like to know how to retrieve the unique recipe id of a particular recipe ON BEING CLICKED upon mainly.
If you are displaying the contents of a database on a particular page, then definitely you are using a server side scripting like like ASP or PHP or some JavaScript + AJAX. I am quite unclear about that. But for your question, I can tell you one thing that, if, suppose you are using PHP, then you may display the link as;
echo ''.$recipiename.'';
where $recipeid is the variable carrying recipe id and $recipiename is the name of your recipe. In your PHP file (yourpage.php), you may catch this data like $_GET["recipeid"]
You may try a Google search for tutorials.
Use;
$strLink = ''.$strName.'';
echo "<li>".$strLink."</li>";
Don't use spaces.
You just make the id part auf the URL the recipe link points to.
Iced Water
Would be a link pointing to the recipe with ID 23. Since the url is available on the server side you are all set.

Mediawiki blank all pages per namespace. I want to blank all User_talk pages

I want to know if there is a way to blank all user_talk pages enmass. Not delete them, just blank them. I don't know how to write bots, so I'm really asking if there is an extension or pre written bot for this. Thank you
You could write a simple SQL to do this, just look into the page table, for my installation the namespace value for User talk: is 3, so I could just delete all pages with namespace=3.
Deleting the row from the database, will leave the page as blank (not created)
I suggest using AWB. You can easy have it build a list based on a names space and then use a simple ReGeX replace such as: Search: (.*)* Replace with: (empty space).

bot to edit mediawiki categories

I have a mediawiki with different type of categories.
If a page has 2 categories
[[Category:Pear]][[Category:Strawberry]])
I want to add a third category
[[Category:Fruit_Salad]]
Is it possible to do that automatically? (using a bot for instance)
Edit: In fact, what I need is an API for categories
a way to read the category
a way to add a new category
The rest can be done by any program
You are probably looking for the pywikipediabot framework. (Check catlib.py for the category manipulation code, and category.py for an end-user-friendly mass category modification bot.)