Hello!
I installed AddMetas.php and get this in the error-logfile of Apache:
Undefined variable: parser in /vwww/insilence/root/extensions/AddMetas.php on line 25 Trying to get property of non-object in /vwww/insilence/root/extensions/AddMetas.php on line 25
The function in AddMetas.php looks like this:
function wfAddMetas( &$out, &$text ) { global $wgTitle, $wgParser, $wgRequest, $action; if( $action !== 'edit' && $action !== 'history' && $action !== 'delete' && $action !== 'watch' && strpos( $parser->mTitle->mPrefixedText, 'Special:' ) === false && $parser->mTitle->mNamespace !== 8 ) { $name = $wgTitle->getPrefixedDBKey();
$out->addMeta( 'Description', 'you meta description'); $out->addMeta( 'Keywords', $name.', your meta keywords' ); //$out->addMeta( 'Author', 'the author'); //$out->addMeta( 'Rating', 'General'); //$out->addMeta( 'Revisit', '1 DAYS'); //$out->addMeta( "revisit-after", "5 days"); } return true; }
I am not a PHP-specialist. What is wrong?
Regards
You say you installed AddMetas but did you use the functionality? If so then what were the lines that you added to the article page? Also what version of MediaWiki did you install it on?
On Sat, Jun 27, 2009 at 5:22 PM, Andreas Meyer anmeyer@anup.de wrote:
Hello!
I installed AddMetas.php and get this in the error-logfile of Apache:
Undefined variable: parser in /vwww/insilence/root/extensions/AddMetas.php on line 25 Trying to get property of non-object in /vwww/insilence/root/extensions/AddMetas.php on line 25
The function in AddMetas.php looks like this:
function wfAddMetas( &$out, &$text ) { global $wgTitle, $wgParser, $wgRequest, $action; if( $action !== 'edit' && $action !== 'history' && $action !== 'delete' && $action !== 'watch' && strpos( $parser->mTitle->mPrefixedText, 'Special:' ) === false && $parser->mTitle->mNamespace !== 8 ) { $name = $wgTitle->getPrefixedDBKey();
$out->addMeta( 'Description', 'you meta description'); $out->addMeta( 'Keywords', $name.', your meta keywords' ); //$out->addMeta( 'Author', 'the author'); //$out->addMeta( 'Rating', 'General'); //$out->addMeta( 'Revisit', '1 DAYS'); //$out->addMeta( "revisit-after", "5 days"); } return true; }
I am not a PHP-specialist. What is wrong?
Regards
Andreas Meyer
A man, a miss, a car -- a curve, He kissed the miss and missed the curve
Mein öffentlicher GPG-Schlüssel unter: http://gpg-keyserver.de/pks/lookup?search=anmeyer&fingerprint=on&op=...
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hello!
Richard Alan richard.philippines@gmail.com schrieb:
You say you installed AddMetas but did you use the functionality? If so then
hm, I think I use the functionality. In LocalSettings.php I added require_once("$IP/extensions/AddMetas.php");
what were the lines that you added to the article page? Also what version of MediaWiki did you install it on?
There are no articles yet. The version I use is mediawiki-1.14.0 http://www.insilence.de
Datenbank: MySQL 5.0.45 HTTP Server: Apache PHP Version: 5.2.6 (Zend: 2.2.0)
Regards
Andreas Meyer
A man, a miss, a car -- a curve, He kissed the miss and missed the curve
Mein öffentlicher GPG-Schlüssel unter: http://gpg-keyserver.de/pks/lookup?search=anmeyer&fingerprint=on&op=...
On Sat, Jun 27, 2009 at 5:22 PM, Andreas Meyer anmeyer@anup.de wrote:
Hello!
I installed AddMetas.php and get this in the error-logfile of Apache:
Undefined variable: parser in /vwww/insilence/root/extensions/AddMetas.php on line 25 Trying to get property of non-object in /vwww/insilence/root/extensions/AddMetas.php on line 25
The function in AddMetas.php looks like this:
function wfAddMetas( &$out, &$text ) { global $wgTitle, $wgParser, $wgRequest, $action; if( $action !== 'edit' && $action !== 'history' && $action !== 'delete' && $action !== 'watch' && strpos( $parser->mTitle->mPrefixedText, 'Special:' ) === false && $parser->mTitle->mNamespace !== 8 ) { $name = $wgTitle->getPrefixedDBKey();
$out->addMeta( 'Description', 'you meta description'); $out->addMeta( 'Keywords', $name.', your meta keywords' ); //$out->addMeta( 'Author', 'the author'); //$out->addMeta( 'Rating', 'General'); //$out->addMeta( 'Revisit', '1 DAYS'); //$out->addMeta( "revisit-after", "5 days"); } return true; }
I am not a PHP-specialist. What is wrong?
Regards
Andreas Meyer
A man, a miss, a car -- a curve, He kissed the miss and missed the curve
Mein öffentlicher GPG-Schlüssel unter: http://gpg-keyserver.de/pks/lookup?search=anmeyer&fingerprint=on&op=...
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hey,
We created pages/articles for all the cattle breeds available. Now we want to add a block on the right-hand side in the articles, at the top, with links to all the other cattle breeds. Its easy to create a block that floats and is displayed there.
But the problem is that if you make a change in that block, you have to go and change every article to include that change, which can be a lot of work.
Is there a way make a template, and you just change that template and every article will pull in that template automatically?
How do you also call that template?
Do you create a template as an article/page also?
I'm a bit new to this, any help will be appreciated!
Thanks.
Regards, Sarel
www.agriwiki.co.za
Simply go to "Template:Cattle breeds", create it and fill it with your content. You can now include that content with {{Cattle breeds}}. http://mediawiki.org/wiki/Help:Templates
On Tue, Jun 30, 2009 at 9:59 AM, Sarel Wessels (Agri Wiki)swessels@agriwiki.co.za wrote:
Hey,
We created pages/articles for all the cattle breeds available. Now we want to add a block on the right-hand side in the articles, at the top, with links to all the other cattle breeds. Its easy to create a block that floats and is displayed there.
But the problem is that if you make a change in that block, you have to go and change every article to include that change, which can be a lot of work.
Is there a way make a template, and you just change that template and every article will pull in that template automatically?
How do you also call that template?
Do you create a template as an article/page also?
I'm a bit new to this, any help will be appreciated!
Thanks.
Regards, Sarel
www.agriwiki.co.za
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks! Thats very easy!
Michael Rosenthal het geskryf:
Simply go to "Template:Cattle breeds", create it and fill it with your content. You can now include that content with {{Cattle breeds}}. http://mediawiki.org/wiki/Help:Templates
On Tue, Jun 30, 2009 at 9:59 AM, Sarel Wessels (Agri Wiki)swessels@agriwiki.co.za wrote:
Hey,
We created pages/articles for all the cattle breeds available. Now we want to add a block on the right-hand side in the articles, at the top, with links to all the other cattle breeds. Its easy to create a block that floats and is displayed there.
But the problem is that if you make a change in that block, you have to go and change every article to include that change, which can be a lot of work.
Is there a way make a template, and you just change that template and every article will pull in that template automatically?
How do you also call that template?
Do you create a template as an article/page also?
I'm a bit new to this, any help will be appreciated!
Thanks.
Regards, Sarel
www.agriwiki.co.za
Andreas Meyer wrote:
Hello!
I installed AddMetas.php and get this in the error-logfile of Apache:
Undefined variable: parser in /vwww/insilence/root/extensions/AddMetas.php on line 25 Trying to get property of non-object in /vwww/insilence/root/extensions/AddMetas.php on line 25
The function in AddMetas.php looks like this:
function wfAddMetas( &$out, &$text ) { global $wgTitle, $wgParser, $wgRequest, $action; if( $action !== 'edit' && $action !== 'history' && $action !== 'delete' && $action !== 'watch' && strpos( $parser->mTitle->mPrefixedText, 'Special:' ) === false && $parser->mTitle->mNamespace !== 8 ) { $name = $wgTitle->getPrefixedDBKey();
$out->addMeta( 'Description', 'you meta description'); $out->addMeta( 'Keywords', $name.', your meta keywords' ); //$out->addMeta( 'Author', 'the author'); //$out->addMeta( 'Rating', 'General'); //$out->addMeta( 'Revisit', '1 DAYS'); //$out->addMeta( "revisit-after", "5 days");
} return true; }
I am not a PHP-specialist. What is wrong?
Regards
Change $parser-> with $wgParser-> Although the way it uses is not a very good one.
mediawiki-l@lists.wikimedia.org