Extension talk:Advanced Meta/Archive 1

Any users who are using this extension? How do you rate it?

no effect
can change a title --PiFi 11:37, 19 June 2010 (UTC)

Hi, I am very happy to see this hook, ..
Hi, I am very happy to see this hook, but I would need some help. Unfortunatelly I am not very profecient with running server or html/php in general. I ma very sorry if I ask some stupid questions, I will learn as much as it can be.

So I tried to follow the instructions as they are on the pages, I created file named MWAdvancedMeta.php and had put there, the code as it is on the extension page.

I added the following 2 lines to the bottom of localSettings.php:



What I got is imediate change of behavior, with this error message:


 * A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
 * from within function  MySQL returned error
 * from within function  MySQL returned error

May I ask if somebody would help me? It may be stupid, I am just happy that I was able to let my mediawiki run, there inside the system, I am proficient enaugh, but with the workarounds I am completelly clueless, if I am let on my own. I tried to upload this hook in effort, to not let pages of my db to be indexed.. Most of the content is a bit confidential. I would appreciate any help very much. --Reo On 16:28, 12 July 2010 (UTC)


 * This extension needs to add a new table into your database. Execute the SQL shown in the Installation part BEFORE CHANGING wm_ TO YOUR OWN PREFIX. --Zayoo 08:17, 2 October 2010 (UTC)

A good extension, but some suggestions
It's a very good extension because these informations can be edited only by specific users or usergroups. Here are some suggestions.

1. $1 for $wgTitle

I suggest that if (!empty($meta['keywords'])) { $out->mKeywords = array_merge(str_replace("$1",$wgTitle,$this->globalKeywords), explode(',', $meta['keywords'])); } else { $out->mKeywords = array_merge(str_replace("$1",$wgTitle,$this->globalKeywords), $out->mKeywords); } so that if I put $1 in global keywords, it can be translated to the page title (with its namespace).

2. index? follow?

I can't see the index or follow tag in Mediawiki 1.16.0.
 * If this meta tag is missing, or if there is no content, or the robot terms are not specified, then the robot terms will be assumed to be "index, follow. mediawiki began to comply with this rule. it doesn't emit robots-meta for "index,follow" and emits one for other cases. At least it seems to be true for mediawiki 1.16.0 --Erithion 17:43, 27 November 2010 (UTC)

3. Change the page title

I suggest that add an item to change the title displayed in the browser and in search-engine results. (only influence )

--Zayoo 18:34, 26 September 2010 (UTC)


 * I suggest the function of Extension:TitleAlias can be combined into this extension, which can change the html title, with a likely database table and a input box in edit page. Both in GPL. --Zayoo 16:10, 27 September 2010 (UTC)

A new version with Title Alias, i18n and some bugs fixed
A new version with Title Alias, i18n and some bugs fixed. Code is available at User:Zayoo/Extension:Advanced Meta.

See the difference at here. Because of the differences between space and tab, it is shown not very clearly.

Differences:


 * 8     New SQL field "titlealias".
 * 24   Move $wgExtensionCredits['parserhook'][] into correct position.
 * 31   Use i18n file $wgExtensionMessagesFiles['Advanced Meta'].
 * 32   Put MWAdvancedMeta::setup; inside the extension, so it's not necessary to put it into LocalSettings.php.
 * 62   Fix a bug: private $allowedUsergroups = array('sysops', 'bureaucrats'); to     private $allowedUsergroups = array('sysop', 'bureaucrat');.
 * 87   New hook $wgHooks['BeforePageDisplay'][] = $this;.
 * 191 Use Mediawiki:Globalkeywords instead of $globalKeywords so that sysops can change it conveniently and support UTF-8 charactors. $globalKeywords has been removed.
 * 195 Allow i18n in $replaceWith[], and added TitleAlias input box. Allow $1 for FULLPAGENAME.
 * 335 Still show the global keywords if no meta record for this article.
 * 368 Function for TitleAlias. Recreate the HTML title with Mediawiki:Pagetitle.
 * 406 If the meta information is normal (index, follow, no titlealias, no keywords, no description), DELETE the record instead of INSERT or UPDATE to save space in database.

Tested only for Mediawiki 1.16.0. Please help me test it.

--Zayoo 09:53, 2 October 2010 (UTC)
 * This version is now implemented! Litso 16:00, 25 November 2010 (UTC)

Index/Follow doesn't work as expected in 1.16.0
Action: Expected: html head must contain ...  ... Actual: robots-meta is absent and thus this means the default, i.e. ...  ... Solution: // set robots information $index = ($meta['rindex'] == '1')  ? 'index' : 'noindex'; $follow = ($meta['rfollow'] == '1') ? 'follow' : 'nofollow'; $out->setRobotPolicy($index.', '.$follow); global $wgArticleRobotPolicies; $wgArticleRobotPolicies[$wgTitle->getText] = $index.', '.$follow; Why: Mediawiki sets default robot policy up after parser output was done. This overrides custom policy modifications. Previous versions did this just before. At least it seems to be true for 1.15.4. Details see in Article::view of Article.php
 * Create page
 * Text field: test
 * Robots: Index: checked; Follow: unchecked;
 * Keywords: test
 * Descriptio: test
 * In MWAdvancedMeta.php find onOutputPageBeforeHTML function
 * Find following rows
 * Add these rows just after them

PS: '''Thanks very much for this extension to all its authors. I find it to be the most useful meta tag extension I tried so far. Yet simple due to excellent architecture design decisions.''' --Erithion 18:30, 27 November 2010 (UTC)


 * When I worked on the 2.0 version, I also haven't found index/follow. I NEVER see them even I edited the official files where RobotPolicies happens, as well as it is officially said that some pages are indexed and some not. Only noindex/nofollow are shown in special pages. I don't know why and I just kept it unchanged.-- Zayoo (talk) 08:17, 29 November 2010 (UTC)

Request for 2.1.0
I've done several changes to this extension and it is accepted as 2.0.0. Here I want to make a minor upgrade 2.1.0, and request for your voice.

My propose:

1. Restore $globalkeywords and let it work together with Mediawiki:Globalkeywords.
 * I changed $globalkeywords to Mediawiki:Globalkeywords so that UTF-8 charactors can be written. However, it changes the rule and does no help to ANSI users.
 * I suggest that $globalkeywords works prior to Mediawiki:Globalkeywords. If $globalkeywords is not null, use it; otherwise, use Mediawiki:Globalkeywords. It runs quicker for ANSI users. If no global keywords are needed, sysop can set $globalkeywords=',' and system will not request for Mediawiki:Globalkeywords.

2. Remove $mwaMeta.
 * $mwaMeta = MWAdvancedMeta::setup; is unnecessary. Use global variables to avoid it.

3. Robot Policies.
 * It seems that follow/index doesn't work.

Please discuss and write your own issues. -- Zayoo (talk) 08:45, 29 November 2010 (UTC)