User talk:Hoggwild5

Please leave comments about any extensions I have submitted to www.mediawiki.org on the extension discussion page. If you have questions about MediaWiki code hacks, please leave them on the code hack discussion page. I don't check my personal talk page very often.

Thanks!

UserPageEditProtection
Hi, Lisa

I found the UserPageEditProtection extension does not work on 1.11, Can you update this extension for 1.11? thanks a lot!

Done --Hoggwild5 20:09, 6 December 2007 (UTC)

Custom Edit Article w/ Fields
Hi Lisa,

Can you elaborate on your concerns over User_talk:Barrylb/Custom_article_editing_form_with_fields? I noticed that the $wgReadOnly parameter is bypassed but what are the other potential issues? Also, is there an easy way to incorporate them?

Any other thoughts would be appreciated. Blckdmnd99 00:07, 4 June 2007 (UTC)

Sure, I'll be happy to. The hook that this extension uses hooks into the beginning of the edit code in Editpage.php. This coding goes through a number of checks and balances both when you start to edit a page (either by using a custom form or by using the MediaWiki edit screen). This extension is performed in place of the processes in EditPage.php. Since it is a replacement for the edit function in EditPage, and the checks and balances in the code have not been included in Barry's code (checking for edit conflicts with another user is a primary one), there is the possibility that data can be lost, or the appropriate warning messages that you would normally see for edit conflicts would not get delivered to the user. The possibility that this would happen gets larger as a site has more users; if your site has relatively few editors, most likely it will perform fine. I have actually implemented a number of forms based on this code on a couple of sites that I have, but I have restricted my editors to approved users only so I know that the chances of conflicts are minimal.

Hope this helps!

--Hoggwild5 02:14, 4 June 2007 (UTC)

Indeed. Thanks for the scoop. Better than learning the hard way. :) I'm going to take a closer look here but do you think it would be possible to incorporate the Editpage.php checks into the customedit code? Or would this cause additional conflicts? If I can come up with anything I'll give you a shout as well.

Thanks much. Blckdmnd99 03:20, 4 June 2007 (UTC)

Well, you could incorporate the code from EditPage.php, but you will need to make sure you understand PHP's object-oriented programming process (for example, all of the "$this->" instructions will need to be changed to "$editpage->") to make it work properly. It will be quite a bit of work. A better method would probably be to make a new class that extends EditPage -- this way all of the functions outside of edit would not have to be recreated, and would instead be part of the new class.

I have sent a request that EditPage.php be rewritten to make it more modular and thus easier to write extensions for, but it hasn't made it on the priority list yet. --Hoggwild5 18:01, 4 June 2007 (UTC)

CreateArticle suggestions
See Extension talk:CreateArticle for the start of some suggestions (and there are other questions by other people that need answering too). —Eep² 11:39, 20 August 2007 (UTC)

Article Creation Question
Hey there-

I am an instructor of Animation ,and was wondering a few things about your extension "CreateArticle". I wanted to know how difficult it would be to alter this extension to do the following:

Lets say that my user types in: CharacterDesign, the extension would:

1. Automatically detect the user and use that as the "prefix" parameter.. (ie - User:Sstudent)

2. Secondly, it would need to create the page using the name they type in as the subpage parameter (User:Sstudent/CharacterDesign)

Ultimately, I have restricted the creation of pages for the students to their user and usertalk including subpages. This allows me to keep it all managed easier. I would eventually like to register all of the Courses we are teaching into an index that the student could select from. This would then create the article as a subpage of their User page. To fine tune it, I would have the WIKI automatically list any immediate subpages of the page they are attempting to create their article, so that they could easily keep track of where things are going. I know that this is a tall order, but I thought I would get your input, so that I can let our IT guys know how much work it would be.

Thanks

Scott

--sheriffcicada 18:34, 7 February 2008 (UTC)

Hi Scott:

