Esempio n. 1
0
    }
    $EventsID[$EventDay] = $EventID;
    ++$is;
}
sql_free_result($result);
$bdquery = sql_pre_query("SELECT * FROM \"" . $Settings['sqltable'] . "members\" WHERE \"BirthMonth\"=%i", array($MyMonth));
$bdresult = sql_query($bdquery, $SQLStat);
$bdnum = sql_num_rows($bdresult);
$bdi = 0;
while ($bdi < $bdnum) {
    $UserNamebd = sql_result($bdresult, $bdi, "Name");
    $BirthDay = sql_result($bdresult, $bdi, "BirthDay");
    $BirthMonth = sql_result($bdresult, $bdi, "BirthMonth");
    $BirthYear = sql_result($bdresult, $bdi, "BirthYear");
    $oldusername = $UserNamebd;
    $UserNamebd1 = pre_substr($UserNamebd, 0, 20);
    if (pre_strlen($UserNamebd) > 20) {
        $UserNamebd1 = $UserNamebd1 . "...";
    }
    $UserNamebd = $UserNamebd1;
    if (!isset($EventsName[$BirthDay])) {
        $EventsName[$BirthDay] = null;
    }
    if ($EventsName[$BirthDay] != null) {
        $EventsName[$BirthDay] .= ", <span title=\"" . $oldusername . "'s birthday.\">" . $UserNamebd1 . "</span>";
    }
    if ($EventsName[$BirthDay] == null) {
        $EventsName[$BirthDay] = "<span title=\"" . $oldusername . "'s birthday.\">" . $UserNamebd1 . "</span>";
    }
    ++$bdi;
}
Esempio n. 2
0
     }
     $UsersName1 = $PreUsersName1['Name'];
     $UsersHidden1 = $PreUsersName1['Hidden'];
 }
 $NumPages = null;
 $NumRPosts = $NumReply + 1;
 if (!isset($Settings['max_posts'])) {
     $Settings['max_posts'] = 10;
 }
 if ($NumRPosts > $Settings['max_posts']) {
     $NumPages = ceil($NumRPosts / $Settings['max_posts']);
 }
 if ($NumRPosts <= $Settings['max_posts']) {
     $NumPages = 1;
 }
 $Users_Name1 = pre_substr($UsersName1, 0, 20);
 if ($UsersName1 == "Guest") {
     $UsersName1 = $GuestsName1;
     if ($UsersName1 == null) {
         $UsersName1 = "Guest";
     }
 }
 if (pre_strlen($UsersName1) > 20) {
     $Users_Name1 = $Users_Name1 . "...";
     $oldusername = $UsersName1;
     $UsersName1 = $Users_Name1;
 }
 $lul = null;
 if ($TimeStamp1 != null) {
     $lul = null;
     if ($UsersID1 > 0 && $UsersHidden1 == "no") {
Esempio n. 3
0
function pre_substr($string, $start, $length)
{
    global $chkcharset;
    if ($chkcharset == "UTF-8") {
        if (!defined('UTF8_NOMBSTRING') && function_exists('mb_substr')) {
            return mb_substr($string, $start, $length, 'utf-8');
        } else {
            return utf8_substr($string, $start, $length);
        }
    }
    if ($chkcharset != "UTF-8") {
        return substr($string, $start, $length);
    }
}
if (isset($_GET['text'])) {
    echo pre_substr($_GET['text'], 0, 6);
}
// author: Scott Michael Reynen "*****@*****.**"
// url: http://www.randomchaos.com/document.php?source=php_and_unicode
function utf8_strpos($haystack, $needle, $offset = 0)
{
    if (!defined('UTF8_NOMBSTRING') && function_exists('mb_strpos')) {
        return mb_strpos($haystack, $needle, $offset, 'utf-8');
    }
    $haystack = utf8_to_unicode($haystack);
    $needle = utf8_to_unicode($needle);
    $position = $offset;
    $found = false;
    while (!$found && $position < count($haystack)) {
        if ($needle[0] == $haystack[$position]) {
            for ($i = 1; $i < count($needle); $i++) {