1

(98 replies, posted in PunBB 1.3 extensions)

I get the following error:

'/var/www/extensions/pun_attachment/attachments/053a79febc9252de33c6e33f43cd3af3'

The error occurred on line 38 in /var/www/extensions/pun_attachment/install_function.php

2

(1 replies, posted in PunBB 1.2 discussion)

Is there a utility or other way to track changes and mods that are implemented on my site so that when a new version of PunBB is released I know which files have been altered as to not overwrite the changes I have made?

I would hate to make modifications to make my site unique and then lose everything to upgrade to the latest version of PunBB.

I have one site still running 1.2.10 because I don't want to screw up the modifications I have made to it.

Thanks

http://www.stlchristianmusic.net

Not a lot going on and pretty basic. Miniportal and PunBB combined with some very minor CSS.

I'm really liking using PunBB as my forum of choice. Customizing is becoming easier and easier the more I play around with it. Sure beats having to weed through all the bells and whistles of the other forum packages to try and get it to look like I want.

Is there a working link to this mod in action somewhere?

Also, has anyone gotten it to work, specifically with 1.2.14?

*bump*

Yet another I have used PunBB on and integrated it in with the site. (well, nothing fancy, but then again I don't believe in fancy)...

USA Christians
http://www.usachristians.org

Is there a way to do this?

The preferable way is to have it so that as long as a person edits the post within a day or prior to a reply to the post being made it would NOT show 'last edited by'.

If a post is made or 24 hours passes then 'last edited by' would appear.

8

(4 replies, posted in PunBB 1.2 troubleshooting)

You have to set your SERVERS timezone in Options first, then users can change whatever they want in their profile, it won't matter. As long as it is set for server timezone there will be no issues (YOU have to do the same if you are not located in the servers timezone).

Back up the board via your host cpanel or via phpMyAdmin or via just straight mysql.

http://punbb.org/forums/viewtopic.php?id=9258

This is how I was able to do it at my site....

Frank H wrote:

well, lots of mods will probably be rewritten to the hooks system (the attachment mod is one of them), so you probably will start with a clean install and add mods again ...

***shudder***

Man... I better keep track of all the stuff I modified....

Just to reitterate, you need to make sure you saved the file as a php file and not a text or no extension file.

Also, make sure that when you upload the file that you do so in ASCII as binary will tend to mess it up a bit...

I was wondering what is the easiest way to update PunBB when a new version comes out after I have modded my PunBB files with various mods, plugins, etc.?

Is there a way y'all keep track of what files you modified? I like the fact that I can add the things I want to PunBB without being restricted to bloated code with features I don't want or would not use but I can see upgrades as being a tedious task.

Curious how y'all handle this....

Hey Connorhd, is there a way to make not only the text appear telling the person they have a new message but also have a small pop-up box that lets them know they have a message as well or possibly an email notification that they have a PM waiting?

Thanks

Just installed this mod... doesn't get much easier than that... the install readme was clear and easy to follow and I did a check on my system and no problems whatsoever...

Awesome job Connerhd cool

15

(5 replies, posted in PunBB 1.2 show off)

Cajual wrote:

Your religion makes me shudder.

Thats OK, Jesus still loves you....

I think that this was supposed to be a review of the PunBB mod/integration/style etc, not what the content is about...

16

(5 replies, posted in PunBB 1.2 show off)

I like it except that I personally think the header is WAY too large...

Other than that I like the colors and I like what the site is about...

I have all my issues sorted out with this modification.

The code is now XHTML 1.0 compliant and produces the bold headlines like I wanted.

All credit goes to Paul and CableGuy for their work on this in this thread:

http://punbb.org/forums/viewtopic.php?id=10652

Here is the modified code:

//
// Use this to display 'news' - the recent topics from a specific forum
// expanded to include the first post text, posters, comments, etc.
//

else if ($_GET['action'] == 'news')
{
    $order_by = ($_GET['action'] == 'active') ? 't.last_post' : 't.posted';
    $forum_sql = '';

    // Get the forum id(s) you'd like to post news from
    if (isset($_GET['fid']) && $_GET['fid'] != '')
    {
        $fids = explode(',', trim($_GET['fid']));
        $fids = array_map('intval', $fids);

        if (!empty($fids))
            $forum_sql = ' AND f.id IN('.implode(',', $fids).')';
    }

    // RSS support not implemented, if anyone wants to do it, feel free..
    if (isset($_GET['type']) && strtoupper($_GET['type']) == 'RSS')
    {    
    }
    // Regular HTML output
    else
    {
        $show = isset($_GET['show']) ? intval($_GET['show']) : $show_default_topics;
        if ($show < 1 || $show > $show_max_topics)
            $show = $show_default_topics;        

        $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.num_replies, t.num_views, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE t.moved_to IS NULL '.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show.' ') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
        $show_count = 0;

        if(!$db->num_rows($result))
        {
            echo "No news to display";
        }
        else
        {

            while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) 
            {
                echo "<div class=\"newsblock\">";
                $temp = '';
                if ($pun_config['o_censoring'] == '1')
                    $cur_topic['subject'] = censor_words($cur_topic['subject']);
                if (pun_strlen($cur_topic['subject']) > $max_subject_length)
                    $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
                else
                    $subject_truncated = $cur_topic['subject'];

                // Simplify frequently required display information
                $thisdate = date('l, d F Y', $cur_topic['posted']);
                $poster = $cur_topic['poster'];
                $comments = $cur_topic['num_replies'];
                $views = $cur_topic['num_views'];

                // If using headlines, then after first item only show headlines...
                if(isset($_GET['headlines']) && $show_count > 0)
                {
                    echo '<p class="newsheadline"><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">'.$subject_truncated."</a> ($comments)</p> \n";
                }
                else
                {
                    // DISPLAY FOR TITLE OF NEWS
                    echo '<p class="newstitle"><b><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">'.$subject_truncated."</a></b></p> \n";
                    $id = $cur_topic['id'];
                    $msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
                    if ( !$db->num_rows($msg) ) continue;

                    $cur_post = $db->fetch_assoc($msg);
                    $posterid = $cur_post['poster_id'];    

                    // DISPLAY FOR "Posted on DATE by POSTER"
                    echo '<p class="newsdetails">Posted on '.$thisdate.' by <a href="'.$pun_config['o_base_url'].'/profile.php?id='.$posterid.'">'.$poster.'</a></p>'."\n";                    $truncate = isset($_GET['summary']) ? 1 : 0;
                    if ($truncate == 1)
                    {
                        $paragraph = preg_split("/\s*\n+/", $cur_post['message']);
                        if (isset($paragraph[1])) 
                        {
                            $cur_post['message'] = $paragraph[0] . "...";
                        }
                    }

                    $message = parse_message($cur_post['message'], 0);            
                    echo '<div class="newstext">'.$message;
                    if ($truncate == 1) { echo '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">Read More...</a>'; }
                    echo '</div>'."\n";

                    echo '<p class="newsextra">Comments(<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">'.$comments.'</a>) | Views (<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">'.$views.'</a>) <br /></p><hr />'."\n";
                }
                echo "</div>"; // end newsblock div
                $show_count++;
            }
        }
    }
}
else

