Jump to content

Uploader V6.1 problem


chrismitchell

Recommended Posts

Hi everyone,

 

I'm hoping someone can let me know why this is happening..

 

I have used the Uploader V6.1 script to make a secure upload site for a client. Now it works perfectly apart from one thing. If you are already logged in and you return to the main domain it shows both the main homepage and the page for people logged in.

 

I've been looking at this code for far too long I think.. I was wondering if someone could have a look see and let me know if there is something i've missed?

 

<?php
if ( !isset ( $page_title ) )   $page_title = 'Welcome the Justupload';
if ( !isset ( $content ) )      $content    = 'No content specified.';

// check for unread messages
$has_unread = false;
if ( $UPL['USER']['logged_in'] )
{
    $messages =& $UPL['USER']['messages'];
    reset ( $messages );
    while ( list ( $i, $message ) = each ( $messages ) )
    {
if ( !$message['read'] ) $has_unread = true;
    }
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<title>Welcome to Justupload</title>
<link rel="stylesheet" type="text/css" href="templates/default2/style.css" media="all">
<script type="text/javascript" src="templates/default2/javascript.js"></script>
</head>
<body class="bg" onunload="window.open('account.php?action=logout');" >
<div class="redbartop"></div>
    <noscript>
        <p style="text-align:center;font-size:1.2em;color:red;font-weight:bold;">Please enable Javascript to properly access this service.</p>
    </noscript>
<br/>
<div id="container1">
<a href="http://www.justupload.co.uk/account.php?action=logout"><img id="logo" src="http://www.justupload.co.uk/images/justdigitallogo.png" /></a>
    <?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?>
    <div id="container">
    <div id="container2">
		<?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?>
		<div id="top">
			Welcome <span style="color:#E51B24;"><?=$UPL['USER']['name']?>!</span> <a href="account.php?action=logout" onclick="return confirm('Confirm logout?');">Please logout you are when finished</a>.
		</div>
		<div id="menu">
			<div id="menu_links">
				<div style="float:left;">
					<?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?>
					<a href="myfiles.php">My Files</a>
					<a href="upload.php">Upload</a>
					<?php /* Otherwise, show this menu instead */ else: ?>
					<a href="account.php?action=login">Login</a>
					<a href="account.php?action=register">Register</a>
					<?php endif; ?>
				</div>

				<?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?>
				<div style="float:right;">
					<a href="usercp.php">User Control Panel</a>
					<a href="account.php?action=logout" onclick="return confirm('Confirm logout?');">Logout</a>
				</div>
				<?php endif;?>
			</div>
		</div>
		<?php /* Otherwise, show this menu instead */ else: ?>
		<?php endif; ?>
		<div id="message">
			<div style="float:left;width:98%;" id="message_content"><!-- --></div>
			<div style="float:right;width:10px;text-align:right;"><img src="templates/default2/images/close.gif" alt="" onclick="showIt('message',false);" style="cursor:pointer;" /></div>
			<div class="spacer"><!-- --></div>
		</div>

            <div id="content">
                <?=$content?>
            </div>
        </div>
</div>
</div>
<?php /* Otherwise, show this menu instead */ else: ?>
<div id="container3">
	<div id="content">
            <?=$content?>
	</div>
</div>
<?php endif; ?>
    <div id="credit">
<?php /* If user is logged in, show this menu */ if ( $UPL['USER']['logged_in'] ) : ?>
<p style="color:#fff;font-size:18px;">browser based - no software - no hassle</p>
<?php /* Otherwise, show this menu instead */ else: ?>
<img src="http://www.justupload.co.uk/test/templates/default2/images/Icon.png"/>
<?php endif; ?>
<br/>
<a style="color:#fff;fontsize:9px;text-align:center;font-weight:normal;" href="http://www.nemodesigns.com/webdesign.html">Pixels by Nemo Designs</a><br/>
        <?php /* Show this link if user is a mod or admin */ if ( $UPL['USER']['level'] >= LEVEL_MODERATOR ) : ?>
        <br /> <a href="admin.php">Go to Admin section</a>
        <?php endif; ?>
    </div>

    <!-- post processing -->
    <?php /* Show message if there are unread messages */
    if ( $has_unread ) : ?>
    <script type="text/javascript">
    help ( 'You have a new message. <a href="usercp.php?action=pm" class="special">Click here</a> to view your messages.' );
    </script>
    <?php endif; ?>
</body>
</html>

 

What i would love to do is either force the user to go to a different location if they are logged in and they go to the main url or to log them off when they close the window or something like that.. i've tried all number of things and nothing seems to work..

 

I'm hoping that someone on here has had similar problems with this and knows of a solution :)

 

Thanks everyone :)

 

Chris

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.