26

(4 replies, posted in PunBB 1.2 troubleshooting)

Well, you would start by accessing your Main.tpl file. Once you have accessed this file simply replace the <pun_title>, and <pun_desc> with an image tag. It should then display that image in the header on all of your forum pages.

Mark wrote:

i dont understand that much. i made the code adjustment but then i dont know how to edit the colors on it :S
sorry for askin so many questions sad

Wouldn't the colours be located with in each css file? With this modification the usergroups are coloured by div styles.

looks rather nice. Although, i feel that the code could be organized in a much better way.

this would definitely be a great modification, but maybe if you were to try thinking outside of the box you could figure it out one way or another. Maybe try creating seperate user groups for each clan, and then create a forum for clan invites/requests ect.

so, what you are thinking is that we should a user profile commenting system? seems like a good idea to me. It would probably make a great extension in punbb 1.3.

It looks rather nice, but i think that a table is at hand to seperate the links from their specific descriptions. It would look alot more professional ( not to mention organised ).

seems rather useful smile

rather than using the "echo" command punbb has a "message" command that is integrated. Try this out:

if ($pun_user['is_guest']) 
         message("You must be logged in to view this page!");

well, i've been holding off on this project mainly to think of a better way to implement the "archive" feature rather than just inserting a link. I cleaned it up a little bit and added a link directly to the topic. I have turned the text "Replies" in to a link. This was all done yesterday afternoon.

<?php
 
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
 
// Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / News Page';
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';

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

// News Information
$news = '2'; 
$forum = '1';

