2,301

(6 replies, posted in PunBB 1.2 show off)

Looks like a great site, I'll sign up later ^^

2,302

(29 replies, posted in PunBB 1.2 show off)

Ehm, change
$num_pages = ceil($num_users / 50);
to
$num_pages = ceil($num_users / 10);
and
$start_from = 50 * ($p - 1);
to
$start_from = 10 * ($p - 1);

Think that should do it =/

2,303

(9 replies, posted in General discussion)

The text isn't displaying in Opera wink

Looks nice tho smile

2,304

(7 replies, posted in PunBB 1.2 troubleshooting)

Smartys wrote:

You can't add URL parameters to a require if you're getting the stuff from the local filesystem (it looks for a file named extern.php?action=active&show=5)

Works for me, as I did it before on my localhost =/

Hrmm, better load functions.php too.

include('forum/include/parser.php');
include('forum/include/functions.php');

$message = parse_message($message, 0);
include('forum/include/parser.php');

$message = parse_message($message, 0);

2,307

(7 replies, posted in PunBB 1.2 troubleshooting)

True pogenwurst, didn't see that one tongue

2,308

(7 replies, posted in PunBB 1.2 troubleshooting)

It should work, unless you have no threads =/

2,309

(4 replies, posted in PunBB 1.2 troubleshooting)

Some sort of cleaning script deleted your table? =/ No idea, really.

2,310

(1 replies, posted in PunBB 1.2 troubleshooting)

Yeah, that would be best =/ Your host seems quite slow.

2,311

(4 replies, posted in PunBB 1.2 troubleshooting)

In include/common.php, uncomment define('PUN_DEBUG', 1)
It would also be wise to uncomment the part so it will show the queries it executes smile

Normally, it should give no problems =/

2,313

(2 replies, posted in PunBB 1.2 troubleshooting)

Set the Silent Edit options as a default?

2,314

(29 replies, posted in PunBB 1.2 show off)

Sure, the members.php is only some changed HTML (and something extra to the query, to retrieve the CS nick, which replaces Jabber) smile


EDIT:

Here's the code smile

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

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB 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.

  PunBB 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';


if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);


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

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


// Determine if we are allowed to view post counts
$show_post_count = ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST) ? true : false;

$username = (isset($_GET['username']) && $pun_user['g_search_users'] == '1') ? $_GET['username'] : '';
$show_group = (!isset($_GET['show_group']) || intval($_GET['show_group']) < -1 && intval($_GET['show_group']) > 2) ? -1 : intval($_GET['show_group']);
$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];
$sort_dir = (!isset($_GET['sort_dir']) || $_GET['sort_dir'] != 'ASC' && $_GET['sort_dir'] != 'DESC') ? 'ASC' : strtoupper($_GET['sort_dir']);


$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['User list'];
if ($pun_user['g_search_users'] == '1')
    $focus_element = array('userlist', 'username');

define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

?>
<div class="blockform">
    <h2><span><?php echo $lang_search['User search'] ?></span></h2>
    <div class="box">
    <form id="userlist" method="get" action="members.php">
        <div class="inform">
            <fieldset>
                <legend><?php echo $lang_ul['User find legend'] ?></legend>
                <div class="infldset">
<?php if ($pun_user['g_search_users'] == '1'): ?>                    <label class="conl"><?php echo $lang_common['Username'] ?><br /><input type="text" name="username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
<?php endif; ?>                    <label class="conl"><?php echo $lang_ul['User group']."\n" ?>
                    <br /><select name="show_group">
                        <option value="-1"<?php if ($show_group == -1) echo ' selected="selected"' ?>><?php echo $lang_ul['All users'] ?></option>
<?php

$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_id') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());

while ($cur_group = $db->fetch_assoc($result))
{
    if ($cur_group['g_id'] == $show_group)
        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
    else
        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
}

?>
                    </select>
                    <br /></label>
                    <label class="conl"><?php echo $lang_search['Sort by']."\n" ?>
                    <br /><select name="sort_by">
                        <option value="username"<?php if ($sort_by == 'username') echo ' selected="selected"' ?>><?php echo $lang_common['Username'] ?></option>
                        <option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>
<?php if ($show_post_count): ?>                        <option value="num_posts"<?php if ($sort_by == 'num_posts') echo ' selected="selected"' ?>><?php echo $lang_ul['No of posts'] ?></option>
<?php endif; ?>                    </select>
                    <br /></label>
                    <label class="conl"><?php echo $lang_search['Sort order']."\n" ?>
                    <br /><select name="sort_dir">
                        <option value="ASC"<?php if ($sort_dir == 'ASC') echo ' selected="selected"' ?>><?php echo $lang_search['Ascending'] ?></option>
                        <option value="DESC"<?php if ($sort_dir == 'DESC') echo ' selected="selected"' ?>><?php echo $lang_search['Descending'] ?></option>
                    </select>
                    <br /></label>
                    <p class="clearb"><?php echo $lang_ul['User search info'] ?></p>
                </div>
            </fieldset>
        </div>
        <p><input type="submit" name="search" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /></p>
    </form>
    </div>
