Is there any way I can stop that gaping mouth of an edit box on empty category pages??
P.S., I will see you here in Taiwan at WikiMania, 8/2007.
function fnmybla($text,$title) { if ( ( NS_CATEGORY == $title->mNamespace ) || ( NS_CATEGORY_TALK == $title->mNamespace ) ) { $text = "(Please don't edit any Category pages on this wiki. They are ment to have members, but no text bodies, on purpose. I cannot figure out any way to stop the big edit window from opening below. I wish when one visits action=edit on category pages, it would act like action=view. I could have $wgHooks['userCan'] return false, but then the user is given 'This page has been locked to prevent editing...' and must click an additional time to see what are the member categories.
makeBrokenLinkObj() has no hook to stop making them &action=edit links for empty categories. I wish I had a way to change them to action=view, i.e., no action= parameter at all.)";
} } $wgHooks['EditFormPreloadText'][]='fnmybla';
function fnmyEdit(&$this ) { #gave up due to not being a php phd global $wgUser, $wgOut, $wgRequest, $wgContLang; global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser; global $wgUseTrackbacks, $wgNamespaceRobotPolicies; global $wgArticle, $wgTitle; $sk = $wgUser->getSkin();
wfDebug("qq$wgTitle->mNamespace $wgTitle->mTitle\n"); if ( ( NS_CATEGORY == $wgTitle->mNamespace ) || ( NS_CATEGORY_TALK == $wgTitle->mNamespace ) ) { #maybe these will do what I want, except I don't know how to invoke them. CategoryPage::view(); #CategoryPage::doCategoryMagic(); return false; #you see, I want the user to see just what he would if action=view, though he did HTTP GET action=edit.
#no, Article::view(); won't get the category links shown.
} return true; }
$wgHooks['AlternateEdit'][]=fnmyEdit;
As you can see I want to contain all this inside LocalSettings.php.
Dan Jacobson wrote:
Is there any way I can stop that gaping mouth of an edit box on empty category pages??
Just make the links to categories with no associated pages blue instead of red. It's a one-line patch.
Index: OutputPage.php =================================================================== --- OutputPage.php (revision 19212) +++ OutputPage.php (working copy) @@ -258,7 +258,7 @@ foreach ( $categories as $category => $unused ) { $title = Title::makeTitleSafe( NS_CATEGORY, $category ); $text = $wgContLang->convertHtml( $title->getText() ); - $this->mCategoryLinks[] = $sk->makeLinkObj( $title, $text ); + $this->mCategoryLinks[] = $sk->makeKnownLinkObj( $title, $text ); } }
I wish when one visits action=edit on category pages, it would act like action=view.
Then you wouldn't be able to edit it, even by clicking the edit tab.
-- Tim Starling
On 1/14/07, Tim Starling tstarling@wikimedia.org wrote:
Then you wouldn't be able to edit it, even by clicking the edit tab.
I think that's what he wants.
Dan Jacobson wrote:
Is there any way I can stop that gaping mouth of an edit box on empty category pages??
Tim says <Just make the links to categories with no associated pages blue instead of <red. It's a one-line patch. [OutputPage.php] - $this->mCategoryLinks[] = $sk->makeLinkObj( $title, $text ); + $this->mCategoryLinks[] = $sk->makeKnownLinkObj( $title, $text );
I wish when one visits action=edit on category pages, it would act like action=view.
Nice, but what about [[Special:Categories]]? The empty categories are still red there. A hack here, a hack there...
<Then you wouldn't be able to edit it, even by clicking the edit tab.
I think that's what he wants.
Yes. And me messing in includes/* will only get overwritten next time as I always don't know what I did six months later. Plus I am not making a permanent contribution/mark/impact on the MediaWiki that way.
<Create the pages, but give them an empty content.
Hurmf, 1500 empty pages for http://radioscanningtw.jidanni.org/ . Naw.
So far I have come up with wimpy function fnmybla1($text,$title) { global $wgSitename; if ( ( NS_CATEGORY == $title->mNamespace ) || ( NS_CATEGORY_TALK == $title->mNamespace ) ) {$text = "${wgSitename} notice: please put frequencies into articles, the categories will be automatically generated";}} $wgHooks['EditFormPreloadText'][]='fnmybla1'; for LocalSettings.php, which I wish not to venture beyond.
Anyway, how limiting that MediaWiki can't deny editing (to everybody, fine with me) in a given namespace! One must create new namespaces, etc.
It seems even if array $wgGroupPermissions had a added dimension: namespace, stamping out all those red links would better be accoplished via hooks into OutputPage.php above and SpecialCategories.php.
For now I must use http://radioscanningtw.jidanni.org/index.php?title=Template:C to help a little against sending users into the gaping mouth of the edit box.
Creating 1500 empty pages is trivial with a script and importDump.php. Seems like a cron job or bot could periodically run the query from Special:Wantedcategories and make stubs for those pages. ===================================== Jim Hu Associate Professor
On Jan 28, 2007, at 10:36 AM, Dan Jacobson wrote:
Dan Jacobson wrote:
Is there any way I can stop that gaping mouth of an edit box on empty category pages??
Tim says <Just make the links to categories with no associated pages blue instead of <red. It's a one-line patch. [OutputPage.php]
$this->mCategoryLinks[] = $sk->makeLinkObj( $title, $text );
$this->mCategoryLinks[] = $sk->makeKnownLinkObj( $title, $text );
I wish when one visits action=edit on category pages, it would act like action=view.
Nice, but what about [[Special:Categories]]? The empty categories are still red there. A hack here, a hack there...
<Then you wouldn't be able to edit it, even by clicking the edit tab.
I think that's what he wants.
Yes. And me messing in includes/* will only get overwritten next time as I always don't know what I did six months later. Plus I am not making a permanent contribution/mark/impact on the MediaWiki that way.
<Create the pages, but give them an empty content.
Hurmf, 1500 empty pages for http://radioscanningtw.jidanni.org/ . Naw.
So far I have come up with wimpy function fnmybla1($text,$title) { global $wgSitename; if ( ( NS_CATEGORY == $title->mNamespace ) || ( NS_CATEGORY_TALK == $title->mNamespace ) ) {$text = "${wgSitename} notice: please put frequencies into articles, the categories will be automatically generated";}} $wgHooks['EditFormPreloadText'][]='fnmybla1'; for LocalSettings.php, which I wish not to venture beyond.
Anyway, how limiting that MediaWiki can't deny editing (to everybody, fine with me) in a given namespace! One must create new namespaces, etc.
It seems even if array $wgGroupPermissions had a added dimension: namespace, stamping out all those red links would better be accoplished via hooks into OutputPage.php above and SpecialCategories.php.
For now I must use http://radioscanningtw.jidanni.org/index.php?title=Template:C to help a little against sending users into the gaping mouth of the edit box.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
And Jim, as you will notice on http://radioscanningtw.jidanni.org/index.php?title=%E7%89%B9%E6%AE%8A:Catego... each category represents a frequency, and assuming the radio spectrum from 0 to 1000 MHz has a station every 25 kHz, I would need 1000*1000/25=40000 empty categories, when all along there is nothing really to say about a frequency(category,ns=14), what matters is what organization(article,ns=0) uses it, for this otherwise fitting use of MediaWiki, that you shall here more from me on my puny poster at Wikimania here in Taiwan 8/2007.
As Einstein would have said, "there are many applications that would be perfect for MediaWiki, if only one could not bother users about what should be the contents of otherwise meaningless categories.
Do we put comments on various points of a ruler or tape measure? No. We want to keep it clean."
Dan,
I'm sure I'm being clueless, but how does having 40K or more blank rows in the db really hurt anything? Do they take up more space than I'm thinking they do. I have >20,000 categories in this wiki
http://gowiki.tamu.edu/GO/wiki/index.php/Main_Page
but they almost all have content, so it's a different situation. It seems like there will be some categories where you, or users may want to say something on the category page. So modifying the whole Category system seems like overkill. Also, wouldn't you want to put a stub on every page like "{{Donate}}"? ; )
Jim ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
On Jan 28, 2007, at 4:00 PM, Dan Jacobson wrote:
And Jim, as you will notice on http://radioscanningtw.jidanni.org/index.php?title=%E7%89%B9%E6%AE%8A:Catego... each category represents a frequency, and assuming the radio spectrum from 0 to 1000 MHz has a station every 25 kHz, I would need 1000*1000/25=40000 empty categories, when all along there is nothing really to say about a frequency(category,ns=14), what matters is what organization(article,ns=0) uses it, for this otherwise fitting use of MediaWiki, that you shall here more from me on my puny poster at Wikimania here in Taiwan 8/2007.
As Einstein would have said, "there are many applications that would be perfect for MediaWiki, if only one could not bother users about what should be the contents of otherwise meaningless categories.
Do we put comments on various points of a ruler or tape measure? No. We want to keep it clean."
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 1/28/07, Dan Jacobson jidanni@jidanni.org wrote:
Anyway, how limiting that MediaWiki can't deny editing (to everybody, fine with me) in a given namespace! One must create new namespaces, etc.
Latest trunk allows denial of editing in a given namespace, using.$wgNamespaceProtection. I don't recall offhand if that made it into the 1.9 branch.
2007/1/14, Dan Jacobson jidanni@jidanni.org:
Is there any way I can stop that gaping mouth of an edit box on empty category pages??
Create the pages, but give them an empty content.
wikitech-l@lists.wikimedia.org