<ul>
<li><a href="#pci">What is PCI?</a></li>
<li><a href="#dss">What is the 'PCI DSS'?</a></li>
<li><a href="#apply">To whom does PCI apply?</a></li>
<li><a href="#refuse">What if a Merchant refuses to cooperate?</a></li>
<li><a href="#okay">What does a Merchant have to do in order to satisfy the PCI requirements?</a></li>
<li><a href="#saq1">What is the 'Self-Assessment Questionnaire'?</a></li>
<li><a href="#saq2">What is the 'SAQ'?</a></li>
<li><a href="#compliance">What is meant by 'Compliance'?</a></li>
<li><a href="#validation">What is meant by 'Validation'?</a></li>
<li><a href="#levels">How are the different Merchant Levels defined?</a></li>
<li><a href="#remediation">What is meant by 'Remediation'?</a></li>
<li><a href="#government">Is PCI a government program? Is it a law?</a></li>
<li><a href="#panoptic">Are Merchants required to use the tools provided through this web-site to fix any compliance problems?</a></li>
<li><a href="#Internet">If a merchant does not have Internet access what options do they have to complete the SAQ forms?</a></li>
<li><a href="#printRemed">How do I print my Fix-It Plan?</a></li>
<li><a href="#glossary">Glossary of Technical Terms</a></li>
<li><a href="#submitQuestion">Submit a Question</a></li>
</ul>
$content = preg_replace("|(?!<[^<>]*?)(?<![?./&])\b$term\b(?!:)(?![^<>]*?>)|imsU","<span class=\"gloss\"><strong>$term_link</strong></span>" , $content);
<ul>
<!--glossover-start--> <li><a href="#pci">What is PCI?</a></li> <li><a href="#dss">What is the 'PCI DSS'?</a></li><!--glossover-end-->
<li><a href="#apply">To whom does PCI apply?</a></li>
<li><a href="#refuse">What if a Merchant refuses to cooperate?</a></li>
<li><a href="#okay">What does a Merchant have to do in order to satisfy the PCI requirements?</a></li>
<li><a href="#saq1">What is the 'Self-Assessment Questionnaire'?</a></li>
<li><a href="#saq2">What is the 'SAQ'?</a></li>
<li><a href="#compliance">What is meant by 'Compliance'?</a></li>
<li><a href="#validation">What is meant by 'Validation'?</a></li>
<li><a href="#levels">How are the different Merchant Levels defined?</a></li>
<li><a href="#remediation">What is meant by 'Remediation'?</a></li>
<li><a href="#government">Is PCI a government program? Is it a law?</a></li>
<li><a href="#panoptic">Are Merchants required to use the tools provided through this web-site to fix any compliance problems?</a></li>
<li><a href="#Internet">If a merchant does not have Internet access what options do they have to complete the SAQ forms?</a></li>
<li><a href="#printRemed">How do I print my Fix-It Plan?</a></li>
<li><a href="#glossary">Glossary of Technical Terms</a></li>
<li><a href="#submitQuestion">Submit a Question</a></li>
</ul>
$content = preg_replace("|(?<![^glossover\-start])(?!<[^<>]*?)(?<![?./&])\b$term\b(?!:)(?![^<>]*?>)(?![^glossover\-end])|imsU","<span class=\"gloss\"><strong>$term_link</strong></span>" , $content);
ASKER
<?php
//if (!isset(cmsms())) exit;
global $CMS_ADMIN_PAGE;
//print($CMS_ADMIN_PAGE.' admin');
if($CMS_ADMIN_PAGE!=1){
if (substr($_GET['page'], 0,8)!="glossary"){
$content=$params["content"];
global $gCms;
$config = $gCms->GetConfig();
$tmp_file=$config['root_path'].'/tmp//templates_c/gloss.tmp';
if(!file_exists($tmp_file)){
$db = $gCms->db;
$query = 'SELECT * FROM '.cms_db_prefix().'module_glossary_term';
$result=$db->Execute($query,array());
$resultsarray=array();
while ($result && !$result->EOF){
$term=$result->fields['term'];
$returnid='69';
$id='asdga';
$def = $result->fields['definition'];
$prettyurl = 'glossary/'.$term.'/'.$returnid;
$term_link = $this->CreateFrontendLink($id, 'show', $returnid, $term,array('tid'=>$result->fields['term_id']), '', false, false, 'rel="'.$def.'"', false,$prettyurl);
$resultsarray[]=array('term'=>$term,'term_link'=>$term_link);
$result->MoveNext();
}
$fn = $tmp_file;
$fp = fopen($fn, "w");
if (!$fp) {
return 0;
}
fwrite($fp, serialize($resultsarray));
fclose($fp);
$data=file_get_contents($tmp_file);
}else{
$data=file_get_contents($tmp_file);
}
//debug_display('$data---->'.$data);
$result=unserialize($data);
foreach($result as $key => $item){
$term=$item['term'];
$term_link=$item['term_link'];
//$pattern = '/()'.$term.'/';
//$replacement='<span class="gloss"><strong>'.$term_link .'</strong></span>';
//debug_display('$replacement---->'.$replacement);
//$content = preg_replace($pattern, $replacement, $content);
/*$content = preg_replace("|(?<![^glossover\-start])(?!<[^<>]*?)(?<![?./&])\b$term\b(?!:)(?![^<>]*?>)(?![^glossover\-end])|imsU","<span class=\"gloss\"><strong>$term_link</strong></span>" , $content);*/
$gloss = '#<!--glossover-start-->.*?<!--glossover-end-->#'; // Pattern for a glossy section
$term_link = "<span class=\"gloss\"><strong>$term_link</strong></span>";
if (preg_match_all($gloss, $content, $glossed)) { // Find all glossy sections
$content = preg_replace($gloss, $temp_replace, $content); // Replace glossy sections with temporary placeholder
$content = str_replace($term, $term_link, $content); // Replace non-glossy PCI occurrences
preg_match_all("/$temp_replace/", $content, $temps); // Find all placeholders
$content = str_replace($temps[0], $glossed[0], $content); // Replace placeholders with original values.
}
//echo $content;
// Acronyms wrapped in dollar signs will just be unwrapped:
// So: $AOL$ will become AOL, without the <acronym title="America Online">AOL</acronym>
$content = preg_replace("|[$]<span class=\"gloss\"><strong>$term_link</strong></span>[$]|imsU" , "$term" , $content);
}
$params["content"]=trim($content);
}
}
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
ASKER
Open in new window
where I look to replace PCI with
<span class="gloss"><strong>$ter
which would give me
Open in new window
So that anyything in the <!--glossover-start--> <!--glossover-end--> area doesn't get replaced.
@kaufmed isn't [^glossover\-start] saying any characters except those listed? ie: [^notWantedPhrase]
Please let me know if there is any thing else I can add to clear up the need. thank you.. Cheers -Jeremy