101

(12 replies, posted in General discussion)

Can you fix it for me Matt?

102

(12 replies, posted in General discussion)

yes, but now it doesnt'. I just wanted to add 2 more extra files to the code.

@CReatiVe4w3 - I have been using this mod for a very long time and I never once encountered an error. You are probably doing something wrong. I don' t think it is fair for you to call it crap. Do you even know how much work went into it? You should seriously think before you speak mate. That ain't fair to the creator of the mod.

btw: Before posting you should at least have the decency to put the punBB credits back where they belong.

Bingiman

104

(12 replies, posted in General discussion)

Any idea why this doesn't work...anyone?

105

(22 replies, posted in General discussion)

I jsut checked out that theme CodeXP. It is very similar to what I have done excpet that I am using an image in the center of the <h2> so here is my example:

.pun h2 {
font-family:verdana,tahoma,arial,sans-serif;
font-size:11px;
font-weight:700;
color:#2E5B82;
border-top:0px #bbb solid;
border-bottom:0px #bbb solid;
border-left:1px #bbb solid;
border-right:1px #bbb solid;
}

.blocktable, .block, .blockpost, .blockform, .blockmenu {
background:#F8F8F8 url(../../img/ShowcaseIII/h2_bg.png);
background-repeat:repeat-x;
}

.pun h2, .blocktable span tcr, .block span tcr {
background: url(../../img/ShowcaseIII/right_rounded.png) top right no-repeat; 
border-right: 0;
}

.pun H2 span {
background-repeat : no-repeat; 
background-image : url(../../img/ShowcaseIII/left_rounded.png); 
padding: 5px;
margin-left: -7px; 
padding-left: 25px;
}

106

(22 replies, posted in General discussion)

liquidat0r - His own uses 2 (left small image and a long right image as all the other styles I have seen so far) I have not seen a single theme for punbb that uses 3 images. If they exist can someone lead me to it.

CodeXP - The theme I've created works. You can see it on http://megapun.com - It all looks fantastic but I don't think you guys did what I did. I could be wrong. You need to look at my stylesheets. Paul also said there is no extras in there for the other image as his post above states. One major hurdle was the admin and plugin files. You can't use <div class="block2"> because it throws the whole layout out. If you look at my stylesheet_cs.css on that site you will see what i did.

Bingiman

107

(12 replies, posted in General discussion)

I get the following error:

Warning: opendir(1) [function.opendir]: failed to open dir: Invalid argument in c:\punbb\header.php on line 268

Warning: readdir(): supplied argument is not a valid Directory resource in c:\punbb\header.php on line 269

108

(16 replies, posted in General discussion)

Why not just use the User Blogs and save yourself that work?

109

(12 replies, posted in General discussion)

Something is still wrong with this code and I just noticed it. Here is what happens. If I have lets say the (3) top posts locked then it should display all 3 with the locked icon and it doesn't. It displays the 1st and 3rd as locked. There is something wrong in that query and I don't know what it is. Any help would be greatly appreciated.

The code below is my last update to this file:

<?php
/*

PunBB Active Topics

Copyright 2004-2005 Alex King, http://www.alexking.org/

This is a mod for PunBB, http://www.punbb.org/
PunBB is Copyright (C) 2002, 2003, 2004  Rickard Andersson (rickard@punbb.org)

This file is based on the viewtopic.php file in PunBB.

-------------------------------
*/

$ak_limit = 10; // change this to the number of active topics you want to display.

$result = $db->query('
    SELECT p.poster_id AS has_posted, t.* 
    FROM '.$db->prefix.'topics AS t 

LEFT JOIN '.$db->prefix.'posts AS p ON p.id=p.topic_id AND p.poster_id='.$pun_user['id'].' 
    INNER JOIN '.$db->prefix.'forums AS f 
    ON f.id=t.forum_id 
    LEFT JOIN '.$db->prefix.'forum_perms AS fp 
    ON (
        fp.forum_id=f.id 
        AND fp.group_id='.$pun_user['g_id'].'
    ) 
    WHERE (
        fp.read_forum IS NULL 
        OR fp.read_forum=1
    ) 
    GROUP BY t.id
    ORDER BY t.last_post DESC
    LIMIT '.$ak_limit
) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