Page now passes XHTML 1.0 validation!

Thanks Paul and CableGuy for your efforts!

cool

Thanks guys... learning a lot from this... I think... LOL.... I have it down from the initial 119 problems to 5... some were easy to figure out some (like what I posted here) I had trouble grasping.

The last 5 appear to be related to this (I think):

echo '<p class="newstext">'.$message;
if ($truncate == 1) { echo '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">Read More...</a>'; }
echo '</p>'."\n";

Somewhere an extra <p> is being inserted after < class='newstext'>

This is getting me so close... it's also greatly appreciated too...

I have tried messing with the last bit thats left but I cannot seem to grasp where to add and remove the ' and ".

This is what I think is left to be altered:

echo "<p class=\"newstext\">$message";
                    if ($truncate == 1) { echo "<a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">Read More...</a>"; }
                    echo "</p> \n";

                    echo "<p class=\"newsextra\">Comments(<a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">$comments</a>) | Views (<a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">$views</a>) <br /><hr /></p> \n";

Well I did it without the <h2> tag and then made the changes suggested and that cleared up half the errors...

The next line causing the remainder appears to be this line:

echo "<p class=\"newsdetails\">Posted on $thisdate by <a href=".$pun_config['o_base_url']."/profile.php?id=$posterid>$poster</a></p> \n";

I tried making similar changes as the bit mentioned before but I end up with parse errors...

Shell is a command line... it has nothing to do with your browser... Most hosts don't allow shell access....But if yours does then you need a helper program like "putty" (it's free) and then log in and use the command line to CHMOD your directories...

If you can't do that then you are left with FTP... I would suggest using SmartFTP, it's free and really easy to use.

If you chose to not use FTP, well, I can't help you... Frontpage is garbage...  I couldn't tell you if it's possible with it....

I like it.... Can't read a single word there, but I like it...

Those two things were causing a few of the validation errors, but I still have a ton left over from what appears to be the output of the extern file...

This is a sample of the 90 errors returned... all from the output of the script to display the news thread on the main page:

# Error  Line 56 column 60: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.

...ock"><p class="newstitle"><b><a href=http://www.uscivilwaronline.com/forums/v

?
# Error Line 56 column 66: NET-enabling start-tag not immediately followed by null end-tag.

...p class="newstitle"><b><a href=http://www.uscivilwaronline.com/forums/viewtop

