Jump to content
xisto Community

Raptrex

Members
  • Content Count

    300
  • Joined

  • Last visited

Posts posted by Raptrex


  1. ok i found a little script

    <?php// grab current time$time=time();// handle the logout eventif ($logout == true) {setcookie ("user", md5($_POST[user]), $time-3200);setcookie ("pass", md5($_POST[pass]), $time-3200);echo "<a href=http://forums.xisto.com/no_longer_exists/ Out!</a>";}// handle validation eventif ($_POST[user] && $_POST[pass]) {mysql_connect(localhost, raptrex_forum, forum) or die(mysql_error()); // Connectionmysql_select_db(raptrex_member) or die(mysql_error()); // Selection of database$user_data = mysql_fetch_array(mysql_query("select id, username, password from users where username='$_POST[user]' and password='$_POST[pass]'"));if ($user_data[id] > 0) {  setcookie ("user", md5($user_data[username]), $time+3200);  setcookie ("pass", md5($user_data[password]), $time+3200);  echo "<a href=http://forums.xisto.com/no_longer_exists/ In!</a>";} else { $login_error= true; }}// handle login event, both successful and erroneous, or show login screenif ($login_error == true) { ?><table align=center style="font-family:arial; font-size:12; border:1 solid #000000;">  <tr><td align=center bgcolor=#123dd4>LOGIN ERROR</td></tr>  <tr><td align=center><b>Invalid Username and/or Password</b><br><br><a href=login.php>Back</a></td></tr></table><?} elseif ($_COOKIE[user] == md5($username) && $_COOKIE[pass] == md5($password)) { ?><table align=center style="font-family:arial; font-size:12; border:1 solid #000000;">  <tr><td align=center bgcolor=#123dd4>SECURE AREA</td></tr>  <tr><td align=right><a href=login.php?logout=true>Logout</a></td></tr>  <tr><td>You have successfully logged in.<br><br>   Encrypted Username: <b><?=  $_COOKIE[user] ?></b><br>   Encrypted Password: <b><?= $_COOKIE[pass] ?></b><br>  </td></tr></table><?} else {?><form action=login.php method=post><table align=center style="font-family:arial; font-size:12; border:1 solid #000000;">  <tr><td colspan=2 align=center bgcolor=#123dd4>LOGIN</td></tr>  <tr><td align=right>Username: </td><td><input type=text name=user size=15></td></tr>  <tr><td align=right>Password: </td><td><input type=password name=pass size=15></td></tr>  <tr><td align=center colspan=2><input type=submit value=Login></td></tr></table></form><?}?>

    im going to include this onto my site
    say if im not logged in, it shows the login area
    but if im logged in, it says im logged in as whoever im logged in as
    how do i do this?

  2. well with cookies, the site remembers you, but with session, it only remembers you until you close your browser or something like that

    anyway i found a pretty decent tutorial and was wondering how i can make a "logout" script and a "whos online" script

    http://www.xentrik.net/php/signup/complete.php

    the scripts works

    see it here

    nothing fancy
    just added if your logged in it would show you
    oh and also say your not logged in, i want it to show the login form but i dont know how to use the if then statement that much

    thx :D


  3. 7) Whos Online: add this to functions.php (the end is fine)

    //// Generate the whos online block//function generate_whosonline(){    global $pun_config, $lang_common, $pun_user, $db;        if ($pun_user['is_guest'])    {        require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';        return 'Welcome Guest!<br />            Please login.<br />            <form id="login" method="post" action="login.php?action=in" onsubmit="return process_form(this)">                <input type="hidden" name="form_sent" value="1" />                <input type="hidden" name="redirect_url" value="index.php" />                <label><strong>Username</strong><br /><input type="text" name="req_username" size="13" maxlength="25" tabindex="1" /><br /></label>                <label><strong>Password</strong><br /><input type="password" name="req_password" size="13" maxlength="16" tabindex="2" /><br /></label>                <p><a href="register.php" tabindex="4">'.$lang_login['Not registered'].'</a><br />                <a href="login.php?action=forget" tabindex="5">'.$lang_login['Forgotten pass'].'</a></p>                <p><input type="submit" name="login" value="Login" tabindex="3" /></p>            </form>';    }    else    {        require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';        $result = $db->query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Unable to fetch total user count', __FILE__, __LINE__, $db->error());        $stats['total_users'] = $db->result($result);                $result = $db->query('SELECT id, username FROM '.$db->prefix.'users ORDER BY registered DESC LIMIT 1') or error('Unable to fetch newest registered user', __FILE__, __LINE__, $db->error());        $stats['last_user'] = $db->fetch_assoc($result);                $result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());        list($stats['total_topics'], $stats['total_posts']) = $db->fetch_row($result);                if ($pun_config['o_users_online'] == '1')        {            // Fetch users online info and generate strings for output            $num_guests = 0;            $users = array();            $online = array();            $result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());                    while ($pun_user_online = $db->fetch_assoc($result))            {                if ($pun_user_online['user_id'] > 1)                    $users[] = "\n\t\t\t\t".'<a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a><br />';                else                    ++$num_guests;            }                    $num_users = count($users);            $online[] = "\t\t\t\t".$lang_index['Users online'].': <strong>'.$num_users.'</strong><br />'."\n\t\t\t\t".$lang_index['Guests online'].': <strong>'.$num_guests.'</strong>'."\n\t\t\t"."\n";                            if ($num_users > 0 && $num_users < 10)                $online[] = "\t\t\t"."\n\t\t\t\t".'<strong>'.$lang_index['Online'].': </strong>'."\t\t\t\t".implode($users)."\n";            else                $online[] = "\t\t\t".'<div class="clearer"></div>'."\n";                }                return 'Welcome <strong>'.$pun_user['username'].'</strong><br /><br />            '.implode($online,'').'<br />            Users: <strong>'. $stats['total_users'].'</strong><br />            Topics: <strong>'.$stats['total_topics'].'</strong><br />            Posts: <strong>'.$stats['total_posts'].'</strong><br />';    }}

    8) open main.tpl and inside:

    <div id="left">    .....</div>

    put this inside the <div> tags

    <div class="block">        <h2 class="block2"><span>Whos Online?</span></h2>        <div class="box">        <pun_online>        </div></div>

    9) adjust the width of the tables in main.tpl with this

    <style type="text/css">    #left {        width: 140px;        float: left;    }    #main {        margin-left: 150px;    }    #container {        width: 100%;        float: right;        margin-left: -140px;    }</style>

    and it should all create something like this

    My Webpage with the miniportal

    works with all version of punbb

    make sure its in the same directory as your forum

    have fun


  4. $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
    after this add

     

    $links[] = '<li id="navforum"><a href="forum.php">'.$lang_common['Forum'].'</a>';
    5) Add a sidebar: replace main.tpl with

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;"> <html dir="<pun_content_direction>"><head><meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" /><pun_head><style type="text/css">    #left {        width: 120px;        float: left;    }    #main {        margin-left: 130px;    }    #container {        width: 100%;        float: right;        ;    }</style></head><body> <div id="punwrap"><div id="pun<pun_page>" class="pun"> <div id="brdheader" class="block">    <div class="box">        <div id="brdtitle" class="inbox">            <pun_title>            <pun_desc>        </div>        <pun_navlinks>        <pun_status>    </div></div> <div id="container">    <div id="main">            <pun_announcement>            <pun_main>            </div>    </div> <div id="left">        <div class="block">        <h2><span>Menu</span></h2>        <div class="box">        <pun_sidelinks>                    </div>    </div>    <div class="block">        <h2 class="block2"><span>More Links</span></h2>        <div class="box">            <div class="inbox">                <ul>                    <li><a href="index.php">Link 1</a></li>                    <li><a href="index.php">Link 2</a></li>                    <li><a href="index.php">Link 3</a></li>                    <li><a href="index.php">Link 4</a></li>                </ul>                    </div>        </div>    </div></div> <div class="clearer"></div> <pun_footer> </div></div> </body></html>
    6) open header.php find

    // START SUBST - <pun_navlinks>$tpl_main = str_replace('<pun_navlinks>','<div id="brdmenu" class="inbox">'."\n\t\t\t". generate_navlinks()."\n\t\t".'</div>', $tpl_main);// END SUBST - <pun_navlinks>
    after add

     

    // START SUBST - <pun_sidelinks>$tpl_main = str_replace('<pun_sidelinks>','<div class="inbox">'."\n\t\t\t". generate_navlinks()."\n\t\t".'</div>', $tpl_main);// END SUBST - <pun_sidelinks>
    contiues to 3rd post

  5. i just installed this miniportal on my forum

    My Webpage showing the miniportal with punbb

     

    very easy to do just edit a few pages

     

    1) Install punbb

    2) Rename the index.php to forum.php

    3) Create a new index.php

    <?php define('PUN_ROOT', './');define('PUN_QUIET_VISIT', 1);require PUN_ROOT.'include/common.php'; $page_title = pun_htmlspecialchars($pun_config['o_board_title']);define('PUN_ALLOW_INDEX', 1);require PUN_ROOT.'header.php';require PUN_ROOT.'include/parser.php'; function pun_news($fid='', $show=15, $truncate=1){    global $lang_common, $db, $pun_config, $db_prefix;    $max_subject_length = 30;    $show_max_topics = 50;    $fid = intval($fid);    $order_by = 't.posted';    $forum_sql = '';    // Was a forum ID supplied?    if ( $fid ) $forum_sql = 'f.id='.$fid.' AND ';    $show = intval($show);    if ($show < 1 || $show > $show_max_topics)    $show = 15;    $saveddate="";    // Fetch $show topics    $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE f.id='.$fid.' AND t.moved_to IS NULL ORDER BY '.$order_by.' DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());    $show_count = 0;    if ( !$db->num_rows($result) ) return $output;    while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) {        $temp = '';        if ($pun_config['o_censoring'] == '1')            $cur_topic['subject'] = censor_words($cur_topic['subject']);        if (pun_strlen($cur_topic['subject']) > $max_subject_length)            $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';        else            $subject_truncated = $cur_topic['subject'];        $newsheading = '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a> - <em>Posted by '.$cur_topic['poster'].' at '.date('h:i A', $cur_topic['posted']).'</em><br>';        // Group posts by date            $thisdate = date('l, d F Y', $cur_topic['posted']);        if ($thisdate != $saveddate)         {            if ($saveddate)            {                $temp .= "</div></div>";            }            $temp .= '<div class="block"><h2><span>'.$thisdate.'</span></h2><div class="box"><div class="inbox"><p>';            $saveddate = $thisdate;        }        else {            $temp .= '<div class="inbox"><p>';        }        $temp .= $newsheading.'</p><p>';        $id = $cur_topic['id'];        $msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());            if ( !$db->num_rows($msg) ) continue;        $cur_post = $db->fetch_assoc($msg);        // Display first paragraph only (comment out next four lines to turn off)        if ($truncate == 1)        {        $paragraph = preg_split("/\s*\n+/", $cur_post['message']);            if (isset($paragraph[1])) {                $cur_post['message'] = $paragraph[0] . "...";            }        }        $cur_post['message'] = parse_message($cur_post['message'], 0);        $temp .= $cur_post['message'];        $temp .= "</p></div>";        if (isset($output)) {            $output .= $temp;        }        else {            $output = $temp;        }        ++$show_count;    } // end of while    $output .= "</div></div>";    return $output;}?>        <div class="block">            <h2><span>Welcome</span></h2>            <div class="box">                <div class="inbox">                    <p>                    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent augue. Nulla facilisi. Fusce bibendum accumsan erat. Quisque sollicitudin mattis neque. Sed dapibus. Integer a lectus eu sem consequat pellentesque. Morbi rhoncus nulla. Duis adipiscing interdum velit. Fusce ante. Ut vitae enim sit amet magna sodales hendrerit. In sed tortor at sapien convallis eleifend. Proin mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut metus. Cras ac arcu et arcu porttitor blandit. Nam vitae lectus eget mauris sollicitudin placerat. Suspendisse vestibulum. Donec varius libero. Duis velit tellus, euismod vitae, consequat sed, consectetuer ut, purus.                    </p>                    <p>                    Praesent viverra venenatis magna. Etiam in dolor. Ut in justo ac nibh malesuada cursus. Duis urna arcu, aliquam vitae, consequat nec, tincidunt non, mi. Nunc lobortis. Nunc pharetra. Sed porttitor. Maecenas turpis tortor, blandit nec, dignissim in, porttitor eu, odio. In hac habitasse platea dictumst. Suspendisse augue odio, ornare a, elementum ac, tincidunt varius, orci. Nulla libero ante, hendrerit ac, consectetuer eu, sollicitudin et, eros. Duis sapien. Suspendisse ornare enim sit amet dui. Donec ullamcorper diam.                    </p>                </div>            </div>        </div><?phpecho pun_news(1, 5, 0); require PUN_ROOT.'footer.php';

    put what you want in the welcome block, pun_news(1, 5, 0); is the news generator the syntax is pun_news(forum id, number of news to display, truncate news);

     

    4) Add forums.php to the menu: open functions.php find (line 235):

     

    continues in next post:


  6. ok i just got my ridge racer for my psp yesterday and its awsome!the graphics are amazingthe colors are very nice and bright and everything looks beutifulit has a lot better graphics than twisted metal heads on which lags sometimes when a lot of things blows up at oncei would give the graphics a 9/10the gameplay is awsomethe sence of speed isnt like need for speed but its still okthe drifting is awasome and very easy to doi havent played online or wirelessly yet but i will tell you how it is when i dowhen you bumb into the side or stay near the side, your car shakes i dont know if you can customize your car or notthe loading times are longthey should make the loading time more interesting by showing a hot girl :rolleyes: i would give the gameplay a 8/10overall ridge racer is a great game for $40i would definatly buy it


  7. i like guild warsits very coolI just recently bought Guild Wars and have 3 charactersthere are 6 classes: warrior, ranger, necromancer, elementalist, monk, and mesmeryou choose one job and then later you get to get a 2nd jobi believe there is a total of 42 classes including someone without a 2nd classright now im a elementalist/mesmerranger/necromancerand elementalist/rangerits really cool as when you join a guild, you can get a cape!with your own logo on it i thinki havnt pvp anyone yet cuz im still in the noobie area but i heard its coolits free to play online (boo WoW) and its pretty cool


  8. I just recently bought Guild Wars and have 3 charactersthere are 6 classes: warrior, ranger, necromancer, elementalist, monk, and mesmeryou choose one job and then later you get to get a 2nd jobi believe there is a total of 42 classes including someone without a 2nd classright now im a elementalist/mesmerranger/necromancerand elementalist/rangerits really cool as when you join a guild, you can get a cape!with your own logo on it i thinki havnt pvp anyone yet cuz im still in the noobie area but i heard its coolits free to play online (boo WoW) and its pretty cool

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.