3,606 bytes added
, 15:50, 16 December 2008
<font color=gray><div align="center" style="text-align: center;font-size: 300%; font-weight: bold; margin: 10px auto;"> '' Wikipedia Link Mod '' </div></font>
{|align=right
|__TOC__
|}
== Purpose of the mod ==
This mod provides links to Wikipedia for the TNG Place name and for each of the individual segments of the place name.
== Advantages ==
The Wikipedia link mod allows your users to link to Wikipedia:
* where they may find additional information on the place.
* where they may find the additional information on the segments of the place name.
== Developer ==
The mod was initially provided on the [http://www.tngforum.us/index.php?s=&showtopic=3921&view=findpost&p=18911 TNG Forum] by Luke Weerts.
Note that Luke initially replaced the Place Name header with a link to Wikipedia. Ken Roy modified Luke's code to add the Wikipedia link information below the Place Name Header and use cust_text.php to provide the indication of a Wikipedia link.
== TNG module - placesearch.php ==
This mod pertains to the placesearch.php script
The following are the instructions on how to install the Wikipedia Link mod.
=== Where ===
Add the following after line 236 - applies to TNG 7.0 (this mod is also working in TNG 6.1.3 but the line number is likely are different).
<pre>
echo tng_DrawHeading( $photostr, $psearchns, "" );
</pre>
=== What to add ===
After the TNG generated Place Name header line, add a conditional include.
<font color=green>
<pre>
@include($cms[tngpath] . "extensions/wikipedia_link.php"); // Luke Weert's Wikipedia Link mod
http://www.tngforum.us/index.php?s=&showtopic=3921&view=findpost&p=18911
</pre>
</font>
=== Content of wikipedia_link.php ===
You can create the wikipedia_link.php file from the following content and place the file in the extensions subdirectory of your TNG install directory. Note that you may have to create the subdirectory as a New Folder.
<font color=green>
<pre>
<?php
// Luke Weert's Wikipedia link mod -
http://www.tngforum.us/index.php?s=&showtopic=3921&view=findpost&p=18911
$citst = explode(",", $psearchns);
$ct = count($citst);
end($citst);
$ct = $ct > 1 ? "," . ($ct > 2 ? prev($citst): current($citst)) : "";
echo "$text[wikilinks]" ."<br />" ;
echo "<a href=\"http://en.wikipedia.org/wiki/".
str_ireplace( " ", "_",$citst[0] . $ct) . "\" target=\"_blank\">";
echo "$psearchns ";
echo "</a><br />";
function wikis($nam,$nu)
{
$nam = trim($nam);
echo " [<a href=\"http://en.wikipedia.org/wiki/".
str_ireplace( " ", "_",$nam) . "\">". $nam . "</a>] ";
};
array_walk($citst, 'wikis');
?>
</pre>
</font>
=== Co-requesite custom text ===
In your English/cust_text.php, add
<pre>
// Added for Wikipedia Searchplace mod by Luke Weerts
$text[wikilinks] = "Wikipedia links for";
</pre>
In your French/cust_text.php, add
<pre>
// Added for Wikipedia Searchplace mod by Luke Weerts
$text[wikilinks] = "Wikipedia liens pour";
</pre>
You will need to add similar text for your other languages.
== Visual of mod ==
See sites using the mod below for visual.
== TNG User sites using this mod ==
*Please add TNG site that you have found that utilize this modification
=== Site List ===
*[http://www.cousinfolk.net/placesearch.php?psearch=Goodhue%2C+Goodhue+County%2C+Minnesota%2C+USA Luke Weert's Cousin Folk] web site. Luke is the developer of the Wikipedia Link mod
*[http://www.royandboucher.com/genealogy/placesearch.php?tree=&psearch=Joigny%2C+Yonne%2C+Bourgogne%2C+France Our Acadian, French Canadian, and Maine Ancestors] Mod updated to add Wikipedia links for text by Ken Roy.
[[Category:TNGmods]]