[10:02:14] Recalcitrance of developers and Cabalism WHAT DO I HAVE TO DO TO GET SOME REASSURANCE AROUND HERE?!! As long as this problem exists, work is not being done! If the problem isn't going to be fixed immediately, I'd at least like to know. - Furrykef 00:15, 22 Aug 2004 (UTC) https://meta.wikimedia.org/wiki/MediaWiki_1.3_comments_and_bug_reports/Archive#Recalcitrance_of_developers_and_Cabalism [15:00:01] sigh https://editthis.uservoice.com/forums/35672-feature-requests [15:10:06] Afternoon people, anyone able to help with a AutoPromote issue? [15:12:20] trying move users to a specific group on login but AutoPromote doesnt actually add them, even though they are shown in that group [15:14:44] Ive looked for an extension that might do the same job but no luck =\ [15:30:19] anyone about who could help? [15:36:40] Hey folk. On a stock installation of the stable release, does something need to be set to show bot edits in article history? I'm testing something with the API (posts including the bot flag as they should), and while edits complete successfully, they don't appear with the "b". In fact, the legend displayed on action=history doesn't mention bot edits at all. [15:56:31] Scott_enwp: bot edits are never shown in the history [15:58:16] Oh, they're only flagged up as such on watchlists/RecentChanges? [15:58:30] Somehow I never noticed that. [15:59:57] Scott_enwp: yeah, the bot flag is only tracked in the recent changes table [16:00:10] Well, that's that, then. Great, thanks. [16:00:16] Cheerio [16:02:45] Betacommand, any suggestions/ideas on AutoPromote, I'm trying to get users into a specific group on login, AutoPromote is working but adds as a Implicit member of: and the permissions do not take effect, adding them via the SPecialPages works fine on the other hand. [16:03:04] or simply changing the default group on signup would do [16:03:10] th3sarg: what are you trying to do? [16:04:38] on signup I want users to be put into a "Members" group I have rather than default users [16:04:51] rather than having to manually add them as there will be alot [16:05:43] th3sarg: why not just use the default users group? [16:07:24] Im using a extension to make pages public and private and tried using the users group and it didn't like it [16:08:26] th3sarg: whats the extension? [16:08:56] Extension:Restrict_access_by_category_and_group [16:09:47] I have everything working dandy, I'm just trying to get users into a different group [16:10:19] if I manually change the user works fine, just dont want to do that for every user. [16:12:24] th3sarg: Ive got an idea [16:12:51] all are welcome at this moment in time! :) [16:16:16] th3sarg: OK, I figured out the root cause of this, and its really annoying. The extension programmer decided to use a group name instead of a user right... Just Plain Wrong [16:17:00] ahh wonderful haha :p [16:18:22] th3sarg: Besides mixing Italian and English in the code...... [16:18:39] * Betacommand gets shotgun and goes looking [16:18:55] oh really!? lol that's sounds clever... [16:19:13] th3sarg: its really really obnoxious [16:19:38] I take it I'm better off looking for another ext that does the same job? [16:19:42] newsflash: there are other languages out there besides English! :) [16:20:09] th3sarg: Ive got to be somewhere in an hour, but I should be able to tweak the extension to use user rights [16:20:33] Vulpix: so use ONE and dont mix them [16:20:35] oh nice :) [16:21:13] th3sarg: drop me an email to remind me and include a link to the extension [16:21:18] @gmail.com [16:21:48] ok cool will do, thanks :) [16:22:54] will probably take me a few days [16:25:13] yea that's not a problem, I appreciate it [16:31:35] th3sarg: I think I may have just found a quick fix [16:31:48] oh nice :) [16:31:51] getAllGroups ( ) [16:32:47] th3sarg: this will require you to edit the php file for the extension though, so I recommend creating a backup of it first [16:33:04] yea thats not a problem [16:33:17] anywhere in specfiic I need to stick that [16:33:23] see the text: [16:33:24] $user->getGroups() [16:33:29] change that to: [16:33:39] $user->getAllGroups() [16:34:11] then restart the webservers and see if it works :P [16:34:54] NOTE if things break its your responsibility not mine :) [16:35:03] haha thats fine I backup alot [16:35:47] th3sarg: I saw that getGroups only gets explicit user groups [16:36:08] autoconfirmed and the others are considered implicit [16:42:14] looking good... [16:46:45] th3sarg: try it with a new account and see if it works [16:49:37] th3sarg: status? [16:50:10] yea works but opens everything up [16:50:56] th3sarg: that sounds like an issue with your autopromote then [16:51:20] Im headed out drop me an email with a status update [16:51:28] ok will do :) [18:02:50] hi all [18:03:02] any template master around ? [18:04:32] i am trying to allign center a text but cant able to [18:12:53] Saqib: maybe adding style="text-align: center" to one of your
s (if there are any) could help? [18:13:07] tried it [18:13:21] here https://test.wikipedia.org/wiki/User:Saqib [18:13:46] i am trying to center allign "More images" under image row [18:14:35] and here's the template that need fixing https://test.wikipedia.org/wiki/Template:Welcom1 [18:14:50] its {{#if:{{{commonscat|}}}[[:commons:Category:{{{commonscat}}}|More images]]}} [18:17:33] its too complex :P [18:19:23] while you have a

