Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User talk:Catrope: Difference between revisions

Discussion page of User:Catrope
Catrope (talk | contribs)
→‎New extension idea: ext is on line
New section: Thankyou
Line 69: Line 69:
: Eureka! It works! :) -- [[User:Joe Beaudoin Jr.|Joe Beaudoin]] <sup>[[User talk:Joe Beaudoin Jr.|So say we all]] - [[Battlestar Wiki:Site support|Donate]] - [http://www.sanctuarywiki.org Sanctuary Wiki &mdash; ''New'']</sup> 12:43, 3 October 2007 (CDT)
: Eureka! It works! :) -- [[User:Joe Beaudoin Jr.|Joe Beaudoin]] <sup>[[User talk:Joe Beaudoin Jr.|So say we all]] - [[Battlestar Wiki:Site support|Donate]] - [http://www.sanctuarywiki.org Sanctuary Wiki &mdash; ''New'']</sup> 12:43, 3 October 2007 (CDT)
::The extension is now on line [http://www.mediawiki.org/wiki/Extension:Redircite here]. --[[User:Catrope|Catrope]]<sup>([[User talk:Catrope|Talk to me]] or [[Special:Emailuser/Catrope|e-mail me]])</sup> 15:46, 4 October 2007 (CDT)
::The extension is now on line [http://www.mediawiki.org/wiki/Extension:Redircite here]. --[[User:Catrope|Catrope]]<sup>([[User talk:Catrope|Talk to me]] or [[Special:Emailuser/Catrope|e-mail me]])</sup> 15:46, 4 October 2007 (CDT)
== Thankyou ==
Thanks for cancelling the block. I wont "vandalise" the site again (hopefully) and thankyou for properly explaining it to Shane...
:) ([[User:Pooh the hat|Pooh the hat]] 17:54, 9 October 2007 (CDT))

Revision as of 22:54, 9 October 2007


I speak English (near-native), Dutch (native) and German (limited)
Feel free to ask your question in either of these three languages


creating and modifying templates

i've been looking around on the internet for pointers on creating my own templates and working with other more interesting wiki features, but i'm not having much luck. is there a site you can point me to? the feature i was trying to add on my userinfo was school. thanks! Caw 17:14, 15 September 2007 (CDT)

Here is a pretty extensive guide on templates. For more complex templates ParserFunctions are useful, although you probably won't have to use them at first. If you want to add stuff to the box templates, you might also want to read about tables, which we use to format the boxes. Good luck! ---Catrope(Talk to me or e-mail me) 09:33, 17 September 2007 (CDT)

dumpBackup.php

I figure you might know the answer to this, so I'll ask you before I make a query on the mediawiki mailing list. Is there a way to specify what kinds of pages can be dumped using dumpBackup.php? For instance, I want to make a dump of pages in the article, portal, sources, category, template, and Battlestar Wiki namespaces, but not anything pertaining to the user or any talk namespaces. Is there an option I need to pass in the command line to do that? Or another program? Thanks! -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 11:55, 23 September 2007 (CDT)

How about using MWDumper instead? BTW, why would you want an XML dump of content-only stuff? --Catrope(Talk to me or e-mail me) 12:05, 23 September 2007 (CDT)
Cool. Thanks again! :-) As for why, I'm building a mirror in the event the main server should ever go down. (I don't expect it to, but you never know.) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 12:07, 23 September 2007 (CDT)
It can be done with dumpBackup.php also:
php dumpBackup.php --filter=namespace:NS_MAIN,NS_CATEGORY,NS_TEMPLATE,NS_PROJECT,100,102
Where 100 and 102 are the numbers associated with the Portal and Sources namespaces (see also here). BTW, wouldn't it be wise to include Quotes (104) and Podcast (106) too? --Catrope(Talk to me or e-mail me) 12:14, 23 September 2007 (CDT)
Yeah, I'll add those namespaces too. -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 12:17, 23 September 2007 (CDT)
Well, by just restricting it to the most valuable content, it cut the xml filesize down by half. ;-) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 12:26, 23 September 2007 (CDT)
I see. For serious backups, you want to backup the entire DB though, so as to also backup users and their preferences, not to mention the quite huge {page,template,image,category,external,lang}links, redirect, *cache and math tables. You could exclude them to cut down on backup size, as they can be rebuilt from the pages' content. That would take quite some time, though, considering the amount of pages we have here. During the rebuild, categories, Special:Whatlinkshere and redirects won't work very well. Also, the wiki might be somewhat slower since its internal caches are gone. --Catrope(Talk to me or e-mail me) 12:39, 23 September 2007 (CDT)
Well, the entire database is backed up on a weekly basis. ;-) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 12:41, 23 September 2007 (CDT)
That's a comforting thought. Like I said, some tables can be rebuilt on the fly (you might wanna try excluding them to see if it makes a difference in the backups, I think that it'll at least speed up recovery, less stuff for mysqlbackup to import), but rebuilding will take significant time, although there's not much denial of service involved: the wiki will be somewhat slower, and some features aren't used very often anyway will not work fully. --Catrope(Talk to me or e-mail me) 12:45, 23 September 2007 (CDT)
BTW, if you want to get a general idea of how all those tables work together, see this picture. --Catrope(Talk to me or e-mail me) 12:46, 23 September 2007 (CDT)