</div>
<?php


// Create any SQL for the WHERE clause
$where_sql = array();
$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';

if ($pun_user['g_search_users'] == '1' && $username != '')
    $where_sql[] = 'u.username '.$like_command.' \''.$db->escape(str_replace('*', '%', $username)).'\'';
if ($show_group > -1)
    $where_sql[] = 'u.group_id='.$show_group;

// Fetch user count
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u'.(!empty($where_sql) ? ' WHERE u.id>1 AND '.implode(' AND ', $where_sql) : '')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result);


// Determine the user offset (based on $_GET['p'])
$num_pages = ceil($num_users / 50);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
$start_from = 50 * ($p - 1);

// Generate paging links
$paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'members.php?username='.urlencode($username).'&show_group='.$show_group.'&sort_by='.$sort_by.'&sort_dir='.strtoupper($sort_dir));


?>
<div class="linkst">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>

<div id="users1" class="blocktable">
    <h2><span><?php echo $lang_common['User list'] ?></span></h2>
    <div class="box">
        <div class="inbox">
<?php

// Grab the users
$result = $db->query('SELECT u.id, u.username, u.use_avatar, u.title, u.num_posts, u.registered, u.jabber, g.g_id, g.g_user_title, g.g_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result))
{
    while ($user_data = $db->fetch_assoc($result))
    {
        if ($pun_config['o_avatars'] == '1' && $user_data['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif" '.$img_size[3].' alt="" style="float: left" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg" '.$img_size[3].' alt="" style="float: left" />';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png'))
                $user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png" '.$img_size[3].' alt="" style="float: left" />';
        }
        else
            $user_avatar = '';    
    
        $user_title_field = get_title($user_data);

?>        
        <div style="margin:5px">
        <h2><a href="<?php echo "profile.php?id=" . $user_data['id'] . '">' . $user_data['username']; ?></a></h2>
        <p style="float:right"><?php echo "<b>" . $lang_common['Registered'] . "</b>: " . format_time($user_data['registered'], true); ?></p>
        <?php echo $user_avatar; ?>
        <?php 
        // The CS nick is stored in the Jabber column. Who uses that anyways? :P
        $cs_nick = ($user_data['jabber']) ? $user_data['jabber'] : "None";
        echo "<b>" . $lang_common['Title'] . "</b>: " . $user_title_field . "<br />\n<b>" . $lang_common['Jabber'] . "</b>: " . $cs_nick . "<br />\n<b>" . $lang_common['Group'] . "</b>: " . $user_data['g_title'] . "<br />\n<b>" . $lang_common['Posts'] . "</b>: " . $user_data['num_posts']; ?>
        </div>
        <div class="clearer"></div>
<?php

    }
}
else
    echo "\t\t\t".'<tr>'."\n\t\t\t\t\t".'<td class="tcl" colspan="'.(($show_post_count) ? 4 : 3).'">'.$lang_search['No hits'].'</td></tr>'."\n";

?>
        </div>
    </div>
</div>

<div class="linksb">
    <div class="inbox">
        <p class="pagelink"><?php echo $paging_links ?></p>
    </div>
</div>
<?php

require PUN_ROOT.'footer.php';
?>

Looks nice smile

What browser are you using?

2,317

(11 replies, posted in PunBB 1.2 troubleshooting)

Well, check if there's anything missing like commas (was my problem) or there is too much.

What you could do is open them one by one and check if PHP gives any errors.

2,318

(11 replies, posted in PunBB 1.2 troubleshooting)

Make sure all your language files are correct.

2,319

(29 replies, posted in PunBB 1.2 show off)

Hey all,

I'v been working on a clan CMS for the last week and have a version that can be quite used smile
You can see it running here: link
I coded all the extra things myself, like the miniportal.
Many thanks go out to Alecks, who created the skin I used, DarkBlue.
The name of the clan hasn't been decided yet, so yes, the logo is only temporary =P
I also drastically changed userlist.php (saved under members.php) to show users a little fancier smile

Any comments are welcome.

-- Bekko

2,320

(4 replies, posted in PunBB 1.2 troubleshooting)

Thx for the help guys, I found the problem. I used the PHP Debugger plugin for Dreamweaver to check all the language files and it seems there was a comma missing somewhere =/

2,321

(4 replies, posted in PunBB 1.2 troubleshooting)

Yeah, all language files I need are in the folder.

2,322

(4 replies, posted in PunBB 1.2 troubleshooting)

Hey guys,

I got this odd little problem. When I select the Dutch language file, I get a blank screen. Like you'd get when the header or the footer isn't loaded =/ The English language file works fine.

Does anyone know how to solve this?

2,323

(14 replies, posted in PunBB 1.2 troubleshooting)

Just send it to Rickard wink He'll put it online with the rest of the language packs smile

2,324

(4 replies, posted in PunBB 1.2 troubleshooting)

You need to set PunBB to UTF-8 too wink

in lang_common.php, change the value of 'lang_encoding'

2,325

(6 replies, posted in PunBB 1.2 show off)

Looks pretty nice smile