1

(124 replies, posted in News)

Wow, talk about drama. Both Rickard and Smartys have made it clear they will fork it if necessary. What else do you need to hear? I'm glad to hear the developers have gotten some monetary compensation for their hardwork. Seems like a win win to me.

2

(4 replies, posted in Programming)

I like the user blog mod for PunBB smile

Will fix up the hardcoded 'choose a forum'.

As for stats and who's online I will add that but only for the first page I think.

I also noticed I left a line in the post.php which needs to be removed. It's harmless and doesn't affect anything but leaves a tag open and uses the lang file from another mod.  I look it over for anything else I may have missed and reupload.

As for stickies I'm not sure what to suggest. The change you made will work fine but this probably isn't a good mod for a site that uses many stickies. It kind of defeats the whole purpose of the stickies IMO.

Thanks for the feedback smile

##
##
##        Mod title:  All Topics
##
##      Mod version:  1.0 
##   Works on PunBB:  1.2.*
##     Release date:  2007-07-26
##           Author:  TinyTim (tinytim@soonotes.com)
##
##      Description:  This mod alows users to view all topics on one page. 
##
##   Affected files:  index.php
##                    footer.php
##                    post.php
##                    lang/English/common.php
##
##       Affects DB:  No
##
##            Notes:  This mod allows viewers to switch between the regular
##                    forums view and topics view (lists all topics) from a
##                    link in the footer. 
##                    A cookie is used to remember the users view choice.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

http://www.punres.org/viewtopic.php?id=3669

This allow users to switch between the traditional forum view and a listing of all posted topics on one page.

Example here. In the page footer there is a link to change views.

http://www.punres.org/viewtopic.php?id=3669

6

(1 replies, posted in PunBB 1.2 discussion)

Not sure if you'd call this a bug or if it's been mentioned before but

I was just replying to a topic I am subscribed to and noticed the option to subscribe to the topic.

If you've already subscribed I would think that option shouldn't be there or maybe it could be replaced with unsubscribe. Minor but it made me check if I was actually subscribed.

I've implemented this on soonotes.com and have added the option to the footer to switch between 'Topics View' and 'Forum View'.

I'll clean it up a little bit, incorporate the lang files and release as a mod in a day or two.

I hope trakman didn't give up on it wink

Was kind of hoping for some feedback from trakman. Also trying to figure a way to integrate it better. Any thoughts on that?

Is there a reason you don't want the 'social networking' links available to guests?

If not this should work, a small change to the original code

if (!$pun_user['is_guest'] && $pun_config['o_subscriptions'] == '1')
{
    if ($cur_topic['is_subscribed'])
        // I apologize for the variable naming here. It's a mix of subscription and action I guess :-)
        $subscraction = '<li class="email">'.$lang_topic['Is subscribed'].' - <a href="misc.php?unsubscribe='.$id.'">'.$lang_topic['Unsubscribe'].'</a></li>'."\n";
    else
        $subscraction = '<li class="email"><a href="misc.php?subscribe='.$id.'">'.$lang_topic['Subscribe'].'</a></li>'."\n";
}
else
    $subscraction = ''."\n";

Then around line 350

Find

        <?php echo $subscraction ?>

and replace with
<div id="social-toolbar">
    <ul class="tools">
        <?php echo $subscraction ?>
        <li class="rss"><a href="rss.php?tid=<?php echo $id ?>"">RSS Feed for this Topic</a></li>
        <li class="digg"><a href="http://digg.com/submit?phase=2&url=<?php echo $pun_config['o_base_url'] ?>/viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>&title=<?php echo pun_htmlspecialchars($cur_topic['subject']) ?>">Digg This</a></li>
        <li class="delicious"><a rel="nofollow" href="http://del.icio.us/" onclick="window.open('http://del.icio.us/post?v=2&url='+encodeURIComponent(location.href)+'&notes=&tags=&title='+encodeURIComponent(document.title));return false;" onmouseover="schnapp('Delicious','','<?php echo PUN_ROOT; ?>',1)" onmouseout="schnipp()">Del.icio.us</a></li>
        <li class="magnolia"><a rel="nofollow" href="http://ma.gnolia.com/" onclick="window.open('http://ma.gnolia.com/bookmarklet/add?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&description=&tags=');return false;" onmouseover="schnapp('MaGnolia','','<?php echo PUN_ROOT; ?>',1)" onmouseout="schnipp()">Ma.gnolia</a></li>
        <li class="stumble last"><a rel="nofollow" href="http://www.stumbleupon.com/" onclick="window.open('http://www.stumbleupon.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title));return false;" onmouseover="schnapp('StumbleUpon','','<?php echo PUN_ROOT; ?>',1)" onmouseout="schnipp()">StumbleUpon</a></li>
    </ul>
</div>

You may need a div clearer in there but the basic idea should be pretty clear.

