User talk:Barre/MediaWiki/Extensions/kw bread crumbs: Difference between revisions
(Success with MediaWiki 1.5.0) |
|||
Line 80: | Line 80: | ||
I'm not sure what's unclear... Check the example section, there is an explicit use of the trim_prefix option to remove the User: from the title. You can specify as many as you want, i.e. trim_prefix=User:|trim_prefix=Special:, etc. | I'm not sure what's unclear... Check the example section, there is an explicit use of the trim_prefix option to remove the User: from the title. You can specify as many as you want, i.e. trim_prefix=User:|trim_prefix=Special:, etc. | ||
== Success with MediaWiki 1.5.0 == | |||
This is a great extension! It solves many problems and adds a great tool in a very elegant way. Just thought you would like to know that I succeeded in getting this extension to work with MediaWiki 1.5.0. I only needed to change one line in kwBreadCrumbs.php. The table ''cur'' was removed, and I think it was replaced with ''page''. Thus, simply change the following line (approx. 429): | |||
$sql = "UPDATE cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'"; | |||
to: | |||
$sql = "UPDATE page SET page_touched='$now' WHERE page_namespace=$ns AND page_title='$ti'"; | |||
FYI, I have the following in my LocalSettings.php file: | |||
#Add breadcrumb extension | |||
include("extensions/kwBreadCrumbs.php"); | |||
$wgKwBreadCrumbs = "prefix=Trace: |small=1|bgcolor=F9F9F9"; | |||
and the following in my MonoBook.php file: | |||
<pre><div><?php echo kwBreadCrumbsTAL() ?></div></pre> |
Revision as of 06:20, 20 October 2005
Hey thanks Sebastien for you help with the trail, however your positioning description was a little confusing.
So I have saved the file kwBreadCrumbs.php into extensions folder and and entered include("extensions/kwBreadCrumbs.php"); into LocalSettings.php.
I want the trail to run along the top of the page like in your Wiki system. I have set $on_top_hack = 1; What does "use the tag anywhere in the page " mean?
Thanks in advance, really neat little idea. Also just in case you were wondering my wiki will not be going public. Its just a research project for university.
Ali.
It seems this extension was written in mind for the 1.3 series. I got the "Anywhere in the layout" part working for the 1.4 series. You need to add:
<div><?php echo kwBreadCrumbsTAL() ?></div>
into: <wikibasedir>/skins/MonoBook.php
This of course will limit this option to monobook, but i'm sure you could add it to your other skins as well.
Laner 16:28, 25 Apr 2005 (EDT)
Has anyone gotten this to work for mediawiki 1.4rc1? I've spent some time to try to get this working but I keep getting "database error" and "internal error". there's no place on the net that talks about this, i've scoured every last webpage for a month already :(
Then I noticed that the version of this wiki:
MediaWiki (http://wikipedia.sf.net/): 1.3.0beta4 PHP (http://www.php.net/): 4.3.8-9 (apache) MySQL (http://www.mysql.com/): 4.0.20-log
while mine is:
MediaWiki (http://wikipedia.sf.net/): 1.4rc1 PHP (http://www.php.net/): 4.3.9 (apache2handler) MySQL (http://www.mysql.com/): 3.23.58
this has got to be the reason why it isnt working for me...
Jctong 18:22, 26 Apr 2005 (EDT)
You guys are right, I did not test this extension for 1.4 yet. I will try soon.
I updated this extension and the documentation so that it can work with MediaWiki 1.4. Sadly, the on_top_hack option that made it easy to put the trace on top of the page does not work with 1.4 anymore, so you will have (as one user noticed already) to directly call the extension from the template code. See doc. Hope this helps. Note that as of today, this web site is still running 1.3. It will be upgraded by our sysadmin to 1.4 soon, at which point the examples may not be working properly until I notice the upgrade ;)
It appears that you have not taken into account a database table prefix that may have been set by the user. This can be overcome by replacing line 429 in the kwBreadCrumbs.php file with the following:
Find:
$sql = "UPDATE cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'";
Replace With:
if ( $options ) { $db =& wfGetDB( DB_MASTER ); } else { $db =& wfGetDB( DB_SLAVE ); } $cur = $db->tableName( 'cur' ); $sql = "UPDATE $cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'";
Xangelusx 13:10, 1 Jun 2005 (EDT)
Successfully installed it on MediaWiki 1.4rc1! Thank you for upgrading code and thank you Xangelusx for the modification. Even Laner's portion works too.
- I placed <div><?php echo kwBreadCrumbsTAL() ?></div> at line 71 of MonoBook.php
Jctong 21:21, 8 Jun 2005 (EDT)
Trim prefixes array
What is the proper usage of this setting in the extension? I am trying to remove Special:, User:, etc...
$trim_prefixes = array();
Toykilla 15:19, 3 Aug 2005 (EDT)
I'm not sure what's unclear... Check the example section, there is an explicit use of the trim_prefix option to remove the User: from the title. You can specify as many as you want, i.e. trim_prefix=User:|trim_prefix=Special:, etc.
Success with MediaWiki 1.5.0
This is a great extension! It solves many problems and adds a great tool in a very elegant way. Just thought you would like to know that I succeeded in getting this extension to work with MediaWiki 1.5.0. I only needed to change one line in kwBreadCrumbs.php. The table cur was removed, and I think it was replaced with page. Thus, simply change the following line (approx. 429):
$sql = "UPDATE cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'";
to:
$sql = "UPDATE page SET page_touched='$now' WHERE page_namespace=$ns AND page_title='$ti'";
FYI, I have the following in my LocalSettings.php file:
#Add breadcrumb extension include("extensions/kwBreadCrumbs.php"); $wgKwBreadCrumbs = "prefix=Trace: |small=1|bgcolor=F9F9F9";
and the following in my MonoBook.php file:
<div><?php echo kwBreadCrumbsTAL() ?></div>