Nykyinen versio |
Oma tekstisi |
Rivi 34: |
Rivi 34: |
| $wgHashedUploadDirectory = false; | | $wgHashedUploadDirectory = false; |
|
| |
|
| == Bännerin lisääminen sivupalkkiin == | | == Add a banner to the sidebar (PHP) == |
|
| |
|
| Hyvä ja toimiva ohje löytyy [http://www.mediawiki.org/w/index.php?title=Manual:Interface/Sidebar&oldid=398382#Add_a_banner_to_the_sidebar_.28PHP.29 täältä].
| | You can add one or more banners to the sidebar by hacking your ''skins/Monobook.php'' file (if you're using monobook) to include the following piece of code. |
|
| |
|
| == Suosittele-namiskan (Facebook) lisääminen artikkelin oikeaan yläkulmaan ==
| | Find (line 188): |
| | ?> |
| | </div><!-- end of the left (by default at least) column --> |
|
| |
|
| Homma on hyvin simppeli. Jos haluat vain namiskan esim. etusivulle (jengi voi suositella vain kyseistä sivua), voit generoida koodin [http://developers.facebook.com/docs/reference/plugins/like/ täällä] ja tunkea koodin mihin lystäät. Vaikkapa etusivun lähdekoodiin htmlets-ekstensiolla.
| | Include: |
| | ?> |
| | <!-- begin of banner1 --> |
| | <div class='generated-sidebar portlet'> |
| | <h5><?php $this->msg('sidebar-banner1-headingtext') ?></h5> |
| | <div style="border: 1px solid #B0B0B0; background-color: #FFFFFF;"> |
| | <a href="<?php $this->msg('sidebar-banner1-url') ?>"> |
| | <img width="100%" title="<?php $this->msg('sidebar-banner1-alttext') ?>" |
| | alt="<?php $this->msg('sidebar-banner1-alttext') ?>" |
| | src="<?php $this->msg('sidebar-banner1-imgsrc') ?>" /></a> |
| | </div></div> |
| | <!-- end of banner1 --> |
| | </div><!-- end of the left (by default at least) column --> |
|
| |
|
| Jos taas haluat jokaiselle sivulle oman namiskansa siten, että namiskalla suositellaan aina auki olevaa sivua (namiska siis näkyy joka sivulla ApoWikin tyyliin), tarvitaan PHP:tä. Homma menee niin, että seuraava koodipätkä liitetään teematiedoston (esim. skins/Vector.php) alkupuolelle:
| | Now in your Wiki, create four System messages: (i.e. articles named MediaWiki:sidebar-banner1-...) |
|
| |
|
| <?php $url = "http" . ((!empty($_SERVER['HTTPS'])) ? "s" : "") . "://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>
| | {| class="prettytable" |
| | ! parameter |
| | ! value |
| | |- |
| | | <tt>sidebar-banner1-headingtext</tt> |
| | | The text that will be displayed as the banner heading ("advertisement", "sponsor" etc.) |
| | |- |
| | | <tt>sidebar-banner1-url</tt> |
| | | The destination URL of this banner |
| | |- |
| | | <tt>sidebar-banner1-alttext</tt> |
| | | Title for the site. Content of the '''alt=""''' parameter of an HTML <img> tag. |
| | |- |
| | | <tt>sidebar-banner1-imgsrc</tt> |
| | | URL of the banner image. It may be the address of an image uploaded to your Wiki ([[magic words]] may be used, e.g. <tt><nowiki>{{filepath:banner1.png}}</nowiki></tt>), or the address of an external image. Content of the '''src=""''' parameter of an HTML <img> tag. |
| | |} |
|
| |
|
| Yllä siis selvitetään sen sivun osoite, jolla nappula sattuu näkymään, ja tungetaan se muuttujaan $url. Seuraava koodi näyttää kyseisen nappulan, eli se liitetään mihin nappula sitten halutaankaan (skins/Vector.php).
| | To add more banners, just repeat the process renaming "banner1" to "banner2" etc. |
| | |
| <iframe align="right" spacing="4" src="http://www.facebook.com/plugins/like.php?locale=fi_FI&app_id=234649153215753&href=<?php echo urlencode($url); ?>&amp;send=false&amp;layout=button_count&amp;width=20&amp;show_faces=false&amp;action=recommend&amp;colorscheme=dark&amp;font=verdana&amp;height=21"
| |
| scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
| |
| | |
| ApoWikissä koodi siis näyttää seuraavanlaiselta, eli jos haluat apinoida ApoWikiä, muuta firstHeading -kommenttitägien (<tt><nowiki><!-- firstHeading --></nowiki></tt>) väli seuraavanlaiseksi:
| |
| | |
| <nowiki><!-- firstHeading --></nowiki>
| |
| <?php $url = "http" . ((!empty($_SERVER['HTTPS'])) ? "s" : "") . "://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>
| |
| <h1 id="firstHeading" class="firstHeading"><?php $this->html( 'title' ) ?> <iframe align="right" spacing="4" src="http://www.facebook.com/plugins/like.php?locale=fi_FI&app_id=234649153215753&href=<?php echo urlencode($url); ?>&amp;send=false&amp;layout=button_count&amp;width=20&amp;show_faces=false&amp;action=recommend&amp;colorscheme=dark&amp;font=verdana&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe></h1>
| |
| <nowiki><!-- /firstHeading --></nowiki>
| |