The last source update was done nearly three weeks ago. What's up?

 <?php echo $cur_post['message']."\n" ?>

This one line can drain 64KB of RAM. Assuming that temporary strings remain in memory until the end of script execution (do they?) and that a user views 50 posts per page, with the absence of code cache, you can potentially drain > 3MB of RAM.

Plus it's good practice.

I also don't see what is so confusing about this.

http://karma.nucleuscms.org/item/27

54

(5 replies, posted in Feature requests)

guardian34 wrote:

They already use something like this:

<meta name="ROBOTS" content="NOINDEX, FOLLOW" />

Doesn't robots.txt have to be at the root of a server?

No, it does not. Example:

http://www.sitepoint.com/forums/robots.txt

55

(5 replies, posted in Feature requests)

Have a default robots.txt file that blocks post.php, profile.php, userlist.php, login.php, etc. etc.

deadram wrote:

  This isn't a "OOP is worse then procedural" benchmarks. It messures time spent creating an object with a single function, time spent calling an object's function, time spent calling a function, and time spent without either. It offers nothing conclusive for all senarios, but does hint at places where one might improve speed. Each program/script is different, and each programmer's (or clients) needs are different.

  I'm not really using my object period, or my function. I'm timing the underlying system. No matter how neat and inovative my OOP code may be, it won't outperform 18 seconds for 10000000 creations on my box+config+version of php. I'm also willing to bet that regardless of box+config the ratio of 18:9:8:4 will remain constant, and regardless of version (ignoring other majors though, php6 for example tongue) the ratio will remain fairly simular. I don't think I mentioned anything about what oop could or couldn't do... I simply mentioned how fast it could execute under 2 different senarios.

  I think it's important to keep in mind that no benchmark will ever tell the whole story, short of writing the app twice, but who really has time for that tongue PS: Appologies for the spelling, don't have firefox atm, and opera doesn't have spellcheck installed by default? 0.o

On a totally unrelated note: People actually use spellcheck? Lazy lazy.

57

(5 replies, posted in Programming)

I don't really want to use sprintf for this. Meh, I give up. I'll just use str_replace. Thanks though.

58

(5 replies, posted in Programming)

Okay, I'm having some trouble with Regex. I have this string:

'What is %? <input name="auth">'

I have this Regex applied to this string:

Matches all % characters not followed by a \
preg_replace('/[^\\\\]%/', $this->literal, $formatting);

This is the output:

What isfive times three?

I want the space to remain between the 'is' and 'five', so essentially, the output should be: 'What is five times three?'. How can I do this? What am I doing wrong?

59

(4 replies, posted in Feature requests)

Ah, I see. I ought to read my citations!

60

(8 replies, posted in PunBB 1.2 discussion)

Um, what can one do with an IP address?

61

(4 replies, posted in Feature requests)

I see many TINYINT(1) rows, many of which I assume are either a '0' or '1' value. Why is this? Wouldn't it be better to have an ENUM('0', '1') instead?

http://dev.mysql.com/doc/refman/5.0/en/enum.html

Yes.

i.e header('HTTP/1.1 400 Bad Request') for non-existant topics and header('HTTP/1.1 403 Forbidden') for unauthorized actions.

I suggest you read this: http://karma.nucleuscms.org/item/27

Oh and I don't know if 1.3 fixes this, but BBCode similar to [ b ][ i ]foo[ /b ]bar[ /i ] creates invalid markup.

.

Just so you won't endorse a "wrong" site.
http://microformats.org/wiki/rel-nofollow

66

(3 replies, posted in Programming)

I will dynamically make the title element to the specified image name and via css retrieve the content. The attr(attribute) function can retrieve the contents of specified attribute; it's just that I don't know how to do so in my example. More concise:

<style type="text/css">
#test::after {
content: url('http://www.yahoo.com/attr(test).png')
}
</style>

<div id="test" title="main">
...
</div>

Doing this yiels no output.

67

(3 replies, posted in Programming)

background-image: url('http://domain.tld/attr(title).png');

where the title attribute says "image" so the actual URL should be http://domain.tld/image.png. This is bugging me so much... sad

elbekko wrote:

Doing it with PHP would horribly ruin the quality of the image.

What kind of quality would you need in a 60x60 picture, anyway?

Maybe I was more vague than I thought. What I mean is when you subscribe to a topic, you get emailed the thread; what I want is to have a feature that alerts you IN PunBB itself that there has been a new reply in a specified topic.

I find it a pain to manually resize an image that is 10 pixels larger than maximum size. Some people don't even know how to resize an image, actually.

I'm sorry; I meant the 'Subscribe to Topic' feature being intergrated.

Eh, self-explanatory.

73

(13 replies, posted in Programming)

I can only think of OOP being used as an SQL parser/interface or an error handler. But if I want an SQL interface, I can just use PDO. So what do/would you use OOP for?

By the way, why doesn't PunBB use PDO?

74

(6 replies, posted in Feature requests)

That is going to generate a lot of CPU usage...

http://img181.imageshack.us/img181/2595/adminuk5.jpg
http://img181.imageshack.us/img181/5589/topicpt9.jpg

As you can see, the text background is mainly the problem. It works fine in FF and IE7, though. This is rev 759.