wraggster
01-06-2014, 03:07 PM
I found a thread over at Vbulletin.com (http://www.vbulletin.com/forum/forum/vbulletin-4/vbulletin-4-questions-problems-and-troubleshooting/412135-query-to-mass-edit-spam-posts) which seems to be something that im looking for basically i want to change all the links in posts on my forum to a new url, replacement variable manager does work mostly but because i grab feeds from our news forums the news forums dont take the replaced variables with it. so on the thread linked above, theres this snippet of code which was used to make a plugin
if($thread['postuserid'] == '1') {
$find = array(
'________'
);
$replace = array(
''
);
$this->post['message'] = str_replace($find, $replace, $this->post['message']);
}
could this code be changed so that i can replace on any thread and instead of replacing _____, could i use it to replace www.oldurl.com with www.newurl.com ?
Is this doable?
--------------- Added 1389025772 at 1389025772 ---------------
so would this work
if($thread['postuserid'] == '1') {
$find = array(
'www.oldurl.com'
);
$replace = array(
'www.newurl.com'
);
$this->post['message'] = str_replace($find, $replace, $this->post['message']);
}
Still unsure how to make it effect all threads
if($thread['postuserid'] == '1') {
$find = array(
'________'
);
$replace = array(
''
);
$this->post['message'] = str_replace($find, $replace, $this->post['message']);
}
could this code be changed so that i can replace on any thread and instead of replacing _____, could i use it to replace www.oldurl.com with www.newurl.com ?
Is this doable?
--------------- Added 1389025772 at 1389025772 ---------------
so would this work
if($thread['postuserid'] == '1') {
$find = array(
'www.oldurl.com'
);
$replace = array(
'www.newurl.com'
);
$this->post['message'] = str_replace($find, $replace, $this->post['message']);
}
Still unsure how to make it effect all threads