<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1029744" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1029744</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/everytime-word-appears-it-needs-be-linked#comment-1173998</link>
    <description> &lt;p&gt;Thanks for the help guys! You made it a lot easier.&lt;/p&gt;
 </description>
     <pubDate>Wed, 29 Jun 2005 22:57:49 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1173998 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/everytime-word-appears-it-needs-be-linked#comment-1173949</link>
    <description> &lt;p&gt;I suggest using regex over str_replace if the haystack contains meta information like HTML tags. Using a comprehensive regular expression, you can avoid accidentally replacing strings in HTML tags that may collide with words in the glossary. Suppose you have the word &quot;block&quot; in the glossary, the identical substring in&lt;br /&gt;
&lt;blockquote&gt; will be affected, if you use str_replace. Of course, if the haystack is pure, then str_replace may be a better choice due to efficiency.&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 29 Jun 2005 05:52:53 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1173949 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/everytime-word-appears-it-needs-be-linked#comment-1173944</link>
    <description> &lt;p&gt;Here my piece...&lt;br /&gt;
get a freeware program that batch replaces any keyword you assign with a new code: (e.g. replace &quot;wake&quot; with &quot;wake&quot;) it replaces all of that word in the code with the new one.. You can even replace a bunch of seperate html or css or whatever file with text...&lt;br /&gt;
You do it only once... And im sure there is this kind of software...&lt;/p&gt;
 </description>
     <pubDate>Wed, 29 Jun 2005 04:39:12 +0000</pubDate>
 <dc:creator>demonhale</dc:creator>
 <guid isPermaLink="false">comment 1173944 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/everytime-word-appears-it-needs-be-linked#comment-1173942</link>
    <description> &lt;p&gt;in php you can do:&lt;/p&gt;
&lt;p&gt;(haystack is all the text that you want to sort through, and the needle is the word you want to replace it with)&lt;br /&gt;
$haystack = &quot;make this needle a link&quot;;&lt;br /&gt;
$haystack = str_replace(&#039;needle&#039;,&#039;&lt;a&gt;needle&lt;/a&gt;&#039;,$haystack);&lt;br /&gt;
(str_replace is case sensitive, if you have php5 you can use str_ireplace, or have multiple str_replaces)&lt;br /&gt;
echo $haystack;&lt;/p&gt;
&lt;p&gt;the other option, preg_replace() is a little more complex, this site: &lt;a href=&quot;http://regexlib.com/Default.aspx&quot; class=&quot;bb-url&quot;&gt;http://regexlib.com/Default.aspx&lt;/a&gt; can teach you a little more what Regular Expressions (RegEx) are.&lt;/p&gt;
 </description>
     <pubDate>Wed, 29 Jun 2005 04:24:25 +0000</pubDate>
 <dc:creator>CptAwesome</dc:creator>
 <guid isPermaLink="false">comment 1173942 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/everytime-word-appears-it-needs-be-linked#comment-1173926</link>
    <description> &lt;p&gt;You&#039;ll want to run a filtering script that replaces, perhaps by regex, the keywords as it reads them off a list (array, database, whatever). This should be fairly simple... loop through the glossary and run a preg_replace on the content string each time, adding &lt;a&gt; tags etc. With this, you have three options:&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;1) Depending on your CMS&#039;s editorial process for adding content, you may want to invoke the script each time something is posted. Maybe this works best for blogs or forums.&lt;/p&gt;
&lt;p&gt;2) If your CMS caches content, then have the script run at every cache alteration. That way viewers will see the hardcoded links whereas the data store will have virgin text.&lt;/p&gt;
&lt;p&gt;3) Probably the worst solution is to run the script to parse all output text every time it&#039;s viewed. If you&#039;re in a controlled network, that could be ok.&lt;/p&gt;
&lt;p&gt;On some sites where I&#039;ve seen this done, I&#039;ve noticed that the &#039;glossary&#039; links load after everything else has rendered. That probably means there&#039;s some Javascript trickery going on as well. It&#039;s basically the third option above, but with the stressful work delegated to JS instead of PHP -- the stressful part is done by the browser, not your server. I guess in this case, PHP simply matches the glossary with the output string and passes an array of relevant words/urls to JS, which does the replacement work.&lt;/p&gt;
&lt;p&gt;Iirc, &lt;a href=&quot;http://drupal.org&quot; class=&quot;bb-url&quot;&gt;Drupal&lt;/a&gt; has a glossary.module or definitions.module or something like that. So I&#039;m sure there must be scripts written already for this. Try pear.php.net, phpclasses.org and hotscripts.com.&lt;/p&gt;
 </description>
     <pubDate>Wed, 29 Jun 2005 00:36:08 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1173926 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
