Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (7 votes)

42% thumbs up 57% thumbs down

How would you rate this answer?



Thank you for rating this answer.

How can I get the Interspire Website Publisher Glossary to work on other non-Interspire Website Publisher sections of my site?

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.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software