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)
 * Regarding to the last issue, I think that MediaWiki doesn't output index/follow because no robots meta tag is exactly the same as index/follow. So yeah, I think we can safely delete it. I agree with the other two ideas too.
 * Another idea I had, I don't believe meta tags move with a page if you rename it. I've seen important pages on my wiki have no tags and description because the article got renamed.. we should definitely add something for that. Litso 09:13, 29 November 2010 (UTC)


 * Hi to all, I have two wishes/proposals for the next version. Hopefully they are somehow easy to implement.
 * * One is regarding the title tag. If you do not set an alternative title your get the name of your wiki, e. g. "Foo" into the title tag, in case you set the alternative Title e. g. "Foo-Wiki - the greatest wiki on the face of the planet" you get "Foo-Wiki - the greatest wiki on the face of the planet - Foo". It would be nice if this extension overrides the standard title an replace it with the alternative title instead of just adding it in front.
 * * Secondly it would be nice to have some action logging for setting and changing the inputs with this extension. It should not be in the normal version history, but a log would be cool.
 * I do not want to forget to say that this extension is already very useful and wish to thank everybody putting effort into its creation. Cheers --kgh 10:06, 29 November 2010 (UTC)


 * Robots... I have no idea. This extension links to page with 'pageid', not its title; I don't know why it doesn't work with title changing; and I don't have time to try it currently, please help check it.
 * The title? It works nice in my own wiki and it only changes the HTML title. In its function, I rebuild the title from Mediawiki:Pagetitle by replacing $1 with $meta['titlealias']. It can be considered to OVERRIDE or REBUILD. Logging... Where to put them? Creating a new table in database, or using an existing table? I have no idea now, but idea will come soon. And

4. It is supposed to open a new window for Mediawiki:Globalkeywords when clicking on the global keywords, but I failed - I just made a tool tip. I'll move on for a better solution.
 * -- Zayoo (talk) 16:14, 30 November 2010 (UTC)

Error
I think I followed all the steps to install the extension but I'm getting this error:

MediaWiki internal error. Exception caught inside exception handler

Is anybody using this extension with MediaWiki 1.6? --Hoiol 03:47, 23 December 2010 (UTC)


 * Hi Hoiol, this extension requires PHP 5. Thus it will not work with MediaWiki 1.6. I strongly advise to update your software to PHP 5 and MediaWiki 1.16 in case you would like to use this extension. Cheers --&#91;&#91;kgh&#93;&#93; 15:38, 27 December 2010 (UTC)

Hi, I get the same error in MW 1.16 using PHP 5.2. Is there another solution to solve this problem?

Thanks+greetings --Filburt 10:07, 10 January 2011 (UTC)
 * I also get the same error using PHP 5.3.2 and MediaWiki 1.16.1 --Ciovala 23:27, 13 January 2011 (UTC)