Here is some code you can use to add glossary terms to other parts. This code needs to go into a file with a .php extension.
$output needs to contain the text you want to contain the glossary
terms, and the 'init.php' may need to change if you want it in another
directory.
<?php
include 'init.php';
$output = "TEXT to have glossary terms added into";
// Get all glossary words
$arrWords = AL_HELPER::GetGlossaryTerms();
if(sizeof($arrWords) > 0)
{
// Make the replacements
for($i = 0; $i < sizeof($arrWords); $i++)
{
$output =
preg_replace("#([^a-zA-Z])(" .
preg_quote(trim($arrWords[$i]["word"]),'#') .
")([^a-zA-Z])#i",'$1'.$arrWords[$i]["token"].'$3', $output, 1);
}
}
if(sizeof($arrWords) > 0)
{
// Make the replacements
for($i = 0; $i < sizeof($arrWords); $i++)
{
// Just replace the first instanse of the token
$title = str_replace("
",
"<br>", str_replace(''', ''', str_replace('"',
'', $arrWords[$i]["desc"])));
$popup = "<a
class="HelpLink" href="javascript:void(0)"
onclick="showHelpTip(event, '><b>" . $arrWords[$i]["word"] .
"</b><br><br>" . $title . "'); return false">"
. $arrWords[$i]["word"] . "</a>";
// Replace the rest of the tokens back with the word
$output = str_replace($arrWords[$i]["token"], $popup, $output);
}
}
echo $output;
?>
You will also need to make sure you have this in the page:
<script src="http://yoursite.com/websitepublisher/javascript/helpTip.js"></script>
and then the styles in the same page:
<style>
a.helpLink {
color: Green;
text-decoration: none;
border-bottom: 1px dashed Green;
cursor: help;
}
a.helpLink:hover {
color: Red;
text-decoration: none;
border-bottom: 1px dashed Red;
}
.help-tooltip {
position: absolute;
width: 250px;
border: 1px Solid WindowFrame;
background: Infobackground;
color: InfoText;
font: StatusBar;
font: Status-Bar;
padding: 3px;
filter:
progid:DXImageTransform.Microsoft.Shadow(color="#777777",
Direction=135, Strength=3);
z-index: 10000;
}
.help-tooltip a,
.help-tooltip a:hover {
color: blue !important;
background: none;
}
</style>
If you have any further troubles send in a trouble ticket.
