1 ? lang('core', 'page', array('page' => $data['page'])) : '';
}
$replaces[] = $data[$var] ? strip_tags($data[$var]) : '';
}
if($titletext) {
$seotitle = helper_seo::strreplace_strip_split($searchs, $replaces, $titletext);
}
if($descriptiontext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
$seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
}
if($keywordstext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
$seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
}
}
return array($seotitle, $seodescription, $seokeywords);
}
public static function strreplace_strip_split($searchs, $replaces, $str) {
$searchspace = array('((\s*\-\s*)+)', '((\s*\,\s*)+)', '((\s*\|\s*)+)', '((\s*\t\s*)+)', '((\s*_\s*)+)');
$replacespace = array('-', ',', '|', ' ', '_');
return trim(preg_replace($searchspace, $replacespace, str_replace($searchs, $replaces, $str)), ' ,-|_');
}
public static function get_title_page($navtitle, $page){
if($page > 1) {
$navtitle .= ' - '.lang('core', 'page', array('page' => $page));
}
return $navtitle;
}
public static function get_related_link($extent) {
global $_G;
loadcache('relatedlink');
$allextent = array('article' => 0, 'forum' => 1, 'group' => 2, 'blog' => 3);
$links = array();
if($_G['cache']['relatedlink'] && isset($allextent[$extent])) {
foreach($_G['cache']['relatedlink'] as $link) {
$link['extent'] = sprintf('%04b', $link['extent']);
if($link['extent'][$allextent[$extent]] && $link['name'] && $link['url']) {
$links[] = daddslashes($link);
}
}
}
rsort($links);
return $links;
}
public static function parse_related_link($content, $extent) {
global $_G;
loadcache('relatedlink');
$allextent = array('article' => 0, 'forum' => 1, 'group' => 2, 'blog' => 3);
if($_G['cache']['relatedlink'] && isset($allextent[$extent])) {
$searcharray = $replacearray = array();
foreach($_G['cache']['relatedlink'] as $link) {
$link['extent'] = sprintf('%04b', $link['extent']);
if($link['extent'][$allextent[$extent]] && $link['name'] && $link['url']) {
$searcharray[$link[name]] = '/('.preg_quote($link['name']).')/i';
$replacearray[$link[name]] = "$link[name]";
}
}
if($searcharray && $replacearray) {
$_G['trunsform_tmp'] = array();
$content = preg_replace_callback("/(