http://wiki.punres.org/Last_post%27s_su … orum_index

11

(16 replies, posted in Feature requests)

Hey Trakman, or anyone else interested in this

If you click the link in my previous post you will see this in action. It basically lists all topics ever posted in order of last post.

You also see a link for 'post new topic' which brings you to a page where you need to select a forum to post in before going to the normal post form. This of course only shows if you have permission to post on the site and only shows the forums you can post in. Pretty straight forward and I really like for a small site like mine.

The OP also mentioned sub forums and default view. As I don't use sub forums I'm not sure what would need to change for it to be compatable with that mod.

As for the default I'm not sure what you mean. Making it the default forum view for the site would be pretty straight forward. Letting a user choose their default may not be. Will look into it but would appreciate any feedback.

12

(16 replies, posted in Feature requests)

Hey there trakman, my apologies for taking so long but again this slipped my mind.

I have made a basic page which will show all topics. It can be seen here

I'm not sure what you would like for additional info. I put a link to the forum (category) and could add reply or whatever. Take a look and let me know.

Like this? http://www.punres.org/viewtopic.php?pid=17676

So, where does this leave me?  Should I have gone with vBulletin originally?   Should I make the switch now?  Should I install the mods or wait for 1.3 and extensions?

I think you answered that yourself already with a couple of comments you made.

but I'm afraid the resources required to run a big forum on that platform would have been too much

From what I understand "mark as read" will be built into the core and the other two are first on the list for "supported extensions".

Personally I say forget about 1.3 It will happen sometime. I believe both PM's and Easy Poll are both expected to be a simple transition without losing any existing messages or polls.

Like everyone else I would love to see a timeline for 1.3 (or atleast a list of hooks that will be added) but the big thing to remember is that when it does come out you don't have to upgrade right away. There will be a beta I'm sure and the mod authors will have time to create and test extensions. Just wait until the mods you are using have proven extensions.

As for installing mods it's not a big deal. Just make sure you have back ups, only install one at a time and keep a record of what you have. Also read the release threads for the mod in question to see if anyone else has run into conflicts with other mods. I'm not familiar with the mark topics read mod but the other two you want are a couple of the most used mods, if there's any issues there's also answers smile

<img src="'.$pun_config[o_base_url].'/img/'.$pun_user['style'].'/buttons/btn_icon_email.png">

16

(4 replies, posted in PunBB 1.2 troubleshooting)

Check this mod for feeds that don't use DTD. Works fine in IE7 (example)

Tried to register again and still getting the same error when submitting. Like Burnsy86 mentioned debug mode would be a big help.

No reason for your base url to have changed. The base url shouldn't refer to a specific file, just the directory your forum is in. Change it back to what it was unless you moved directories.

I tried to register at your site and got the same error. No reason (that I know of) registering should fetch any post info so I'm guessing it's something being loaded in a side block.

20

(4 replies, posted in General discussion)

You may want to try a different browser too. I know that mod has issues with IE6 if not the latest version.

lol MattF

If you're going to rewrite it you may want to have the query check for read permissions also.

Change

        $str = close_tags(preg_replace('#\s*<[^>]+>?\s*$#','',$str).$append);

to

        $str = close_tags(preg_replace('#\s*<[^>]+>?\s*$#','',$str));

Try this

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

define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/login.php';
require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';

$newsid = '19'; //This is the forum the news is retrieved from
$newsdisplay = '5'; //This is how many news articles are displayed.


function close_tags($string)
{
  // match opened tags
  if(preg_match_all('/<([a-z\:\-]+)[ >]/', $string, $start_tags))
  {
    $start_tags = $start_tags[1];

    // match closed tags
    if(preg_match_all('/<\/([a-z]+)>/', $string, $end_tags))
    {
      $complete_tags = array();
      $end_tags = $end_tags[1];
    
      foreach($start_tags as $key => $val)
      {   
        $posb = array_search($val, $end_tags);
        if(is_integer($posb))
        {
          unset($end_tags[$posb]);
        }
        else
        {
          $complete_tags[] = $val;
        }
      }
    }
    else
    {
      $complete_tags = $start_tags;
    }
    
    $complete_tags = array_reverse($complete_tags);
    for($i = 0; $i < count($complete_tags); $i++)
    {
      $string .= '</' . $complete_tags[$i] . '>';
    }
  }
  // Removes the </img> tag
$xhtml_tags = array("</img>", "</hr>", "</br>");
$string = str_replace($xhtml_tags, "", $string);
  return $string;
}


