How do I use them? I making a mod wich affect the user profile and I see link like: pun_link($pun_url['profile_about'], $id) and I don't really understand it. How do I make my mod working with the url rewrite system?

This:

td.tcl span.unread.new img {
    border-color: #2B75AD #235E8C #1F537B #266799
    }

Does not work in IE6.

28

(3 replies, posted in PunBB 1.2 show off)

A forum for Team Kosmos (a graphics team I'm in). I made the style for the forum.

Url: http://teamkosmos.wepwnyou.net/

Couldn't find it. But after replacing the files with those from my local forum is worked again.

I got this error showing up when I enter my download page:

Warning: Cannot modify header information - headers already sent by (output started at /home/fsx61924/public_html/mithrill/download.php:2) in /home/fsx61924/public_html/mithrill/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home/fsx61924/public_html/mithrill/download.php:2) in /home/fsx61924/public_html/mithrill/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home/fsx61924/public_html/mithrill/download.php:2) in /home/fsx61924/public_html/mithrill/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home/fsx61924/public_html/mithrill/download.php:2) in /home/fsx61924/public_html/mithrill/header.php on line 34

I tried some thing but I don't really know how to solve it. The download isn't working either, when I click download my browser shows all kinds of weirds characters.

This is the source of my download page.:

<?php
/***********************************************************************

  Copyright (C) 2007-2008  Frank Smit (fsx.nr01@gmail.com)

  This file is part of Download Mod.

  Download Mod is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  Download Mod is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';

// Load the index.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';

// Config
$dldir            = $pun_config['dl_download_dir'];
$page_limit        = $pun_config['dl_files_per_page'];

// Url stuff
$_GET            = array_map('addslashes', $_GET);
$_GET            = array_map('trim', $_GET);
$category        = $_GET['c'];
$by                = empty($_GET['by']) ? 'date' : $_GET['by'];
$sort            = $_GET['sort'] == 'DESC' ? 'ASC' : 'DESC';
$sortp            = $_GET['sort'] == 'ASC' || $_GET['sort'] == 'DESC' ? $_GET['sort'] : '';
$getp            = empty($_GET['p']) ? 0 : $_GET['p'];

// Download the file
if (!empty($_GET['d'])) {
    // Set vars
    $info        = explode (",", $_GET['d']);
    $info['3']     = findexts($info['1']);
    $filepath    = PUN_ROOT.$dldir.'/'.$info['0'].'/'.$info['1'];
    
    if (!file_exists($filepath))
        message('File does not exist.');
    
    // Checking stuff
    if (filterlist($filename,$info['0'],$info['3']['0'],$info['3']['1'],true)) {
        
        // Update bandwidth of user
        $db->query('UPDATE '.$db->prefix.'users SET dl_total_bandwidth=dl_total_bandwidth+'.$info['2'].' WHERE id='.$pun_user['id']) or error('Unable to update total bandwidth of user', __FILE__, __LINE__, $db->error());
    
        // Write to log
        $logfile = $dldir.'/.log';
        $fopen = fopen($logfile, 'a') or die('can\'t open file');
        fwrite($fopen, $pun_user['username'].' - '.date("Y-m-d/H:i:s", time()).' - '.$info['0'].'/'.$info['1']."\n");
        fclose($fopen);
        
        // Check if file can be opened, if so, download it
        $fp = @fopen($filepath, "rb");
        if(!$fp) {
            die('Bad request');
        } else {
            $filepath = rawurlencode($filepath);    // fix filename (spaces may still mess things up, perhaps add a specific MSIE thing later, not sure though)

            header('Content-Disposition: attachment; filename="'.$info['1'].'"');
            header('Content-type: application/octet-stream');
            header('Pragma: no-cache');
            header('Expires: 0'); 
            header('Connection: close');
            header('Content-Length: '.$info['2']);
            fpassthru($fp);
        }
    
    } else message('You are not aloud to download this file. <a href="download.php?c='.$info['0'].'">Click here to go back.</a>');
    
    exit;
}

// Stuff for the search function
if (isset($_POST['form_sent']) && !empty($_POST['searchword']) && !empty($_POST['category'])) {
    session_name('dlmod_search');
    session_start();
    
    
    if (!isset($_SESSION['initiated'])) {
        session_regenerate_id();
        $_SESSION['initiated'] = true;
    } 
}

// Insert search stuff in a session
if (isset($_SESSION['initiated']) && isset($_POST['form_sent']) && !empty($_POST['searchword']) && !empty($_POST['category'])) {
    
    $searchvar = array_map('trim', $_POST);
    
    $_SESSION['search'] = array(
        'searchword'     => ereg_replace('[^a-zA-Z0-9 _ -]', '', $searchvar['searchword']),
        'searchby'         => intval($searchvar['searchby']),
        'category'         => addslashes($searchvar['category'])
    );
    
    if ($category != $_SESSION['search']['category'] && is_dir($dldir.'/'.$_SESSION['search']['category'])) {
        header('location: download.php?c='.$_SESSION['search']['category']);
        exit;
    }
}

// Clean out sesson if user goes to an other category
if ($category != $_SESSION['search']['category'] || isset($_GET['clean']))
    $_SESSION['search'] = NULL;

// Read dirs
if (!empty($category)) {
    
    // Read dir for filelist
    $dir    = $dldir.'/'.$category;
    $dh        = opendir($dir);
    while (false !== ($filename = readdir($dh))) {
        
        $filetype = findexts($filename);
        
        if (filterlist($filename,$category,$filetype['0'],$filetype['1'],true)) continue;

        $filestats    = stat($dldir.'/'.$category.'/'.$filename);
        $files[]    = array('filename' => $filename , 'filenamenoext' => $filetype['0'] , 'filesize' => $filestats['7'], 'filetype' => $filetype['1'], 'filedate' => $filestats['mtime']);
    }
    
    $filecount = count($files) - 1;
    $cfilecount = $filecount + 1;
    
    if ($cfilecount != 0) {
        if        ($by == 'name') foreach($files as $res) $sortAux[] = $res['filename'];
        elseif    ($by == 'size') foreach($files as $res) $sortAux[] = $res['filesize'];
        elseif    ($by == 'type') foreach($files as $res) $sortAux[] = $res['filetype'];
        elseif    ($by == 'date') foreach($files as $res) $sortAux[] = $res['filedate'];
    
            
        if        ($sort == 'ASC')    array_multisort($sortAux, SORT_ASC, $files);
        elseif    ($sort == 'DESC')    array_multisort($sortAux, SORT_DESC, $files);
    }
    
    
} else {
    
    // Read dir for download index list
    $cdir    = $dldir;
    $cdh    = opendir($cdir);
    while (false !== ($cname = readdir($cdh))) {
        
        if (filterlist($cname)) continue;
        
        $cstats = stat($dldir.'/'.$cname);
        $cdirs[] = array('cname' => $cname ,'cdate' => $cstats['mtime']);
    }
    
    $ccount = count($cdirs) - 1;
    
    if        ($by == 'name') foreach($cdirs as $res) $sortAux[] = $res['cname'];
    elseif    ($by == 'date') foreach($cdirs as $res) $sortAux[] = $res['cdate'];
        
    if        ($sort == 'ASC')    array_multisort($sortAux, SORT_ASC, $cdirs);
    elseif    ($sort == 'DESC')    array_multisort($sortAux, SORT_DESC, $cdirs);

}

// Read dir for category menu
$menudir    = $dldir;
$menudh     = opendir($menudir);
while (false !== ($dirname = readdir($menudh))) {
    if (filterlist($dirname)) continue;
    
    $dirsmenu[] = $dirname;
}
@sort($dirsmenu);
    
// Set title
$cattitle = !empty($category) ? '/ '.str_replace('_',' ',$category) : '';
$page_title = pun_htmlspecialchars($pun_config['o_board_title'])." / Downloads $cattitle";
require PUN_ROOT.'header.php';

if (intval($pun_config['dl_open_closed']) == 0)
    message('The download section is closed.');

if ($pun_user['id'] == 1 && intval($pun_config['dl_guest_access']) == 0)
    message('Guests are not allowed to download. Please <a href="register.php">register</a> or <a href="login.php">login</a>.');

?>

<div class="block2col">

    <div class="blockmenu">
        <h2><span>Download menu</span></h2>
        <div class="box" style="">
            <div class="inbox">
                <ul>
                    <li><a href="download.php">Download Index</a></li>
                    <li><hr style="height: 0;border: 0;border-top: 1px solid #BFBFBF;" /></li>                    
                    <li><select onchange="window.location='download.php?c='+this.value" style="width: 100%">
                        <option value="">Select category</option>
                        <?php foreach ($dirsmenu as $menuitem) { $selected = $menuitem == $category ? ' selected="selected"' : ''; echo '<option value="'.$menuitem.'"'.$selected.'>'.str_replace('_',' ',$menuitem).'</option>'."\n"; } ?>
                    </select></li>
                    
                </ul>
            </div>
        </div>
    </div>
    
    <?php if (!empty($category)) { 
        
        // Get information file
        if(file_exists($dldir.'/'.$category.'/.info')) {
            
            require PUN_ROOT.'include/parser.php'; ?>
            
            <div class="block">    
                <h2><span>Information about <?=str_replace('_',' ',$category)?></span></h2>
                <div class="box">
                    <div class="inbox" style="padding:5px">
                        <?php 
                        $dext = file_exists($dldir.'/'.$category.'/_descimg.gif') ? 'gif' : file_exists($dldir.'/'.$category.'/_descimg.jpg') ? 'jpg' : 'png';
                        if(file_exists($dldir.'/'.$category.'/_descimg.'.$dext)) echo '<img style="float:right;margin: 5px 3px 5px 5px" src="'.$dldir.'/'.$category.'/_descimg.'.$dext.'" alt="" />'; echo parse_message(file_get_contents($dldir.'/'.$category.'/.info'), 0); ?>
                        <div class="clearer" style="clear:right !important"></div>
                    </div>
                </div>
            </div>
            <br />
            
        <?php } 
        
        if ($cfilecount == 0) { ?>
            
            <div class="blockform">
                <h2><span>File search</span></h2>
                <div class="box">
                <form id="filelist" method="post" action="download.php?c=<?=$category?>">
            
                    <input type="hidden" name="form_sent" value="1" />
                
                    <div class="inform">
                        <fieldset>
                            <legend>Find files</legend>
                            <div class="infldset">
                                <label class="conl">Filename<br /><input type="text" name="searchword" value="<?php if (isset($_SESSION['search'])) echo $_SESSION['search']['searchword']; ?>" size="25" maxlength="255" /><br /></label>
                                
                                <label class="conl">Search by
                                <br /><select name="searchby">
                                        <option value="1">Filename</option>
                                        <option value="2">Extension</option>
                                </select>
                                <br /></label>
                                
                                <label class="conl">Category
                                <br /><select name="category">
                                        <?php foreach ($dirsmenu as $menuitem) { $selected = $menuitem == $category ? ' selected="selected"' : ''; echo '<option value="'.$menuitem.'"'.$selected.'>'.str_replace('_',' ',$menuitem).'</option>'."\n"; } ?>
                                </select>
                                <br /></label>
                                <p class="clearb">Enter a filename to search or search by extension/filetype.</p>
                            </div>
                        </fieldset>
                    </div>
                    <p><input type="submit" name="search" value="Submit" accesskey="s" /> <?php if (isset($_SESSION['search'])) echo '<a href="download.php?c='.$category.'&clean">View normal filelist.</a>'; ?></p>
                </form>
            
                </div>
            </div>
            <br />
        
            <div class="block box" style="text-align:center;padding:10px">
            <?php if (isset($_SESSION['search'])) { ?>
                <span>No files found.</span>
            <?php } else { ?>
                <span>There are no files in this category.</span>
            <?php } ?>
            </div>
                    
            <?php
                    
        } else {
            
            ?>
            
            <div class="blockform">
                <h2><span>File search</span></h2>
                <div class="box">
                <form id="filelist" method="post" action="download.php?c=<?=$category?>">
            
                    <input type="hidden" name="form_sent" value="1" />
                
                    <div class="inform">
                        <fieldset>
                            <legend>Find files</legend>
                            <div class="infldset">
                                <label class="conl">Filename<br /><input type="text" name="searchword" value="<?php if (isset($_SESSION['search'])) echo $_SESSION['search']['searchword']; ?>" size="25" maxlength="255" /><br /></label>
                                
                                <label class="conl">Search by
                                <br /><select name="searchby">
                                        <option value="1">Filename</option>
                                        <option value="2">Extension</option>
                                </select>
                                <br /></label>
                                
                                <label class="conl">Category
                                <br /><select name="category">
                                        <?php foreach ($dirsmenu as $menuitem) { $selected = $menuitem == $category ? ' selected="selected"' : ''; echo '<option value="'.$menuitem.'"'.$selected.'>'.str_replace('_',' ',$menuitem).'</option>'."\n"; } ?>
                                </select>
                                <br /></label>
                                <p class="clearb">Enter a filename to search or search by extension/filetype.</p>
                            </div>
                        </fieldset>
                    </div>
                    <p><input type="submit" name="search" value="Submit" accesskey="s" /> <?php if (isset($_SESSION['search'])) echo '<a href="download.php?c='.$category.'&clean">View normal filelist.</a>'; ?></p>
                </form>
            
                </div>
            </div>
            <br />
            
            <div class="block">
                <h2><span><?=str_replace('_',' ',$category)?> - <?=$cfilecount?> files</span></h2>
                <div class="box" style="padding:0">
                    <div class="inbox" style="padding:0">
                
                        <table cellspacing="0">
                        <thead>
                            <tr>
                                <th class="tcl" scope="col" style="width:46%"><a href="download.php?c=<?=$category?>&p=<?=$getp?>&by=name&sort=<?=$sort?>">Filename</a></th>
                                <th class="tc2" scope="col" style="width:15%"><a href="download.php?c=<?=$category?>&p=<?=$getp?>&by=size&sort=<?=$sort?>">Size</a></th>
                                <th class="tc3" scope="col" style="width:15%"><a href="download.php?c=<?=$category?>&p=<?=$getp?>&by=type&sort=<?=$sort?>">Type</a></th>
                                <th class="tcr" scope="col" style="width:24%"><a href="download.php?c=<?=$category?>&p=<?=$getp?>&by=date&sort=<?=$sort?>">Date</a></th>
                            </tr>
                        </thead>
                        <tbody>
                        
                            <?php 
                            
                            $startrow            = $getp * $page_limit;
                            $calculateendrow    = $startrow + $page_limit;
                            
                            if        ($calculateendrow > $filecount) $endrow = $filecount + 1;
                            else    $endrow = $startrow + $page_limit;
                            
                        //    for ($i = 0; $i <= $filecount; $i++) { Use this to view all the downloads on one page
                            for ($i = $startrow; $i <= $endrow - 1; $i++) {
                                
                                $rowbg = $rowbg == 'even' ? 'odd' : 'even';
                                
                            ?>
                
                                 <tr class="<?=$rowbg?>">
                                    <td class="tcl"><a href="download.php?d=<?=$category.",".rawurlencode($files[$i]['filename']).",".$files[$i]['filesize']?>" title="<?=htmlspecialchars($files[$i]['filenamenoext'])?>"><?=htmlspecialchars(substrdot($files[$i]['filenamenoext']))?></a></td>
                                    <td class="tc2" style="width:15%"><?=fsize($files[$i]['filesize'])?></td>
                                    <td class="tc3" style="width:15%"><a href="http://www.fileinfo.net/extension/<?=strtolower($files[$i]['filetype'])?>" target="_blank"><?=strtolower($files[$i]['filetype'])?></a></td>
                                    <td class="tcr" style="width:24%"><?=format_time($files[$i]['filedate'],true)?></td>
                                </tr>
                                
                            <?php } ?>
                            
                            
                        </tbody>
                        </table>
                    </div>
                </div>
            </div>
            
            <?php $calculatepages = ceil($cfilecount / $page_limit) - 1; if ($calculatepages >= 1) { ?>
            
            <div class="linkst block" style="margin-top: 15px">
                <p class="pagelink">Pages:
                <?php
            
                    for ($j = 0; $j <= $calculatepages; ++$j) {
                        $k = $j + 1;
                        
                        $bold = $_GET['p'] == $j ? ' style="font-weight:bold"' : '';
                        
                        echo '<a'.$bold.' href="download.php?c='.$category.'&p='.$j.'&by='.$by.'&sort='.$sortp.'">'.$k.'</a> ';
                    }
                
                ?></p>
            </div>
        
        <?php } } ?>
    
    <?php } else { 
        
        // Get information file
        if(file_exists($dldir.'/.dldesc')) {
            
            require PUN_ROOT.'include/parser.php'; ?>
            
            <div class="blockform">    
                <h2><span>Information</span></h2>
                <div class="box">
                    <div class="inbox" style="padding:5px">
                        <?=parse_message(file_get_contents($dldir.'/.dldesc'), 0)?>
                    </div>
                </div>
            </div>
            <br />
            
        <?php } ?>
    
            <div class="blockform">
                <h2><span>File search</span></h2>
                <div class="box">
                <form id="filelist" method="post" action="download.php?c=<?=$category?>">
            
                    <input type="hidden" name="form_sent" value="1" />
                
                    <div class="inform">
                        <fieldset>
                            <legend>Find files</legend>
                            <div class="infldset">
                                <label class="conl">Filename<br /><input type="text" name="searchword" value="<?php if (isset($_SESSION['search'])) echo $_SESSION['search']['searchword']; ?>" size="25" maxlength="255" /><br /></label>
                                
                                <label class="conl">Search by
                                <br /><select name="searchby">
                                        <option value="1">Filename</option>
                                        <option value="2">Extension</option>
                                </select>
                                <br /></label>
                                
                                <label class="conl">Category
                                <br /><select name="category">
                                        <option value="">Select a category</option>
                                        <?php foreach ($dirsmenu as $menuitem) { echo '<option value="'.$menuitem.'">'.str_replace('_',' ',$menuitem).'</option>'."\n"; } ?>
                                </select>
                                <br /></label>
                                <p class="clearb">Enter a filename to search or search by extension/filetype.</p>
                            </div>
                        </fieldset>
                    </div>
                    <p><input type="submit" name="search" value="Submit" accesskey="s" /> <?php if (isset($_SESSION['search'])) echo '<a href="download.php?c='.$category.'&clean">View normal filelist.</a>'; ?></p>
                </form>
            
                </div>
            </div>
            <br />
        
        <div class="block">
            <h2><span>Downloads - <?=$ccount+1?> Categories</span></h2>
            <div class="box">
                <div class="inbox" style="padding:0">
        
                    <table cellspacing="0">
                    <thead>
                        <tr>
                            <th class="tcl" scope="col"><a href="download.php?by=name&sort=<?=$sort?>">Name</a></th>
                            <th class="tc2" scope="col" style="width:24%;text-align:left"><a href="download.php?by=date&sort=<?=$sort?>">Date</a></th>
                        </tr>
                    </thead>
                    <tbody>
                
                        <?php for ($i = 0; $i <= $ccount; $i++) { $rowbg = $rowbg == 'even' ? 'odd' : 'even'; ?>
            
                             <tr class="<?=$rowbg?>">
                                <td class="tcl"><a href="download.php?c=<?=$cdirs[$i]['cname']?>"><?=str_replace('_',' ',$cdirs[$i]['cname'])?></a></td>
                                <td class="tc2" style="width:24%;text-align:left"><?=date('F d Y', $cdirs[$i]['cdate'])?></td>
                            </tr>
                            
                        <?php } ?>
                        
                    </tbody>
                    </table>
                </div>
            </div>
        </div>
    
    <?php } ?>
    
    <div class="clearer"></div>    
</div>

<?php 
require PUN_ROOT.'footer.php';

I tope someone can help me.

It seems no price is needed smile. When does the contest start?

I saw this function in functions.php:

//
// An UTF-8 aware version of strlen()
//
function pun_strlen($str)
{
    return strlen(utf8_decode($str));
}

But why not use mb_strlen()? I don't know much about that utf-8 stuff, but I red somewhere that mbstring functions should be used with utf-8.

Or maybe right after the final is released. Maybe the CSS is going to be changed before the the final is released.

I think a contest would be cool ^^. I would certainly make a style for it. But I think there should be a (cool) price for the winner else not much people would join the contest. 2 People at Punres organised a contest and almost nobody joined it.

34

(26 replies, posted in PunBB 1.3 troubleshooting)

5) Profile > Identity: Rename the "MSN-Messenger" field to Live-Messenger

MSN is a protocol (right?) Live messenger is the program.

35

(5 replies, posted in PunBB 1.2 show off)

quaker wrote:

fsx when u click on the random user the profile page is funky looking..

Q

Should be solved now ^^.

And for the topic subject in the last post colum, Punres wiki smile : http://wiki.punres.org/Last_post%27s_su … orum_index

36

(5 replies, posted in PunBB 1.2 show off)

A site for my (and two friends) clan/guild. Forum is empty cause we just started. The style is custom made by me.

Url: http://mithrill.wepwnyou.net/index.php

Description:
The website/forum is the base of Mithrill, Mithrill is a clan. At the moment we have a guild in Perfect world and R.O.S.E. Online. The forum is not only for clan/guild talk, but for discussing various things like: movies, graphics, anime ^^ etc. So just register and start talking xD.

37

(50 replies, posted in PunBB 1.3 troubleshooting)

I didn't work for me first, but I edited the RewriteBase and RewriteRule and it worked.

# BEGIN PunBB

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /punbb13beta/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . rewrite.php [L]
</IfModule>

# END PunBB

Maybe it is an idea when you activate URL rewriting punbb makes an htaccess file?

I had the same problem... Try this: DIV.postright, DIV.postfootright { border-left-width: 2px }

I tried that a while ago for my style, it didn't work.

The background of the left block is the border of the right block. If yo change the color code of this line DIV.postright, DIV.postfootright {BORDER-LEFT-COLOR: #f1f1f1} in the *yourstyle*_cs.css file, you change the bg color of the left block.

You can change the border width of the rightblock (DIV.postright, DIV.postfootright) then you have a border, but the leftblock doesn't have a bg anymore.

41

(11 replies, posted in PunBB 1.2 show off)

Alright big_smile.

42

(51 replies, posted in PunBB 1.2 discussion)

MySQL 5.0.41-community-nt

I'm using wos portable.

Forum is a where you can talk about stuff and discuss, a blog is not a place to discuss stuff.

I don't know about the locale, but you can edit the english language file, but you can also copy the English folder and rename it wich is better.

Example

$lang_test = array(
    'word1' => 'translation1',
    'word2' => 'translation2',
    'word3' => 'translation3',
    'word4' => 'translation4'
);

I hope this helps ^^.

You have a connection to the database?

I think global $pun_user; only works in functions.

The function I posted was for the cms I'm building. I haven't have settings for the time so the function outputs GMT time.

You should not replace the orginal time function of punbb with my function, it isn't made for punbb. I just tought you could use the code ^^.

I made this for my system:

function formattime($timestamp){
    
    // Set some vars
    $gmtunix    = $timestamp - date('Z', $timestamp); // This returns an GMT unix timestamp
    $diff        = time() - $gmtunix;
    $hour        = 3600;
    $day        = (24 * $hour);
    $week        = (7 * $day);
    
    $days    = floor($diff / $day);
    $weeks    = floor($diff / $week);
    $daysweeks = $days - ($weeks * 7);
    
    // $time = date("d/m/Y H:i", $timestamp - date('Z', $time));
    $date = date('d - m - Y', $timestamp - date('Z', $timestamp));
    $time = date('H:i', $timestamp - date('Z', $timestamp));
    
    if ($days == 0)
        return 'Today at '.$time;
    elseif ($days == 1)
        return 'Yesterday at '.$time;
    elseif ($days > 1 && $days < 7)
        return $days.' days ago at '.$time;
    elseif ($weeks == 1 && $daysweeks < 7) 
        return $weeks.' weeks and '.$daysweeks.' days ago at '.$time;
    elseif ($weeks == 2 && $daysweeks < 7) 
        return $weeks.' weeks and '.$daysweeks.' days ago at '.$time;
    elseif ($weeks >= 1 && $daysweeks <= 2)
        return $weeks.' weeks ago at '.$time;
    else
        return $date;
}

It converts the inputted timestamp to GMT time.
And it displays something like this:
- Today at 10:16
- Yesterday at 9:06
- 4 Days ago at 10:16
- 1 week and 2 days ago at 10:16

Maybe you can use it. I haven't tested it good, just made it today.

I don't do censor stuff. Members can follow the rules or they can .... up ^^.

Hehe tongue, cool action from that marine.