/** * Записывает реферал в базу данных. * @param $referer */ function AuditWriteReferer($referer) { if (trim($referer) != '' && !IsMainHost($referer)) { $referer = SafeEnv(Url($referer), 255, str); $count = 1; System::database()->Select('referers', "`referer`='{$referer}'"); if (System::database()->NumRows() > 0) { $ref = System::database()->FetchRow(); $count = SafeDB($ref['count'], 11, int); $count++; System::database()->Update('referers', "count='{$count}'", "`referer`='{$referer}'"); } else { $values = Values('', $referer, $count); System::database()->Insert('referers', $values); } } }
function UrlRender($url) { static $out = null; if (!isset($out)) { $out = System::config('general/specialoutlinks'); if ($out == 0) { $out = false; } elseif ($out == 1) { $out = true; } elseif ($out == 2 && !System::user()->Auth) { $out = true; } else { $out = false; } } if ($out && !IsMainHost($url)) { return 'index.php?name=plugins&p=out&url=' . urlencode(Url($url)); } else { return 'http://' . Url($url); } }