Give the pattern the /e flag as well and then use str_replace or rawurlencode as the callback function?

127

(13 replies, posted in General discussion)

Better

            <thead>
                    <th style="border-left: 0px;" class="tc0" scope="col"> </th>
                    <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
                    <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
                    <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
                    <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
                </tr>
            </thead>

You're missing a <tr> between the first <th> and <thead>

128

(13 replies, posted in General discussion)

Either that's not the code you're using on that page or you're buffering the HTML and modifying it elsewhere. I can't find a reference in the PHP to the HTML mentioned in the first error, for example.

129

(13 replies, posted in General discussion)

I meant to this wink
http://www.openwings.co.cc/viewforum.php?id=1

130

(1 replies, posted in PunBB 1.3 troubleshooting)

Yeah, I'll be rewriting bits of moderate.php at some point to be more consistent (and thus avoid issues like this).

131

(13 replies, posted in General discussion)

A link to the actual page in question so we can see the HTML is important.

Yes, that's the meaning of "don't define it": don't have the line, period. tongue

Don't define it.

134

(14 replies, posted in Programming)

As I said, look at the third example. It has the exact correct syntax for generating the array AND for the array_multisort call.
Anyway, I'll modify your code so that it should at least sort the array properly.

$result = $db->query('SELECT id, size_inches, size_decimal, normal_lbs, 144inch_lbs FROM '.$db->prefix.'sizes WHERE alloy_id='.$id.' ORDER BY size_decimal ASC') or error('Unable to fetch size information', __FILE__, __LINE__, $db->error());
$sizes = array();
$size_decimal = array();
while ($cur_size = $db->fetch_assoc($result))
{
$sizes[] = $cur_size;
$size_decimal[] = $cur_size['size_decimal'];
}

array_multisort($data['size_decimal'], SORT_ASC, SORT_REGULAR, $sizes);

foreach ($sizes as $cur_size)
{    
echo '<tr style="text-align: center;"><td style="border: 0;">'.$cur_size['size_inches'].'</td><td style="border: 0;">'.$cur_size['size_decimal'].'</td><td style="border: 0;">'.$cur_size['normal_lbs'].'</td><td style="border: 0;">'.$cur_size['144inch_lbs'].'</td>';
if(!$pun_user['is_guest'])
echo '<td style="border: 0;"><a href="deletesize.php?id='.$cur_size['id'].'">delete</a></td>';

echo '</tr>';
}

http://backspaces.net/forum as base URL (make sure you removed the config cache PHP file if you updated the database manually) should work. Of course, the redirect has to be working first (it isn't right now). wink

136

(17 replies, posted in PunBB 1.2 troubleshooting)

Ghirai: Yeah, I know why it would be happening, the question in that case is why PHP is not using the alternative syntax.

137

(14 replies, posted in Programming)

Lurker.boi wrote:
lie2815 wrote:

oh I understand now. It's not always only a decimal... but sometimes something lik 2.00x5.04 or whatever...

Thats weird data.  What would you want that to sort by?  The cast will cast that as 2.00. not sure what the multisort would do.

It probably wouldn't do much better: the data isn't normalized and it really should be wink
You have to make the last parameter of your multisort call the original array, the one you want sorted (which you don't have in your code).

138

(17 replies, posted in PunBB 1.2 troubleshooting)

Well, Googling the error message turned up some interesting results, but nothing that sheds any light on why PHP would be escaping something improperly. If you have any ideas or more details, that would be great.

That piece of code is about 150 lines too high if this is an unmodded install (and even if it isn't).

140

(14 replies, posted in Programming)

Take a look at the example again, you're doing it wrong

141

(10 replies, posted in Programming)

You need to explain more: what are these images, how many are loaded on a given page, how do you pick which filenames to load, etc. Right now, all we know is you have a bunch of images and want to load some subset of them under some circumstances. That's too general to really recommend anything.

Yes, edit login.php so the logout redirects somewhere other than the forum index.

Enable debug mode, paste the full error.

Where it can be found in PunBB's code? header.php.
And you edit the $required_fields array in register.php to add fields to it.

Sounds good to me.

The same way 1.2 and 1.3 are: yes, you just need to run a script to make sure the schema is up to date.

If you mean can you use a 1.2 database in 1.3, then yes, you just need to convert it first.

Mmm, I wouldn't prune it, it's useful to have. It's just better to have some logical divisions.
This is why some larger forums by default only display topics posted in within the past x days. It means a smaller number of topics are searched through on each pageview.

149

(4 replies, posted in PunBB 1.2 discussion)

...I'm not really sure what you're asking how to do tongue
http://punbb.org/docs/video_tutorials/v … punbb.html
Does this help?

150

(11 replies, posted in PunBB 1.2 show off)

sirena wrote:

Still... I don't want to think about the consequences for the server if - for example - someone remotely threw a 1,000,000 word dictionary at the dynatext script, and asked for the font size of each requested word to be 10000 pt, for example. smile

That's not possible (the font size is hardcoded into the script). And a DoS attack using that script? It's just about the most basic script you could use to generate an image. CAPTCHA images are potentially an issue because generating some of them takes a lot of CPU (since there's a lot of image manipulation being done, not just putting a certain color/font/size text on a background), but this should be no more of an issue than any other script on the server.