<?php
/*functions_vbseo_vb.php birinci parça. Devamı gelecek. */
/************************************************************************************
* vBSEO 3.6.0 for vBulletin v3.x & v4.x by Crawlability, Inc.                       *
*                                                                                   *
* Copyright © 2011, Crawlability, Inc. All rights reserved.                         *
* You may not redistribute this file or its derivatives without written permission. *
*                                                                                   *
* Sales Email: sales@crawlability.com                                               *
*                                                                                   *
*----------------------------vBSEO IS NOT FREE SOFTWARE-----------------------------*
* http://www.crawlability.com/vbseo/license/                                        *
************************************************************************************/

function vbseo_process_template($type, $pdata = array())
{
if(VBSEO_VB4)
return vbseo_process_template_vb4($type, $pdata);
else
return vbseo_process_template_vb3($type, $pdata);
}
function vbseo_vbroute_var()
{
global $vbulletin;
return ($vbulletin && $vbulletin->options[&#039;route_requestvar&#039;]) ?
$vbulletin->options[&#039;route_requestvar&#039;]: &#039;r&#039;;
}
function vbseo_vbtemplate_render_any($tpl, $params)
{
global $show, $vbphrase;
if(VBSEO_VB4)
{
$templater = vB_Template::create($tpl);
foreach($params as $pk => $pv)
$templater->register($pk, $pv);
$out = $templater->render();
}else
{
foreach($params as $pk => $pv)
$$pk = $pv;
eval(vbseo_eval_template($tpl, &#039;$out&#039;));
}
return $out;
}
function vbseo_vbtemplate_render($tpl, $params)
{
$navbar = render_navbar_template($navbits);
if(VBSEO_VB4)
{
$templater = vB_Template::create($tpl);
$templater->register_page_templates();
$templater->register(&#039;navbar&#039;, $navbar);
foreach($params as $pk => $pv)
$templater->register($pk, $pv);
$out = $templater->render();
}else
{
foreach($params as $pk => $pv)
$$pk = $pv;
eval(vbseo_eval_template(&#039;navbar&#039;, &#039;$navbar&#039;));
eval(vbseo_eval_template(&#039;USERCP_SHELL&#039;, &#039;$out&#039;));
}
return $out;
}
function vbseo_process_template_vb4($type, $pdata = array())
{
global $vbulletin, $vbphrase;
switch($type)
{
case &#039;forumrules&#039;:
$pingrules = 
"\n<li>&#039; . vB_Template_Runtime::parsePhrase(&#039;vbseo_trackback_is_x&#039;, &#039;misc.&#039;.VBSEO_VB_EXT.&#039;?do=linkbacks#trackbacks&#039;, vB_Template_Runtime::parsePhrase(iif(VBSEO_EXT_TRACKBACK, &#039;on&#039;, &#039;off&#039;))) .&#039;</li>"
."\n<li>&#039; . vB_Template_Runtime::parsePhrase(&#039;vbseo_pingback_is_x&#039;, &#039;misc.&#039;.VBSEO_VB_EXT.&#039;?do=linkbacks#pingbacks&#039;, vB_Template_Runtime::parsePhrase(iif(VBSEO_EXT_PINGBACK, &#039;on&#039;, &#039;off&#039;))) .&#039;</li>"
."\n<li>&#039; . vB_Template_Runtime::parsePhrase(&#039;vbseo_refback_is_x&#039;, &#039;misc.&#039;.VBSEO_VB_EXT.&#039;?do=linkbacks#refbacks&#039;, vB_Template_Runtime::parsePhrase(iif(VBSEO_EXT_REFBACK, &#039;on&#039;, &#039;off&#039;))) .&#039;</li>"
;
vbseo_modify_template(&#039;forumrules&#039;, &#039;#(html_code_is_x.*?</li>)#s&#039;, &#039;$1&#039; . $pingrules, 0, &#039;<!--LINKBACK_POSTRULES-->&#039;);
break;
case &#039;postbit_bookmarks&#039;:
if(($search_for = $pdata[&#039;search_for&#039;]) == &#039;editlink&#039;)
$search_for = &#039;\&#039;; if ($post[\&#039;editlink\&#039;])&#039;;
$pdata[&#039;abm&#039;] = str_replace(&#039;$post[postid]&#039;, &#039;\&#039;.$post[postid].\&#039;&#039;, $pdata[&#039;abm&#039;]);
vbseo_modify_template( $pdata[&#039;tpl&#039;], $search_for,
&#039;<div style="float:\&#039;.vB_Template_Runtime::fetchStylevar("left").\&#039;">&#039; . $pdata[&#039;abm&#039;] . "</div>\n" . $search_for
);
break;
case &#039;postbit_linkback&#039;:
$tplpostbit = vbseo_get_postbit_tpl();
$pingtpl = &#039;".($post[\&#039;linkbacksno\&#039;]?"<a href=\"&#039; . (($_POST[&#039;ajax&#039;] || (THIS_SCRIPT != &#039;showthread&#039;))?&#039;showthread.&#039; . VBSEO_VB_EXT . &#039;?p=$post[postid]&#039;:"") . &#039;#linkbacks\"><img class=\\"inlineimg\\" src=\\"&#039;.vBSEO_Storage::path(&#039;fimages&#039;).&#039;post_linkback.gif\\" alt=\\"".construct_phrase("$vbphrase[vbseo_no_links_to_this_post]",$post[linkbacksno])."\" border=\\"0\\" /></a> ":"")."&#039;;
$pingtpl2 = &#039;<a href=\"&#039; . (($_POST[&#039;ajax&#039;] || (THIS_SCRIPT != &#039;showthread&#039;))?&#039;showthread.&#039; . VBSEO_VB_EXT . &#039;?p=$post[postid]&#039;:&#039;#post$post[postid]&#039;) . &#039;\" title=\"".$vbphrase[\&#039;vbseo_link_to_this_post\&#039;]."\">".$vbphrase[\&#039;vbseo_permalink\&#039;]."</a>&#039;;
if (VBSEO_POSTBIT_PINGBACK == 1)
$pingtpl .= $pingtpl2;
if (vbseo_tpl_search($tplpostbit, &#039;<!--PERMALINK_INFO-->&#039;))
vbseo_modify_template($tplpostbit, &#039;<!--PERMALINK_INFO-->&#039;, $pingtpl);
else
{
if (VBSEO_POSTBIT_PINGBACK == 1)
vbseo_modify_template($tplpostbit, &#039;#(\$show\[\&#039;messageicon\&#039;\] OR \$post\[\&#039;title\&#039;\])(.*?)(<div.*?</div>)#s&#039;,
&#039;$1 OR 1$2<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">
<tr><td>$3</td>
<td><div class=\"smallfont\" style=\"float:right\">&#039; . $pingtpl . &#039;</div></td>
</tr></table>&#039;
);
else
vbseo_modify_template($tplpostbit, &#039;#("\.\(\(\$show\[\&#039;postcount\&#039;\])#s&#039;,
$pingtpl . &#039;$1&#039;
);
if (VBSEO_POSTBIT_PINGBACK == 3)
vbseo_modify_template($tplpostbit, &#039;#("\.\(\(\$show\[\&#039;postcount\&#039;\].*?</a>)#s&#039;,
&#039;$1 (<b>&#039; . $pingtpl2 . &#039;</b>)&#039;
);
}
break;
case &#039;linkback_menu&#039;:
global $vbseo_bookmarks, $show;
$show[&#039;vbseo_bookmarks&#039;] = $vbseo_bookmarks;
$_q = vbseo_fetch_tpl(&#039;vbseo_linkbackmenu_entry&#039;);
vbseo_modify_template(&#039;SHOWTHREAD&#039;, &#039;#(<li[^>]*?threadtools)#i&#039;, $_q.&#039;$1&#039;, 0, &#039;<!--LINKBACK_MENU-->&#039;);
break;
case &#039;misc_linkbacks&#039;:
$navbits = construct_navbits(array(&#039;faq.&#039; . VBSEO_VB_EXT . $vbulletin->session->vars[&#039;sessionurl_q&#039;] => $vbphrase[&#039;faq&#039;],
&#039;&#039; => $vbphrase[&#039;vbseo_linkbacks&#039;]
));
$navbar = render_navbar_template($navbits);
$templater = vB_Template::create(&#039;vbseo_help_linkback&#039;);
$templater->register_page_templates();
$templater->register(&#039;navbar&#039;, $navbar);
print_output($templater->render());
exit;
break;	
case &#039;linkbacks_list&#039;:
if (!vbseo_tpl_search(&#039;SHOWTHREAD&#039;, &#039;[vbseolinkbacks]&#039;))
{
$search_for = $pdata[&#039;showactusers&#039;] ? &#039;; if ($show[\&#039;activeusers\&#039;]&#039; : &#039; . $similarthreads&#039;;
if (!vbseo_tpl_search(&#039;SHOWTHREAD&#039;, $search_for))
$search_for = &#039;<!-- currently active users -->&#039;;
vbseo_modify_template(&#039;SHOWTHREAD&#039;, $search_for, ".\$show[vbseolinkbacks]$search_for");
}
break;
case &#039;notices&#039;:
global $notices;
if($notices)
{
$_js_snr = &#039;#(\$show\\[\&#039;notices\&#039;\\].*?)(<ol.*?\$notices.*?</ol>)#s&#039;;
vbseo_modify_template(&#039;navbar&#039;, $_js_snr, &#039;$1<!--VBSEO_VIRTUAL_HTML-->$2<!--/VBSEO_VIRTUAL_HTML-->&#039;);
}
break;
case &#039;lastpost_col&#039;:                       
vbseo_modify_template(&#039;FORUMHOME&#039;,
&#039;#<span[^>]*forumlastpost.*?</span>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_forumbit_level1_nopost&#039;,
&#039;#<span[^>]*forumlastpost.*?</span>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;FORUMDISPLAY&#039;,
&#039;#<span[^>]*forumlastpost.*?</span>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_forumbit_level2_post&#039;,
&#039;#<div[^>]*forumlastpost td.*?</div>.*?</div>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_forumbit_level1_post&#039;,
&#039;#<div[^>]*forumlastpost td.*?</div>.*?</div>#is&#039;, &#039;&#039;);
break;
case &#039;lastpost_links&#039;:
vbseo_modify_template(&#039;forumhome_lastpostby&#039;,
&#039;#<a href=[^>]*?lastpostid[^>]*?><img[^<]*?</a>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_lastpostby&#039;,
&#039;$memberaction_dropdown&#039;, &#039;$lastpostinfo[\&#039;lastposter\&#039;]&#039;);
$vbphrase[&#039;by_x&#039;] = strip_tags($vbphrase[&#039;by_x&#039;]);
break;
}
}
function vbseo_int_var(&$thevar)
{
if(is_array($thevar))
{
foreach($thevar as $k=>$v)
$thevar[$k] = intval($v);
}else
$thevar = intval($thevar);
}
function vbseo_vb_userinfo($field = &#039;&#039;, $isint = false)
{
global $vbulletin, $bbuserinfo;
if(is_object($vbulletin) && $vbulletin->userinfo && (!$field || isset($vbulletin->userinfo[$field])))
$uid = $field ? $vbulletin->userinfo[$field] : $vbulletin->userinfo;
else
if($bbuserinfo[$field])
$uid = $field ? $bbuserinfo[$field] : $bbuserinfo;
else
$uid = vBSEO_Storage::get(&#039;c&#039;.$field);
return $isint ? intval($uid) : $uid;
}
function vbseo_vb_userid()
{
return vbseo_vb_userinfo(&#039;userid&#039;, true);
}
function vbseo_process_template_vb3($type, $pdata = array())
{
global $vbulletin, $vbphrase;
switch($type)
{
case &#039;forumrules&#039;:
$pingrules = &#039;<div>" . construct_phrase("$vbphrase[vbseo_trackback_is_x]", "misc.".VBSEO_VB_EXT."?do=linkbacks#trackbacks", "&#039; . iif(VBSEO_EXT_TRACKBACK, $vbphrase[&#039;on&#039;], $vbphrase[&#039;off&#039;]) . &#039;") . "</div>
<div>" . construct_phrase("$vbphrase[vbseo_pingback_is_x]", "misc.".VBSEO_VB_EXT."?do=linkbacks#pingbacks", "&#039; . iif(VBSEO_EXT_PINGBACK, $vbphrase[&#039;on&#039;], $vbphrase[&#039;off&#039;]) . &#039;") . "</div>
<div>" . construct_phrase("$vbphrase[vbseo_refback_is_x]", "misc.".VBSEO_VB_EXT."?do=linkbacks#refbacks", "&#039; . iif(VBSEO_IN_REFBACK, $vbphrase[&#039;on&#039;], $vbphrase[&#039;off&#039;]) . &#039;") . "</div>&#039;;
vbseo_modify_template(&#039;forumrules&#039;, &#039;#(html_code_is_x.*?</div>)#s&#039;, &#039;$1&#039; . $pingrules, 0, &#039;<!--LINKBACK_POSTRULES-->&#039;);
break;
case &#039;postbit_bookmarks&#039;:
if(($search_for = $pdata[&#039;search_for&#039;]) == &#039;editlink&#039;)
$search_for = &#039;".(($post[\&#039;editlink\&#039;])&#039;;
vbseo_modify_template( $pdata[&#039;tpl&#039;], $search_for,
&#039;<div style=\\"float:$stylevar[left]\\">&#039; . str_replace(&#039;"&#039;, &#039;\\"&#039;, $pdata[&#039;abm&#039;]). "</div>\n" . $search_for
);
break;
case &#039;postbit_linkback&#039;:
$tplpostbit = vbseo_get_postbit_tpl();
$pingtpl = &#039;".($post[\&#039;linkbacksno\&#039;]?"<a href=\"&#039; . (($_POST[&#039;ajax&#039;] || (THIS_SCRIPT != &#039;showthread&#039;))?&#039;showthread.&#039; . VBSEO_VB_EXT . &#039;?p=$post[postid]&#039;:"") . &#039;#linkbacks\"><img class=\\"inlineimg\\" src=\\"&#039;.vBSEO_Storage::path(&#039;fimages&#039;).&#039;post_linkback.gif\\" alt=\\"".construct_phrase("$vbphrase[vbseo_no_links_to_this_post]",$post[linkbacksno])."\" border=\\"0\\" /></a> ":"")."&#039;;
$pingtpl2 = &#039;<a href=\"&#039; . (($_POST[&#039;ajax&#039;] || (THIS_SCRIPT != &#039;showthread&#039;))?&#039;showthread.&#039; . VBSEO_VB_EXT . &#039;?p=$post[postid]&#039;:&#039;#post$post[postid]&#039;) . &#039;\" title=\"".$vbphrase[\&#039;vbseo_link_to_this_post\&#039;]."\">".$vbphrase[\&#039;vbseo_permalink\&#039;]."</a>&#039;;
if (VBSEO_POSTBIT_PINGBACK == 1)
$pingtpl .= $pingtpl2;
if (vbseo_tpl_search($tplpostbit, &#039;<!--PERMALINK_INFO-->&#039;))
vbseo_modify_template($tplpostbit, &#039;<!--PERMALINK_INFO-->&#039;, $pingtpl);
else
{
if (VBSEO_POSTBIT_PINGBACK == 1)
vbseo_modify_template($tplpostbit, &#039;#(\$show\[\&#039;messageicon\&#039;\] OR \$post\[\&#039;title\&#039;\])(.*?)(<div.*?</div>)#s&#039;,
&#039;$1 OR 1$2<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">
<tr><td>$3</td>
<td><div class=\"smallfont\" style=\"float:right\">&#039; . $pingtpl . &#039;</div></td>
</tr></table>&#039;
);
else
vbseo_modify_template($tplpostbit, &#039;#("\.\(\(\$show\[\&#039;postcount\&#039;\])#s&#039;,
$pingtpl . &#039;$1&#039;
);
if (VBSEO_POSTBIT_PINGBACK == 3)
vbseo_modify_template($tplpostbit, &#039;#("\.\(\(\$show\[\&#039;postcount\&#039;\].*?</a>)#s&#039;,
&#039;$1 (<b>&#039; . $pingtpl2 . &#039;</b>)&#039;
);
}
break;
case &#039;linkback_menu&#039;:
global $vbseo_bookmarks, $vbseo_linkback_menu, $vbseo_linkback_menu_list, $show, $vbseo_linkback_uri, $thread;
eval(&#039;$vbseo_linkback_menu = "&#039; . fetch_template(&#039;vbseo_linkbackmenu_entry&#039;) . &#039;";&#039;);
vbseo_modify_template(&#039;SHOWTHREAD&#039;, &#039;#(<td[^>]*?threadtools)#i&#039;, &#039;\$vbseo_linkback_menu$1&#039;, 0, &#039;<!--LINKBACK_MENU-->&#039;);
eval(&#039;$vbseo_linkback_menu_list = "&#039; . fetch_template(&#039;vbseo_linkbackmenu&#039;) . &#039;";&#039;);
if (!vbseo_tpl_search(&#039;SHOWTHREAD&#039;, &#039;$vbseo_linkback_menu_list&#039;))
vbseo_modify_template(&#039;SHOWTHREAD&#039;, &#039;#(</body>)#is&#039;, &#039;\$vbseo_linkback_menu_list&#039;.&#039;$1&#039;);
break;
case &#039;misc_linkbacks&#039;:
global $navbits, $headinclude, $header, $footer;
$navbits = construct_navbits(array(&#039;faq.&#039; . VBSEO_VB_EXT . $vbulletin->session->vars[&#039;sessionurl_q&#039;] => $vbphrase[&#039;faq&#039;],
&#039;&#039; => $vbphrase[&#039;vbseo_linkbacks&#039;]
));
@extract($GLOBALS);
eval(&#039;$navbar = "&#039; . vbseo_fetch_tpl(&#039;navbar&#039;) . &#039;";&#039;);
eval(&#039;print_output("&#039; . vbseo_fetch_tpl(&#039;vbseo_help_linkback&#039;) . &#039;");&#039;);
exit;
break;	
case &#039;linkbacks_list&#039;:
if (!vbseo_tpl_search(&#039;SHOWTHREAD&#039;, &#039;$vbseolinkbacks&#039;))
{
$search_for = $pdata[&#039;showactusers&#039;] ? &#039;".(($show[\&#039;activeusers\&#039;]&#039; : &#039;$similarthreads&#039;;
if (!vbseo_tpl_search(&#039;SHOWTHREAD&#039;, $search_for))
$search_for = &#039;<!-- currently active users -->&#039;;
vbseo_modify_template(&#039;SHOWTHREAD&#039;, $search_for, "\$show[vbseolinkbacks]\n$search_for");
}
break;
case &#039;notices&#039;:
global $notices;
if($notices)
{
$_js_snr = &#039;#(\$show\[\&#039;notices\&#039;\].*?)(<table.*?\$notices.*?</table>)#s&#039;;
vbseo_modify_template(&#039;navbar&#039;, $_js_snr, &#039;$1<!--VBSEO_VIRTUAL_HTML-->$2<!--/VBSEO_VIRTUAL_HTML-->&#039;);
}
break;
case &#039;lastpost_col&#039;:
vbseo_modify_template(&#039;FORUMHOME&#039;,
&#039;#<td[^<]+?vbphrase\[last_post\]</td>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_forumbit_level1_nopost&#039;,
&#039;#<td[^<]+?vbphrase\[last_post\].*?</td>#is&#039;, &#039;&#039;);  
vbseo_modify_template(&#039;FORUMDISPLAY&#039;,
&#039;#<td[^<]+?(<span[^<]+?)?(<a[^<]+?)?vbphrase\[last_post\].*?</td>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_forumbit_level2_post&#039;,
&#039;#<td[^<]+?forum\[lastpostinfo\].*?</td>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_forumbit_level1_post&#039;,
&#039;#<td[^<]+?forum\[lastpostinfo\].*?</td>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;threadbit&#039;,
&#039;#\(\(\$show\[\&#039;threadmoved\&#039;.*?/td>\s*"\)\)\.#is&#039;, &#039;&#039;);
break;
case &#039;lastpost_links&#039;:
vbseo_modify_template(&#039;threadbit&#039;,
&#039;#<a href=[^>]*?->[^>]*?->[^>]*?lastpostid.*?</a>#is&#039;, &#039;&#039;);
vbseo_modify_template(&#039;forumhome_lastpostby&#039;,
&#039;#<a href=[^>]*?->[^>]*?->[^>]*?lastpostid.*?</a>#is&#039;, &#039;&#039;);
$vbphrase[&#039;by_x&#039;] = strip_tags($vbphrase[&#039;by_x&#039;]);
break;
}
}
function vbseo_fetch_tpl($tplname)
{
return
(class_exists(&#039;vB_Template&#039;) && method_exists(vB_Template, &#039;fetch_template_raw&#039;)) ? 
vB_Template::fetch_template_raw($tplname) : 
fetch_template($tplname);
}
function vbseo_eval_template($tpl, $varname, $append = false)
{
$tplcode = vbseo_fetch_tpl($tpl);
$enclose = VBSEO_VB4 ? "&#039;" : &#039;"&#039;;
$tplcode = &#039;$final_rendered = &#039; . $enclose . $tplcode . $enclose .&#039;;&#039;;
if(!VBSEO_VB4 && strstr($tpl, &#039;vbseo&#039;))
{
while(strstr($tplcode, &#039;<vb:each&#039;))
{
if($xn++>5)break;
$tplcode = preg_replace(
&#039;#^(.*)<vb:each from=\\\\"(.*?)\\\\" key=\\\\"(.*?)\\\\" value=\\\\"(.*?)\\\\">(.*?)</vb:each>#is&#039;,
&#039;
\\$_tfe&#039;.$xn.&#039; = "";
if(is_array(\\$$2))
foreach(\\$$2 as \\$$3=>\\$$4){
\\$_tfe&#039;.$xn.&#039; .= "$5";
}; $1 \\$_tfe&#039;.$xn,
$tplcode);
}
}
if($varname)
$tplcode .= $varname . ($append ? &#039;.&#039; : &#039;&#039;) . &#039;=$final_rendered;&#039;;
return $tplcode;
}
function vbseo_modify_template34($tplname, $searchfor, $replacewith, $show = false, $strsearch = &#039;&#039;)
{
if(VBSEO_VB4)
{
$replacewith = str_replace("&#039;", "\\&#039;", $replacewith);
$replacewith = preg_replace(&#039;#\$stylevar\[(.*?)\]#&#039;, "&#039;.vB_Template_Runtime::fetchStylevar(\"$1\").&#039;", $replacewith);
$replacewith = preg_replace(&#039;#(\$[\w\_]+?\[.*?\])#m&#039;, "&#039;.$1.&#039;", $replacewith);
$searchfor = preg_replace(&#039;#(\\\\\$[\w\_]+?\\\\\[)(.*?)(\\\\\])#m&#039;, "\&#039; \. $1&#039;$2&#039;$3 \. \&#039;", $searchfor);
}else
{
$replacewith = str_replace(&#039;"&#039;, &#039;\\"&#039;, $replacewith);
}
return vbseo_modify_template($tplname, $searchfor, $replacewith, $show, $strsearch);
}
function vbseo_modify_template($tplname, $searchfor, $replacewith, $show = false, $strsearch = &#039;&#039;)
{
global $vbulletin;
$_thistpl = $_thistpl1 = &#039;&#039;;    
if (vbseo_tpl_exists($tplname))
{
$_thistpl = & $vbulletin->templatecache[$tplname];
$_thistpl1 = $_thistpl;
if($strsearch && strstr($_thistpl, $strsearch))
{
$_thistpl = str_replace($strsearch, 
preg_replace(&#039;#^[\s\-]+#&#039;, &#039;&#039;, preg_replace(&#039;#\$\d+#&#039;, &#039;&#039;, $replacewith)), $_thistpl);
}else
if($searchfor[0] == &#039;#&#039;)
{
$_thistpl = preg_replace($searchfor, $replacewith, $_thistpl);
}else
$_thistpl = str_replace($searchfor, $replacewith, $_thistpl);
}
if ($show)
echo $vbulletin->templatecache[$tplname];
return $_thistpl != $_thistpl1;
}
function vbseo_cache_templates()
{
global $globaltemplates, $bootstrap;
$tlikes = 0;
$gtpointer = array();
if($_REQUEST[&#039;ajax&#039;])
{
if(THIS_SCRIPT == &#039;blog_post&#039;)
$gtpointer[] = &#039;blog_comment&#039;;
if(THIS_SCRIPT == &#039;group&#039;)
$gtpointer[] = &#039;socialgroups_message&#039;;
if(THIS_SCRIPT == &#039;album&#039;)
$gtpointer[] = &#039;picturecomment_message&#039;;
if(THIS_SCRIPT == &#039;visitormessage&#039;)
$gtpointer[] = &#039;memberinfo_visitormessage&#039;;
if($_REQUEST[&#039;do&#039;] == &#039;vbseoui&#039;)
$tlikes = 3;
}
if(THIS_SCRIPT == &#039;picturecomment&#039;)
$gtpointer[] = &#039;picturecomment_message&#039;;
if (in_array(THIS_SCRIPT, array(&#039;entry&#039;, &#039;blog&#039;)) && $_REQUEST[&#039;do&#039;] == &#039;blog&#039;)
{
$gtpointer[] = &#039;vbseo_blog_bmarkentry&#039;;
$gtpointer[] = &#039;vbseo_blog_bmarksection&#039;;
if(VBSEO_LIKE_BLOG)
$tlikes = 1;	
}
if((THIS_SCRIPT==&#039;vbcms&#039;) && defined(&#039;VB_ENTRY&#039;))
{
if(VBSEO_LIKE_CMS)
$tlikes = 1;	
}
if (THIS_SCRIPT == &#039;moderation&#039;)
{
$gtpointer[] = &#039;vbseo_linkbacks&#039;;
$gtpointer[] = &#039;vbseo_linkbackbit&#039;;
}
if (THIS_SCRIPT == &#039;showthread&#039;)
{
if(VBSEO_IN_PINGBACK || VBSEO_IN_TRACKBACK || VBSEO_IN_REFBACK || VBSEO_BOOKMARK_THREAD)
{
$gtpointer[] = &#039;vbseo_linkbacks&#039;;
$gtpointer[] = &#039;vbseo_linkbackbit&#039;;
$gtpointer[] = &#039;vbseo_linkbackmenu&#039;;
$gtpointer[] = &#039;vbseo_linkbackmenu_entry&#039;;
}
$tlikes = 3;	
}
if (THIS_SCRIPT == &#039;index&#039;)
if(VBSEO_LIKE_POST)
{                        
$gtpointer[] = &#039;vbseo_likes_widget&#039;;
}
if (THIS_SCRIPT == &#039;member&#039;)
{
$tlikes = 2;	
}
if ((THIS_SCRIPT == &#039;misc&#039;) && ($_REQUEST[&#039;do&#039;] == &#039;pingtrackback&#039;))
vbseo_safe_redirect(&#039;misc.&#039; . VBSEO_VB_EXT . &#039;?do=linkbacks&#039;, array(&#039;do&#039;));
if ((THIS_SCRIPT == &#039;misc&#039;) && ($_REQUEST[&#039;do&#039;] == &#039;linkbacks&#039;))
{
$gtpointer[] = &#039;vbseo_help_linkback&#039;;
}
if($tlikes && VBSEO_LIKE_POST)
{
vbseo_extra_inc(&#039;ui&#039;);
$gtpointer[] = &#039;vbseo_likeshare&#039;;
$gtpointer[] = &#039;vbseo_ui_headinc&#039;;
if($tlikes == 3)
{
$gtpointer[] = &#039;vbseo_like_tree&#039;;
}
if($tlikes == 2)
{
$gtpointer[] = &#039;vbseo_profile_menu&#039;;
$gtpointer[] = &#039;vbseo_likes_list_container&#039;;
$gtpointer[] = &#039;vbseo_likebit&#039;;
}
}
if(VBSEO_VB4 && $bootstrap)
{
$bootstrap->cache_templates = array_merge($bootstrap->cache_templates, $gtpointer);
}
else
if(is_array($globaltemplates))
$globaltemplates = array_merge($globaltemplates, $gtpointer);
}
function vbseo_content_type($cinfo)
{
if($cinfo[&#039;albumid&#039;])
return &#039;album&#039;;
else
if($cinfo[&#039;groupid&#039;])
return &#039;group&#039;;
else
if(VBSEO_VB4)
{
if(class_exists(&#039;vB_Types&#039;) && $cinfo[&#039;contenttypeid&#039;])
{
$types = vB_Types::instance();
if($cinfo[&#039;contenttypeid&#039;] == $types->getContentTypeID(&#039;vBForum_Album&#039;))
return &#039;album&#039;;
else
if($cinfo[&#039;contenttypeid&#039;] == $types->getContentTypeID(&#039;vBForum_SocialGroup&#039;))
return &#039;group&#039;;
else
if($cinfo[&#039;contenttypeid&#039;] == $types->getContentTypeID(&#039;vBBlog_BlogEntry&#039;))
return &#039;blog&#039;;
else
if($cinfo[&#039;contenttypeid&#039;] == $types->getContentTypeID(&#039;vBCms_Section&#039;))
return &#039;cms_section&#039;;
else
if($cinfo[&#039;contenttypeid&#039;] == $types->getContentTypeID(&#039;vBCms_Article&#039;))
return &#039;cms_article&#039;;
else
return &#039;forum&#039;;
}else
if(!$cinfo[&#039;contenttypeid&#039;] || $cinfo[&#039;contenttypeid&#039;]<3)
return &#039;forum&#039;;
}
}
function vbseo_attachment_contentid($attinfo)
{
if($attinfo[&#039;albumid&#039;])
return $attinfo[&#039;albumid&#039;];
else
if($attinfo[&#039;groupid&#039;])
return $attinfo[&#039;groupid&#039;];
else
return $attinfo[&#039;contentid&#039;];
}

Add a code snippet to your website: www.paste.org