public static function get_seosetting($page, $data = array(), $defset = array()) { global $_G; $searchs = array('{bbname}'); $replaces = array($_G['setting']['bbname']); $seotitle = $seodescription = $seokeywords = ''; $titletext = $defset['seotitle'] ? $defset['seotitle'] : $_G['setting']['seotitle'][$page]; $descriptiontext = $defset['seodescription'] ? $defset['seodescription'] : $_G['setting']['seodescription'][$page]; $keywordstext = $defset['seokeywords'] ? $defset['seokeywords'] : $_G['setting']['seokeywords'][$page]; preg_match_all("/\\{([a-z0-9_-]+?)\\}/", $titletext . $descriptiontext . $keywordstext, $pageparams); if ($pageparams) { foreach ($pageparams[1] as $var) { $searchs[] = '{' . $var . '}'; if ($var == 'page') { $data['page'] = $data['page'] > 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 && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) { $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext); } if ($keywordstext && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) { $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext); } } return array($seotitle, $seodescription, $seokeywords); }
} } $endrows = $curtype['forumcolumns'] > 1 ? str_repeat('<td width="' . $curtype['forumcolwidth'] . '"></td>', $curtype['forumcolumns'] - count($list) % $curtype['forumcolumns']) : ''; $groupviewed_list = get_viewedgroup(); if (empty($sgid) && empty($gid)) { foreach ($first as $key => $val) { if (is_array($val['secondlist']) && !empty($val['secondlist'])) { $first[$key]['secondlist'] = array_slice($val['secondlist'], 0, 8); } } } if (!$navtitle || !empty($sgid) || !empty($gid)) { if (!$navtitle) { $navtitle = !empty($gid) ? $nav['first']['name'] : (!empty($sgid) ? $nav['second']['name'] : ''); } $navtitle = (!empty($sgid) || !empty($gid) ? helper_seo::get_title_page($navtitle, $_G['page']) . ' - ' : '') . $_G['setting']['navs'][3]['navname']; $nobbname = false; } else { $nobbname = true; } if (!$metakeywords) { $metakeywords = $_G['setting']['navs'][3]['navname']; } if (!$metadescription) { $metadescription = $_G['setting']['navs'][3]['navname']; } if (empty($curtype)) { include template('diy:group/index'); } else { if (empty($sgid)) { include template('diy:group/type:' . $gid);
$clicks[$key] = $value; } $clickuserlist = array(); foreach (C::t('home_clickuser')->fetch_all_by_id_idtype($id, $idtype, 0, 24) as $value) { $value['clickname'] = $clicks[$value['clickid']]['name']; $clickuserlist[] = $value; } $article['timestamp'] = $article['dateline']; $article['dateline'] = dgmdate($article['dateline']); foreach ($cat['ups'] as $val) { $cats[] = $val['catname']; } $seodata = array('firstcat' => $cats[0], 'secondcat' => $cats[1], 'curcat' => $cat['catname'], 'subject' => $article['title'], 'user' => $article['username'], 'summary' => $article['summary'], 'page' => intval($_GET['page'])); list($navtitle, $metadescription, $metakeywords) = get_seosetting('article', $seodata); if (empty($navtitle)) { $navtitle = helper_seo::get_title_page($article['title'], $_G['page']) . ' - ' . $cat['catname']; $nobbname = false; } else { $nobbname = true; } if (empty($metakeywords)) { $metakeywords = $article['title']; } if (empty($metadescription)) { $metadescription = $article['summary'] ? $article['summary'] : $article['title']; } list($seccodecheck, $secqaacheck) = seccheck('publish'); $catid = $article['catid']; if (!$_G['setting']['relatedlinkstatus']) { $_G['relatedlinks'] = get_related_link('article'); } else {
} $postlist[$post['pid']] = $post; } } unset($hotpostarr); $seodata = array('forum' => $_G['forum']['name'], 'fup' => $_G['cache']['forums'][$fup]['name'], 'subject' => $_G['forum_thread']['subject'], 'summary' => $summary, 'tags' => @implode(',', $tagnames), 'page' => intval($_GET['page'])); if ($_G['forum']['status'] != 3) { $seotype = 'viewthread'; } else { $seotype = 'viewthread_group'; $seodata['first'] = $nav['first']['name']; $seodata['second'] = $nav['second']['name']; } list($navtitle, $metadescription, $metakeywords) = get_seosetting($seotype, $seodata); if (!$navtitle) { $navtitle = helper_seo::get_title_page($_G['forum_thread']['subject'], $_G['page']) . ' - ' . strip_tags($_G['forum']['name']); $nobbname = false; } else { $nobbname = true; } if (!$metakeywords) { $metakeywords = strip_tags($thread['subject']); } if (!$metadescription) { $metadescription = $summary . ' ' . strip_tags($_G['forum_thread']['subject']); } $_G['allblocked'] = true; $postno =& $_G['cache']['custominfo']['postno']; $postnostick = str_replace(array('<sup>', '</sup>'), '', $postno[0]); if ($postusers) { $member_verify = $member_field_forum = $member_status = $member_count = $member_profile = $member_field_home = array();
} else { $navtitle = lang('core', 'title_friend_blog'); } } else { if ($_GET['order'] == 'hot') { $navtitle = lang('core', 'title_recommend_blog'); } else { $navtitle = lang('core', 'title_newest_blog'); } } if ($space['username']) { $navtitle = lang('space', 'sb_blog', array('who' => $space['username'])); } $metakeywords = $navtitle; $metadescription = $navtitle; $navtitle = helper_seo::get_title_page($navtitle, $_G['page']); space_merge($space, 'field_home'); include_once template("diy:home/space_blog_list"); } function blog_get_stick($uid, $stickblogs, $summarylen) { $list = array_flip($stickblogs); if ($stickblogs) { $data_blog = C::t('home_blog')->fetch_all($stickblogs); $data_blogfield = C::t('home_blogfield')->fetch_all($stickblogs); foreach ($data_blog as $curblogid => $value) { $value = array_merge($value, (array) $data_blogfield[$curblogid]); $value['message'] = getstr($value['message'], $summarylen, 0, 0, 0, -1); $value['message'] = preg_replace("/&[a-z]+\\;/i", '', $value['message']); if ($value['pic']) { $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
} $groupcache = getgroupcache($_G['fid'], array('replies', 'views', 'digest', 'lastpost', 'ranking', 'activityuser', 'newuserlist'), 604800); $_G['forum']['icon'] = get_groupimg($_G['forum']['icon'], 'icon'); $_G['forum']['banner'] = get_groupimg($_G['forum']['banner']); $_G['forum']['dateline'] = dgmdate($_G['forum']['dateline'], 'd'); $_G['forum']['posts'] = intval($_G['forum']['posts']); $_G['grouptypeid'] = $_G['forum']['fup']; $groupuser = C::t('forum_groupuser')->fetch_userinfo($_G['uid'], $_G['fid']); $onlinemember = grouponline($_G['fid'], 1); $groupmanagers = $_G['forum']['moderators']; $nav = get_groupnav($_G['forum']); $groupnav = $nav['nav']; $seodata = array('forum' => $_G['forum']['name'], 'first' => $nav['first']['name'], 'second' => $nav['second']['name'], 'gdes' => $_G['forum']['description']); list($navtitle, $metadescription, $metakeywords) = get_seosetting('grouppage', $seodata); if (!$navtitle) { $navtitle = helper_seo::get_title_page($_G['forum']['name'], $_G['page']) . ' - ' . $_G['setting']['navs'][3]['navname']; $nobbname = false; } else { $nobbname = true; } if (!$metakeywords) { $metakeywords = $_G['forum']['name']; } if (!$metadescription) { $metadescription = $_G['forum']['name']; } $_G['seokeywords'] = $_G['setting']['seokeywords']['group']; $_G['seodescription'] = $_G['setting']['seodescription']['group']; } if (in_array($action, array('out', 'viewmember', 'manage', 'index', 'memberlist'))) { $status = groupperm($_G['forum'], $_G['uid'], $action, $groupuser);
function parse_related_link($content, $extent) { return helper_seo::parse_related_link($content, $extent); }
$_G['forum']['dateline'] = dgmdate($_G['forum']['dateline'], 'd'); $nav = get_groupnav($_G['forum']); $groupnav = $nav['nav']; $onlinemember = grouponline($_G['fid']); $groupmanagers = $_G['forum']['moderators']; $groupcache = getgroupcache($_G['fid'], array('replies', 'views', 'digest', 'lastpost', 'ranking', 'activityuser', 'newuserlist')); $seotype = 'grouppage'; $seodata['first'] = $nav['first']['name']; $seodata['second'] = $nav['second']['name']; $seodata['gdes'] = $_G['forum']['description']; $forumseoset = array(); } $_G['forum']['banner'] = get_forumimg($_G['forum']['banner']); list($navtitle, $metadescription, $metakeywords) = get_seosetting($seotype, $seodata, $forumseoset); if (!$navtitle) { $navtitle = helper_seo::get_title_page($_G['forum']['name'], $_G['page']); $nobbname = false; } else { $nobbname = true; } $_GET['typeid'] = intval($_GET['typeid']); if (!empty($_GET['typeid']) && !empty($_G['forum']['threadtypes']['types'][$_GET['typeid']])) { $navtitle = strip_tags($_G['forum']['threadtypes']['types'][$_GET['typeid']]) . ' - ' . $navtitle; } if (!$metakeywords) { $metakeywords = $_G['forum']['name']; } if (!$metadescription) { $metadescription = $_G['forum']['name']; } if ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm']) && !$_G['forum']['allowview']) {
} $page = max(1, intval($_GET['page'])); foreach ($cat['ups'] as $val) { $cats[] = $val['catname']; } $bodycss = array($cat['topid'] => 'pg_list_' . $cat['topid']); if ($cat['upid']) { $bodycss[$cat['upid']] = 'pg_list_' . $cat['upid']; } $bodycss[$cat['catid']] = 'pg_list_' . $cat['catid']; $cat['bodycss'] = implode(' ', $bodycss); $catseoset = array('seotitle' => $cat['seotitle'], 'seokeywords' => $cat['keyword'], 'seodescription' => $cat['description']); $seodata = array('firstcat' => $cats[0], 'secondcat' => $cats[1], 'curcat' => $cat['catname'], 'page' => intval($_GET['page'])); list($navtitle, $metadescription, $metakeywords) = get_seosetting('articlelist', $seodata, $catseoset); if (!$navtitle) { $navtitle = helper_seo::get_title_page($cat['catname'], $_G['page']); $nobbname = false; } else { $nobbname = true; } if (!$metakeywords) { $metakeywords = $cat['catname']; } if (!$metadescription) { $metadescription = $cat['catname']; } if (isset($_G['makehtml'])) { helper_makehtml::portal_list($cat); } $file = 'portal/list:' . $catid; $tpldirectory = '';
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]] = "<a href=\"{$link['url']}\" target=\"_blank\" class=\"relatedlink\">{$link['name']}</a>"; } } if ($searcharray && $replacearray) { $_G['trunsform_tmp'] = array(); $content = preg_replace_callback("/(<script\\s+.*?>.*?<\\/script>)|(<a\\s+.*?>.*?<\\/a>)|(<img\\s+.*?[\\/]?>)|(\\[attach\\](\\d+)\\[\\/attach\\])/is", function ($matches) { return helper_seo::base64_transform('encode', '<relatedlink>', $matches[1] . $matches[2] . $matches[3] . $matches[4], '</relatedlink>'); }, $content); $content = preg_replace($searcharray, $replacearray, $content, 1); $content = preg_replace_callback("/<relatedlink>(.*?)<\\/relatedlink>/is", function ($matches) { return helper_seo::base64_transform('decode', '', $matches[1], ''); }, $content); } } return $content; }
public static function getSeoSetting($page, $data = array(), $defset = array()) { global $_G; $searchs = array('{bbname}'); $replaces = array($_G['setting']['bbname']); $setting = array(); $seoConfigs = array('seotitle', 'seokeywords', 'seodescription'); foreach ($seoConfigs as $key) { $config = Appbyme::getAppbymeConfig($key); $setting[$key] = unserialize($config['cvalue']); } $_G['setting'] = array_merge($_G['setting'], $setting); $seotitle = $seodescription = $seokeywords = ''; $titletext = $defset['seotitle'] ? $defset['seotitle'] : $_G['setting']['seotitle'][$page]; $descriptiontext = $defset['seodescription'] ? $defset['seodescription'] : $_G['setting']['seodescription'][$page]; $keywordstext = $defset['seokeywords'] ? $defset['seokeywords'] : $_G['setting']['seokeywords'][$page]; preg_match_all("/\\{([a-z0-9_-]+?)\\}/", $titletext . $descriptiontext . $keywordstext, $pageparams); if ($pageparams) { foreach ($pageparams[1] as $var) { $searchs[] = '{' . $var . '}'; if ($var == 'page') { $data['page'] = $data['page'] > 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); }