Content added Content deleted
No edit summary |
(Replacing page with 'Category:Mediawiki ===Thank you=== This worked, Much appreciated. A donation has been made. Thanks, it has arrived and is much appreciated. mutante...') |
||
Line 3: | Line 3: | ||
=== A === |
|||
Hi, i have implemented a simple version of your requested feature. check out this: Go to a page on this wiki in [[:Category:GNU]], you should see a GNU head appearing in our logo, unlike on other pages. Also try pages in [[:Category:ASCII]]. Those are just random examples. Source code changes i made follow: |
|||
go to /var/www/w/'''skins/MonoBook.php''': |
|||
around line 138 find the part that says |
|||
<pre> |
|||
<div class="portlet" id="p-logo"> |
|||
... |
|||
</div> |
|||
</pre> |
|||
In between these tags, replace the existing code with something like: |
|||
<pre> |
|||
if (ereg ("GNU",$this->data['catlinks'])) { ?> |
|||
<a style="background-image: url(http://s23.org/w/skins/common/images/wiki-gnu.png);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a> |
|||
<?php } elseif (ereg ("ASCII",$this->data['catlinks'])){ ?> |
|||
<a style="background-image: url(http://s23.org/w/skins/common/images/wiki-ascii.png);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a> |
|||
<?php } else { ?> |
|||
<a style="background-image: url(<?php $this->text('logopath') ?>);" href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" title="<?php $this->msg('mainpage') ?>"></a> |
|||
</pre> |
|||
==== explanation: ==== |
|||
<pre>if (ereg ("GNU",$this->data['catlinks'])) ...</pre> '''if the category links contain "GNU"''' |
|||
<pre><a style="background-image: url(http://s23.org/w/skins/common/images/wiki-gnu.png) ..</pre> '''set the logo to wiki-gnu.png''' .. |
|||
<pre>elseif (ereg ("ASCII",$this->data['catlinks']))..</pre> '''if the category links contain "ASCII"'''.. |
|||
<pre><a style="background-image: url(http://s23.org/w/skins/common/images/wiki-ascii.png) ..</pre> '''set the logo to wiki-ascii.png''' .. |
|||
... |
|||
<pre>} else {</pre> |
|||
'''if nothing matched until now...''' |
|||
<pre><a style="background-image: url(<?php $this->text('logopath') ?>)</pre> |
|||
'''set to default logopath from LocalSettings.php'''. |
|||
==== You need to customize ==== |
|||
You need to change the URLs to your server and the keywords to your desired categories. You can add more "elseif" lines for other categories you want. |
|||
The price shall be a volunatary [[S23Wiki:Site_support|donation]] to our Wiki. (or, if you have work lets say the equivalent of what you get for 2 hours of your work in your location). |
|||
Revision as of 05:09, 31 July 2008
Thank you
This worked, Much appreciated. A donation has been made.
Thanks, it has arrived and is much appreciated. mutante 11:09, 23 April 2006 (CEST)