$new_topics = get_all_new_topics();

?>

<div id="vf" class="blocktable">
    <h2><span>Latest Active Topics</span></h2>


    <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <thead>
                <tr><th style="border-left: 0px;" class="tc0"> </th>
                    <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
                    <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
                    <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
                    <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
                </tr>
            </thead>
            <tbody>
<?php

// If there are topics in this forum.
if ($db->num_rows($result))
{
// added for forum row differnetial colors
$alt = true;
// added for forum row differnetial colors

    while ($cur_topic = $db->fetch_assoc($result))
    {
// added for forum row differnetial colors
    $alt = !$alt;
// added for forum row differnetial colors

        $icon_text = $lang_common['Normal icon'];
        $item_status = '';
        $icon_type = 'icon';

        if ($cur_topic['moved_to'] == null)
            $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <br /><span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>';
        else
            $last_post = ' ';

        if ($pun_config['o_censoring'] == '1')
            $cur_topic['subject'] = censor_words($cur_topic['subject']);

        if ($cur_topic['moved_to'] != 0) {
            $item_status .= 'imoved';
            $icon_type = 'icon imoved';
            $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <br /><span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
}
        else if ($cur_topic['closed'] == '0')
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class=""><br />'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
        else
        {
            $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <br /><span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
            $icon_text = $lang_common['Closed icon'];
            $item_status = 'iclosed';
        }
                            // gleek edit
                        if ($cur_topic['num_replies'] >= $pun_config['o_hot_count'])
                        {
                                $item_status .= 'ihot';
                                $icon_type = 'icon ihot';
                        }
        if (!$pun_user['is_guest'] && topic_is_new($cur_topic['id'], $id,  $cur_topic['last_post']) && $cur_topic['moved_to'] == null)
        {
            $icon_text .= ' '.$lang_common['New icon'];
            $item_status .= ' inew';
            $icon_type = 'icon inew';
            $subject = '<strong>'.$subject.'</strong>';
            $subject_new_posts = '<span class="newtext">[<a href="viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>]</span>';
        }
        else
            $subject_new_posts = null;

        // Should we display the dot or not? :)
        if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1')
        {
            if ($cur_topic['has_posted'] == $pun_user['id'])
                $subject = '<img src="img/'.$pun_user['style'].'/buttons/btn_just_posted.png" title="'.$lang_forum['User has just posted'].'" alt="'.$lang_forum['User has just posted'].'" /> '.$subject;
            else
                $subject = '  '.$subject;
        }

        if ($cur_topic['sticky'] == '1')
        {
            $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
            $item_status .= ' isticky';
            $icon_text .= ' '.$lang_forum['Sticky'];
        }

        $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

        if ($num_pages_topic > 1)
            $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]';
        else
            $subject_multipage = null;

        // Should we show the "New posts" and/or the multipage links?
        if (!empty($subject_new_posts) || !empty($subject_multipage))
        {
            $subject .= '  '.(!empty($subject_new_posts) ? $subject_new_posts : '');
            $subject .= !empty($subject_multipage) ? ' '.$subject_multipage : '';
        }
// added for forum row differnetial colors
if ($alt)
{
    $item_status .= 'alt';
}
// added for forum row differnetial colors
?>
                <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
            <td style="border-left: 0;" class="tc0"><div class="<?php echo $icon_type ?>"> </div></td>
                    <td class="tc1"><?php echo $subject."\n" ?> </td>


                    <td class="tc2"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_replies'] : ' ' ?></td>
                    <td class="tc3"><?php echo ($cur_topic['moved_to'] == null) ? $cur_topic['num_views'] : ' ' ?></td>


<?php
        if ($cur_topic['moved_to'] != 0) {
            $item_status .= 'imoved';
            $icon_type = 'icon imoved';
            echo '<td class="tcr"><img src="'.$pun_config['o_base_url'].'/img/topic_moved.gif" alt="Topic Moved" title="Topic Moved" /> Topic Moved</td>';
}else {


?>


                    <td class="tcr"><?php echo $last_post ?></td>
<?php
        }
?>
                </tr>
<?php
    }
}
else
{

?>
                <tr>
                    <td class="tcl" colspan="5"><?php echo $lang_forum['Empty forum'] ?></td>
                </tr>
<?php

}

