Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Durango Posted July 5, 2015 Posted July 5, 2015 HiI would like to replace in the whole forum a special word by a link like replace keword1 by <a href="url">keyword1</a>how can i do that ?Tx a lot for your help !
chilihead Posted July 5, 2015 Posted July 5, 2015 I wonder if the bad word filter would do that for you. Use it to add the link instead of changing the word. So replace with the code.
Durango Posted July 5, 2015 Author Posted July 5, 2015 Hi Chilihead Tx ! I added a filter But it didnt replace the word in the topic Should i wait a bit for IPB to look around the topics and replace the word ?
chilihead Posted July 5, 2015 Posted July 5, 2015 I believe that would affect new posts only to have it affect old you'd have to ask how, not sure. First make sure it works works with new.
Durango Posted July 5, 2015 Author Posted July 5, 2015 Hey ok i just tested, it seems it doesnt affect old posts or maybe it will take time to affect them ? Also for a new post, it works ! but the problem is that it doesnt take into account the html l replaced keword1 by <a href="url">keyword1</a> but instead of showing keyword1 it shows raw html : <a href="url">keyword1</a> How to make it work ? Tx a lot
chilihead Posted July 5, 2015 Posted July 5, 2015 BBcode still parses. Or allow html. Rebuilding post data may do it for old posts not sure, ask IPS.
Durango Posted July 6, 2015 Author Posted July 6, 2015 Hey I tried, but it doesnt work, it wouldnt parse the filter words (maybe because the same word appear again in the replacement url) on our previous forum, we used this : require .'include/strings.php'; global $searchReplaceword; foreach($searchReplaceword as $search => $replace) { $cur_post['message'] = str_replace($search,$replace,$cur_post['message']); } and then on the file strings.php : <?php $searchReplaceword = array( " word1 " => " <a href='http://www.url.com/go/word1' target='_blank' rel='nofollow'>word1</a> ", " word2 " => " <a href='http://www.url.com/go/word2' target='_blank' rel='nofollow'>word2</a> " would be great to use this on IPB !
Recommended Posts
Archived
This topic is now archived and is closed to further replies.