and

on that template, apparently something is breaking that

tag in 2 when used on that page [18:20:03] I was about to suggest adding style="text-align: center" to that

, but it won't work because of this :S [18:20:10] oh [18:20:49] btw there is no

in template [18:21:08] the "Upload Photo" button seems to be the culprit [18:21:35] Saqib: I'm seeing one here, next to https://test.wikipedia.org/w/index.php?title=Template:Welcom1&action=edit [18:22:02] ops yes [18:22:03] sorry [18:26:30] would this help vulpix https://test.wikipedia.org/w/index.php?title=Template%3AWelcom1&diff=202149&oldid=202148 [18:28:09] Saqib: yes. Actually, you could put {{#if:{{{commonscat|}}}... inside a

or put that style on the table cell [18:29:24] such a headache https://test.wikipedia.org/w/index.php?title=Template%3AWelcom1&diff=202152&oldid=202151 [18:31:35] strange, that link has disappeared now, apparently [18:33:19] Hello! I wish to store the values under a column name of a table into an array from the database in MediaWiki special page code. Can any one help please? [18:33:51] in fact, the generated HTML has

but no content [18:34:21] I wish to use this array further in function array_key-exists(); [18:34:54] :( [18:35:27] Saqib: ahh, I found it [18:35:41] what [18:36:12] Saqib: you have: {{#if:{{{commonscat|}}}[[:common... Note there's a missing pipe just before the [[:commons ]] link [18:40:45] lets leave it .. its beyond my control [18:41:12] anyway thanks for you help [18:41:38] Saqib: it's

and not

[18:42:16] yes i corrected it [18:42:24] ah, yes, fixed now [18:42:31] HMM [18:42:34] hmm [18:43:04] actually this WLM template [18:43:17] it was important but its not possible [18:43:27] it is on WP https://en.wikipedia.org/wiki/Template:PKmonument_row [18:44:01] you can see it here usage https://en.wikipedia.org/wiki/List_of_cultural_heritage_sites_in_Islamabad_Capital_Territory [18:44:25] you will notice why i am trying to center it [18:44:42] because "More images" text is center is some columns [18:44:50] in some columns * [18:45:24] yeah [18:45:30] oh its worked [18:45:32] :O [18:45:36] https://test.wikipedia.org/wiki/User:Saqib [18:45:41] i am amazed [18:45:43] I am using |align="center"|.... in tables [18:45:45] that's caused by

being split when an image is included [18:46:20] actually it worked guys [18:46:23] so thanks alot [18:46:26] Saqib: | style="vertical-align:middle;text-align:center" {{!}} this is what {{PKmonuent_row}} is doing [18:47:18] yes [18:51:17] bye vulpix and saper :) [18:51:18] thanks [18:51:57] no problem, bye! [19:00:56] vulpix. sorry to bother you again [19:01:15] can you please check what makes the serial nos in serial number row appear bold https://en.wikipedia.org/wiki/List_of_cultural_heritage_sites_in_Islamabad_Capital_Territory [19:01:26] yes! [19:02:13] Saqib: that's because it's a table header (th instead of td), which has a default style of bold [19:03:36] here https://en.wikipedia.org/wiki/Template:PKmonument_header ? [19:04:30] the style of is defined in MediaWiki's core files [19:04:40] you mis understood [19:04:54] i mean to say in https://en.wikipedia.org/wiki/List_of_cultural_heritage_sites_in_Islamabad_Capital_Territory [19:05:05] you will see ICT/1 , ICT/2 , ICT/3 [19:05:07] all bold [19:05:14] Here is the , (wikimarkup ! instead of |) https://en.wikipedia.org/w/index.php?title=Template:PKmonument_row&action=edit [19:05:30] Saqib: ^ [19:06:56] oh ok [19:07:35] fixed it [19:08:05] you are master [19:09:44] thanks again vulpix [19:09:48] template guru [19:13:05] well, the problem wasn't template here, but HTML [19:38:17] Hi, does anybody know how to access the current user's ID for writing to the database? I've created a new special page that asks a user to enter information, though I'm not sure how to determine which user is entering in the information. [19:40:04] http://www.wockymedia.com/main/index.php?title=Special:MyExtension - Try it out. [19:40:37] It's stupidly simple, but is needed to determine a user's age and place them in a group based on their age. [19:42:28] surely User.php has the answer [19:46:32] $this->getUser() should work on a special page [19:48:21] Reedy: What information does that give the page access to? Everything from wikiuser? [19:49:40] It's an instance of the User object [19:49:42] !class User [19:49:42] See https://doc.wikimedia.org/mediawiki-core/master/php/html/classUser.html [19:58:32] Reedy: As obvious as it seems, my knowledge with PHP is rather limited and I'm having trouble understand what's written on that page. I'm not sure what to do - If whether $this->getUser() accesses all user data of if you must access it yourself with $this->getUser(). [20:00:09] You've got a user object [20:00:14] I really hate to be the person who says "Show me what to do", but that's what's needed in this case. Specifically, how can I get ahold of the user's ID so I can put that into a variable that can be passed along to processAge.php? [20:00:17] From there, you can call the methods on it (documented on that page) [20:00:27] $this->getUser()->getId() [20:00:48] 0 if it's an anonymous user [20:02:12] Ah, it's good to hear it has handling for non-logged in users. I needed a way to prevent anonymous users from using the page as well, so now I know I can just check for 0. [20:02:40] hmm, would it be possible to enable the Visual Editor, but not have it co-opt the "Edit" tab label from the normal editor? [20:03:00] I'd rather it have a new label called "Visual Edit" [20:03:03] or something like that [20:03:31] There's also $this->getUser()->isAnon() [20:03:45] What does that do? [20:03:55] Tells you if the user as anonymous ;) [20:04:00] Plip, this might help you as I have used it too in my extension. "public function execute($sub){ [20:04:00] global $wgOut; [20:04:01] global $array; [20:04:01] global $wgUser; [20:04:01] $name=$wgUser->getId(); [20:04:01] Gives you a bool [20:04:02] " [20:04:20] $name = getId()? [20:04:21] Seriously? [20:05:15] remove unwanted global variables Plip like $wgOut, $array [20:05:33] albertcoder: Just for reference, in modern mediawiki, the coding convention for special pages is to use $this->getOutput() and $this->getUser(); instead of the globals $wgOut; and $wgUser; [20:06:29] bawolff, Thanks I will rectify it. [20:07:33] It won't actually make any difference whatsoever, but we're trying to slowly get rid of uses of $wgOut and $wgUser in mediawiki [20:09:05] SamB: yes [20:09:16] SamB: the English Wikipedia uses that kind of configuration, even [20:09:23] oh cool [20:09:54] bawolff, yeah, I have read it somewhere that global variables should be eliminated as they are performance or memory inefficient. [20:09:59] bawolff: iirc, the variable is set to that anyway, but it means in future someone won't have to run a huge find/replace ? [20:10:23] is still inaccessible from wikitext-formatted tables? [20:10:24] http://www.wockymedia.com/main/index.php?title=Special:MyExtension < Can somebody verify for me that the page gives you an error message for users without accounts? [20:10:35] albertcoder: Actually I'd bet they're more efficient then all this IContextSource bussiness [20:10:37] Error - Only registed users may view this page. [20:10:38] SamB: the setting seems to be `$wgVisualEditorTabPosition = 'after';` [20:10:40] die() ? [20:11:05] Lcawte: more or less [20:11:33] MatmaRex: as it happens, I wanted this on enwp anyway ;-) [20:11:46] was afraid I'd be told "sure; write some JS for it" [20:11:51] Lcawte: In theory, someone could modify the context to be something else (For example this is done when transcluding a special page), in practise, we change all the globals anyways to prevent bugs when people do it [20:12:15] bawolff, you might be right but I am not familiar with IContextSource bussiness. :) Anyway I will eliminate them from my code. [20:12:16] or "not that I know of" which amounts to the same thing really [20:12:19] exit(), technically. :P It would probably be better to have the page's user-only content & the error messages as an if and elseif so the rest of the page can render. [20:12:52] Plip: indeed [20:12:56] albertcoder: Its not for efficiency, its because some people think global state makes for hard to maintain code (and they're right) [20:13:08] Plip: if ( anon ) { output error message; return; } [20:13:18] Save un-necessary nesting [20:13:22] Of course, its not 100% clear that simply putting all global state into an object and passing it everywhere actually makes the code any easier to maintain [20:13:39] bawolff: well, it's not very flexible anyway [20:13:40] but we're pretty comitted to that path at this point [20:13:51] it turns out that non-global state can be hard to manage too [20:14:06] SamB: Indeed. State itself is the real problem! [20:14:26] Computers are complicated [20:14:44] bawolff, thanks for the information. :) I will try to make it a habit to use global variables as less as possible. [20:17:09] bawolff: well, it becomes somewhat clearer what to do with formerly-global state when you eventually want to be able have more than one instance of that state ... [20:17:49] SamB: yes. But outside of $wgTitle, that really doesn't happen very often in MW [20:18:00] and maybe it turns out to be mere data rather than state [20:18:11] * SamB is thinking of GDB [20:19:43] anyway, it might help to ask "now what is this value actually specific to?" [20:33:54] I have a question more of logic now: What would be the best way to pass the user's ID (Now a variable) along with the data in my submit form? [20:34:32] Only method I can think of would potentially allow users to change the ID with editors like FireBug [20:36:06] Plip: Why would you want to pass the user id with the submit form [20:36:38] Is the user going to not be logged in after they hit submit (Since otherwise you can just get it again via $this->getUser()->getId() on the other side of the form) [20:37:27] The page the submit form submits it's data to is a non-wiki page, so that page wouldn't have access to the ID. [20:37:44] Unless it would be possible to handle the submitted data locally? [20:38:34] Its hard to say if you could handle it locally without knowing the context, but as a general rule, you can usually do anything locally if you try hard enough [20:39:25] Plip: If you're submitting somewhere external, its pretty hard to submit the data in a way that the user can't tamper with it. Basically you would have the encrypt the data with a key shared between mediawiki and the other server [20:39:57] It's on my server, just not on Mediawiki. [20:40:06] Hello [20:40:13] I have a question [20:40:20] then there's a 99% chance you could make mediawiki do whatever your other script is doing [20:40:58] I can create a wiki like Meta? (with global groups and numerous wikis) [20:41:13] bawolff: Would you like to try my script out? That may give you a better idea. [20:41:51] Guest4432: Yes, but it can be a lot of work to set up all the extensions. Lots of the multi-wiki global extensions aren't the best documented [20:42:04] Plip: Unforunately I actually have to go to dinner [20:42:40] That's fine, I'm just simply not sure how to have Mediawiki handle the submitted data within itself. [20:44:12] And where I can install the extensions [21:09:35] Question - Is there some global function for allowing data to be written to the database using the settings put in place by LocalSetting.php? [21:09:42] MatmaRex: hmm, that doesn't do precisely what I was hoping it would do; I as hoping that the normal edit would keep the label "Edit" ... [21:09:47] *LocalSettings.php [21:10:07] Plip: what do you mean by "allowing data to be written" ? [21:11:46] sapre: I mean, giving the page (In this case, a special page) access to the database data so I can execute MySQL commands. [21:11:54] *saper (Sorry) [21:12:20] Or does it already have that access by simply existing on the wiki? [21:12:58] Plip: look at pretty any special page in the MediaWiki code - they use database abstraction functions lik $dbr->select, $dbw->insert etc. [21:14:07] saper: Not what I mean precisely - I mean, does each page already have access to writing to database, or do you need to add something to allow it to do so? [21:14:41] Not writing, but reading AND writing. [21:15:00] Plip: yes. just call wfGetDb( DB_MASTER ) to get a database object. [21:15:08] wfGetDB * [21:15:22] Plip: any PHP code in the MediaWiki core or extension can access pretty much anything in the database [21:17:13] So I can just run the query without having to re-define the database information? [21:20:38] yes, you can query whatever you want. Maybe if you want to push some data from MW into a third-party form you might want consider using API or [[Special:Export]] features and pull data from MediaWiki instead [21:25:19] Hi everyone, a co-worker just upgraded our wiki and now the Help link on the Sidebar points to https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents instead of our local Help:Contents [21:26:41] I can see how to edit the sidebar but the syntax of it defeats me and there are three top-level heading after 'navigation' that don't show on the Sidebar. [21:33:02] Oh, I get it now [21:36:58] Last question, hopefully: May I see an example of how Mediawiki actually writes to the database, more specifically a case of it writing a specific value to entry in a table? It's just confusing how it uses it's own form of doing that. [21:38:16] I'd like to write $total_birthdate to user_birthdate where the user ID = $user_id. [21:39:32] Plip: depends on if you are inserting or updating [21:39:44] if inserting use $dbw->insert(), if updating use $dbw->update() [21:39:53] where $dbw = wfGetDB( DB_MASTER ); [21:41:52] Updating, not inserting. [21:42:40] I assume DB_MASTER stands for the name of the table within the database? [21:43:38] This stuff just isn't documented in a "If A, then B" sort of way, it's more of "If A, C = Q (See notes)" [21:44:04] no, DB_MASTER tells mediawiki to grab a database object that connects to the master database (as opposed to slaves, if you have replication set up) [21:44:14] all of the notes are in the code itself [21:44:53] see https://doc.wikimedia.org/mediawiki-core/master/php/html/classDatabaseBase.html#a865730fc5cb11e63b50d0524efaf0fff [21:45:04] You need to use DB_MASTER/DB_SLAVE appropriately if it will be deployed to a more complex database system. For simple single-server sites I don't think it changes much. [21:45:54] For writing changes, this should be DB_MASTER [21:46:30] Plip: just getting $dbw = wfGetDB( DB_MASTER ); $dbw->update("....") should get you started [21:47:19] You'll probably get something like wfGetDB( DB_MASTER )->update( 'user', array( 'user_birthdate' => $total_birthdate ), array( 'user_id' => $user_id ) ); [21:52:36] Plip: see http://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSocialProfile.git/455819809829c9d9644125e51822ea9c1edba552/UserProfile%2FUserProfileClass.php as an example of fetching some user profile out of the database; and this http://git.wikimedia.org/blob/mediawiki%2Fextensions%2FSocialProfile.git/455819809829c9d9644125e51822ea9c1edba552/UserProfile%2FSpecialUpdateProfile.php for writing [22:03:19] Okay, I've tried this: http://www.ipaste.eu/view?id=7027 - And on the page I get 'DatabaseBase::makeList called with incorrect parameters' [22:05:44] 'user_id = $user_id' won't work [22:06:27] array( 'user_id' => $user_id ) [22:06:39] Also, the column user_birthdate won't exist unless you've created it [22:06:57] And an extension shouldn't be modifying core database table structure [22:07:07] Plip, that site apparently takes issue with AdBlock [22:07:20] It's an extension for private use. [22:07:41] Still, I wouldn't reccommend it [22:12:44] Hello Reedy I have resolved my problem of applying joins on multiple tables by using variable and for loop. Now I have another query I wish to use that code another extension. Please help me do this. [22:13:23] Reedy: Fair enough, the value is now stored in it's own table and indentified by the user's ID. Thanks for helping as much as you have so far, I'm sorry to have been a bother. [22:13:37] Plip: You're not being a bother [22:13:46] We just prefer people try to do things properly ;) [22:21:48] Reedy: I see, most communities get annoyed with questions (*pokes Stack Overflow, which happens to be a Q&A platform*) [22:22:19] As long as you're not rude or whatever, chances are someone will help you out [22:22:26] Just might take a little while depending on who's about etc [22:22:36] Plip: its often fun to try and fix problems :P [22:23:07] and often you can have 3-4 different ways of doing the same thing presented here as options [22:23:16] And the occasional OH MY GOD MY EYES WHY ARE YOU DOING THAT!? [22:23:52] I'm sure he has said that so many times while reading my code [22:23:53] Reedy: ran into that earlier with an extension [22:24:22] Hehe, I'm sure I've made you guys do that before when I've come for help :P [22:24:30] Reedy: extension was using user groups instead of user rights to control stuff [22:24:35] In that case though, I am having another issue here. [22:24:47] Or please explain, I have made a form which is individually another php file in my extension. Now how can I open that form from my same extension? [22:25:18] It's not "grabbing" the user's ID and writing it to the birthdate table, it instead write it as zero. [22:25:47] I'm guessing it's trying to compare rather than copy? [22:25:54] Pastebin? [22:27:49] http://pastebin.com/e03Mqctv - What's confusing me is that in the case of 'birthdate', it uses $total_birthdate as the value it copies, but int he case of bd_user_id, it does nothing when $user_id is already defined. [22:27:58] *the [22:29:18] Plip, you're using insert [22:29:25] I thought you wanted update [22:29:46] I had to change it to insert now that I'm using a new table - There's nothing to update. [22:30:28] read the definitions of the functions [22:30:41] insert does not take table, values, conds. [22:31:01] it takes table, values (in a couple of different ways) [22:31:06] https://doc.wikimedia.org/mediawiki-core/master/php/html/classDatabaseBase.html#a12219e558b40a81b6e3871f79fc3938e [22:33:51] Changing it to update causes nothing to be written to the table. [22:34:18] array ( 'bd_user_id' = $user_id ) is wrong [22:34:21] array ( 'bd_user_id' => $user_id ) [22:34:21] http://pastebin.com/G4GxB46J < Updated pastebin, by the way. The previous one contained a copy error. [22:34:35] But Krenair is right [22:35:26] http://pastebin.com/skYvxfHt [22:36:44] You're unconditionally inserting [22:48:26] Corrected, things are coming together pretty quickly. I've a great deal through examples, rather than documentations. [22:49:41] Next question - How can I check the database for an existing value? For instance, if the birthdate already exists, then don't ask the user for their birthdate again.