Smartys wrote:

I would argue that PunBB is scalable. My understanding of replication is somewhat limited, but I believe you would have one master, several slaves, make all selects come from the slaves, and all inserts/deletes/updates go to the master. I don't see any case where PunBB makes that difficult.

php application code is  NOT atomic, since there can be multiple concurrent http POST operations, so the count accuracy cannot be guaranteed.  This is the case for punbb rcode running on a single server or multiple servers.

It might be that punbb is not not even scalable to multiple httpd daemons on the same server (the usual case) -- in other words it's only accurate for a single user forum, unless the counts are maintained as globals or you provide blocking to prevent simultaneous posts.

Thanks for pointing out the code.  This would be a great feature to have for admin.

There's also a cost to not being scalable.  and my conjecture is there are more cycles needed to run a php interpreter than an optimized query, but that's irrelevant really.  These are design choices, and I respect (even if I disagree with) the decisions.
But, I think that along with those decisions comes the need to provide tools that allow intelligent pruning.



Now for  more explanation:

1. I manually deleted:

delete from pun_posts where poster_id=21
delete from pun_topics where poster='amandaloan'

2.  I then noticed that the post and topic counts were erroneous, and there were more page links built than needed.

3. I tried to rebuild the index, hoping that would figure things out, but I get an error:

An error was encountered
Error: Unable to update table auto_increment.

Can you help me with the queries needed to reset the topic and post counts, please?
Something like
update pun_posts set num_replies =  ....

I'm running mysql4, so no subselects.  probably need to loop this in php.

thx.

Some time ago (measured in years) I posed  questions about the data model commonly used in php applications like punbb and wordpress-- like why isn't it normalized; why does punbb keep track of post counts in tables, instead of counting as part of a query; why isn't the user id always used, instead of sometimes using the username (poster)?

I was told that it was for 'efficiency' and responsiveness, so the database didn't have to have to do all those calculations.  That didn't satisfy me then, and I'm now seeing problems with the data model as I try to prune spam.

It's an inconvenience to have to write pruning queries using id to prune posts, but 'poster' to prune topics.  But then, none of the topic counts and page counts are correct, because these are maintained by the application instead of the database!  So still more queries needed to count them up by groups, and then manually correct them. 

it would be so much better IMHO to use the database instead of the app -- they're fast for this kind of thing.  And it also allows scalability (multiple web servers hitting one or more punbb databases; which can't be done if topic and post counts are handled by the app.

4

(4 replies, posted in Feature requests)

Smartys wrote:

This way you need to store only one variable: post ID. Your way, you would need to store post ID, topic ID, and page in order to link to the post in the same way.

I see. Yes, one might want to store the post ordinal for efficiency, but I don't think it's necessary as I imagine punBB is already using
ORDER BY post_timestamp.  The LIMIT BY clause is  probably simpler if a page number is included, since the start row is POSTS_PER_PAGE x PAGE_NUMBER

Semantically, it make more sense to me to always go to viewtopic.php?id=topicid, instead of sometimes to viewtopic.php?pid=postid.  And it would make my external spidering easier.

But maybe there are plans for trackback that would make use of the postid???

quaker wrote:

nice but center the logo......

thanks.  also cleaned up styles to work with MacIE 5 (what a piece of S***)

6

(4 replies, posted in Feature requests)

But it doesn't seem to link to a specific post, as in an anchor on a page (id=n#p, where n is the topic, and p is the ordinal of the post number) but instead renders the same page as for the parent topic.  Of course, if the link is on page 2,3,4, etc, then yes, you go to a specific page.  But following the link takes you to the top of the page -- not to a particular post.

Say there are 15 posts per page -- we end up with 16 links (topic plus 15 posts) that end up rendering the same page.  This bothers me, as I would much prefer that there be one to one mapping of pages and URIs.

Maybe I'm missing something.  It seems to me that it  would be more useful for an authors link, for example, to go to the topic id, with the page number and anchor.  I'll have to take a look at what's involved in the sql.

7

(4 replies, posted in Feature requests)

I've integrated punBB into my site, which uses swish-e for site-wide spidering and search.  Now that the forum has been running for a while, I decided to run a few queries, for example thy. I was surprised to see multiple references to the same page, each with a different viewtopic.php?pid=.  I see some are from the author links, but there must be some other sources.

Each page is superficially identical, with the same byte count, ince swish-e takes an MD5 hash of each page to avoid duplicates, but they have unique URIs, so the same page gets indexed repeatedly.

But I'm curious about the design intent in using two URIs to reference the same resource?  Is this so viewtopic.php can go to the second or later page of a multipage topic?  If so, why not calculate the page number in advance and use, viewtopic.php?id=n&p=page.  This way, each Resource would be Uniformly Identified. 

Meanwhile, I will write a perl callback to exclude the ?pid= from getting spidered.

DOUBLETHINK
A Tale of Unintended Consequences
by J.E. Schwartz

It is Election Day 2012 and the electoral map is glowing red. The conservative agenda is well on its way to full implementation with minimal taxes, faith-based social policies, and market-driven government focused on national defense and homeland security. For Joe Winston, a successful Silicon Valley attorney with a wonderful life? beautiful home, great job, plenty of money in the bank?it promises to be another banner year.

DOUBLETHINK is the story of a decent guy, respected in his church and community, who sets off a disastrous chain of events with a generous donation to the wrong charity. In his terrifying descent from ?have? to ?have not,? Joe is forced to experience the natural consequences of the policies he has sincerely supported his entire life. His guides on his transformative adventure include Daniel, his gay son; Robert, a downsized scientist whose wife is dying of cancer; and Maria, a young homeless woman who helps Joe discover what he truly values.

In this thought-provoking debut novel, author J.E. Schwartz explores the divisions affecting our society by imagining a future that is chillingly real and all-too plausible.

The admin options state for rules:

This text will not be parsed like regular posts and thus may contain HTML.

So to allow valid html, line 52 of misc.php should be changed from

            <p><?php echo $pun_config['o_rules_message'] ?></p>


to             <?php echo $pun_config['o_rules_message'] ?>


The <p> block level element doesn't permit <ol>, for example.

10

(4 replies, posted in PunBB 1.2 bug reports)

Yep.  My ./configure was at fault.

11

(4 replies, posted in PunBB 1.2 bug reports)

Smartys wrote:

http://bugs.php.net/bug.php?id=31501&edit=2
In other words, it would appear you're not using the PCRE library bundled with PHP

Perhaps not. I'm installing onto Fedora Core 4.

# rpm -q php
php-5.0.4-10.5


Perhaps this also explains why I get an HTTP REFERER error from admin_options.php?

Maybe the bug is that install.php does not test its environment to be sure the required libraries are present?

install.php
    if (strlen($email) > 50 || !preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email))
        error('The administrator e-mail address you entered is invalid. Please go back and correct.');

apache error log:

PHP Warning:  preg_match: internal pcre_fullinfo() error -3 in /web/www/public/rtb/htdocs/forum/install.php on line 327, referer: http://www3.raisethebar.com/forum/install.php


Browser:

An error occured.

PunBB reported: The administrator e-mail address you entered is invalid. Please go back and correct.


my email:

bill@tothept.com