0) {
$pos = strpos($target, $search[$i], $pos);
$matches++;
}
if (strlen($search[$i])<1) {
$matches++;
}
}
if ($matches == count($search)) {
return true;
} else {
return false;
}
}
////////////////////////////////////
//findStr("search","in this");
////////////////////////////////////
function autolink( &$text, $target='_blank', $nofollow=true )
{
$urls = _autolink_find_URLS( $text );
if( !empty($urls) ) // i.e. there were some URLS found in the text
{
array_walk( $urls, '_autolink_create_html_tags', array('target'=>$target, 'nofollow'=>$nofollow) );
$text = strtr( $text, $urls );
}
}
function _autolink_find_URLS( $text )
{
$scheme = '(http:\/\/|https:\/\/)';
$www = 'www\.';
$ip = '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
$subdomain = '[-a-z0-9_]+\.';
$name = '[a-z][-a-z0-9]+\.';
$tld = '[a-z]+(\.[a-z]{2,2})?';
$the_rest = '\/?[a-z0-9._\/~#&=;%+?-]+[a-z0-9\/#=?]{1,1}';
$pattern = "$scheme?(?(1)($ip|($subdomain)?$name$tld)|($www$name$tld))$the_rest";
$pattern = '/'.$pattern.'/is';
$c = preg_match_all( $pattern, $text, $m );
unset( $text, $scheme, $www, $ip, $subdomain, $name, $tld, $the_rest, $pattern );
if( $c )
{
return( array_flip($m[0]) );
}
return( array() );
}
function _autolink_create_html_tags( &$value, $key, $other=null )
{
$target = $nofollow = null;
if( is_array($other) )
{
$target = ( $other['target'] ? " target=\"$other[target]\"" : null );
$nofollow = ( $other['nofollow'] ? ' rel="nofollow"' : null );
}
$value = "$key";
}
function rand_pass() {
$array = array(
"ap","dus","tin","rog","sti","rev","pik","sty","lev","qot","rel","vid",
"kro","xo","pro","wia","axi","jer","foh","mu","ya","zol","gu","pli","cra",
"den","bi","sat","ry","qui","wip","fla","gro","tav","peh","gil","lot",
"kal","zan","noc","bat","tev","lun","pal","hom","cun","wos","vox"
);
$num_letters = 8;
$uppercased = 3;
mt_srand ((double)microtime()*1000000);
for($i=0; $i<$num_letters; $i++)
$pass .= $array[mt_rand(0, (count($array) - 1))];
for($i=1; $i[@$pl[username]] ";
} elseif ($pl[position] == Moderator) {
$ton = "$ton [%$pl[username]] ";
} else {
$ton = "$ton [$pl[username]] ";
}
}elseif($span >= $seconds&&$checkwhen=="off"){
$charpsel = mysql_fetch_array(mysql_query("select * from characters where id=$pl[activechar] and owner=$pl[id]"));
$ton = "$ton [$pl[username]] ";
}
}
return $ton;
}
function getFileExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}
function getcontestnumber() {
$contest = mysql_fetch_array(mysql_query("select * from contest_contest where active=1 limit 1"));
if(!$contest[id]){ $contest[id]="none"; }
return $contest[id];
}
function getvotenumber() {
$contest = mysql_fetch_array(mysql_query("select * from contest_contest where vote=1 limit 1"));
if(!$contest[id]){ $contest[id]="none"; }
return $contest[id];
}
function getwinnumber() {
$contest = mysql_fetch_array(mysql_query("select * from contest_contest where end=1 limit 1"));
if(!$contest[id]){ $contest[id]="none"; }
return $contest[id];
}