Jump to content

Link Contatins Keyword - HELP!


ipwnzphp

Recommended Posts

Here is what is going on

 

Another installment from the kitchen...wish I could get outside more! Spring is coming though...much more to come from the cashews-1-lb.html' target='' style='text-decoration:none; border-bottom: 1px dotted; color: red;'>outdoors soon. Enjoy the video and PLEASE SUBSCRIBE!!!

 

Link: store/raw-food/truly-raw-wild-cashews-1-lb.html

 

If they keyword is fount it replaces the keyword with a link. But cashew is one of my keywords so it is trying to link it.

 

Need some help with it. Other then that it works prefect!

 

<?php
function smarty_modifier_autolink( $text ) {
$pull_url = mysql_query("SELECT * FROM `jos_autolinks`");
while ($url = mysql_fetch_array($pull_url)) {
$keyword = $url['phrase'];
$link = $url['link'];
$target = $url['target'];
// modify $text with preg_replace
$new_link = "<a href='$link' target='$target' style='text-decoration:none; border-bottom: 1px dotted; color: red;'>$keyword</a>";
$text = preg_replace("/$keyword/", $new_link, $text);
}
return $text;
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.