Revision history for CustomPageTitleTag
Revision [21606]
Last edited on 2011-10-09 11:12:24 by EmeraldIsland [Changes for WikkaWiki version with UTF-8 support]Additions:
==={{color hex="#73A" text="Wikka with UTF-8 support (since version 1.3.2)"}}===
''**§**'' ASCII code is 0xA7 and because it is bigger than 0x7F, the corresponding UTF-8 code differs. You need to replace in the code above each ''**§**'' whith ''**\xC2§**''.
Alternatively, you can also choose a free char with an ASCII code below 0x7F (but you will have to change also all your pages title.
In ##""PageTitle()""## function :
##ereg## might be replaced with ##preg_match## for deprecated reason and ##$title = ""''"";## might be changed to ##$title = array();## --EmeraldIsland
''**§**'' ASCII code is 0xA7 and because it is bigger than 0x7F, the corresponding UTF-8 code differs. You need to replace in the code above each ''**§**'' whith ''**\xC2§**''.
Alternatively, you can also choose a free char with an ASCII code below 0x7F (but you will have to change also all your pages title.
In ##""PageTitle()""## function :
##ereg## might be replaced with ##preg_match## for deprecated reason and ##$title = ""''"";## might be changed to ##$title = array();## --EmeraldIsland
Revision [19027]
Edited on 2008-01-28 00:13:47 by ShopRocker [Modified links pointing to docs server]No Differences
Additions:
2) Modify wakka.class file, you'll find it in the /libs/ directory.
Deletions:
Additions:
//note: as the custom title should not contain special characters, regexp could be simplified. For example ereg("§§§.*§§§"...)//
Additions:
//note: the "<br />" that follows title should be removed too//
**update 2007/01/23** : custom titles should not be mandatory.
Better patch :
ereg( "(§){3,5}([^=\n]+)(§){3,5}", $pagecontent, $title); // custom title ?
if (!$title) ereg( "(=){3,5}([^=\n]+)(=){3,5}", $pagecontent, $title); // smart title ?
if ($title) {
if ($title) return strip_tags($this->Format($title)); # fix for forced links in heading
**update 2007/01/23** : custom titles should not be mandatory.
Better patch :
ereg( "(§){3,5}([^=\n]+)(§){3,5}", $pagecontent, $title); // custom title ?
if (!$title) ereg( "(=){3,5}([^=\n]+)(=){3,5}", $pagecontent, $title); // smart title ?
if ($title) {
if ($title) return strip_tags($this->Format($title)); # fix for forced links in heading
Deletions:
Additions:
//Feel free to correct any possible errors. Do some of you guys know how to make a wikka action (more nifty than modifing files manually) out of this? If so feel free to modify this article.//
Deletions:
Additions:
//Feel free to correct any possible errors. Do some of you guys know how to make a wikka action (more nifty than modifing files manually) out of this, if so feel free to modify this article.//
Deletions:
Deletions:
Additions:
%%(php) $text = preg_replace("/§§§.*?§§§/","", $text); //for cutting out the §§§my title§§§ tag from page content
Deletions:
Additions:
%%(php) // we're cutting the last <br />
Deletions:
%% function PageTitle() {
Additions:
%%(php)function PageTitle() {
}%%
}%%
Additions:
%%(php)$this->SavePage($this->tag, $body, $note);%%
Deletions:
Additions:
%%(php)$this->SavePage($this->tag, $body, $note);%%
Additions:
====USAGE:====
Deletions:
Additions:
Now if You want to specify a custom TITLE for a page you're editing, you're free to do so. Just use ##""§§§My Custom Tile§§§""## to specify your specific TITLE for the page. This way the TITLE of the page doesn't have to be same as the highest Heading on the page. --TomEk
Deletions:
Additions:
P.//S.//
//Do some of you guys know how to make a wikka action (more nifty than modifing files manually) out of this, if so feel free to modify this article.//
//Do some of you guys know how to make a wikka action (more nifty than modifing files manually) out of this, if so feel free to modify this article.//
Additions:
if (ereg( "(=){3,5}([^=\n]+)(=){3,5}", $pagecontent, $title)) {
Additions:
However, if you want the page to have a different, more descriptive TITLE (Ex: "Resume of Chopin, the most eminent Polish composer") and still keep the highest Heading short (##""=====Resume=====""##), you can use the following hack and modify two Wikka files.
Deletions:
Additions:
wakka2callback('closetags'); %%
wakka2callback('closetags'); %%
} %%
} %%
wakka2callback('closetags'); %%
} %%
} %%
Deletions:
%%
wakka2callback('closetags');
%%
}
%%
}
%%
Additions:
%% // we're cutting the last <br />
%% $text = preg_replace("/§§§.*?§§§/","", $text); //for cutting out the §§§my title§§§ tag from page content
%% function PageTitle() {
%% function PageTitle() {
%% $text = preg_replace("/§§§.*?§§§/","", $text); //for cutting out the §§§my title§§§ tag from page content
%% function PageTitle() {
%% function PageTitle() {
Deletions:
%%
function PageTitle() {
function PageTitle() {
No Differences
Deletions:
?>
Additions:
%% (php) <?php
?>
?>
Deletions:
Additions:
%% (php)
Deletions:
Additions:
====Here's how:====
%% (php)
%% (php)