Sorry for bumped old thread...
I try to make replace url`s from our own clowd into image with this url.
Then I use hook
postbit_display_complete with this code:
PHP Code:
$cloudurl = "/" .substr("\[url\]http:\/\/wedframe\.ru\/downloads\.php\?do=file&id=\d*&act=down\[\/url\]", 0). "/";
$testcloudurl = preg_match($cloudurl, $this->post['message'], $matchecloudurl);
$iconicurl = "[URL=\"" .substr($matchecloudurl[0], 5, -6). "\"][img]https://vborg.vbsupport.ru/external/2015/04/16.png[/img][/URL]";
$this->post['message'] = str_ireplace($matchecloudurl[0], $iconicurl, $this->post['message']);
its wont work. Because of url tag`s, I think?..
If I use hook
postdata_presave with slightly changed code:
PHP Code:
$cloudurl = "/" .substr("\[url\]http:\/\/wedframe\.ru\/downloads\.php\?do=file&id=\d*&act=down\[\/url\]", 0). "/";
$testcloudurl = preg_match($cloudurl, $this->post['pagetext'], $matchecloudurl);
$iconicurl = "[URL=\"" .substr($matchecloudurl[0], 5, -6). "\"][img]https://vborg.vbsupport.ru/external/2015/04/16.png[/img][/URL]";
$this->post['pagetext'] = str_ireplace($matchecloudurl[0], $iconicurl, $this->post['pagetext']);
replacing work correctly... but I have a problem with moderated posts. With enabled this module, approved posts saved with cleared itself content.
So... I`m not deeper coder of vB, and I hope somebody help me with correct code for my module.
Thanks anyway!