Exemplo n.º 1
0
<?php

include 'classes/jforg_news.php';
include 'classes/jforg_usersearch.php';
include 'functions/jforg_cleanurl.php';
include 'functions/jforg_gettext.php';
if ($language == 'de') {
    $news_link = 'neuigkeiten';
} else {
    $news_link = 'news';
}
$usersearch = new jforg_usersearch();
$news = new jforg_news();
$row = $usersearch->get_random();
$template->set_frame('startpage');
$details_match = '<b><a href="{LINK_MEMBERS}' . $row['nick'] . '.htm">' . $row['nick'] . '</a>:</b> ';
$details_match .= $template->format_userdetails($user->get_details($row['id']), 10);
$search = '<form action="{LINK_SEARCH}" method="post"><input name="search" type="text" /><br /><br /><input class="submit" name="submit" type="submit" value="{LANG_SEARCH}" /></form>';
$template->replace('RANDOMMEMBER', $details_match);
$template->replace('MEMBERSEARCH', $search);
$template->replace('DEVELOPER', get_text(3, $language));
$lastnews = $news->get_latest();
$template->replace('NEWSHEAD', htmlentities($lastnews['title']));
$template->replace('NEWSDATE', date('d.m.Y H:i', $lastnews['datetime']));
$news_absatz = explode("\n", $lastnews['text']);
$template->replace_wiki('NEWSTEXT', $news_absatz[0]);
$template->replace('LINK_GERMAN', '/de/');
$template->replace('LINK_ENGLISH', '/en/');
$template->replace('META_TITLE', 'JabberFriends.org');
$template->replace('LINK_NEWS', '/' . $language . '/' . $news_link . '/' . $lastnews['id'] . '-' . cleanurl($lastnews['title']) . '.htm');
$template->replace('LINK_ALLNEWS', '/' . $language . '/' . $news_link . '/');
$user = new jforg_user();
$template->set_path('design');
$template->set_frame('fullpage', 'green');
$template->hover_on('green');
SESSION_START();
if ($user->login($_SESSION['nick'], $_SESSION['passwd'])) {
    $template->replace('LOGIN', '{LANG_LOGOUT}');
    $template->replace('REGISTER', '{LANG_OPTIONS}');
    $template->replace('LINK_LOGIN', '{LINK_LOGOUT}');
    $template->replace('LINK_REGISTER', '{LINK_OPTIONS}');
} else {
    $template->replace('LOGIN', '{LANG_LOGIN}');
    $template->replace('REGISTER', '{LANG_REGISTER}');
}
$max_per_search = 5;
$usersearch = new jforg_usersearch();
$content = '<br /><form action="{LINK_SEARCH}" method="post"><input name="search" type="text" />&nbsp;<input class="submit" name="submit" type="submit" value="{LANG_SEARCH}" /></form>';
$content = $content . '<br /><br /><b>{LANG_LAST_MEMBERS}</b><ol>';
$array = $usersearch->search_last(5);
foreach ($array as $row) {
    $details_match = $template->format_userdetails($user->get_details($row['id']));
    $content = $content . '<li><b><a href="' . $row['id'] . '-' . $row['nick'] . '.htm">' . $row['nick'] . '</a></b><br />' . $details_match . '</li>';
}
$content = $content . '</ol>';
$content .= $template->generate_cloud($language);
$template->replace('LOGIN', '{LANG_LOGIN}');
$template->replace('REGISTER', '{LANG_REGISTER}');
$template->replace('LINK_GERMAN', '/de/mitglieder/');
$template->replace('LINK_ENGLISH', '/en/members/');
$template->replace('META_TITLE', '{LANG_MEMBERS}');
$template->replace('FULLPAGE_HEADER', '{LANG_MEMBERS}');
Exemplo n.º 3
0
<?php

include 'classes/jforg_usersearch.php';
$template->set_frame('fullpage', 'green');
$usersearch = new jforg_usersearch();
$searched_nick = $_GET['search'] == '' ? $_POST['search'] : $_GET['search'];
$content = '<form action="{LINK_SEARCH}" method="post"><input value="' . $searched_nick . '" name="search" type="text" />&nbsp;<input class="submit" name="submit" type="submit" value="{LANG_SEARCH}" /></form>';
$max_per_search = 5;
if (isset($_GET['search']) and !isset($_POST['search'])) {
    $_POST['search'] = $_GET['search'];
}
$link_word = '';
if (isset($_POST['search'])) {
    if (preg_match('/.{3,}/', $_POST['search'])) {
        $array = $usersearch->search_all($_POST['search']);
        $result_counter = 0;
        $number = $usersearch->get_number_of();
        $content = $content . "<br /><br /><b>{$number} {LANG_MATCHES_FOR} " . $_POST['search'] . "</b><ol>";
        foreach ($array as $row) {
            $id = $row['id'];
            $nick = $user->get_nick($id);
            $details_match = $template->format_userdetails($row, 5, $_POST['search']);
            $content = $content . "<li><b><a href=\"../{$nick}.htm\">{$nick}</a></b><br />{$details_match}";
        }
        $link_word = $_POST['search'];
    } else {
        $content = $content . "<br /><br /><b><em>{LANG_3CHAR}</em></b><br /><br />";
    }
}
$content = $content . "</ol>";
$template->replace('LOGIN', '{LANG_LOGIN}');