Why not just create a standard function such as this to prevent code repetition:

function initialize_hooks($hook_key) {
 $hook = get_hook($hook_key);
 if($hook) {
  eval($hook);
 }
 return (bool)$hook;
}

It makes much more sense in my mind hmm

27

(11 replies, posted in General discussion)

matt1298 wrote:

I would help, but .. im too tired lol... ( happy new year wink ) and im sure you can do it, if a 15 year old can

Since when does age play any part in programming?

28

(21 replies, posted in PunBB 1.2 discussion)

Ugh. Change your alias.
Or at least attempt to learn HTML, CSS and PHP so you won't have to make a topic on the most trival of problems.

This is what middle click, ctrl/shift+click are for.

gil wrote:
orlandu63 wrote:
gil wrote:

And does somebody know if it will be possible with the 1.3 version?

The [ img] BBCode tag references the <img> HTML tag.

Yes, I know.

Because all search input is escaped, you won't even be able to search for "<img>."
So, in short, no.

What I would say is not to search exactly the "[url]" pattern, but all the post using an image. Not possible indeed?

Possible.

gil wrote:

Or the name of an image: with or without "*", it seems it doesn't work. Why?

Huh?

gil wrote:
gil wrote:

Is it possible to use punbb search function to find all [url]used in post?

Smartys wrote:

1. I don't think so

too bad

And does somebody know if it will be possible with the 1.3 version?

The [ img] BBCode tag references the <img> HTML tag. Because all search input is escaped, you won't even be able to search for "<img>."

So, in short, no.

32

(3 replies, posted in Feature requests)

Have Show New Posts feature be able to display posts in ascending order as well as descending.

33

(14 replies, posted in PunBB 1.2 discussion)

oneless wrote:

Thank you so much orlandu63.

Woops -- mistake on my part:

Replace:

for ($i = 0, $num_links = count($extra_links); $i < $num_links; ++$i)

With:

for ($i = 0, $num_links = count($extra_links[1]); $i < $num_links; ++$i)

Editing code without syntax highlighting confuses me tongue

34

(14 replies, posted in PunBB 1.2 discussion)

In functions.php, replace for ($i = 0; $i < count($extra_links[1]); ++$i) with for ($i = 0, $num_links = count($extra_links); $i < $num_links; ++$i). (Around line 315)
In functions.php, replace for ($i = 0; $i < count($cur_ban_ips); ++$i) with for ($i = 0, $num_ips = count($cur_ban_ips); $i < $num_ips; ++$i) (Around line 213)

35

(6 replies, posted in PunBB 1.2 troubleshooting)

Why not try it out yourself?

36

(11 replies, posted in PunBB 1.2 troubleshooting)

http://www.openwings.zephyrhosting.net/forum/

37

(14 replies, posted in PunBB 1.2 discussion)

Yes. Using this code,

$array = array_fill(0, 500000, null);
$time = microtime(true);
for($i = 0; $i <= count($array); ++$i);
echo '<strong>', microtime(true)-$time, '</strong><br/>';

$time = microtime(true);
$count = count($array);
for($i = 0; $i <= $count; ++$i);
echo '<em>', microtime(true)-$time, '</em>';

It took 35ms to iterate through the first loop.
It took just under 10ms to iterate through the second loop.

38

(14 replies, posted in PunBB 1.2 discussion)

In function generate_navlinks(), count($extra_links[1]) is being redundantly executed with each loop iteration.
In function check_bans(), count($cur_ban_ips) is being redundantly executed with each loop iteration.

You can actually remove the entire for(; ; ) loop in check_bans() with this code:

//after line 363 in rev 1084
$cur_ban_ips = array_map(create_function('$ip', 'return "$ip.";'), $cur_ban_ips); //I don't even think you need this part, along with line 328.
if(in_array($user_ip, $cur_ban_ips)) {
//lines 371-379
}

PDO

Corp wrote:

1. The numbers should be displayed with "," not 14345 views but instead 14,345 views!
2. Make a "Back to top" link or button so you can go to the top fast!
3. Sub-forums
4. Nice statistics page at first admin entrance page!

1. I agree. number_format can accomplish this.
2. Redundant. See Home key.
3. Agree. A simple 'parent' column can accomplish this (null if top-level forum; parent's forum_id if otheriwse). As an added bonus this can also handle mutli-level forums.
4. Neutral.

0$

stalling.

Solution:

mysql_escape_string($board_title);
mysql_escape_string($board_descrip);

In fact you should escape $username, $password1 and $password2, too.

Also, there are plenty of areas where you can use foreach instead of for for array looping; why don't you?

revision 1000 of install.php

43

(18 replies, posted in Feature requests)

A link would work just fine.

44

(12 replies, posted in PunBB 1.2 discussion)

I find CAPTCHAs to be a nuisance, so I created my own human verification, http://funnel.ath.cx:1420/spam/. It verifies with a simple mathematical question such as

What is two plus eight;
Which is larger, three or seven;
What is eight times ten;
Which is smaller, ten or five;
and what is eight minus five.

You can also easily edit the script's language by changing lines 25, 26, 27 and 28 with your preffered language's words, too. Minimal PHP knowledge is required.

div#container{margin: 0 auto}

This would allow better search-engine indexing and consistency. (500 URIs won't point back to the same content.)

If you're not going to use the 'application/xhtml+xml' header, why bother with XHTML?
Also, it seems that   is not a valid entity anymore.

http://www.hixie.ch/advocacy/xhtml

<object data="rules.txt" type="text/plain">
<a href="rules.txt">Forum Rules</a>
</object>

tongue

Paul wrote:

2. Whilst everything has to work in IE6 I don't think it appropriate to optomise for a previous generation browser.

3. I doubt the difference in rendering time could be detected in normal use.

Doing so is still considered good practice, though.

To avoid creating a new topic, I'm going to post this suggestion here.

IE6 and lower apply CSS faster when the tag name is specified along with the ID or span. For example, in http://dev.punbb.org/browser/branches/p … /print.css

.pun-common,
.pun-form,
.pun-modmenu,
.pun-mainhead,
.pun-mainfoot,
.postlinks,
#pun-maintitle,
.post dt span,
.pun-main h2 span.item2,

should be,

div.pun-common,
div.pun-form,
div.pun-modmenu,
div.pun-mainhead,
div.pun-mainfoot,
div.postlinks,
div#pun-maintitle,
div.post dt span,
div.pun-main h2 span.item2,

(Replacing div with the appropiate tag name, of course.)