$v) unset($al_ar2[$k]); } if (count($al_arar)) { foreach($al_arar as $k=>$v) unset($al_arar[$k]); } if (count($al_mpp)) { foreach($al_mpp as $k=>$v) unset($al_mpp[$k]); } if (count($al_okgroups)) { foreach($al_okgroups as $k=>$v) unset($al_okgroups[$k]); } if (count($al_oklinks)) { foreach($al_oklinks as $k=>$v) unset($al_oklinks[$k]); } if (count($al_okid)) { foreach($al_okid as $k=>$v) unset($al_okid[$k]); } $vbulletin->input->clean_array_gpc('r', array( 'forumid' => TYPE_INT )); $al_forumid = intval($vbulletin->GPC['forumid']); $al_userid = $vbulletin->userinfo['userid']; if ($al_userid == "") $al_userid = "0"; if ($al_forumid == "") $al_forumid = "999999"; $r0 = $db->query_read("SELECT alvalue FROM " . TABLE_PREFIX . "autolinker_settings WHERE alkey='active'"); $ar0 = $db->fetch_array($r0); $al_isactive = $ar0['alvalue']; if ($al_isactive !="isactive") return 1; $r0 = $db->query_read("SELECT alvalue FROM " . TABLE_PREFIX . "autolinker_settings WHERE alkey='maxperpost'"); $ar0 = $db->fetch_array($r0); $al_mpp = $ar0['alvalue']; $al_groups = $vbulletin->userinfo['membergroupids'] . "," . $vbulletin->userinfo['usergroupid']; $al_groups = trim($al_groups,","); if ($al_groups == "") $al_groups="0"; $r1 = $db->query_read("SELECT linkid FROM " . TABLE_PREFIX . "autolinker_linkgroups WHERE groupid IN ($al_groups)"); while ($ar1 = $db->fetch_array($r1)) { $ar_oklinks[$ar1['linkid']] = 1; } if (count($ar_oklinks) == 0) return 1; if ($al_userid == "") { $ar_oklinks[] = "0";} $r1 = $db->query_read("SELECT linkid FROM " . TABLE_PREFIX . "autolinker_linkforums WHERE forumid=\"$al_forumid\""); while ($ar1 = $db->fetch_array($r1)) { if ($ar_oklinks[$ar1['linkid']]) { $ar_okgroups[] = $ar1['linkid']; } } $al_okid = @implode($ar_okgroups,","); $copyright ="