This error may occur when there is a mistake in how a self-closing tag is closed, e.g '.../ >'. The proper syntax is '... />' (note the position of the space).

?
# Error Line 56 column 181: end tag for element "a" which is not open.

...ntally Plow Civil War-Era Cemetery</a></b></p> 

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occured in a script section of your document, you should probably read this FAQ entry.

For example, this part of the script:

echo "<p class=\"newstitle\"><b><a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">$subject_truncated</a></b></p> \n";

returns this in the source view (hence what the validator sees):

<p class="newstitle"><b><a href=http://www.uscivilwaronline.com/forums/viewtopic.php?id=55>Plantation Workers Accidentally Plow Civil War-Era Cemetery</a></b></p>

and obviously the lack of quotes (") enclosing the URL.


Any thoughts?

I have added a modification to the extern.php file to show news that is posted in my punbb news forum on my frontpage of my website.

The problem I am having is that the output is causing the site to no longer comply to XHTML 1.0 W3C standards.

Can anyone take a look and see what they think can be done to remedy this problem?

Here is the added code to extern.php:

//
// Use this to display 'news' - the recent topics from a specific forum
// expanded to include the first post text, posters, comments, etc.
//

else if ($_GET['action'] == 'news')
{
    $order_by = ($_GET['action'] == 'active') ? 't.last_post' : 't.posted';
    $forum_sql = '';

    // Get the forum id(s) you'd like to post news from
    if (isset($_GET['fid']) && $_GET['fid'] != '')
    {
        $fids = explode(',', trim($_GET['fid']));
        $fids = array_map('intval', $fids);

        if (!empty($fids))
            $forum_sql = ' AND f.id IN('.implode(',', $fids).')';
    }

    // RSS support not implemented, if anyone wants to do it, feel free..
    if (isset($_GET['type']) && strtoupper($_GET['type']) == 'RSS')
    {    
    }
    // Regular HTML output
    else
    {
        $show = isset($_GET['show']) ? intval($_GET['show']) : $show_default_topics;
        if ($show < 1 || $show > $show_max_topics)
            $show = $show_default_topics;        

        $result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.num_replies, t.num_views, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE t.moved_to IS NULL '.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show.' ') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
        $show_count = 0;

        if(!$db->num_rows($result))
        {
            echo "No news to display";
        }
        else
        {

            while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) 
            {
                echo "<div class=newsblock>";
                $temp = '';
                if ($pun_config['o_censoring'] == '1')
                    $cur_topic['subject'] = censor_words($cur_topic['subject']);
                if (pun_strlen($cur_topic['subject']) > $max_subject_length)
                    $subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
                else
                    $subject_truncated = $cur_topic['subject'];

                // Simplify frequently required display information
                $thisdate = date('l, d F Y', $cur_topic['posted']);
                $poster = $cur_topic['poster'];
                $comments = $cur_topic['num_replies'];
                $views = $cur_topic['num_views'];

                // If using headlines, then after first item only show headlines...
                if(isset($_GET['headlines']) && $show_count > 0)
                {
                    echo "<p class=\"newsheadline\"><a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">$subject_truncated</a> ($comments)</p> \n";
                }
                else
                {
                    // DISPLAY FOR TITLE OF NEWS
                    echo "<p class=\"newstitle\"><h2><b><a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">$subject_truncated</a></b></h2></p> \n";

                    $id = $cur_topic['id'];
                    $msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
                    if ( !$db->num_rows($msg) ) continue;

                    $cur_post = $db->fetch_assoc($msg);
                    $posterid = $cur_post['poster_id'];    

                    // DISPLAY FOR "Posted on DATE by POSTER"
                    echo "<p class=\"newsdetails\">Posted on $thisdate by <a href=".$pun_config['o_base_url']."/profile.php?id=$posterid>$poster</a></p> \n";

                    $truncate = isset($_GET['summary']) ? 1 : 0;
                    if ($truncate == 1)
                    {
                        $paragraph = preg_split("/\s*\n+/", $cur_post['message']);
                        if (isset($paragraph[1])) 
                        {
                            $cur_post['message'] = $paragraph[0] . "...";
                        }
                    }

                    $message = parse_message($cur_post['message'], 0);            
                    echo "<p class=\"newstext\">$message";
                    if ($truncate == 1) { echo "<p><a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">Read More...</a></p>"; }
                    echo "</p> \n";

                    echo "<p class=\"newsextra\">Comments(<a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">$comments</a>) | Views (<a href=".$pun_config['o_base_url']."/viewtopic.php?id=".$cur_topic['id'].">$views</a>) <br /><hr /></p> \n";                
                }
                echo "</div>"; // end newsblock div
                $show_count++;
            }
        }
    }
}
else
    exit('Bad request');

Thanks!