function truncate($str, $id) {

$len = '200'; //This is how many characters are displayed.
$splitter = '<!--MORE-->';
$append = ' ... <span class="barlink"><i><a href="viewtopic.php?pid='.$id.'#p'.$id.'">View Post';
    if(strlen($str) <= $len){
        return $str;
    }
    if($len > 0 && !strstr($str,$splitter)){
        preg_match('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$len.',}\b#U', $str,$matches);
        $str = $matches[0];
        # remove trailing opener tags and close all other open tags:
        $str = close_tags(preg_replace('#\s*<[^>]+>?\s*$#','',$str).$append);
    } else {
        $arr = explode($splitter,$str,2);
        $str = $arr[0];
    }
    return $str;
}

if ($pun_config['o_index_message_show'] == 1)
{
?>
 
        <div class="block">
            <h2><span><?php echo pun_htmlspecialchars($pun_config['o_index_message_head']) ?></span></h2>
            <div class="box">
                <div class="inbox">
        <?php echo $pun_config['o_index_message'] ?>
                </div>
            </div>
        </div>
<?php
}
$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, u.use_avatar, p.id AS post_id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id='.$newsid.' AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$newsdisplay) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());

        if ($db->num_rows($result))
                    {
                            while($cur_post = $db->fetch_assoc($result))
                            {
$id = ($cur_post['post_id']);
                                    $pre = parse_message($cur_post['message'], $cur_post['hide_smilies']);
$str = truncate ($pre, $id);
?>
    <div class="block">
       
<?php
        if ($pun_config['o_avatars'] == '1' && $cur_post['use_avatar'] == '1' && $pun_user['show_avatars'] != '0')
        {
            if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif'))
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.gif" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg'))
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.jpg" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
            else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png'))
                $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img src="'.$pun_config['o_avatars_dir'].'/'.$cur_post['poster_id'].'.png" '.$img_size[3].' title="'.$cur_post['poster'].'\'s Avatar" alt="'.$cur_post['poster'].'\'s Avatar" /></a>';
        }
        else
            $user_avatar = '<a href="profile.php?id=' . $cur_post['poster_id'] . '"><img alt="" src="img/noimage.gif" /></a>';
    echo "\t\t\t\t\t\t\t".'<h2><strong><a href="forum.php">Forum</a> » <a href="viewforum.php?id='.$cur_post['forum_id'].'">'.pun_htmlspecialchars($cur_post['forum_name']).'</a>'.'</strong></h2>'."\n";
?>
<div class="box">
    <div class="inbox">
<ul><li>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
    <tr>
        <td style="border: 0px; padding: 0px 10px 7px 7px;"><a class="news_subject" href="viewtopic.php?id=<?php echo $cur_post['id']; ?>"><?php echo $cur_post['subject']; ?></a></td>
    </tr>
</table> 
 
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
    <tr>
        <td align="left" style="white-space: nowrap; width: 8em; padding-left: 7px; padding-top: 6px; padding-bottom: 30px; border: 0px;" valign="top"><?php echo $user_avatar ?></td>
        <td style="text-align: left; border: 0px; padding-top: 0px;" valign="top"><?php echo $str ?></td>
    </tr>
</table>

<table class="news_footer" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td width="100%">
            
            <?php
    echo "\t\t\t\t\t\t\t".'<span class="user" style="float:left">Posted: '.format_time($cur_post['posted']).' by:<span class="user'.(isset($cur_post['g_title']) ? ' '.strtolower(str_replace(' ', '', $cur_post['g_title'])) : '').'"> <a class="poster" href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['poster']).'</a> |  Views: '. $cur_post['num_views'].' |  Replies: '. $cur_post['num_replies'].'</span></span>'."\n";
        if ($cur_post['poster_id'] == $pun_user['id'] || $pun_user['g_id'] < PUN_GUEST)
    echo "\t\t\t\t\t\t\t".'<a href="viewtopic.php?id='.$cur_post['id'].'">'.pun_htmlspecialchars($lang_portal['Visit_Topic']).'</a>'.'<span style="float:right">'.'<a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.' | <a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a> | <a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'">'.'Reply'.'</a>'.' | <a href="post.php?tid='.$cur_post['id'].'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'.'</span>'."\n\n\n\n";
?>
        </td>
    </tr>
</table>       
</li></ul>
        </div>
    </div>
</div>
<?
}
     }

require PUN_ROOT.'footer.php';

Thank you MattF. Nice job, regex gives me headaches.

MattF wrote:
soonotes wrote:

Are those spans in the $append? If so leave them open.

Have removed the append. smile Already have the read more setup where I'm trying to jemmy it, so that bit's unneeded. smile It's purely between the <p> </p> tags that it's adding the extras. I think it's the following where the problem is initially occuring:

if (preg_match_all ('/<([a-z\:\-]+)[ >]/', $string, $start_tags))

Now that I think about it I had the exact same issue. I don't know what caused it but what I did was start again with the unmodified function and make the changes I needed.

In other words, try it with the code I posted and you shouldn't have the issue. Then make your changes one at a time and see when the issue occurs.