// Retrieve News From Database
$db_news = $db->query('SELECT t.id, t.subject, t.num_replies, t.num_views, t.forum_id,  p.topic_id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id='.$forum.' AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$news) or error('Unable to fetch the news', __FILE__, __LINE__, $db->error());

if($db->num_rows($db_news))
{
    while($news = $db->fetch_assoc($db_news))
    {
        // Set Some Variables
        $message = parse_message($news['message'], $news['hide_smilies']);
        $subject = $news['subject'];
        $poster = '<a href="profile.php?id='.$news['poster_id'].'">'.$news['poster'].'</a>';
        $date_posted = gmdate('F jS, Y', $news['posted']);
        $replies = $news['num_replies'];
        $views = $news['num_views'];
        $news_id = $news['id'];
        $news_output = '<div class="blocktable" style="margin-bottom: 10px"><h2><span>'.$subject.'</span></h2><div class="box"><div class="inbox"><table cellspacing="0"><thead><tr><th class="tcl">Posted by '.$poster.' on '.$date_posted.'</th></tr></thead><tbody><tr><td class="tcl"><div style="padding: 5px 2px 7px 5px">'.$message.'</div></td></tr></tbody><thead><tr><th class="tcl"><a href="viewtopic.php?id='.$news_id.'">Replies</a>: '.$replies.' | Views: '.$views.'</th></tr></thead></table></div></div></div>';
            
        echo $news_output;
            
    }
}
// Require the footer
require PUN_ROOT.'footer.php';

35

(3 replies, posted in Programming)

okay after looking around in this minmax.js file i have found a bunch of javascript coding that iam very unfamiliar with. How would i apply this code or script to a certain file in order to solve this problem.

36

(19 replies, posted in PunBB 1.2 show off)

the skin looks exactly similar to the new hyi skin smile.

37

(11 replies, posted in PunBB 1.2 troubleshooting)

either that or i recommend NotePad++. It is free and easy to use.

http://notepad-plus.sourceforge.net/uk/site.htm

some great ideas you have smile

i will most likely end up implementing these features as soon as possible ( probably when i get home this afternoon ).

39

(3 replies, posted in Programming)

Well, i wish to set a maximum/minimum height in IE. Does anybody know how i would be able to achieve this or work my way around the issue? Open for suggestions.

thank you for that fast reply dr.jeckyl smile.

I kind of like the idea of using tables as you can see. I wanted to try outputing the news in a different way tongue. Do you have any suggestions as far as enhancing any of this code goes? I'm not the brightest bulb in the box when it comes to php.

Well, i've been extremely bored lately and decided to code a little something tongue

What this code does is form a punbb page that retrieves "news" from a specific forum of your choice. You are also capable of setting a maximum amount of news to retrieve from the database. It's nothing special, but i hope that some of you will put this code to good use smile

<?php
 
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
 
// Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / Home';
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';

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

// News Information
$news = '3';
$forum = '1';

// Retrieve News From Database
$db_news = $db->query('SELECT t.id, t.subject, t.num_replies, t.num_views, t.forum_id,  p.topic_id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id='.$forum.' AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$news) or error('Unable to fetch the portal news', __FILE__, __LINE__, $db->error());
                  
if ($db->num_rows($db_news))
{
    while($news = $db->fetch_assoc($db_news))
    {
        // Set Some Variables
        $message = parse_message($news['message'], $news['hide_smilies']);
        $subject = $news['subject'];
        $poster = '<a href="profile.php?id='.$news['poster_id'].'">'.$news['poster'].'</a>';
        $date_posted = format_time($news['posted']);
        $replies = $news['num_replies'];
        $views = $news['num_views'];
        $news_id = $news['id'];
        
        // Output News
        echo "\t\t\t\t".'<div class="blocktable" style="margin-bottom: 10px"><h2><span>'.$subject.'</span></h2><div class="box"><div class="inbox"><table cellspacing="0"><thead><tr><th class="tcl">'.$date_posted.' » by '.$poster.'</th></tr></thead><tbody><tr><td class="tcl"><div style="padding: 5px 2px 7px 5px">'.$message.'</div></td></tr></tbody><thead><tr><th class="tcl">Replies: '.$replies.' » Views: '.$views.' » <a href="post.php?tid='.$news_id.'">Post Reply</a></th></tr></thead></table></div></div></div>'."\n";
    }
}

// Require the footer
require PUN_ROOT.'footer.php';

Don't forget that you are able to configure the news information via these two lines:

// News Information
$news = '3';
$forum = '1';

A demo of this paticular page can be found here.

42

(1 replies, posted in PunBB 1.2 show off)

any comments/suggestions as far as the new home page goes?

i agree with the group permissions smile ncie idea

44

(1 replies, posted in PunBB 1.2 show off)

Not your average community tongue

Basically its a forum to discuss and enjoy some of the features that i will be adding to my customized punbb forum. I have also implemented a sort of advertisement system for all registered members smile

Stop by and Register Now!

I will probably find the time to add some more forums to the board once i have noticed an increase in members with in the next few days.

AlanCollier wrote:

This will add a login form to any page from which you call it.
If already logged in, it shows your username and group.

// Login Menu
    function login_menu() 
        {
        global $pun_user;
        if ($pun_user['is_guest'])
            {
            $stroutput= '<form id="login" method="post" action="'.PUN_ROOT.'login.php?action=in" onsubmit="return process_form(this)">

            <input type="hidden" name="form_sent" value="1" />
            <input type="hidden" name="redirect_url" value="'.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'" />
            <label for="req_username">Username: </label>
            <input type="text" id="req_username" name="req_username" size="4" maxlength="25" />
            <label for="req_password">Password: </label>
            <input type="password" id="req_password" name="req_password" size="4" maxlength="16" />
            <input type="submit" name="login" value="Login" />
            [<a href="'.PUN_ROOT.'register.php">Register</a>] 
            </form>';

            echo $stroutput;    
            }
        else 
            {
            $stroutput= '<p>Logged in as: '.pun_htmlspecialchars($pun_user['username']).' ('.$pun_user['g_user_title'].') [<a href="'.PUN_ROOT.'login.php?action=out&id='.$pun_user['id'].'">Logout</a>]</p>';
            echo $stroutput;    
            }
        }

I found it somewhere on this site (or Punres) so apologies for not crediting the original author.

--Alan

seems very nice smile, but is the 1st "echo $stroutput;" necessary? You are only declaring the variables with in the "if" statement. So simply add this jsut after the if statement:

echo $stroutput;

46

(15 replies, posted in Programming)

i've always been wondering as to what this code was for as well. So basically "\t\t\t\t" inserts 4 tabs?

47

(26 replies, posted in News)

prit what rickard is saying is that he doesn't want to be the judge of anyone or anything. There for he is allowing the users to be the judges.

If you are refering to the title of the block then all you must do is access your index.php page, search for "Welcome", and change the it around.

could you copy and paste your index.php coding here so i can have a look at it.

seems useful wink good thinking