Jump to content
xisto Community

Dayzed

Members
  • Content Count

    79
  • Joined

  • Last visited

Everything posted by Dayzed

  1. 1. Create new database for the boards. I understand that.2. Then I use the SQL in the SQL file to create the table for the boards. Thats in the SQL.SQL file correct?3. Then I go into the config.inc.php and edit the database connection variables to yours. I did do that-- I think. Thats what Argoth was helping me with...
  2. Could someone help me? I dont understand what is the matter with my code....
  3. I am going to get off the computer for a while. I will fix it when I get back on, later. I'll be back on later tonight.
  4. There are a couple screwed up: <?phpsession_cache_limiter('private, must-revalidate');session_name('sid');session_start(); $result = mysql_query('SELECT ip_addr FROM banned_ips');while ($row = mysql_fetch_row($result)){if (stristr($_SERVER['REMOTE_ADDR'], $row[0]) || stristr($_SERVER['HTTP_REFERER'], $row[0])) default:empty($userstylem) ? $userstylem = 1 : '';$theme_path = mysql_result(mysql_query("SELECT theme_path FROM themes WHERE theme_id = $userstylem"), 0); Those are the messed up ones and some lines around them.
  5. It works! YAY! Now, the header is messed up... It says in line 261. <?phpsession_cache_limiter('private, must-revalidate');session_name('sid');session_start();$_PAGE['start_time'] = getmicrotime();//// Unset globals//$methods = array('_POST', '_GET', '_COOKIE', '_FILES');isset($_SESSION) ? $methods[] = '_SESSION' : '';foreach ($methods as $method){ foreach ($$method as $var_name => $var_value) { unset($$var_name); }}$_GET['board'] = isset($_GET['board']) ? intval($_GET['board']) : null;$_GET['topic'] = isset($_GET['topic']) ? intval($_GET['topic']) : null;$_GET['message'] = isset($_GET['message']) ? intval($_GET['message']) : null;$_GET['user'] = isset($_GET['user']) ? intval($_GET['user']) : null; //// User Authentication Function//function auth($username, $password) { $result = mysql_query("SELECT username FROM users WHERE username = '$username' AND userpass = '$password'"); return mysql_num_rows($result) != 0 ? mysql_result($result, 0) : null;}//// SQL Field Fetching Function//function get_field($field, $tbl_name, $condition = 1){ $result = mysql_query("SELECT $field FROM $tbl_name WHERE $condition"); return @mysql_result($result, 0);}//// IP Fetching Function//function fetch_ip() { $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if (strpos($ip, ',')) { $ip = explode(',', $ip); $ip = trim($ip[0]); } return $ip;}//// Get Microtime//function getmicrotime() { list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } function navigator($title, $col = 2, $bor = 1, $spc = 0, $info = 1, $other_links = null, $style = null) { global $q_string, $userlevelm; if (isset($userlevelm)) { ?> <table border="<?= $bor ?>" cellspacing="<?= $spc ?>" width="100%"<?= $style ?>> <tr><td align="center" colspan="<?= $col ?>"><font size="6"><b><?= $title ?></b></font></td></tr> <tr><td align="center" colspan="<?= $col ?>" class="b"><i>Return to: <a class="menu" href="index.php">Board List</a> <?php if (isset($_GET['board'])) { ?> | <a class="menu" href="gentopic.php?board=<?= $_GET['board'] ?>">Topic List</a><?php } if (isset($_GET['topic'])) { ?> | <a class="menu" href="genmessage.php<?= $q_string['a'] ?>">Message List</a><?php } if ($info == 1) { ?> | <a class="menu" href="user.php<?= $q_string['a'] ?>">User Info Page</a><?php } if (is_array($other_links)) { foreach ($other_links as $href => $link_title) { $href = explode('|', $href); if ($href[1] == '' || $userlevelm >= $href[1]) { ?> | <a class="menu" href="<?= $href[0], $q_string['a'] ?>"><?= $link_title ?></a><?php } } } if ($userlevelm >= 52) { ?> | <a class="menu" href="cpanel.php<?= $q_string['a'] ?>">Control Panel</a><?php } ?> </i></td></tr> <?php } else { ?> <table border="<?= $bor ?>" cellspacing="<?= $spc ?>" width="100%"<?= $style ?>> <tr><td align="center" colspan="<?= $col ?>"><font size="6"><b><?= $title ?></b></font></td></tr> <tr><td align="center" colspan="<?= $col ?>" class="b"> <a class="menu" href="index.php">Board List</a> | <a class="menu" href="register.php">Register</a> | <a class="menu" href="login.php">Log In</a> | <a class="menu" href="help.php">Help</a> | <a class="menu" href="tos.php">ToS</a></td></tr> <?php }}//// Update Counter//mysql_query("UPDATE counters SET count_value=count_value+1 WHERE count_type='boards'");//// IP Banning//if (isset($_COOKIE['zXi7g'])) die;$result = mysql_query('SELECT ip_addr FROM banned_ips');while ($row = mysql_fetch_row($result)){ if (stristr($_SERVER['REMOTE_ADDR'], $row[0]) || stristr($_SERVER['HTTP_REFERER'], $row[0])) { setcookie('zXi7g', 'o', time()+92275200); die; }}if (stristr($_SERVER['HTTP_USER_AGENT'], 'anon')) die;//// User Name and Password Retrieval//$uname = isset($_SESSION['username']) ? $_SESSION['username'] : (isset($_COOKIE['uname']) ? $_COOKIE['uname'] : null);$pword = isset($_SESSION['password']) ? $_SESSION['password'] : (isset($_COOKIE['pword']) ? $_COOKIE['pword'] : null);//// Common User Info Retrieval//$row = @mysql_fetch_row(@mysql_query("SELECT userid, level, style, timezone, sidebar FROM users WHERE username='$uname' AND userpass='$pword'"));if (isset($row[0])){ $useridm = $row[0]; $userlevelm = $row[1]; $userstylem = $row[2]; $_PAGE['timezone'] = $row[3]*3600; $_PAGE['sidebar'] = $row[4]; mysql_query("UPDATE users SET lastsec='".time()."', lastacip='{$_SERVER['REMOTE_ADDR']}', last_page='". htmlspecialchars(preg_replace('#sid=[[:alnum:]]+(\&)*#i', '', $_SERVER['REQUEST_URI']), ENT_QUOTES) ."', user_agent='". htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES) ."', real_ip = '". fetch_ip() ."' WHERE userid='$useridm'");}//// Spit It All Out//?><html><head><title><?= $_CONFIG['mbsname'] ?>: <?= $title ?></title><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><?phpswitch ($userstylem) { case 'custom': extract(@mysql_fetch_assoc(mysql_query("SELECT * FROM style WHERE userid='$useridm'"))); echo "<style type=\"text/css\">a:link {color: $n_link; text-decoration: underline}a:visited {color: $n_vlink; text-decoration: underline}a.menu:link {color: $m_link; text-decoration: underline}a.menu:visited {color: $m_vlink; text-decoration: underline}a.menu:hover {color: $m_hlink; text-decoration: underline}a.menu:active {color: $m_alink; text-decoration: underline}body, td {background-color: $main_bg; font-family: $font_face; font-size: 80%;color: $font_color}.a {background-color: $c1_bg; font-size: 95%; color: $c1_fc; font-weight: bold}.b {background-color: $c2_bg; font-size: 95%; color: $c2_fc; font-weight: bold}.c {background-color: $c3_bg}.d {background-color: $c4_bg}.system {background-color: $system_bg}.shade {background-color: $shade_bg}.sidebar {background-color: $sidebar_bg}.large {font-size: 120%; font-weight: bold}.medium {font-size: 90%}.poll_graph {display: block; background-color: $poll_graph; line-height: 25px}</style>\n"; break; default: empty($userstylem) ? $userstylem = 1 : ''; $theme_path = mysql_result(mysql_query("SELECT theme_path FROM themes WHERE theme_id = $userstylem"), 0); echo '<link rel="stylesheet" type="text/css" href="'.$theme_path.'" />' . "\n";}echo $_PAGE['sidebar'] == 1 ? '<link rel="stylesheet" type="text/css" href="styles/margins.css" />' : '';?></head><body><?$_PAGE['sidebar'] == 1 ? include 'sidebar_header.inc.php' : '';if (isset($_GET['message'])) get_field('COUNT(*)', 'messages', "messageid = '{$_GET['message']}'") == 0 ? die('Invalid Message ID') : '';if (isset($_GET['topic'])) get_field('COUNT(*)', 'topics', "topicid = '{$_GET['topic']}' AND board='{$_GET['board']}'") == 0 ? die('Invalid Topic ID') : '';if (isset($_GET['board'])) get_field('COUNT(*)', 'boards', "boardid = '{$_GET['board']}'") == 0 ? die('Invalid Board ID') : '';if (isset($_GET['user'])) get_field('COUNT(*)', 'users', "userid = '{$_GET['user']}'") == 0 ? die('Invalid User ID') : '';if (defined('_FILE_LVL')){ if ($userlevelm < _FILE_LVL) { echo '<div align="center"><b><font size="6">Error</font></b></div><br /><div align="left">You have to be at least level <b>'.52.'</b> to view this page. Return to the <a href="javascript:window.history.go(-1)">previous page</a> or the <a href="index.php">general board list</a>.</div>'; include 'footer.inc.php'; exit; }}if ($userlevelm >= 52){ $result = mysql_query('SELECT COUNT(*) FROM marked'); $num_msgs = mysql_result($result, 0); $result = mysql_query("SELECT COUNT(*) FROM temp_users WHERE act_status = 2"); $num_pend_users = mysql_result($result, 0); ?> <span class="d" style="display: block; width: 100%; line-height: 25px; text-align: center"><b>Backlog:</b> <a href="mark_queue.php">Marked Messages</a> - <b><?= $num_msgs ?></b> / <a href="man_act_user.php">Inactive Users</a> - <b><?= $num_pend_users ?></b></span> <?php}//// Set Common Query String Variables//$q_string_x = '';$q_string_x .= isset($_GET['board']) ? 'board=' . $_GET['board'] : '';$q_string_x .= isset($_GET['topic']) ? '&topic=' . $_GET['topic'] : '';$q_string = array();$q_string['a'] = '';$q_string['b'] = '';if ($q_string_x != ''){ $q_string['a'] = '?' . $q_string_x; $q_string['b'] = '&' . $q_string_x;}?> For one, I dont know which is line 261, since I dont know how to count lines with a program. And if I did, I wouldn't know what to do. :\
  6. AHHHH!It doesnt work! I get a bigger error page now! It says the header is messed up too!http://forums.xisto.com/no_longer_exists/ for yourself!
  7. $_CONFIG['mbname'] = 'Giga Pass'; // Giga Pass$_CONFIG['mbsurl'] = 'http://gigapass.trap17.com'; // [url=http://gigapass.trap17.com]http://gigapass.trap17.com[/url]$_CONFIG['dbhost'] = 'Xisto.com'; // Xisto.com$_CONFIG['homepage'] = 'http://gigapass.trap17.com'; // [url=http://gigapass.trap17.com]http://gigapass.trap17.com[/url]$_CONFIG['legal_tags'] = 'b|i'; // HTML tags allowed in messages. You can only add tags that have no attributes./////// Set these variables:$_MYSQL['dbhost'] = ''; // localhost$_MYSQL['dbuser'] = ''; // dayzed_ejashby$_MYSQL['dbpass'] = ''; // (I put the password for dayzed_ejashby here)$_MYSQL['dbname'] = ''; // dayzed_SQLdatabase//// User level definitions//define('Inactive', 0);define('Warned', 1);define('Mutie', 12);define('Rookie', 15);define('Veteran', 18);define('Idol', 30);define('Moderator', 52);define('Administrator', 60);//// Include money (Coins) configuration. Go edit that file.//require 'mny_config.php';$db = @mysql_connect($_MYSQL['dbhost'], $_MYSQL['dbuser'], $_MYSQL['dbpass'])or die("<b>Error:</b> Failed to connect to database host: {$_MYSQL['dbhost']}<br /> <b>Possible Solution:</b> Check if the database host name, user name and password are defined correctly in the config.inc.php file.<br /> <b>MySQL says:</b> ". mysql_error());@mysql_select_db($_MYSQL['dbname'], $db)or die("<b>Error:</b> Failed to select database: {$_MYSQL['dbname']}<br /> <b>Possible Solution:</b> Check if the database is set up and the database name defined in the config.inc.php file is correct.<br /> <b>MySQL says:</b> ". mysql_error());?> So the code would be like that?
  8. Yes I did....*cries*So you can't help me anymore? Do you know anyone who can?
  9. <?php$_CONFIG['mbname'] = ''; // Giga Pass$_CONFIG['mbsurl'] = ''; // [url=http://gigapass.trap17.com]http://gigapass.trap17.com[/url]$_CONFIG['dbhost'] = ''; // Xisto.com$_CONFIG['homepage'] = ''; // [url=http://gigapass.trap17.com]http://gigapass.trap17.com[/url]$_CONFIG['legal_tags'] = 'b|i'; // HTML tags allowed in messages. You can only add tags that have no attributes.$_MYSQL['dbhost'] = ''; // localhost$_MYSQL['dbuser'] = ''; // dayzed_ejashby$_MYSQL['dbpass'] = ''; // (I put the password for dayzed_ejashby here)$_MYSQL['dbname'] = ''; // dayzed_SQLdatabase//// User level definitions//define('Inactive', 0);define('Warned', 1);define('Mutie', 12);define('Rookie', 15);define('Veteran', 18);define('Idol', 30);define('Moderator', 52);define('Administrator', 60);//// Include money (Coins) configuration. Go edit that file.//require 'mny_config.php';$db = @mysql_connect($_MYSQL['localhost'], $_MYSQL['dayzed_ejashby'], $_MYSQL['(password for dayzed_ejashby)']) or die("<b>Error:</b> Failed to connect to database host: {$_MYSQL['localhost']}<br /> <b>Possible Solution:</b> Check if the database host name, user name and password are defined correctly in the config.inc.php file.<br /> <b>MySQL says:</b> ". mysql_error());@mysql_select_db($_MYSQL['dayzed_sqldatabase'], $db)or die("<b>Error:</b> Failed to select database: {$_MYSQL['dayzed_sqldatabase']}<br /> <b>Possible Solution:</b> Check if the database is set up and the database name defined in the config.inc.php file is correct.<br /> <b>MySQL says:</b> ". mysql_error());?>Where my password is supposed to be, I have my password, not the text. Notice from snlildude87: Placing your code in BBCodes makes it so much easier to read
  10. I think I get what your saying, not sure though.I tried moving it around, all over the place, and an error message comes up. Go to here to figure out what I'm talking about:http://forums.xisto.com/no_longer_exists/ dont know what is wrong. I triple checked everything, and it seems to be correct....
  11. Whats an absolute link? Okay, okay, I lied, not the last question....
  12. Also, I have a file called sql.sql. Do I put it in the same place?
  13. Yeah, it probably is. When the slow as heck dial up allows me to uploade my files, I will tell you how it goes.If you make me blow it up, its your fault...
  14. Okay, thanks.But, there is a couple more problems, where do I upload the rest of my site script? In a seperate file? I have about 30 more files I need to upload, all of which are needed. Do I do it in a seperate file than index.php or in the same one? There is a footer that is needed on all pages and none of the site works without it. And uh, since your helping, you still want an admin position correct? Or are you doing this out of the kindness of your heart?
  15. I think I got it! I have one more question before I procede, do I delete what is already in index.html (which I renamed to index.php), that states, "You wont do this, Welcome to your site, thank you, ect ect.'? Well, not delete, but remove it and place my code in its place...
  16. Okay, so I look in public_html?The name of the first webpage is index.php.
  17. I see no 'public_http.'There is 'public_ftp' and 'public_html.' Thats it. :\
  18. Er, I uploaded the files to seperate files. There are about 50 of 'em. I still dont know what the database name is, would it be USERNAME_trap17 (so really it would be dayzed_trap17?) How do you change the index page?
×
×
  • 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.