?>
            </tbody>
            </table>
        </div>
    </div>
</div>

Thanks
Bingiman

110

(12 replies, posted in General discussion)

Is it possible in the code below to add more than one filename to search for. In this case it only looks for install_mod.php and I would like it to look for 2 others, so 3 in total.

    // START SUBST - <pun_mod>
        ## Function
    function regExpFile($regExp, $dir, $regType='P', $case='') {
    # Two parameters accepted by $regType are E for ereg* functions
    # and P for preg* functions
    $func = ( $regType == 'P' ) ? 'preg_match' : 'ereg' . $case;
    $regExp = ( $regType == 'P' ) ? $regExp . $case : $regExp;
    # Note, technically anything other than P will use ereg* functions;
    # however, you can specify whether to use ereg or eregi by
    # declaring $case as "i" to use eregi rather than ereg
    
    $open = opendir($dir);
    while( ($file = readdir($open)) !== false ) {
    if ( $func($regExp, $file) ) {
    return true;
    }
    } // End while
    return false;
    } // End function
    
    
    $reff_function = function_exists('preg_match') ? 'P' : 'E';
    if(regExpFile("#install_mod.*#i", './') && ($pun_user['g_id'] == PUN_ADMIN))
        {
        $replace = '<div id="announce" class="block">
        <h2><span class="mod_warn">Attention - There is currently an <font class="mod_warn_text">install_mod.php</font> file located in your root folder!</span></h2>
        <div class="box">
            <div class="inbox">
                <div>There is a modification ready to be installed.<br /><a href="'.PUN_ROOT.'install_mod.php" target="_blank">Install the modification!</a></div>
            </div>
        </div>
    </div>';
        
        $tpl_main = str_replace('<pun_mod>', $replace, $tpl_main);
        }
    else
        {
        $tpl_main = str_replace('<pun_mod>', '', $tpl_main);
        }
    // END SUBST - <pun_mod>

111

(22 replies, posted in General discussion)

but you see in my opinion those don't look like a nice clean rounded edge. That's why I didn't want to go with your method. Although, it might have been easier. I wanted to prove to myself that e images could work using divs and not just a left round edge and a long right image. That sorts makes the style a fixed width on some images. Anyway, I did have to modify all the admin files that used the <h2 class="block2"> this was also changed to the block or blocktable class. It was for Mega Pun so I really didn't mind modifying them.

This is why I love tables. you never have these problems.

112

(22 replies, posted in General discussion)

quaker wrote:

bingiman... i think i know what that is..
that might be a top border....... on the h2...
Q

Hey Scot,

I thought that was really obvious mate. I know where it is. I need to find a fix for it. lol

113

(10 replies, posted in PunBB 1.2 show off)

The images look familiar. hmm...:D

114

(22 replies, posted in General discussion)

@Tjalve - Well, I know what you mean. I will get this right even if it kills me. I will make it possible with time. yikes

115

(18 replies, posted in General discussion)

Matt,

Checkout http://kde-look.org and download the Crystal Project Icon set.

116

(22 replies, posted in General discussion)

Well, I managed to sort a lot out with this middle image and it seems to be working well after I made some modifications to the admin files. Anyway, I am having a very strange issue. As you can see in the image below it appears that the left rounded image is outta whack. The thing is, it is not happening on every post while in viewtopic, only on some. I made some modifications to the codebox class because the font size was a problem, but it seems to be still happening on some posts. Maybe some one can have a look at the css files for me and have a go at it? If necessary, I can provide you with a link to download the entire theme.

http://megapun.com/img/gallery/1201058801.gif

Thanks
Bingiman

117

(6 replies, posted in General discussion)

It is for Mega Pun 5.00 - I want to make it perfect. lol, well as close as I can get. smile

118

(6 replies, posted in General discussion)

Thank you both. It works great. Here is the working code.

<?php

