eliminate dup identical hashtags in posts
This commit is contained in:
parent
193435e980
commit
efb9157490
1 changed files with 7 additions and 3 deletions
10
mod/item.php
10
mod/item.php
|
@ -398,9 +398,13 @@ function item_post(&$a) {
|
||||||
continue;
|
continue;
|
||||||
$basetag = str_replace('_',' ',substr($tag,1));
|
$basetag = str_replace('_',' ',substr($tag,1));
|
||||||
$body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
|
$body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
|
||||||
if(strlen($str_tags))
|
|
||||||
$str_tags .= ',';
|
$newtag = '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
|
||||||
$str_tags .= '#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
|
if(! stristr($str_tags,$newtag)) {
|
||||||
|
if(strlen($str_tags))
|
||||||
|
$str_tags .= ',';
|
||||||
|
$str_tags .= $newtag;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(strpos($tag,'@') === 0) {
|
if(strpos($tag,'@') === 0) {
|
||||||
|
|
Loading…
Reference in a new issue