AutoLinks by http://www.autolinker.com"; if ($al_okid == "") return; $r2 = $db->query_read("SELECT linkid,keyword FROM " . TABLE_PREFIX . "autolinker_keyword2link"); while ($arx = $db->fetch_array($r2)) { $link2key[$arx['linkid']]['keyword'][] = $arx['keyword']; } $r1 = $db->query_read("SELECT *, " . TABLE_PREFIX . "autolinker_links.id FROM " . TABLE_PREFIX . "autolinker_links, " . TABLE_PREFIX . "autolinker_templates WHERE " . TABLE_PREFIX . "autolinker_links.permid IN ($al_okid) AND " . TABLE_PREFIX . "autolinker_templates.id=tid"); while ($ar = $db->fetch_array($r1)) { $al_arar[] = $ar; $al_ar2[$ar['id']][] = $link2key[$ar['id']]['keyword']; } } global $told; $told = microtime(get_as_float); function autolinker_filter($foo) { pete("Start"); global $vbulletin, $db, $al_forumid, $al_userid, $al_isactive, $al_okid, $ar_oklinks, $ar_okgroups, $al_mpp, $al_arar, $al_ar2, $copyright; if ($al_isactive !="isactive") return $foo; if (count($ar_oklinks) == 0) return $foo; if (count($ar_okgroups) == 0) return $foo; # if ($al_isactive != 1) continue; $al_mpp_t = $al_mpp; $countp = 0; $count = 0; $counttotal = 0; foreach ($al_arar as $ar) { $content = $ar['content']; $content = str_replace("\r", "", $content); $content = str_replace("\n", "
", $content); $content = str_replace("'", "\\'",$content); $content = str_replace("\"", "'",$content); $content = str_replace("<", "<", $content); $content = str_replace(">", ">", $content); if ($ar['follow'] == 1) { $fol = "FOLLOWMOUSE, '1'"; } else {$fol = "FOLLOWMOUSE, 0";} if ($ar['shadow'] == 0) $ar['shadow'] = ""; if ($ar['titl'] == "") { $closebtn = 'false';} else {$closebtn = "true";} if ($ar['balloon'] == 1) { $bpath = 'autolinker/images/balloons/';} if ($ar['balloon'] == 2) { $bpath = 'autolinker/images/rounded/';} if ($ar['balloon'] == 3) { $bpath = 'autolinker/images/rounded-footer/';} if ($ar['showcross'] == "") { $ar['showcross'] = 0;} if ($ar['balloon'] == 0) { $js = "Tip('" . $content . "', BGCOLOR, '" . $ar['bgcolor'] . "', BORDERCOLOR, '" . $ar['bordercolor'] . "', BORDERWIDTH, '" . $ar['borderwidth'] . "', WIDTH, '-" . $ar['padding'] . "', TITLE, '" . $ar['titl'] . "', SHADOW, '" . $ar['shadow'] . "'," . $fol . ", OPACITY, '" . $ar['opacity'] . "', FADEIN, '" . $ar['fadein'] . "', FADEOUT, '" . $ar['fadeout'] . "', CLICKCLOSE, true," . "FOLLOWSCROLL, true,CLOSEBTN, $closebtn, PADDING, 0, SWIPE, '" . $ar['swipe'] . "')"; } else { $js = "Tip('" . $content . "', BGCOLOR, '" . $ar['bgcolor'] . "', BORDERCOLOR, '" . $ar['bordercolor'] . "', BORDERWIDTH, '" . $ar['borderwidth'] . "'," . $fol . ", OFFSETX, -10, OPACITY, '" . $ar['opacity'] . "', FADEIN, '" . $ar['fadein'] . "', FADEOUT, '" . $ar['fadeout'] . "', CLICKCLOSE, true," . "FOLLOWSCROLL, true, PADDING, 0, BALLOON, " . $ar['balloon'] . " ,ABOVE, false, TITLE1, '" . $ar['titl'] . "',LINKURL, '" . $ar['url'] . "', SHOWCLOSE, " . $ar['showcross'] . ", BALLOONIMGPATH , '" . $bpath . $ar['ballooncolor'] . "')"; } if ($ar['sticky'] == 0) { $omo = "onmouseout='UnTip()'"; } else { $omo = ""; } if ($ar['mouseover'] == "popup") { $om = "onmouseover"; } else { $om = "onclick";} if ($forumid == "999999") { $align = "align=\"absmiddle\"";} else {$align = "";} if ($ar['image'] > 0) { $img = "icon"; } else { $img = "";} if ($ar['href'] == "link") { $hrt = $ar['url']; } else { $hrt = "javascript:;"; } if ($ar['nofollow'] == 1) { $nofollow = "rel=\"nofollow\""; } else { $nofollow = "";} $countkw = 0; foreach ($al_ar2[$ar['id']] as $ar2) { foreach ($ar2 as $ar3) { $kw = trim($ar3); $count++; $cp = 0; if (stripos($foo, $kw) !== false) { if (($counttotal < $al_mpp_t)||($al_mpp_t == 0)) { if ($ar['max'] == 0) { $foo = preg_replace("/\b(?= 0) { $foo = preg_replace("/\b(? 0) { $seen[$count] = $cp; $js .= "; microAjax('autolinker/autolinker_stats.php?uid=" . $al_userid . "&fid=" . $al_forumid . "&t=v&kw=" . $kw . "', function (res) {;});"; if ($ar['href'] == "link") { $jslink = "onclick=\"microAjax('autolinker/autolinker_stats.php?uid=" . $al_userid . "&fid=" . $al_forumid . "&t=c&kw=" . $kw . "', function (res) {;});\""; } else { $jslink = ""; } $tmplink = "" . $kw . "" . $img . ""; $bits[$count] = $tmplink; $words[$count] = $kw; } $countp += $cp; $counttotal += $cp; $countkw += $cp; } } } if (1==1 ) { foreach ($seen as $x => $y) { # for ($x = 1; $x <= $count; $x++) { $foo = preg_replace("/(\]*?)%ALHOLDER" . $x . "%(.*?\<\/a)/", "$1" . $words[$x] . "$2" , $foo); $foo = preg_replace("/(\.*?)%ALHOLDER" . $x . "%(.*?\<\/a\>.*?)/", "$1" . $words[$x] . "$2" , $foo); $foo = preg_replace("/(\]*?)%ALHOLDER" . $x . "%(.*?\>)/", "$1" . $words[$x] . "$2" , $foo); $foo = preg_replace("/(\<[^>]*?)%ALHOLDER" . $x . "%(.*?\>)/", "$1" . $words[$x] . "$2" , $foo); # $foo = preg_replace("/%ALHOLDER" . $x . "%/", $bits[$x], $foo); $foo = str_replace("%ALHOLDER" . $x . "%", $bits[$x], $foo); } } pete("End"); return $foo; } function pete($x) { if ($_SERVER['REMOTE_ADDR'] == "82.11.19.16") { global $told; # print (microtime(get_as_float) - $told) * 1000 . " - $x
\n"; } } function pete1($x) { if ($_SERVER['REMOTE_ADDR'] == "82.11.19.16") { # print_R($x); } }