Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
Quote:
Originally Posted by
Murawd
Well, for one, you used way too many queries. The structure makes no sense, and there isn't much room for additions.
This is just a Pre-Alpha Release. It's not supposed to be too much
Quote:
Originally Posted by
xSilv3rbullet
Wayne...you messed it up.
Just shut up.
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
Quote:
Originally Posted by
SimpleBB
This is just a Pre-Alpha Release. It's not supposed to be too much
Just shut up.
It doesn't matter. This isn't very extensible.
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
Quote:
Originally Posted by
Murawd
It doesn't matter. This isn't very extensible.
Let's take this to VM.
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
Can has cookie?
style/poseidonBB/usercp.php (apparently he didn't finish it, cuz it's crap. T_T)
PHP Code:
<?php
/**
* User Control Panel
*/
if(isset($_SESSION['uid']))
{
$sql = "SELECT * FROM `users` WHERE `id`='".$_SESSION['uid']."'";
$res = mysql_query($sql) or die (mysql_error());
$row = mysql_fetch_array($res);
$profile_ops = array('Edit Your Details' => 'edit_detail', 'Change Your Account Details' => 'acc_detail');
$comm_ops = array('Friends and Contacts' => 'friends_contacts', 'Ignored Users' => 'ignore_users');
$pm_ops = array('Send New' => 'pm_send', 'Inbox' => 'pm_inbox', 'Sent' => 'pm_sent');
$proc = 1;
$count = count($profile_ops);
$comm_count = count($comm_ops);
$pm_count = count($pm_ops);
if(isset($_GET['do'])) {
$do = $_GET['do'];
} else {
$do = "";
}
echo "<center>";
echo "<div id=\"container\">";
echo "<div id=\"userinfo\">";
echo "<table border=\"0\" width=\"100%\">";
echo "<tr align=\"right\"><td>Welcome, <a href=\"".$rootdir."profile.php?id=".$row['id']."\">".$row['username']."</a>! <a href=\"".$rootdir."logout.php\">Logout</a></td></tr>";
echo "</table>";
echo "</div>";
echo "<table border=\"0\" width=\"100%\" cellspacing=\"3\" cellpadding=\"3\">";
echo "<tr><td align=\"left\" width=\"22%\">";
echo "<div id=\"notice\" style=\"width:95%; border:1px solid #000;\">UCP Options</div>";
echo "<div id=\"content\" style=\"width:95%; border:1px solid #000; margin-top:0px;\">";
echo "<a href=\"".$rootdir."ucp.php\">«UCP Home»</a><br><br>";
echo "<b>Profile Options</b><br>";
foreach($profile_ops AS $name => $link)
{
$break = ($proc == $count) ? "" : " <br> ";
echo "<a href=\"".$rootdir."ucp.php?do=".$link."\">".$name."</a>" . $break . "\n";
$proc++;
}
echo "<br><b>Community</b><br>";
foreach($comm_ops AS $name => $link)
{
$break = ($proc == $comm_count) ? "" : " <br> ";
echo "<a href=\"".$rootdir."ucp.php?do=".$link."\">".$name."</a>" . $break . "\n";
$proc++;
}
echo "<b>Private Messaging</b><br>";
foreach($pm_ops AS $name => $link)
{
$break = ($proc == $pm_count) ? "" : " <br> ";
echo "<a href=\"".$rootdir."ucp.php?do=".$link."\">".$name."</a>" . $break . "\n";
$proc++;
}
echo "</div>";
echo "</div>";
echo "</td><td colspan=\"2\" valign=\"top\" align=\"left\">";
echo "<div id=\"content\">";
switch($do)
{
case NULL:
echo "<title>User Control Panel</title>";
echo "Welcome to the User Control Panel, ".$_SESSION['name']."!<br>
Here, you will find many useful tools to tweak and edit your profile to create the ultimate look!<br><br>
<i>Profile Options - Change your email, include your website, your location, anything! Keep in mind that all of this is displayed publicly.</i><br><br>
<i>Community - Access friends, contacts, or anything related to the community here!</i><br><br>
<i>Private Messaging - You can use private messaging to send someone a message without it being publicly displayed on the user's profile.</i>";
break;
case "edit_detail":
$image = (file_exists("avatars/".$get['posterid'].".gif")) ? "<img src=\"avatars/".$_SESSION['uid'].".gif\" title=\"Your Avatar\" border=\"1\">" : "No Avatar";
echo "<title>User Control Panel - Edit Details</title>";
echo "<fieldset>
<legend>Avatar</legend>
<center>
".$image."<br />
</center>
<form method=\"post\" action=\"\">
<table border=\"0\" cellspacing=\"1\" width=\"100%\">
<tr>
<td>
<input type=\"file\" name=\"avatar\">
</td>
</tr>
</table>
</form>
</fieldset>";
break;
case "acc_detail":
echo "<title>User Control Panel - Edit Account Details</title>";
if(!isset($_POST['updatepass']))
{
echo "<fieldset>
<legend>Change Password</legend>
<form method=\"post\" action=\"\">
<table border=\"0\" cellspacing=\"1\" width=\"100%\">
<tr>
<td>
<fieldset>
<legend>Please enter your current password to continue</legend>
<input type=\"password\" name=\"password\">
</fieldset>
</td>
</tr>
<tr>
<td>
New Password
<input type=\"password\" name=\"newp\">
</td>
</tr>
<tr>
<td>
Confirm New Password
<input type=\"password\" name=\"cnewp\">
</td>
</tr>
<tr>
<td>
New Email Address
<input type=\"text\" name=\"newemail\">
</td>
</tr>
<tr>
<td>
<input type=\"submit\" name=\"updatepass\" value=\"Update Details\">
</td>
</tr>
</table>
</form>
</fieldset>";
}
else
{
$old = mysql_real_escape_string(stripslashes($_POST['password']));
$new = mysql_real_escape_string(stripslashes($_POST['newp']));
$confirm = mysql_real_escape_string(stripslashes($_POST['$cnewp']));
$email = mysql_real_escape_string(stripslashes($_POST['newemail']));
$sql = "SELECT * FROM `users` WHERE id='".$_SESSION['uid']."'";
$query = mysql_query($sql) or die(mysql_error());
$fetch = mysql_fetch_array($query);
$md5pass = md5($old);
$md5newpass = md5($new);
if($md5pass == $fetch['password'])
{
if($new == $confirm)
{
mysql_query("UPDATE `users` SET password='".$md5newpass."' WHERE id='".$_SESSION['uid']."'") or die(mysql_error());
}
else
{
echo "Passwords do not match!";
}
if($email != "")
{
mysql_query("UPDATE `users` SET email='".$email."' WHERE id='".$_SESSION['uid']."'") or die(mysql_error());
}
else
{
echo "Please provide an email!";
}
}
else
{
echo "Incorrect password provided!";
}
}
break;
case "pm_send":
$userid = mysql_real_escape_string(stripslashes($_GET['uid']));
#$script = "INSERT INTO";
break;
}
echo "</div>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "</center><br>";
}
else
{
include('notice.php');
}
?>
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
You should learn to separate the html from the PHP. This is where procedural becomes a pain.
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
Well then, thank you for your opinion, I'll try to change it around.
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
lol, can I has the latest build?
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
I am sorry, but that is THEE ugliest theme I have ever seen. Do you honestly need someone to explain to you why it's horrible? Good job on making a forum software, but the theme is just.. just sucks. Sorry dude.
Instead of using just HTML, try looking into making actual forum themes. Look at RaGEZONE, you see how the whole thing flows? Well, your's is just blue, grey, and text.
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
It looks alright but the skin there just put me off straight away.
Re: [PHP]SimpleBB - The New Bulletin Board! (And the new poseidonBB :D)
Are you kidding me? You don't code it to suit Internet Explorer. That's the most retarded thing you can do. It's not Firefox's fault the borders are not aligned, it's your fault for very poor coding.
You should code your layouts to work in Firefox, that pretty much guarantees it to work with other standards compliant browsers like Chrome, Opera, Safari etc etc. Once that's done, hack it for [s]shit[/s], I mean Internet Explorer.
Also your PHP code has absolutely no structure whatsoever, you've caused it to be almost impossible to improve on it/make it extensible. Also you are running too much innefficient crap. Learn to optimise code, don't just use OOP for MySQL, use it everywhere where neccessary. Keep everything organised, optimal and nice looking. I would hate to be writing plugins for this forum I'll tell you that.
If there's one thing I hate it's flaming other people, however this is just stupid. You should learn good programming techniques and best practices. Have a look at how other forums are structured. Once you have a good understanding, then start to write your own forum. It also wouldn't kill you to learn some decent xHTML/CSS skills too.