I think that's definitely doable. It would require modifications to the extension to make it work, but they shouldn't be too difficult.

I'm gonna give you some technical information that may help your IT people get there quicker...

Just off the top of my head:

The user information for the current user gets stored in the global container $wgUser, which is of the class type User (the details on the class are in the script includes\User.php). You could get the current username from $wgUser->mName.

All User pages are stored in the "User:" namespace. So, the CreateArticle script could be modified to get the username of the current user, like so:

The CreateArticle input box that users see on the screen is where they would enter the CourseName of the page they're wanting to create; for example: CharacterDesign.

The CreateArticle script can then be written to take the user input and append it to $ArticlePagePrefix, and use the result to create the new article in the User: namespace as a subpage of their username.

That would be where I would start.

Let me know if there's anything else you need.

--Hoggwild5 20:35, 7 February 2008 (UTC)

Thanks
Hey Lisa-

Thanks so much for your response. I will look into your suggestions. I am definitely not a php guy, but have done some coding in other languages. I imagine you have not tested this new block of code, and functions as a piece pseudo code, right? I will attempt to plug it into the source that I downloaded. Let me know if we could pay you to help develop this extension. I understand if you are too busy, but it could make a huge difference in what we are attempting to put together here. What line would I place this new code into?

One last thing. I have experience with coding languages, but not php. Do you know of a good place to get started to learn how to write extensions. I am aware of how to loop, create variables, flow and syntax, as well as how to declare procedures in MEL. A language very similar to C++, created for Autodesk's Maya, a 3d animation software. I would just need the basics, and it would allow me to not have to bother the rest of the community who have been so generous already.

Thanks

Scott --sheriffcicada 16:29, 9 February 2008 (UTC)
 * Hi Scott
 * Bear with me -- I'm on the road for the next 10 days, but I'll be checking messages online at least once a day, so if I'm not responding right away it's probably because I'm tied up on something and haven't had internet access.

I'm not a programmer by trade, but have some programming education background years ago, and experience with other languages as well; I'm self taught on PHP.

Some of the books that I've found to be the most helpful are the O'Reilly books. In particular:


 * Web Database Applications with PHP and MySQL
 * PHP Cookbook
 * MySQL In A Nutshell
 * PHP In A Nutshell

The last two I use on a regular basis b/c they're great reference books, and they pack easily in my computer bag for travel (not thousands of pages thick, so they're really handy). I would probably start with the first one I listed to familiarize yourself with PHP and MySQL and how they work together.

The second one I use when I'm trying to figure out how to approach a particular process -- it's chocked full of examples on how to do things in PHP. Very useful.

Hope this helps! --Hoggwild5 23:51, 9 February 2008 (UTC)

Sorry to bother you...
Hey Lisa-

I promise not to make a habit of bothering you. I think that I am close. I have learned quite a bit about how these extensions are built. I am running into a problem though. I created a new variable:

'''getCreateBoxOption($createbox->currentUser,$input,'currentUser'); '''

and called that in the $createForm variable/ function:

'''mName}" /> '''

Then I passed that to the title:

$currentUser = $wgRequest->getVal('currentUser');

if(($currentUser) && (strpos($title, $currentUser)!==0)) { $title = $currentUser. "/" . $title; }

I know that I am missing something, but not sure what. I could send you the whole code, but I figure if you can explain to me how to get php to print, I can probably avoid solve the problem myself, and avoid having to bother helpful people like you. I will wait to hear back. I promise, no more spamming!

Thanks a ton,

Scott --sheriffcicada 18:03, 9 February 2008 (UTC)
 * Scott

I did play with this a little, and did get something working but I didn't save the code. Also, this was the first extension I wrote for MediaWiki and it needs to be cleaned up a little.

I think I understand what you're trying to achieve, and I'm happy to help you with this. Let me get back with you a little later on this one.



--Hoggwild5 23:54, 9 February 2008 (UTC)