New web layout but a few questions

nexhunter

New Member
Messages
239
Reaction score
1
Points
0
http://xstudio.elementfx.com/
I used fireworks then trial of microsoft expression web designer. And i got some questions if no one minds answering.

1.Does anyone know how to make a phpbb3 login box so it can show on an html page while the forum files are in a sub folder called forum?

2. If I added left or right boxes would it look better or worser?

3. Can i use iframes on the main page for news and have it insert a .txt file or would that be breaking the corporate rule where advertisement must be on all pages visible.
 

eddysweb

New Member
Messages
63
Reaction score
0
Points
0
Well the first one should be able to be done, i did it for PHPBB2 which was reasonably easy cause you don't actually use the files from the forum, you just connect to its databse. BUT you can't display it an HTML page you have to use PHP. Here is a little bit of code that should get i used for phpbb2 that you should be able to mod prity easily:

LOGIN SCRIPT:
Code:
<?PHP
$database_name = "PHPBB3_DATABASE";
    //If a log out
    if(@($_GET['f'] == "logout")){
        echo "<meta http-equiv=\"Refresh\" content=\"1.5; URL=index.php\">";
        echo "<div class=\"logout\" align=\"center\">Logging out...</div>\n";
        exit();
}
    if(@($_GET['posted'] == "true")){
            function connect($database_name){
                $mysql_c = mysql_connect('localhost','YOUR_USERNAME','YOUR_PASSWORD');
                $mysql_db = mysql_select_db($database_name);
            }
        connect(PHPBB DATABASE);
        $sql = "SELECT `user_password` FROM `phpbb_users` WHERE UPPER(`username`) = '" . strtoupper($_POST['username']) . "";
        $MD5_password = mysql_query($sql);
        if(@mysql_num_rows($MD5_password)){
            if(implode('',mysql_fetch_array($MD5_password, MYSQL_ASSOC)) == md5($_POST['password'])){
                $_SESSION['username'] = $_POST['username'];
                //Log in
                $error_message = "<div class=\"login\" align=\"center\">Login Successful!</div>";
                echo "<meta http-equiv=\"Refresh\" content=\"1; URL=index.php?f=success\">";
                exit();
            }else{
                //Incorrect password
                $error_message = "<div class=\"logout\" align=\"center\">Login Failed!</div>";
                $username_correct = true;
            }
        }else{
            //Incorrect username message
            $error_message = "<div class=\"logout\" align=\"center\">Login Failed!</div>";
            $username_correct = false;
        }
        
    }
?>
All that we did here is connect to the same database that PHPBB2 uses, grab the username and password the same way it would and checks them against the details put in.

LOGIN FORM:
Code:
<form name="userDetails" action="?posted=true" method="post">
                      <p><label for="username" class="txt">Username: </label>
                          <input class="inputForm" type="text" name="username" tabindex="1" <?PHP if($username_correct){echo 'value=' . $_POST['username'] ;} ?>>
                        </p>

                      <p><label for="password" class="txt">Password: </label>
                          <input class="inputForm" type="password" name="password" tabindex="2">
                      </p>
            
                      <p><input type="submit" name="button" id="button" value="Submit" />
</form>

PRINT:
Code:
<?PHP echo $error_message; ?>

Can't promise anything bout this code but it should work.

I'm not fantastic on design so i'll leave the display to someone else and finally you can use iframes in a page because i do it. I don't have the ads on the included pages but i have them on the page that has the iframe in it. This way every page that gets displayed still has an add on it.
 
Last edited:

nexhunter

New Member
Messages
239
Reaction score
1
Points
0
Thanks for the help i'm currently looking into my layout in fireworks right now and making some changes to add the log in.
 
Top