Revision history for Mod040fSmartPageTitles


Revision [23269]

Last edited on 2016-05-20 07:38:47 by JavaWoman [Replaces old-style internal links with new pipe-split links.]
Additions:
**[[JsnX | Jason Tourtelotte]]** (refinement and implementation)
Deletions:
**[[JsnX Jason Tourtelotte]]** (refinement and implementation)


Revision [19292]

Edited on 2008-01-28 00:14:45 by JavaWoman [Modified links pointing to docs server]

No Differences

Revision [17215]

Edited on 2007-07-07 14:56:26 by JavaWoman [standardized credit links]
Additions:
==== Wikka Mod 040 ====
Type: Feature Addition
----
===Credit:===
**DarTar** **(main credit for the idea and code)**
SmartTitle
**DreckFehler** (suggestions, comedy and code improvement)
**[[JsnX Jason Tourtelotte]]** (refinement and implementation)
----

====Smart Page Titles====

===Description===

Before this mod, page titles in Wikka corresponded to their WikiName.
Although this is consistent with Wiki philosophy, in some cases having a dumb WikiName as a title is pretty limiting:
~-[[WikiName]]s make **""VeryLongTitlesQuiteDifficultToUnderstand""**;
~-They are not an optimal solution for visibility in search engines;
~-They cannot contain accents or other special characters;


After this mod, page titles correspond to the first header found in the page. If no header is found, then the page's WikiName is displayed.

===Code===

Add this code to /wikka.php:
%%
function PageTitle() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "(=){3,5}([^=]+)(=){3,5}", $pagecontent, $title)) {
$formatting_tags = array("**", "//", "__", "##", "''", "++", "#%", "@@", "\"\"");
$title = str_replace($formatting_tags, "", $title[2]);
}
if ($title) return $title;
else return $this->GetPageTag();
}
%%

Then make the following change in ##/actions/header.php##

old:
%%(php) <title><?php echo $this->GetWakkaName()." : ".$this->GetPageTag(); ?></title>%%
new:
Deletions:
==== Wikka Mod 040 ====
Type: Feature Addition
----
===Credit:===
==DarTar (main credit for the idea and code)==
- DreckFehler (suggestions, comedy and code improvement)
- JsnX (refinement and implementation)

http://wikka.jsnx.com/SmartTitle
----

====Smart Page Titles====

===Description===

Before this mod, page titles in Wikka corresponded to their WikiName.
Although this is consistent with Wiki philosophy, in some cases having a dumb WikiName as a title is pretty limiting:
~-WikiNames make **""VeryLongTitlesQuiteDifficultToUnderstand""**;
~-They are not an optimal solution for visibility in search engines;
~-They cannot contain accents or other special characters;


After this mod, page titles correspond to the first header found in the page. If no header is found, then the page's WikiName is displayed.

===Code===

Add this code to /wikka.php:
%%
function PageTitle() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "(=){3,5}([^=]+)(=){3,5}", $pagecontent, $title)) {
$formatting_tags = array("**", "//", "__", "##", "''", "++", "#%", "@@", "\"\"");
$title = str_replace($formatting_tags, "", $title[2]);
}
if ($title) return $title;
else return $this->GetPageTag();
}
%%

Then make the following change in ##/actions/header.php##

old:
%%(php) <title><?php echo $this->GetWakkaName()." : ".$this->GetPageTag(); ?></title>%%
new:


Revision [16966]

Edited on 2007-05-31 23:27:31 by JsnX [Reverted]
Additions:
==== Wikka Mod 040 ====
Type: Feature Addition
----
===Credit:===
==DarTar (main credit for the idea and code)==
- DreckFehler (suggestions, comedy and code improvement)
- JsnX (refinement and implementation)

http://wikka.jsnx.com/SmartTitle
----

====Smart Page Titles====

===Description===

Before this mod, page titles in Wikka corresponded to their WikiName.
Although this is consistent with Wiki philosophy, in some cases having a dumb WikiName as a title is pretty limiting:
~-WikiNames make **""VeryLongTitlesQuiteDifficultToUnderstand""**;
~-They are not an optimal solution for visibility in search engines;
~-They cannot contain accents or other special characters;


After this mod, page titles correspond to the first header found in the page. If no header is found, then the page's WikiName is displayed.

===Code===

Add this code to /wikka.php:
%%
function PageTitle() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "(=){3,5}([^=]+)(=){3,5}", $pagecontent, $title)) {
$formatting_tags = array("**", "//", "__", "##", "''", "++", "#%", "@@", "\"\"");
$title = str_replace($formatting_tags, "", $title[2]);
}
if ($title) return $title;
else return $this->GetPageTag();
}
%%

Then make the following change in ##/actions/header.php##