//get all pages info from the DB
    $result = $db->query('SELECT id, title FROM '.$db->prefix.'pages') or error('Unable to select pages from database', __FILE__, __LINE__, $db->error());
    if ($db->num_rows($result))
    {
$trunc_len = 25; // Set amount of text to be displayed in subject.
?>
<div class="block">
        <h2 class="block2"><span>Custom Page Links</span></h2>
        <div class="box">
            <div class="inbox">
                <ul>
<?php

        while($page_data = $db->fetch_assoc($result))


if (strlen($page_data['title']) > $trunc_len)
{
            echo "\t\t\t\t\t\t\t".'<li>'."\n\t\t\t\t\t\t\t\t".'<a href="page.php?id='.$page_data['id'].'">'.substr($page_data['title'], 0, $trunc_len).'</a>...</li>'."\n\t\t\t\t\t\t\t"."\n";

}else {
            echo "\t\t\t\t\t\t\t".'<li>'."\n\t\t\t\t\t\t\t\t".'<a href="page.php?id='.$page_data['id'].'">'.$page_data['title'].'</a></li>'."\n\t\t\t\t\t\t\t"."\n";

}
?>

                </ul>        
            </div>
        </div>
    </div>
 <?php
  }
?>

119

(6 replies, posted in General discussion)

Shouldn't this code below work for what I want it to do?

<?php

//get all pages info from the DB
    $result = $db->query('SELECT id, title FROM '.$db->prefix.'pages') or error('Unable to select pages from database', __FILE__, __LINE__, $db->error());
    if ($db->num_rows($result))
    {

?>
<div class="block">
        <h2 class="block2"><span>Custom Page Links</span></h2>
        <div class="box">
            <div class="inbox">
                <ul>
<?php

        while($page_data = $db->fetch_assoc($result))



if ($trunc_len < 20) {
        echo "\t\t\t\t\t\t\t".'<li>'."\n\t\t\t\t\t\t\t\t".'<a href="page.php?id='.$page_data['id'].'">'.$page_data['title'].'</a></li>'."\n\t\t\t\t\t\t\t"."\n";
} else {
        echo "\t\t\t\t\t\t\t".'<li>'."\n\t\t\t\t\t\t\t\t".'<a href="page.php?id='.$page_data['id'].'">'.substr($page_data['title'], $trunc_len).'</a>...</li>'."\n\t\t\t\t\t\t\t"."\n";

}
?>

                </ul>        
            </div>
        </div>
    </div>
 <?php
  }
?>

120

(6 replies, posted in General discussion)

I managed to truncate the characters of the custom page to (25) to be displayed on the front page of the portal. How can I make it so that it displays '...'  if there is more text on the subject line? So if for example it says:

text to be read - <- end text
this is the text I want you to read whe...

Hope you follow what I am trying to say. Here is the code below if someone can assist me.

<?php

//get all pages info from the DB
    $result = $db->query('SELECT id, title FROM '.$db->prefix.'pages') or error('Unable to select pages from database', __FILE__, __LINE__, $db->error());
    if ($db->num_rows($result))
    {
$trunc_len = 20; // Set amount of text to be displayed in subject.

?>
<div class="block">
        <h2 class="block2"><span>Custom Page Links</span></h2>
        <div class="box">
            <div class="inbox">
                <ul>
<?php
        while($page_data = $db->fetch_assoc($result))
            echo "\t\t\t\t\t\t\t".'<li>'."\n\t\t\t\t\t\t\t\t".'<a href="page.php?id='.$page_data['id'].'">'.substr($page_data['title'], 0, $trunc_len).'</a></li>'."\n\t\t\t\t\t\t\t"."\n";
?>

                </ul>        
            </div>
        </div>
    </div>
 <?php
  }
?>

121

(16 replies, posted in General discussion)

Well, I figured it out..finally... I did a file comparison with Matt's file and it was a missing </tr> in this littel area of code.

<?php 
        echo "\n";
    }
?>
    </tr>

Finally it validates.

Thanks a lot guys. smile

122

(16 replies, posted in General discussion)

Yours is completely different to mine Matt. I can't even begin to compare them. big_smile

123

(16 replies, posted in General discussion)

Anyone?

124

(16 replies, posted in General discussion)

Sorry to bug you guys again but I have one last file that I can't validate. I managed to validate all the others so far but online.php I can't seem to get. I followed other files with a similar layout but this just never seems to validate. Here is the code if anyone can help me.

