Ejemplo n.º 1
0
     }
 }
 if (array_empty($boards)) {
     $boards = $slog->getBoards();
 }
 $sql_where = $slog->sqlinboards('r.board', 1, $boards) . " ";
 if (count($used) > 0) {
     $sql_where .= "({$sql_where_like}) ";
 }
 if (empty($rname) == false) {
     if (count($used) > 0) {
         $sql_where .= "AND ";
     }
     $sql_where .= "r.name = '{$rname}' ";
 }
 if (strxlen($name) >= $config['searchminlength']) {
     $used[] = $name;
 } else {
     $ignored[] = $name;
 }
 $having = '';
 $temp = $gpc->get('temp', int);
 $temp2 = $gpc->get('temp2', int);
 if ($temp > 0 && $temp < 366) {
     $sql_where .= "AND t.last ";
     if ($temp2 == 1) {
         $sql_where .= '<=';
     } else {
         $sql_where .= '>=';
     }
     $timestamp = time() - 60 * 60 * 24 * $temp;
Ejemplo n.º 2
0
 function highlight($text)
 {
     if (isset($this->profile['highlight']) && count($this->profile['highlight']) > 0) {
         $class = $this->profile['highlight_class'];
         foreach ($this->profile['highlight'] as $token) {
             if (strxlen($token) > 2) {
                 $text = str_replace('\\"', '"', substr(preg_replace('#(\\>(((?>([^><]+|(?R)))*)\\<))#se', "preg_replace('#\\b(" . $token . ")\\b#i', '<span class=\"" . $class . "\">\\\\1</span>', '\\0')", '>' . $text . '<'), 1, -1));
             }
         }
     }
     return $text;
 }
Ejemplo n.º 3
0
         $result = $db->query("SELECT id, answer FROM {$db->pre}vote WHERE tid = '{$info['id']}' ORDER BY id", __LINE__, __FILE__);
         while ($row = $db->fetch_assoc($result)) {
             $data['answer'][$row['id']] = $row['answer'];
             $data['original'][$row['id']] = $row['answer'];
         }
         $data[0] = '';
     }
     $i = 0;
     echo $tpl->parse("menu");
     echo $tpl->parse("admin/topic/vote_edit");
 } elseif ($action == "vote_edit2") {
     $error = array();
     if (strxlen($_POST['question']) > $config['maxtitlelength']) {
         $error[] = $lang->phrase('question_too_long');
     }
     if (strxlen($_POST['question']) < $config['mintitlelength']) {
         $error[] = $lang->phrase('question_too_short');
     }
     if (count_filled($_POST['notice']) < 2) {
         $error[] = $lang->phrase('min_replies_vote');
     }
     if (count_filled($_POST['notice']) > 50) {
         $error[] = $lang->phrase('max_replies_vote');
     }
     if (count($error) > 0) {
         $data = array('question' => $_POST['question'], 'answer' => $_POST['notice']);
         $fid = save_error_data($data);
         error($error, 'managetopic.php?action=vote_edit&amp;id=' . $_GET['id'] . "&amp;fid=" . $fid . SID2URL_x);
     } else {
         $db->query("UPDATE {$db->pre}topics SET vquestion = '{$_POST['question']}' WHERE id = '{$_GET['id']}' LIMIT 1", __LINE__, __FILE__);
         $result = $db->query("SELECT id, answer FROM {$db->pre}vote WHERE tid = '{$info['id']}' ORDER BY id", __LINE__, __FILE__);
Ejemplo n.º 4
0
 if (double_udata('mail', $_POST['email']) == false) {
     $error[] = $lang->phrase('email_already_used');
 }
 if (strxlen($_POST['name']) > $config['maxnamelength']) {
     $error[] = $lang->phrase('name_too_long');
 }
 if (strxlen($_POST['name']) < $config['minnamelength']) {
     $error[] = $lang->phrase('name_too_short');
 }
 if (strxlen($_POST['pw']) > $config['maxpwlength']) {
     $error[] = $lang->phrase('pw_too_long');
 }
 if (strxlen($_POST['pw']) < $config['minpwlength']) {
     $error[] = $lang->phrase('pw_too_short');
 }
 if (strxlen($_POST['email']) > 200) {
     $error[] = $lang->phrase('email_too_long');
 }
 if (check_mail($_POST['email']) == false) {
     $error[] = $lang->phrase('illegal_mail');
 }
 if ($_POST['pw'] != $_POST['pwx']) {
     $error[] = $lang->phrase('pw_comparison_failed');
 }
 // Custom profile fields
 $upquery = array();
 $query = $db->query("SELECT * FROM {$db->pre}profilefields WHERE editable != '0' AND required = '1' ORDER BY disporder");
 while ($profilefield = $db->fetch_assoc($query)) {
     $profilefield['type'] = $gpc->prepare($profilefield['type']);
     $thing = explode("\n", $profilefield['type'], 2);
     $type = $thing[0];
Ejemplo n.º 5
0
    $bbcode->setReplace($config['wordstatus']);
    if ($topic['status'] == 2) {
        $row['comment'] = $bbcode->ReplaceTextOnce($row['comment'], 'moved');
    }
    $text = $bbcode->parse($row['comment'], 'plain');
    if (!empty($my->notice)) {
        $notes = explode('[VSEP]', $my->notice);
        if (!is_array($notes)) {
            $notes = array($notes);
        }
    } else {
        $notes = array();
    }
    $setnotice = $lang->get_text('notice');
    $notes[] = str_replace('[VSEP]', '&#91;VSEP&#93;', $setnotice);
    if (strxlen(implode('', $notes)) > $config['maxnoticelength']) {
        error($lang->phrase('notices_too_long'));
    }
    $db->query("UPDATE {$db->pre}user SET notice = '" . implode('[VSEP]', $notes) . "' WHERE id = '" . $my->id . "'", __LINE__, __FILE__);
    ok($lang->phrase('text_to_notice_success'));
} else {
    $breadcrumb->ResetUrl();
    echo $tpl->parse("header");
    echo $tpl->parse("menu");
    echo $tpl->parse("editprofile/index");
    $mymodules->load('editprofile_index_bottom');
}
$slog->updatelogged();
$zeitmessung = t2();
echo $tpl->parse("footer");
$phpdoc->Out();
Ejemplo n.º 6
0
} elseif ($_GET['action'] == "profile2") {
    $_POST['hp'] = trim($_POST['hp']);
    if (strtolower(substr($_POST['hp'], 0, 4)) == 'www.') {
        $_POST['hp'] = "http://{$_POST['hp']}";
    }
    $error = array();
    if (check_mail($_POST['email']) == false) {
        $error[] = $lang->phrase('illegal_mail');
    }
    if ($my->mail != $_POST['email'] && double_udata('mail', $_POST['email']) == false) {
        $error[] = $lang->phrase('email_already_used');
    }
    if ($config['changename_allowed'] == 1 && strxlen($_POST['name']) > $config['maxnamelength']) {
        $error[] = $lang->phrase('name_too_long');
    }
    if ($config['changename_allowed'] == 1 && strxlen($_POST['name']) < $config['minnamelength']) {
        $error[] = $lang->phrase('name_too_short');
    }
    if ($config['changename_allowed'] == 1 && strtolower($my->name) != strtolower($_POST['name']) && double_udata('name', $_POST['name']) == false) {
        $error[] = $lang->phrase('username_registered');
    }
    if (strlen($_POST['email']) > 200) {
        $error[] = $lang->phrase('email_too_long');
    }
    if (strlen($_POST['hp']) > 255) {
        $error[] = $lang->phrase('editprofile_homepage_too_long');
    }
    if (!check_hp($_POST['hp'])) {
        $_POST['hp'] = '';
    }
    if (strlen($_POST['location']) > 50) {
Ejemplo n.º 7
0
     $pnameid = $my->id;
     $pid = $my->id;
 }
 if (flood_protect() == FALSE) {
     $error[] = $lang->phrase('flood_control');
 }
 if (strxlen($_POST['comment']) > $config['maxpostlength']) {
     $error[] = $lang->phrase('comment_too_long');
 }
 if (strxlen($_POST['comment']) < $config['minpostlength']) {
     $error[] = $lang->phrase('comment_too_short');
 }
 if (strxlen($_POST['topic']) > $config['maxtitlelength']) {
     $error[] = $lang->phrase('title_too_long');
 }
 if (strxlen($_POST['topic']) < $config['mintitlelength']) {
     $error[] = $lang->phrase('title_too_short');
 }
 ($code = $plugins->load('addreply_save_errorhandling')) ? eval($code) : null;
 BBProfile($bbcode);
 $_POST['topic'] = $bbcode->parseTitle($_POST['topic']);
 if (count($error) > 0 || !empty($_POST['Preview'])) {
     $data = array('topic' => $_POST['topic'], 'comment' => $_POST['comment'], 'dosmileys' => $_POST['dosmileys'], 'dowords' => $_POST['dowords'], 'id' => $_POST['id'], 'digest' => $digest, 'guest' => 0, 'human' => $human);
     if (!$my->vlogin) {
         if ($config['guest_email_optional'] == 0 && empty($_POST['email'])) {
             $data['email'] = '';
         } else {
             $data['email'] = $_POST['email'];
         }
         $data['guest'] = 1;
         $data['name'] = $_POST['name'];
Ejemplo n.º 8
0
 if ($im == true) {
     $colspan++;
 }
 $_GET['order'] = strtolower($_GET['order']);
 if ($_GET['order'] != 'desc') {
     $_GET['order'] = 'asc';
 }
 $_GET['sort'] = strtolower($_GET['sort']);
 if ($_GET['sort'] != 'hp' && $_GET['sort'] != 'online' && $_GET['sort'] != 'posts' && $_GET['sort'] != 'regdate' && $_GET['sort'] != 'location' && $_GET['sort'] != 'gender' && $_GET['sort'] != 'birthday' && $_GET['sort'] != 'lastvisit') {
     $sqlorderby = "name {$_GET['order']}";
 } else {
     $sqlorderby = "{$_GET['sort']} {$_GET['order']}, name {$_GET['order']}";
 }
 $sqlwhere = array();
 $_GET['letter'] = $gpc->get('letter', db_esc);
 if (strxlen($_GET['letter']) == 1) {
     if ($_GET['letter'] == '#') {
         $sqlwhere[] = "LEFT(name, 1) REGEXP '^[^" . implode('', $available) . "]'";
     } else {
         $sqlwhere[] = "LEFT(name, 1) = '{$_GET['letter']}'";
     }
 }
 if ($config['mlist_showinactive'] == 0) {
     $sqlwhere[] = "confirm = '11'";
 }
 $groups = array();
 $g = $gpc->get('g', arr_int);
 if ($config['mlist_filtergroups'] > 0) {
     $group_cache = $scache->load('groups');
     $statusdata = $group_cache->status();
     foreach ($statusdata as $id => $row) {
function editprofile_customsave($editable, $uid)
{
    global $db, $lang, $gpc;
    $error = array();
    $upquery = array();
    $query = $db->query("SELECT * FROM {$db->pre}profilefields WHERE editable = '{$editable}' ORDER BY disporder");
    while ($profilefield = $db->fetch_assoc($query)) {
        $thing = explode("\n", $profilefield['type'], 2);
        $type = $thing[0];
        $field = "fid{$profilefield['fid']}";
        $value = $gpc->get($field, none);
        if ($profilefield['required'] == 1 && (empty($value) || is_array($value) && count($value) == 0)) {
            $error[] = $lang->phrase('error_missingrequiredfield');
        }
        if ($profilefield['maxlength'] > 0 && (is_string($value) && strxlen($value) > $profilefield['maxlength'] || is_array($value) && count($value) > $profilefield['maxlength'])) {
            $error[] = $lang->phrase('error_customfieldtoolong');
        }
        if (($type == "multiselect" || $type == "checkbox") && is_array($value)) {
            if (is_array($value)) {
                $options = implode("\n", $value);
            } else {
                $options = '';
            }
        } else {
            $options = $value;
        }
        $upquery[$field] = $gpc->save_str($options);
    }
    if (count($error) == 0 && count($upquery) > 0) {
        $query = $db->query("SELECT * FROM {$db->pre}userfields WHERE ufid='{$uid}'");
        if ($db->num_rows($query) == 0) {
            $fields = $db->list_fields("{$db->pre}userfields");
            $sqldata = array();
            foreach ($fields as $field) {
                if (isset($upquery[$field])) {
                    $sqldata[$field] = "'{$upquery[$field]}'";
                } else {
                    $sqldata[$field] = "''";
                }
            }
            $sqldata['ufid'] = "'{$uid}'";
            $fields = implode(', ', $fields);
            $sqldata = implode(', ', $sqldata);
            $db->query("INSERT INTO {$db->pre}userfields ({$fields}) VALUES ({$sqldata})", __LINE__, __FILE__);
        } else {
            $sqldata = array();
            foreach ($upquery as $field => $value) {
                $sqldata[] = "{$field} = '{$value}'";
            }
            $sqldata = implode(', ', $sqldata);
            $db->query("UPDATE {$db->pre}userfields SET {$sqldata} WHERE ufid = '{$uid}' LIMIT 1", __LINE__, __FILE__);
        }
    }
    return $error;
}
Ejemplo n.º 10
0
	if (double_udata('name',$_POST['name']) == false) {
		$error[] = $lang->phrase('username_registered');
	}
	if (double_udata('mail',$_POST['email']) == false) {
		$error[] = $lang->phrase('email_already_used');
	}
	if (strxlen($_POST['name']) > $config['maxnamelength']) {
		$error[] = $lang->phrase('name_too_long');
	}
	if (strxlen($_POST['name']) < $config['minnamelength']) {
		$error[] = $lang->phrase('name_too_short');
	}
	if (strxlen($_POST['pw']) > $config['maxpwlength']) {
		$error[] = $lang->phrase('pw_too_long');
	}
	if (strxlen($_POST['pw']) < $config['minpwlength']) {
		$error[] = $lang->phrase('pw_too_short');
	}
	if (strlen($_POST['email']) > 200) {
		$error[] = $lang->phrase('email_too_long');
	}
	if (check_mail($_POST['email']) == false) {
		$error[] = $lang->phrase('illegal_mail');
	}
	if ($_POST['pw'] != $_POST['pwx']) {
		$error[] = $lang->phrase('pw_comparison_failed');
	}
	// Custom profile fields
	$custom = addprofile_customprepare();
	$error = array_merge($error, $custom['error']);
Ejemplo n.º 11
0
 function highlight($text)
 {
     if (isset($this->profile['highlight']) && count($this->profile['highlight']) > 0) {
         $class = htmlspecialchars($this->profile['highlight_class'], ENT_QUOTES);
         foreach ($this->profile['highlight'] as $token) {
             if (strxlen($token) > 2) {
                 $token = preg_quote($token, '#');
                 $text = str_replace('\\"', '"', substr(preg_replace('#(\\>(((?>([^><]+|(?R)))*)\\<))#se', "preg_replace('#\\b({$token})\\b#i', '<span class=\"{$class}\">\\\\1</span>', '\\0')", ">{$text}<"), 1, -1));
             }
         }
     }
     return $text;
 }
function editprofile_customsave($editable, $uid)
{
    global $db, $lang, $gpc;
    $error = array();
    $upquery = array();
    $query = $db->query("SELECT * FROM {$db->pre}profilefields WHERE editable = '{$editable}' ORDER BY disporder");
    while ($profilefield = $db->fetch_assoc($query)) {
        $profilefield['type'] = $gpc->prepare($profilefield['type']);
        $thing = explode("\n", $profilefield['type'], 2);
        $type = $thing[0];
        $field = "fid{$profilefield['fid']}";
        $value = $gpc->get($field, none);
        if ($profilefield['required'] == 1 && (is_string($value) && strlen($value) == 0 || is_array($value) && count($value) == 0)) {
            $error[] = $lang->phrase('error_missingrequiredfield');
        }
        if ($profilefield['maxlength'] > 0 && (is_string($value) && strxlen($value) > $profilefield['maxlength'] || is_array($value) && count($value) > $profilefield['maxlength'])) {
            $error[] = $lang->phrase('error_customfieldtoolong');
        }
        if (($type == "multiselect" || $type == "checkbox") && is_array($value)) {
            if (is_array($value)) {
                $options = implode("\n", $value);
            } else {
                $options = '';
            }
        } else {
            $options = $value;
        }
        $options = $gpc->save_str($options);
        $upquery[] = "`{$field}` = '{$options}'";
    }
    if (count($error) == 0 && count($upquery) > 0) {
        $query = $db->query("SELECT * FROM {$db->pre}userfields WHERE ufid='{$uid}'");
        if ($db->num_rows($query) == 0) {
            $db->query("INSERT INTO {$db->pre}userfields (ufid) VALUES ('{$uid}')");
        }
        $db->query("UPDATE {$db->pre}userfields SET " . implode(', ', $upquery) . " WHERE ufid = '{$uid}' LIMIT 1");
    }
    return $error;
}
Ejemplo n.º 13
0
 if ($_POST['pw'] != $_POST['pwx']) {
     $error[] = $lang->phrase('pw_comparison_failed');
 }
 // Custom profile fields
 $upquery = array();
 $query = $db->query("SELECT * FROM {$db->pre}profilefields WHERE editable != '0' AND required = '1' ORDER BY disporder");
 while ($profilefield = $db->fetch_assoc($query)) {
     $profilefield['type'] = $gpc->prepare($profilefield['type']);
     $thing = explode("\n", $profilefield['type'], 2);
     $type = $thing[0];
     $field = "fid{$profilefield['fid']}";
     $value = $gpc->get($field, none);
     if ($profilefield['required'] == 1 && (empty($value) || is_array($value) && count($value) == 0)) {
         $error[] = $lang->phrase('error_missingrequiredfield');
     }
     if ($profilefield['maxlength'] > 0 && (is_string($value) && strxlen($value) > $profilefield['maxlength'] || is_array($value) && count($value) > $profilefield['maxlength'])) {
         $error[] = $lang->phrase('error_customfieldtoolong');
     }
     if ($type == "multiselect" || $type == "checkbox") {
         if (is_array($value)) {
             $options = implode("\n", $value);
         } else {
             $options = '';
         }
     } else {
         $options = $value;
     }
     $options = $gpc->save_str($options);
     $upquery[] = "`{$field}` = '{$options}'";
 }
 ($code = $plugins->load('register_save_errorhandling')) ? eval($code) : null;
Ejemplo n.º 14
0
 function cb_table($text, $tag)
 {
     $length = array();
     $lines = explode("\n", $text);
     $char = chr(7);
     foreach ($lines as $line) {
         if (empty($line)) {
             continue;
         }
         $i = 0;
         $td = explode("\t", $line);
         foreach ($td as $cell) {
             $cell = strip_tags($cell);
             $tab_pos = strxlen($cell);
             $min = $tab_pos / 4 - floor($tab_pos / 4);
             $tab = (1 - $min) * 4;
             if ($tab < 1) {
                 $tab = 4;
             }
             $line = strlen($cell) + $tab;
             if (!isset($result[$i]) || $line > $result[$i]) {
                 $result[$i] = $line;
             }
             $i++;
         }
     }
     $table = array();
     foreach ($lines as $line) {
         if (empty($line)) {
             continue;
         }
         $i = 0;
         $td = explode("\t", $line);
         $line = '';
         foreach ($td as $cell) {
             $spaces = $result[$i];
             $length = strxlen(strip_tags($cell));
             $min = $spaces - $length;
             $tab = str_repeat($char, $min);
             $line .= $cell . $tab;
             $i++;
         }
         $table[] = $line;
     }
     $text = str_replace($char, '&nbsp;', implode("\n", $table));
     return "<{$tag} class=\"bb_table\">{$text}</{$tag}>";
 }
function BoardSelect($board = 0)
{
    global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins, $slog;
    $found = false;
    $sub_cache = $forum_cache = $last_cache = $forums = $cat = array();
    $categories_obj = $scache->load('categories');
    $cat_cache = $categories_obj->get();
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $index_moderators = $scache->load('index_moderators');
    $mod_cache = $index_moderators->get();
    $prefix_obj = $scache->load('prefix');
    $prefix = $prefix_obj->get();
    ($code = $plugins->load('forums_query')) ? eval($code) : null;
    // Fetch Forums
    $result = $db->query("\n\tSELECT\n\t\tf.id, f.name, f.description, f.opt, f.optvalue, f.parent, f.topics, f.replies, f.last_topic, f.invisible,\n\t\tt.topic as l_topic, t.prefix AS l_prefix, t.id as l_tid, t.last as l_date, u.name AS l_uname, t.last_name AS l_name, f.id AS l_bid\n\tFROM {$db->pre}forums AS f\n\t\tLEFT JOIN {$db->pre}topics AS t ON f.last_topic=t.id\n\t\tLEFT JOIN {$db->pre}user AS u ON t.last_name=u.id\n\tORDER BY f.parent, f.position\n\t");
    $keys = array('l_prefix' => null, 'l_topic_full' => null, 'l_topic' => null, 'l_tid' => null, 'l_date' => null, 'l_uname' => null, 'l_name' => null, 'l_bid' => null);
    while ($row = $db->fetch_assoc($result)) {
        $row['name'] = $gpc->prepare($row['name']);
        $row['l_uname'] = $gpc->prepare($row['l_uname']);
        $row['l_name'] = $gpc->prepare($row['l_name']);
        $row['bid'] = $cat_cache[$row['parent']]['parent'];
        // Caching for Subforums
        if (!empty($row['bid'])) {
            $sub_cache[$row['bid']][] = $row;
        }
        // Caching the Forums
        if ($row['bid'] == $board) {
            $forum_cache[$row['parent']][] = $row;
        }
        $last_cache[$row['id']] = $row;
        ($code = $plugins->load('forums_caching')) ? eval($code) : null;
    }
    $cats = array();
    $hidden = 0;
    // Work with the chached data!
    foreach ($cat_cache as $cat) {
        $cat['forums'] = array();
        if (isset($forum_cache[$cat['id']]) == false) {
            continue;
        }
        foreach ($forum_cache[$cat['id']] as $forum) {
            $found = true;
            $forum['new'] = false;
            $forum['show'] = true;
            // Subforendaten vererben (Letzter Beitrag, Markierung)
            if (isset($sub_cache[$forum['id']])) {
                $substats = SubStats($forum['topics'], $forum['replies'], $forum['id'], $sub_cache);
                $forum['topics'] = $substats[0];
                $forum['replies'] = $substats[1];
            }
            // Letzter Beitrag
            $last = $last_cache[$forum['id']];
            if (isset($sub_cache[$forum['id']])) {
                foreach ($substats[2] as $last_bid) {
                    $sub = $last_cache[$last_bid];
                    if ($last['l_date'] < $sub['l_date'] && check_forumperm($sub)) {
                        $last = $sub;
                    }
                }
            }
            $forum = array_merge($forum, array_intersect_key($last, $keys));
            if (is_id($forum['l_name']) && isset($memberdata[$forum['l_name']])) {
                $forum['l_name'] = array($forum['l_uname'], $forum['l_name']);
            } else {
                $forum['l_name'] = array($forum['l_name'], 0);
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] != 0) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['state'] = BOARD_STATE_LOCKED;
                    $forum['topics'] = '-';
                    $forum['replies'] = '-';
                    $forum['l_topic'] = false;
                    $forum['l_topic_full'] = '';
                } else {
                    if ($slog->isForumRead($forum['id'], $forum['l_date']) || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                        $forum['state'] = BOARD_STATE_OLD;
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['state'] = BOARD_STATE_NEW;
                        $forum['new'] = true;
                    }
                    if (!empty($forum['l_topic'])) {
                        if (isset($prefix[$forum['id']][$forum['l_prefix']]) && $forum['l_prefix'] > 0) {
                            $lang->assign('prefix', $prefix[$forum['id']][$forum['l_prefix']]['value']);
                            $forum['l_prefix'] = $lang->phrase('showtopic_prefix_title');
                        } else {
                            $forum['l_prefix'] = '';
                        }
                        if (strxlen($forum['l_topic']) > $config['lasttopic_chars']) {
                            $forum['l_topic_full'] = $forum['l_prefix'] . $forum['l_topic'];
                            $forum['l_topic'] = subxstr($forum['l_topic'], 0, $config['lasttopic_chars']);
                            $forum['l_topic'] .= "...";
                        } else {
                            $forum['l_topic_full'] = '';
                        }
                        $forum['l_date'] = str_date($lang->phrase('dformat1'), times($forum['l_date']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replies'] = numbers($forum['replies']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] != 0) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_LOCKED;
                                }
                            } else {
                                if ($slog->isForumRead($sub_cache[$forum['id']][$i]['id'], $sub_cache[$forum['id']][$i]['l_date']) || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_OLD;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_NEW;
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                            $sub_cache[$forum['id']][$i]['state'] = BOARD_STATE_WWW;
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $cat['forums'][] = $forum;
            } elseif ($forum['invisible'] != 2) {
                $hidden++;
            }
        }
        if (count($cat['forums']) > 0) {
            $cats[] = $cat;
        }
    }
    ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
    $error_state = count($cats) == 0 && $board == 0;
    if (count($cats) > 0 || $error_state) {
        $tpl->globalvars(compact("cats", "board", "hidden", "error_state"));
        echo $tpl->parse("categories");
    }
    // Else: This is a forum without sub forums (that should be displayed)
    return $found;
}
Ejemplo n.º 16
0
     $row->name = $row->uname;
 } else {
     $row->email = $row->gmail;
     $row->name = $row->gname;
 }
 $bbcode->setSmileys(0);
 if ($config['wordstatus'] == 0) {
     $row->dowords = 0;
 }
 $bbcode->setReplace($row->dowords);
 if ($row->status == 2) {
     $row->comment = $bbcode->ReplaceTextOnce($row->comment, 'moved');
 }
 $row->comment = $bbcode->parse($row->comment, 'plain');
 $row->comment = str_replace("\n", ' ', $row->comment);
 if (strxlen($row->comment) > $config['rsschars']) {
     $row->comment = FeedCreator::iTrunc($row->comment, $config['rsschars']);
 }
 $item = new FeedItem();
 $item->title = $row->topic;
 $item->link = $config['furl'] . "/showtopic.php?id=" . $row->id;
 $item->source = $config['furl'] . "/showforum.php?id=" . $row->board;
 $item->description = $row->comment;
 $item->date = $row->date;
 $item->author = $row->name;
 if ($config['syndication_insert_email'] == 1) {
     $item->authorEmail = $row->email;
 } else {
     $item->authorEmail = '';
 }
 $item->pubDate = $row->date;
Ejemplo n.º 17
0
    $error[] = $lang->phrase('query_string_error');
}
if ($my->p['forum'] == 0) {
    $error[] = $lang->phrase('not_allowed');
}
if (count($error) > 0) {
    errorLogin($error, 'forum.php' . SID2URL_1);
}
$catbid = $scache->load('cat_bid');
$fc = $catbid->get();
$last = $fc[$info['board']];
if ($last['topiczahl'] < 1) {
    $last['topiczahl'] = $config['topiczahl'];
}
$q = urldecode($gpc->get('q', str));
if (strxlen($q) > 2) {
    $qUrl = '&q=' . urlencode($q);
    $qUrl2 = '&amp;q=' . urlencode($q);
} else {
    $qUrl = $qUrl2 = '';
}
if ($_GET['action'] == 'firstnew' && $info['last'] >= $my->clv) {
    $sql_order = iif($last['post_order'] == 1, '>', '<=');
    $result = $db->query("SELECT COUNT(*) AS count FROM {$db->pre}replies WHERE topic_id = '{$info['id']}' AND date {$sql_order} '{$my->clv}'");
    $old = $db->fetch_assoc($result);
    if ($last['post_order'] != 1) {
        $old['count']++;
        // Number of old post (with topic start post) + 1, to get the first new post, not the last old post
    }
    $pgs = ceil($old['count'] / $last['topiczahl']);
    if ($pgs < 1) {
Ejemplo n.º 18
0
     }
 } else {
     $error = array();
     if (strxlen($_POST['comment']) > $config['maxpostlength']) {
         $error[] = $lang->phrase('comment_too_long');
     }
     if (strxlen($_POST['comment']) < $config['minpostlength']) {
         $error[] = $lang->phrase('comment_too_short');
     }
     if (strxlen($_POST['topic']) > $config['maxtitlelength']) {
         $error[] = $lang->phrase('title_too_long');
     }
     if (strxlen($_POST['topic']) < $config['mintitlelength']) {
         $error[] = $lang->phrase('title_too_short');
     }
     if (strxlen($_POST['about']) > $config['maxeditlength']) {
         $error[] = $lang->phrase('edit_reason_too_long');
     }
     if (!isset($prefix[$_POST['opt_0']]) && $last['prefix'] == 1) {
         $error[] = $lang->phrase('prefix_not_optional');
     }
     $bbcode = initBBCodes();
     $_POST['topic'] = $bbcode->parseTitle($_POST['topic']);
     if (count($error) > 0 || !empty($_POST['Preview2'])) {
         $data = array('topic' => $_POST['topic'], 'comment' => $_POST['comment'], 'prefix' => $_POST['opt_0'], 'dosmileys' => $_POST['dosmileys'], 'dowords' => $_POST['dowords'], 'about' => $_POST['about']);
         $fid = save_error_data($data);
         if (!empty($_POST['Preview2'])) {
             viscacha_header("Location: edit.php?action=preview&id={$info['id']}&fid=" . $fid . SID2URL_JS_x);
         } else {
             error($error, "edit.php?id={$info['id']}&amp;fid=" . $fid . SID2URL_x);
         }
Ejemplo n.º 19
0
         $sql_where_like .= "(r.topic LIKE{$binary} '%{$str}%' OR r.comment LIKE{$binary} '%{$str}%') ";
     } else {
         $sql_where_like .= "r.topic LIKE{$binary} '%{$str}%' ";
     }
 }
 $sql_where = $slog->sqlinboards('r.board', 1, $boards) . " ";
 if (count($used) > 0) {
     $sql_where .= "({$sql_where_like}) ";
 }
 if (isset($rname)) {
     if (count($used) > 0) {
         $sql_where .= "AND ";
     }
     $sql_where .= "r.name = '{$rname}' ";
 }
 if (strxlen($_POST['name']) >= $config['searchminlength']) {
     $used[] = $_POST['name'];
 } else {
     $ignored[] = $_POST['name'];
 }
 $having = '';
 if ($_POST['temp'] > 0 && $_POST['temp'] < 366) {
     $sql_where .= "AND t.last ";
     if ($_POST['temp2'] == 1) {
         $sql_where .= '<=';
     } else {
         $sql_where .= '>=';
     }
     $timestamp = time() - 60 * 60 * 24 * $_POST['temp'];
     $sql_where .= " '{$timestamp}' ";
     $having = " LEFT JOIN {$db->pre}topics AS t ON t.id = r.topic_id";
Ejemplo n.º 20
0
 if (strxlen($_POST['location']) > 50) {
     $error[] = $lang->phrase('editprofile_location_too_long');
 }
 if ($_POST['gender'] != 'm' && $_POST['gender'] != 'w' && $_POST['gender'] != '') {
     $error[] = $lang->phrase('editprofile_gender_incorrect');
 }
 if ($_POST['birthday'] > 31) {
     $error[] = $lang->phrase('editprofile_birthday_incorrect');
 }
 if ($_POST['birthmonth'] > 12) {
     $error[] = $lang->phrase('editprofile_birthmonth_incorrect');
 }
 if (($_POST['birthyear'] < gmdate('Y') - 120 || $_POST['birthyear'] > gmdate('Y')) && $_POST['birthyear'] != 0) {
     $error[] = $lang->phrase('editprofile_birthyear_incorrect');
 }
 if (strxlen($_POST['fullname']) > 128) {
     $error[] = $lang->phrase('editprofile_fullname_incorrect');
 }
 if (intval($_POST['temp']) < -12 && intval($_POST['temp']) > 12) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('timezone');
 }
 if ($_POST['opt_0'] < 0 && $_POST['opt_0'] > 2) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('editprofile_editor');
 }
 if ($_POST['opt_1'] != 0 && $_POST['opt_1'] != 1) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('editprofile_emailpn');
 }
 if ($_POST['opt_2'] != 0 && $_POST['opt_2'] != 1) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('editprofile_bad');
 }
 if ($_POST['opt_3'] < 0 && $_POST['opt_3'] > 2) {
Ejemplo n.º 21
0
 if (strxlen($_POST['comment']) > $config['maxpostlength']) {
     $error[] = $lang->phrase('comment_too_long');
 }
 if (strxlen($_POST['comment']) < $config['minpostlength']) {
     $error[] = $lang->phrase('comment_too_short');
 }
 if (strxlen($_POST['topic']) > $config['maxtitlelength']) {
     $error[] = $lang->phrase('title_too_long');
 }
 if (strxlen($_POST['topic']) < $config['mintitlelength']) {
     $error[] = $lang->phrase('title_too_short');
 }
 if (strxlen($_POST['about']) > $config['maxeditlength']) {
     $error[] = $lang->phrase('edit_reason_too_long');
 }
 if (strxlen($_POST['about']) < $config['mineditlength']) {
     $error[] = $lang->phrase('edit_reason_too_short');
 }
 if (!isset($prefix[$_POST['opt_0']]) && $last['prefix'] == 1) {
     $error[] = $lang->phrase('prefix_not_optional');
 }
 ($code = $plugins->load('edit_save_errorhandling')) ? eval($code) : null;
 BBProfile($bbcode);
 $_POST['topic'] = $bbcode->parseTitle($_POST['topic']);
 if (count($error) > 0 || !empty($_POST['Preview'])) {
     $data = array('topic' => $_POST['topic'], 'comment' => $_POST['comment'], 'prefix' => $_POST['opt_0'], 'dosmileys' => $_POST['dosmileys'], 'dowords' => $_POST['dowords'], 'about' => $_POST['about']);
     ($code = $plugins->load('edit_save_errordata')) ? eval($code) : null;
     $fid = save_error_data($data);
     if (!empty($_POST['Preview'])) {
         $slog->updatelogged();
         $db->close();
Ejemplo n.º 22
0
 if (strxlen($query['location']) > 50) {
     $error[] = $lang->phrase('editprofile_location_too_short');
 }
 if ($query['gender'] != 'm' && $query['gender'] != 'w' && $query['gender'] != '') {
     $error[] = $lang->phrase('editprofile_gender_incorrect');
 }
 if ($query['birthday'] > 31) {
     $error[] = $lang->phrase('editprofile_birthday_incorrect');
 }
 if ($query['birthmonth'] > 12) {
     $error[] = $lang->phrase('editprofile_birthmonth_incorrect');
 }
 if (($query['birthyear'] < gmdate('Y') - 120 || $query['birthyear'] > gmdate('Y')) && $query['birthyear'] != 0) {
     $error[] = $lang->phrase('editprofile_birthyear_incorrect');
 }
 if (strxlen($query['fullname']) > 128) {
     $error[] = $lang->phrase('editprofile_fullname_incorrect');
 }
 if (intval($query['temp']) < -12 && intval($query['temp']) > 12) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('timezone');
 }
 if ($query['opt_0'] < 0 && $query['opt_0'] > 2) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('editprofile_editor');
 }
 if ($query['opt_1'] != 0 && $query['opt_1'] != 1) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('editprofile_emailpn');
 }
 if ($query['opt_2'] != 0 && $query['opt_2'] != 1) {
     $error[] = $lang->phrase('editprofile_settings_error') . $lang->phrase('editprofile_bad');
 }
 if ($query['opt_3'] < 0 && $query['opt_3'] > 2) {
Ejemplo n.º 23
0
        $search = urldecode($_GET['search']);
        $search = preg_replace("/(\\s){1,}/is", " ", $search);
        $search = preg_replace("/\\*{1,}/is", '*', $search);
        $ignorewords = $lang->get_words();
        $word_seperator = "\\.\\,;:\\+!\\?\\_\\|\\s\"'\\#\\[\\]\\%\\{\\}\\(\\)\\/\\\\";
        $searchwords = preg_split('/[' . $word_seperator . ']+?/', $search, -1, PREG_SPLIT_NO_EMPTY);
        $ignored = array();
        foreach ($searchwords as $sw) {
            $sw = trim($sw);
            if ($sw[0] == '-') {
                $sw2 = substr($sw, 1);
            } else {
                $sw2 = $sw;
            }
            $sw2 = str_replace('*', '', $sw2);
            if (in_array(strtolower($sw2), $ignorewords) || strxlen($sw2) < $config['searchminlength']) {
                $ignored[] = $sw2;
            }
        }
        if (count($ignored) > 0) {
            echo implode(',', $ignored);
        } else {
            echo 1;
        }
    } else {
        echo 1;
    }
}
($code = $plugins->load('ajax_end')) ? eval($code) : null;
$phpdoc->Out(0);
$db->close();
function BoardSelect($board = 0)
{
    global $config, $my, $tpl, $db, $gpc, $lang, $scache, $plugins;
    $found = false;
    $sub_cache = array();
    $sub_cache_last = array();
    $cat_cache = array();
    $mod_cache = array();
    $forum_cache = array();
    $categories_obj = $scache->load('categories');
    $cat_cache = $categories_obj->get();
    $memberdata_obj = $scache->load('memberdata');
    $memberdata = $memberdata_obj->get();
    $index_moderators = $scache->load('index_moderators');
    $mod_cache = $index_moderators->get();
    ($code = $plugins->load('forums_query')) ? eval($code) : null;
    // Fetch Forums
    $result = $db->query("SELECT \n    \tc.id, c.name, c.desc, c.opt, c.optvalue, c.bid, c.topics, c.replys, c.cid, c.last_topic, c.invisible,  \n    \tt.topic as btopic, t.id as btopic_id, t.last as bdate, u.name AS uname, t.last_name AS bname\n    FROM {$db->pre}cat AS c\n        LEFT JOIN {$db->pre}topics AS t ON c.last_topic=t.id \n        LEFT JOIN {$db->pre}user AS u ON t.last_name=u.id \n    ORDER BY c.cid, c.c_order, c.id", __LINE__, __FILE__);
    if ($db->num_rows($result) == 0) {
        $errormsg = array('There are currently no boards to show. Pleas visit the <a href="admin.php' . SID2URL_1 . '">Admin Control Panel</a> and create some forums.');
        $errorurl = '';
        $tpl->globalvars(compact("errorurl", "errormsg"));
        echo $tpl->parse('main/error');
        return $found;
    }
    while ($row = $db->fetch_assoc($result)) {
        $gpc->prepare($row['name']);
        $gpc->prepare($row['btopic']);
        $gpc->prepare($row['uname']);
        $gpc->prepare($row['bname']);
        // Caching for Subforums
        if ($row['bid'] > 0) {
            $sub_cache[$row['bid']][] = $row;
            $sub_cache_last[$row['id']] = $row;
        }
        // Caching the Forums
        if ($row['bid'] == $board) {
            $forum_cache[$row['cid']][] = $row;
        }
        ($code = $plugins->load('forums_caching')) ? eval($code) : null;
    }
    // Work with the chached data!
    foreach ($cat_cache as $cat) {
        $forums = array();
        if (isset($forum_cache[$cat['id']]) == false) {
            continue;
        }
        foreach ($forum_cache[$cat['id']] as $forum) {
            $found = true;
            $forum['new'] = false;
            $forum['show'] = true;
            $forum['mbdate'] = $forum['bdate'];
            // Subforendaten vererben (Letzter Beitrag, Markierung)
            if (isset($sub_cache[$forum['id']])) {
                $substats = SubStats($forum['topics'], $forum['replys'], $forum['id'], $sub_cache);
                $forum['topics'] = $substats[0];
                $forum['replys'] = $substats[1];
                $bids = $substats[2];
            }
            $last = $forum['last_topic'];
            $last_date = $forum['bdate'];
            if (isset($sub_cache[$forum['id']])) {
                foreach ($bids as $bidf) {
                    $sub = $sub_cache_last[$bidf];
                    if ($last_date < $sub['bdate']) {
                        $last = $sub['id'];
                        $last_date = $sub['bdate'];
                    }
                }
            }
            $forum['lname'] = is_id($forum['bname']) ? $forum['uname'] : $forum['bname'];
            if ($last != $forum['last_topic']) {
                $forum['id2'] = $last;
                $forum['last_topic'] = $sub_cache_last[$forum['id2']]['last_topic'];
                $forum['btopic_id'] = $sub_cache_last[$forum['id2']]['btopic_id'];
                $forum['btopic'] = $sub_cache_last[$forum['id2']]['btopic'];
                $forum['bdate'] = $sub_cache_last[$forum['id2']]['bdate'];
                if (!isset($sub_cache_last[$forum['id2']]['lname'])) {
                    $forum['lname'] = is_id($sub_cache_last[$forum['id2']]['bname']) ? $sub_cache_last[$forum['id2']]['uname'] : $sub_cache_last[$forum['id2']]['bname'];
                } else {
                    $forum['lname'] = $sub_cache_last[$forum['id2']]['lname'];
                }
            } else {
                $forum['id2'] = $forum['id'];
            }
            $id = array_search(trim($forum['lname']), $memberdata);
            if (is_id($id)) {
                $forum['lname'] = array($forum['lname'], $id);
            } else {
                $forum['lname'] = array($forum['lname'], 0);
            }
            if ($forum['btopic_id']) {
                $forum['tid'] = $forum['btopic_id'];
            } else {
                $forum['tid'] = $forum['last_topic'];
            }
            // Rechte und Gelesensystem
            if ($forum['opt'] != 're') {
                if (!check_forumperm($forum)) {
                    if ($forum['invisible'] == 1) {
                        $forum['show'] = false;
                    }
                    $forum['foldimg'] = $tpl->img('cat_locked');
                    $forum['topics'] = '-';
                    $forum['replys'] = '-';
                    $forum['btopic'] = false;
                } else {
                    if (isset($my->mark['f'][$forum['id']]) && $my->mark['f'][$forum['id']] > $forum['bdate'] || $forum['bdate'] < $my->clv || $forum['topics'] < 1) {
                        $forum['foldimg'] = $tpl->img('cat_open');
                    } else {
                        $forum['foldimg'] = $tpl->img('cat_red');
                        $forum['new'] = true;
                    }
                    if ($forum['btopic']) {
                        if (strxlen($forum['btopic']) >= 40) {
                            $forum['btopic'] = substr($forum['btopic'], 0, 40);
                            $forum['btopic'] .= "...";
                        }
                        $forum['bdate'] = str_date($lang->phrase('dformat1'), times($forum['bdate']));
                    }
                }
            }
            $forum['topics'] = numbers($forum['topics']);
            $forum['replys'] = numbers($forum['replys']);
            // Moderatoren
            $forum['mod'] = array();
            if (isset($mod_cache[$forum['id']])) {
                $anz2 = count($mod_cache[$forum['id']]);
                for ($i = 0; $i < $anz2; $i++) {
                    if ($anz2 != $i + 1) {
                        $mod_cache[$forum['id']][$i]['sep'] = ', ';
                    } else {
                        $mod_cache[$forum['id']][$i]['sep'] = '';
                    }
                    $forum['mod'][] = $mod_cache[$forum['id']][$i];
                }
            }
            // Unterforen
            $forum['sub'] = array();
            if ($config['showsubfs']) {
                if (isset($sub_cache[$forum['id']])) {
                    $anz2 = count($sub_cache[$forum['id']]);
                    $sub = array();
                    for ($i = 0; $i < $anz2; $i++) {
                        $show = true;
                        $sub_cache[$forum['id']][$i]['new'] = false;
                        if ($sub_cache[$forum['id']][$i]['opt'] != 're') {
                            if (!check_forumperm($sub_cache[$forum['id']][$i])) {
                                if ($sub_cache[$forum['id']][$i]['invisible'] == 1) {
                                    $show = false;
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_locked');
                                }
                            } else {
                                if (isset($my->mark['f'][$sub_cache[$forum['id']][$i]['id']]) && $my->mark['f'][$sub_cache[$forum['id']][$i]['id']] > $sub_cache[$forum['id']][$i]['bdate'] || $sub_cache[$forum['id']][$i]['bdate'] < $my->clv || $sub_cache[$forum['id']][$i]['topics'] < 1) {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_open');
                                } else {
                                    $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_red');
                                    $sub_cache[$forum['id']][$i]['new'] = true;
                                }
                            }
                        } else {
                            $sub_cache[$forum['id']][$i]['foldimg'] = $tpl->img('subcat_redirect');
                        }
                        if ($show == true) {
                            $forum['sub'][] = $sub_cache[$forum['id']][$i];
                        }
                    }
                }
            }
            ($code = $plugins->load('forums_entry_prepared')) ? eval($code) : null;
            if ($forum['show'] == true) {
                $forums[] = $forum;
            }
        }
        if (count($forums) > 0) {
            $tpl->globalvars(compact("cat", "forums"));
            ($code = $plugins->load('forums_prepared')) ? eval($code) : null;
            echo $tpl->parse("categories");
        }
    }
    return $found;
}
Ejemplo n.º 25
0
 $breadcrumb->Add($last['name'], "showforum.php?id=" . $last['id'] . SID2URL_x);
 $breadcrumb->Add($prefix . $info['topic'], "showtopic.php?id={$last['id']}" . SID2URL_x);
 if ($info['tstart'] == '0') {
     $breadcrumb->Add($info['title'], "showtopic.php?action=jumpto&id={$last['id']}&topic_id={$info['id']}" . SID2URL_x);
 }
 $breadcrumb->Add($lang->phrase('report_post'));
 forum_opt($last);
 if (empty($info['report']) == false) {
     error($lang->phrase('report_post_locked'), "showtopic.php?action=jumpto&id={$last['id']}&topic_id={$info['id']}" . SID2URL_x);
 }
 if ($_GET['action'] == "report_post2") {
     $error = array();
     if (flood_protect() == false) {
         $error[] = $lang->phrase('flood_control');
     }
     if (strxlen($_POST['comment']) < $config['minpostlength']) {
         $error[] = $lang->phrase('comment_too_short');
     }
     if (count($error) > 0) {
         error($error, "misc.php?action=report_post&id={$info['id']}" . SID2URL_x);
     } else {
         set_flood();
         $message = $_POST['comment'];
         // Update the report
         $db->query("UPDATE {$db->pre}replies SET report = '{$message}' WHERE id = '{$info['id']}' LIMIT 1", __LINE__, __FILE__);
         // Get administrators and global moderators
         $groups = $scache->load('groups');
         $team = $groups->team();
         $cache = array();
         $t = array_merge($team['admin'], $team['gmod']);
         foreach ($t as $row) {
Ejemplo n.º 26
0
 </table>
</form>
	<?php 
    echo foot();
} elseif ($job == 'edit2') {
    echo head();
    $type = $gpc->get('tp', str);
    $id = $gpc->get('id', int);
    $error = array();
    if ($type != 'word' && $type != 'censor' && $type != 'replace') {
        error('admin.php?action=index', $lang->phrase('admin_bbc_no_valid_type'));
    }
    if (strxlen($gpc->get('temp1', str)) < 2) {
        $error[] = $lang->phrase('admin_bbc_word_too_short');
    }
    if (strxlen($gpc->get('temp1', str)) > 200) {
        $error[] = $lang->phrase('admin_bbc_word_too_long');
    }
    if (strlen($gpc->get('temp2', none)) > 255) {
        $error[] = $lang->phrase('admin_bbc_something_else_too_long');
    }
    if (strlen($gpc->get('temp2', none)) < 2) {
        $error[] = $lang->phrase('admin_bbc_something_else_too_short');
    }
    if (strlen($gpc->get('temp3', none)) < 2 && $type == 'word') {
        $error[] = $lang->phrase('admin_bbc_desc_too_short');
    }
    if (count($error) > 0) {
        error('admin.php?action=bbcodes&job=edit&tp=' . $type . '&id=' . $id, $error);
    }
    $db->query("UPDATE {$db->pre}textparser SET `search` = '" . $gpc->get('temp1', str) . "', `replace` = '" . $gpc->get('temp2', db_esc) . "', `desc` = '" . $gpc->get('temp3', db_esc) . "' WHERE id = '{$id}' AND type = '{$type}'");
Ejemplo n.º 27
0
	if (check_mail($query['email']) == false) {
		 $error[] = $lang->phrase('admin_member_no_valid_mail');
	}
	if (strxlen($query['name']) > $config['maxnamelength']) {
		$error[] = $lang->phrase('admin_member_name_too_many_chars');
	}
	if (strxlen($query['name']) < $config['minnamelength']) {
		$error[] = $lang->phrase('admin_member_too_less_chars');
	}
	if (strlen($query['email']) > 200) {
		$error[] = $lang->phrase('admin_member_email_too_many_chars');
	}
	if ($user['mail'] != $_POST['email'] && double_udata('mail', $_POST['email']) == false) {
		 $error[] = $lang->phrase('email_already_used');
	}
	if (strxlen($query['signature']) > $config['maxsiglength']) {
		$error[] = $lang->phrase('admin_member_signature_too_many_chars');
	}
	if (strlen($query['hp']) > 255) {
		$error[] = $lang->phrase('admin_member_hp_too_many_chars');
	}
	if (!check_hp($query['hp'])) {
		$query['hp'] = '';
	}
	if (strlen($query['location']) > 50) {
		$error[] = $lang->phrase('admin_member_location_too_many_chars');
	}
	if ($query['gender'] != 'm' && $query['gender'] != 'w' && $query['gender'] != '') {
		$error[] = $lang->phrase('admin_member_gender_not_valid');
	}
	if ($query['birthday'] > 31) {
Ejemplo n.º 28
0
                $_POST['birthmonth'] = 0;
                $_POST['birthday'] = 0;
                $_POST['birthyear'] = 0;
            }
            if (empty($_POST['birthyear'])) {
                $_POST['birthyear'] = 1000;
            }
            $_POST['birthmonth'] = leading_zero($_POST['birthmonth']);
            $_POST['birthday'] = leading_zero($_POST['birthday']);
            $_POST['birthyear'] = leading_zero($_POST['birthyear'], 4);
            $bday = $_POST['birthyear'] . '-' . $_POST['birthmonth'] . '-' . $_POST['birthday'];
            $_POST['icq'] = str_replace('-', '', $_POST['icq']);
            if (!is_id($_POST['icq'])) {
                $_POST['icq'] = 0;
            }
            if (!empty($_POST['pw']) && strxlen($_POST['pw']) >= $config['minpwlength']) {
                $md5 = md5($_POST['pw']);
                $update_sql = ", pw = '{$md5}' ";
            } else {
                $update_sql = ' ';
            }
            admin_customsave($user['id']);
            ($code = $plugins->load('managemembers_edit2_savedata')) ? eval($code) : null;
            $db->query("\n\t\t\tUPDATE {$db->pre}user\n\t\t\tSET groups = '" . saveCommaSeparated($_POST['groups']) . "', timezone = '" . $_POST['temp'] . "', opt_textarea = '" . $_POST['opt_0'] . "', opt_pmnotify = '" . $_POST['opt_1'] . "', opt_hidebad = '" . $_POST['opt_2'] . "', opt_hidemail = '" . $_POST['opt_3'] . "', template = '" . $_POST['opt_4'] . "', language = '" . $_POST['opt_5'] . "', pic = '" . $_POST['pic'] . "', about = '" . $_POST['comment'] . "', icq = '" . $_POST['icq'] . "', yahoo = '" . $_POST['yahoo'] . "', aol = '" . $_POST['aol'] . "', msn = '" . $_POST['msn'] . "', jabber = '" . $_POST['jabber'] . "', skype = '{$_POST['skype']}', birthday = '" . $bday . "', gender = '" . $_POST['gender'] . "', hp = '" . $_POST['hp'] . "', signature = '" . $_POST['signature'] . "', location = '" . $_POST['location'] . "', fullname = '" . $_POST['fullname'] . "', mail = '" . $_POST['email'] . "', name = '" . $_POST['name'] . "' {$update_sql}\n\t\t\tWHERE id = '" . $user['id'] . "'\n\t\t\tLIMIT 1\n\t\t\t", __LINE__, __FILE__);
            ok($lang->phrase('data_success'), "profile.php?id=" . $user['id']);
        }
    } else {
        error($lang->phrase('docs_not_found'), "profile.php?id={$user['id']}");
    }
}
($code = $plugins->load('managemembers_end')) ? eval($code) : null;
Ejemplo n.º 29
0
<?php

global $memberdata;
global $gpc;
$result = $db->query("\nSELECT t.id, t.board, t.topic, t.last AS date, t.last_name AS name\nFROM {$db->pre}topics AS t LEFT JOIN {$db->pre}cat AS c ON t.board = c.id \nWHERE c.opt != 'pw' AND t.status != '2' " . $slog->sqlinboards('t.board') . "\nORDER BY t.last DESC \nLIMIT 0," . $ini['params']['num'], __LINE__, __FILE__);
if ($db->num_rows($result) > 0) {
    if (!isset($memberdata) || !is_array($memberdata)) {
        $memberdata = cache_memberdata();
    }
    $lastbox = array();
    while ($row = $gpc->prepare($db->fetch_assoc($result))) {
        if (is_id($row['name']) && isset($memberdata[$row['name']])) {
            $row['name'] = $memberdata[$row['name']];
        }
        $row['date'] = str_date($lang->phrase('dformat1'), times($row['date']));
        if (strxlen($row['topic']) >= 75) {
            $row['topic'] = substr($row['topic'], 0, 75);
            $row['topic'] .= $lang->phrase('dot_more');
        }
        $lastbox[] = $row;
    }
    $tpl->globalvars(compact("lastbox"));
    $lang->assign('num', $ini['params']['num']);
    echo $tpl->parse($dir . "last");
}
 /**
  * Truncates a string to a certain length at the most sensible point.
  * First, if there's a '.' character near the end of the string, the string is truncated after this character.
  * If there is no '.', the string is truncated after the last ' ' character.
  * If the string is truncated, " ..." is appended.
  * If the string is already shorter than $length, it is returned unchanged.
  *
  * @static
  * @param string    string A string to be truncated.
  * @param int        length the maximum length the string should be truncated to
  * @return string    the truncated string
  */
 function iTrunc($string, $length)
 {
     if (strxlen($string) <= $length) {
         return $string;
     }
     $pos = strrpos($string, ".");
     if ($pos !== false && $pos >= $length - 4) {
         $string = substr($string, 0, $length - 4);
         $pos = strrpos($string, ".");
     }
     if ($pos !== false && $pos >= $length * 0.4) {
         return substr($string, 0, $pos + 1) . " ...";
     }
     $pos = strrpos($string, " ");
     if ($pos !== false && $pos >= $length - 4) {
         $string = substr($string, 0, $length - 4);
         $pos = strrpos($string, " ");
     }
     if ($pos !== false && $pos >= $length * 0.4) {
         return substr($string, 0, $pos) . " ...";
     }
     return subxstr($string, 0, $length - 4) . " ...";
 }