New extension idea

For The Great Machine wiki, I've created a template that allows for the creation of shortened inline episode citations. The idea is when the user hovers their cursor over it, the episode number (i.e. S1E01) will reveal the full episode title (i.e. Midnight on the Firing Line). A mouseout event returns the text to its shorter state. This is all done by javascript; the js function that does the text changing is:

function changeTextById(elementId,changeVal){
   var hasInnerText =
   (document.getElementsByTagName("body")[0].innerText != undefined) ? true : false;
   var elem = document.getElementById(elementId);
   if(!hasInnerText){
       elem.textContent = changeVal;
   }else{
       elem.innerText = changeVal;
   }
}

That code is located in the Common.js file so that it works site-wide.

Of course, for it to work, I've had to enable wgRawHTML since that enables the javascript events written in the divs, which is something I really didn't like to do.

And the only way I can get it to work is to create sub templates that template substitute from the cite template.

What I'd like to do is turn it into an extension so that when the user calls <cite id="Midnight on the Firing Line">S1E01</cite>, they'll be able to do the same thing, without the use of templates. Is there a way you can whip up something quickly? If not, no worries.-- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 18:16, 1 October 2007 (CDT)

I think we need to update the "ref" extension. Shane (T - C - E) 02:02, 2 October 2007 (CDT)
I think it would be a good idea to do <redircite>S1E01</redircite>, where S1E01 redirects to Midnight on the Firing Line. Implementing this as a fork of Cite.php (which does the <ref> tags) doesn't seem like a good idea to me, as Cite.php is really intended to do the reference section thing.
Another important issue, though: it currently doesn't work, at least not for me. When I mouseover the example on tgm:Template:Cite, the text doesn't change back and forth between "S1E01" and "Midnight on the Firing Line" as expected, but simply remains static. --Catrope(Talk to me or e-mail me) 09:10, 2 October 2007 (CDT)
Ok, I fixed that. ;) Do a hard refresh and it should work. -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 11:32, 2 October 2007 (CDT)
Yeah, it works now, except that I can't middle-click it. This could be fixed by using an <a> element rather than a <span>. I'll start working on the extension tomorrow. --Catrope(Talk to me or e-mail me) 13:12, 2 October 2007 (CDT)
Yeah, middle click won't work because it uses a javascript on click event. Hopefully, in writing the extension you would be able to get rid of that... :) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 13:27, 2 October 2007 (CDT)
If you work on Cite.php, this one features would be good... <ref name="hello" section="greetings">Hi.</ref> and <references area="greetings" />. "Another" <ref name="hello"/> would still put it in the "greetings" while if you had <ref name="hello2">Test</ref> would show up just in <references/>. Shane (T - C - E) 13:21, 2 October 2007 (CDT) :)
You can file an enhancement request at MediaZilla. --Catrope(Talk to me or e-mail me) 13:27, 2 October 2007 (CDT)

I'm done writing the extension. I still have to draw up a README and do all the other paperwork, but you can already test it (at the hb: for instance) by copypasting this PHP code to extensions/redircite/redircite.php (relative to your MediaWiki root directory) and adding require_once('$IP/extensions/redircite/redircite.php'); to the bottom of your LocalSettings.php --Catrope(Talk to me or e-mail me) 10:21, 3 October 2007 (CDT)

Eureka! It works! :) -- Joe Beaudoin So say we all - Donate - Sanctuary Wiki — New 12:43, 3 October 2007 (CDT)
The extension is now on line here. --Catrope(Talk to me or e-mail me) 15:46, 4 October 2007 (CDT)

Thankyou

Thanks for cancelling the block. I wont "vandalise" the site again (hopefully) and thankyou for properly explaining it to Shane...

) (Pooh the hat 17:54, 9 October 2007 (CDT))