<?php
define('PUN_ALT4',1);
define ('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';

if ($pun_user['is_guest'] && $pun_user['g_read_board'] == '0')
        message($lang_common['No permission']);


// Load the userlist.php language file

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

$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_online['Online List'];
require PUN_ROOT.'header.php';
?>
<div class="blocktable">
    <h2><span><?echo $lang_online['Online List']?></span></h2>
    <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <tr>
                <th class="tcr" style="text-align: center; border-left: 0px;" scope="col"><?php echo $lang_common['Username'] ?></th>
                <th class="tcr" style="text-align: center; border-left: 0px;" scope="col"><?php echo $lang_online['Last action'] ?></th>
                <th class="tcr" style="text-align: center; border-left: 0px;" scope="col"><?php echo $lang_online['Time'] ?></th>
                <?if($pun_user['g_id'] <= PUN_MOD):?>
                <th style="text-align: center; border-left: 0px;" class="tcr" scope="col"><?php echo $lang_online['IP'] ?></th><?echo"\n";endif?>
            
            

<?php


// Grab the users
$result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE user_id > 0 AND idle=0 ORDER BY ident') or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
$num_users_page = $db->num_rows($result);

if ($num_users_page) {
  while ($num_users_page--) {
   $user_data = $db->fetch_assoc($result);
    if ($user_data['current_page']) {
        echo"\t\t\t\t".'<tr>'."\n";
        
    if ($user_data['user_id'] > 1) 
          echo "\t\t\t\t\t".'<td style="text-align: center; border-left: 0px;"><a href="'.PUN_ROOT.'profile.php?id='.$user_data['user_id'].'">'.$user_data['ident'].'</a></td>'."\n";
    else 
        echo "\t\t\t\t\t".'<td style="text-align: center; border-left: 0px;">'.$lang_online['Guest'].'</td>'."\n";

$pathinfo = pathinfo($user_data['current_page']);
$current_page = $pathinfo['basename'];

if ($user_data['current_page_id'] > 0) {
    if ($current_page == "viewtopic.php" || $current_page == "post.php") { $current_page_name = $db->query('SELECT subject FROM '.$db->prefix.'topics WHERE id=\''.$user_data['current_page_id'].'\'') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); }
    if ($current_page == "viewforum.php") { $current_page_name = $db->query('SELECT forum_name FROM '.$db->prefix.'forums WHERE id=\''.$user_data['current_page_id'].'\'') or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error()); }
    if ($current_page == "profile.php") { $current_page_name = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id=\''.$user_data['current_page_id'].'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); }
    if ($current_page == "post.php" || $current_page == "edit.php") { echo"\t\t\t\t\t".'<td>'.$lang_online[$user_data['current_page']].': <b><a href="'.PUN_ROOT.'viewtopic.php?id='.$user_data['current_page_id'].'">'.$db->result($current_page_name, 0).'</a></b></td>'."\n";}
    else { echo"\t\t\t\t\t".'<td style="text-align: left;">'.$lang_online[$user_data['current_page']].': <b><a href="'.$user_data['current_page'].'?id='.$user_data['current_page_id'].'">'.$db->result($current_page_name, 0).'</a></b></td>'."\n";}

}else if ((@$lang_online[$user_data['current_page']]) == '')
        echo"\t\t\t\t\t".'<td style="text-align: left;">'.$lang_online['Hiding Somewhere'].'</td>'."\n";
    else
        echo"\t\t\t\t\t".'<td style="text-align: left;"><a href="'.$user_data['current_page'].'">'.$lang_online[$user_data['current_page']].'</a></td>'."\n";    


echo"\t\t\t\t\t".'<td style="text-align: center;">'.format_time($user_data['logged']).'</td>'."\n";

if ($pun_user['g_id'] <= PUN_MOD) echo"\t\t\t\t\t".'<td style="text-align: center;"><a href="'.PUN_ROOT.'admin_users.php?show_users='.$user_data['current_ip'].'">'.$user_data['current_ip'].'</a></td>'."\n";
echo"\t\t\t\t".'</tr>'."\n";
} } }
else { echo "\t\t\t\t".'<tr><td colspan="4">'.$lang_online['No users'].'</td>'."\n\t\t\t\t".'</tr>'."\n"; }
?>
                        </table>
        </div>
    </div>
</div>

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

Thanks
Bingiman

125

(16 replies, posted in General discussion)

Thank you mat once again. That solved the problem. big_smile

Cheers mate.