old:
%%(php) <title><?php echo $this->GetWakkaName()." : ".$this->GetPageTag(); ?></title>%%
new:
Deletions:
==== Wikka Mod 040 ====
Type: Feature Addition
----
===Credit:===
==DarTar (main credit for the idea and code)==
- DreckFehler (suggestions, comedy and code improvement)
- JsnX (refinement and implementation)

http://wikka.jsnx.com/SmartTitle
----

====Smart Page Titles====

===Description===

Before this mod, page titles in Wikka corresponded to their WikiName.
Although this is consistent with Wiki philosophy, in some cases having a dumb WikiName as a title is pretty limiting:
~-WikiNames make **""VeryLongTitlesQuiteDifficultToUnderstand""**;
~-They are not an optimal solution for visibility in search engines;
~-They cannot contain accents or other special characters;


After this mod, page titles correspond to the first header found in the page. If no header is found, then the page's WikiName is displayed.

===Code===

Add this code to /wikka.php:
%%
function PageTitle() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "(=){3,5}([^=] )(=){3,5}", $pagecontent, $title)) {
$formatting_tags = array("**", "//", "__", "##", "''", " ", "#%", "@@", "\"\"");
$title = str_replace($formatting_tags, "", $title[2]);
}
if ($title) return $title;
else return $this->GetPageTag();
}
%%

Then make the following change in ##/actions/header.php##

old:
%%(php) <title><?php echo $this->GetWakkaName()." : ".$this->GetPageTag(); ?></title>%%
new:


Revision [16765]

Edited on 2007-05-31 10:45:25 by Ix6Ecz [Reverted]
Additions:
==== Wikka Mod 040 ====
Type: Feature Addition
----
===Credit:===
==DarTar (main credit for the idea and code)==
- DreckFehler (suggestions, comedy and code improvement)
- JsnX (refinement and implementation)

http://wikka.jsnx.com/SmartTitle
----

====Smart Page Titles====

===Description===

Before this mod, page titles in Wikka corresponded to their WikiName.
Although this is consistent with Wiki philosophy, in some cases having a dumb WikiName as a title is pretty limiting:
~-WikiNames make **""VeryLongTitlesQuiteDifficultToUnderstand""**;
~-They are not an optimal solution for visibility in search engines;
~-They cannot contain accents or other special characters;


After this mod, page titles correspond to the first header found in the page. If no header is found, then the page's WikiName is displayed.

===Code===

Add this code to /wikka.php:
%%
function PageTitle() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "(=){3,5}([^=] )(=){3,5}", $pagecontent, $title)) {
$formatting_tags = array("**", "//", "__", "##", "''", " ", "#%", "@@", "\"\"");
$title = str_replace($formatting_tags, "", $title[2]);
}
if ($title) return $title;
else return $this->GetPageTag();
}
%%

Then make the following change in ##/actions/header.php##

old:
%%(php) <title><?php echo $this->GetWakkaName()." : ".$this->GetPageTag(); ?></title>%%
new:
Deletions:
==== Wikka Mod 040 ====
Type: Feature Addition
----
===Credit:===
==DarTar (main credit for the idea and code)==
- DreckFehler (suggestions, comedy and code improvement)
- JsnX (refinement and implementation)

http://wikka.jsnx.com/SmartTitle
----

====Smart Page Titles====

===Description===

Before this mod, page titles in Wikka corresponded to their WikiName.
Although this is consistent with Wiki philosophy, in some cases having a dumb WikiName as a title is pretty limiting:
~-WikiNames make **""VeryLongTitlesQuiteDifficultToUnderstand""**;
~-They are not an optimal solution for visibility in search engines;
~-They cannot contain accents or other special characters;


After this mod, page titles correspond to the first header found in the page. If no header is found, then the page's WikiName is displayed.

===Code===

Add this code to /wikka.php:
%%
function PageTitle() {
$title = "";
$pagecontent = $this->page["body"];
if (ereg( "(=){3,5}([^=]+)(=){3,5}", $pagecontent, $title)) {
$formatting_tags = array("**", "//", "__", "##", "''", "++", "#%", "@@", "\"\"");
$title = str_replace($formatting_tags, "", $title[2]);
}
if ($title) return $title;
else return $this->GetPageTag();
}
%%

Then make the following change in ##/actions/header.php##

old:
%%(php) <title><?php echo $this->GetWakkaName()." : ".$this->GetPageTag(); ?></title>%%
new:


Revision [1532]

Edited on 2004-10-03 13:51:59 by JsnX [minor edit]
Additions:
if (ereg( "(=){3,5}([^=]+)(=){3,5}", $pagecontent, $title)) {
Deletions:
if (ereg( "(=){2,5}([^=]+)(=){2,5}", $pagecontent, $title)) {


Revision [1168]

The oldest known version of this page was created on 2004-09-11 13:11:35 by JsnX [minor edit]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki