Give the pattern the /e flag as well and then use str_replace or rawurlencode as the callback function?
126 2008-04-26 14:19
Re: change space into something else in rewrite_rules.php (3 replies, posted in Programming)
127 2008-04-26 13:29
Re: Validating my code (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 2008-04-26 13:20
Re: Validating my code (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 2008-04-26 13:18
Re: Validating my code (13 replies, posted in General discussion)
I meant to this
http://www.openwings.co.cc/viewforum.php?id=1
130 2008-04-26 01:20
Re: Delete posts (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 2008-04-25 23:15
Re: Validating my code (13 replies, posted in General discussion)
A link to the actual page in question so we can see the HTML is important.
132 2008-04-25 23:13
Re: Parameter count issues with define(PUN_ALLOW_INDEX) (3 replies, posted in PunBB 1.2 troubleshooting)
Yes, that's the meaning of "don't define it": don't have the line, period.
133 2008-04-25 22:43
Re: Parameter count issues with define(PUN_ALLOW_INDEX) (3 replies, posted in PunBB 1.2 troubleshooting)
Don't define it.
134 2008-04-25 20:45
Re: Sort array naturally (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>';
}
135 2008-04-25 20:37
Re: .htaccess & punbb -> HTTP_REFERER (4 replies, posted in PunBB 1.2 troubleshooting)
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).
136 2008-04-25 13:11
Re: PostgreSQL warnings in log (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 2008-04-25 10:32
Re: Sort array naturally (14 replies, posted in Programming)
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
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 2008-04-25 01:52
Re: PostgreSQL warnings in log (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.
139 2008-04-24 23:20
Re: Form e-mail - Error: Unable to fetch topic info (7 replies, posted in PunBB 1.2 troubleshooting)
That piece of code is about 150 lines too high if this is an unmodded install (and even if it isn't).
140 2008-04-24 12:33
Re: Sort array naturally (14 replies, posted in Programming)
Take a look at the example again, you're doing it wrong
141 2008-04-24 10:20
Re: PHP Image retrieval efficient (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.
142 2008-04-24 10:18
Re: Logout Redirection? (2 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Yes, edit login.php so the logout redirects somewhere other than the forum index.
143 2008-04-24 10:17
Re: Form e-mail - Error: Unable to fetch topic info (7 replies, posted in PunBB 1.2 troubleshooting)
Enable debug mode, paste the full error.
144 2008-04-24 10:17
Re: Adding fields to register.php and form validation (3 replies, posted in PunBB 1.2 troubleshooting)
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.
145 2008-04-24 10:16
Re: [extension] extensions communicating with one another (3 replies, posted in PunBB 1.3 extensions)
Sounds good to me.
146 2008-04-24 10:13
Re: anybody using 1.3 in a production environment already? (35 replies, posted in PunBB 1.3 troubleshooting)
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.
147 2008-04-24 03:02
Re: anybody using 1.3 in a production environment already? (35 replies, posted in PunBB 1.3 troubleshooting)
If you mean can you use a 1.2 database in 1.3, then yes, you just need to convert it first.
148 2008-04-23 21:50
Re: Hosting problems, I need help bad. PunnBB problem? (21 replies, posted in PunBB 1.2 troubleshooting)
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 2008-04-23 21:19
Re: Assistance. (4 replies, posted in PunBB 1.2 discussion)
...I'm not really sure what you're asking how to do
http://punbb.org/docs/video_tutorials/v … punbb.html
Does this help?
150 2008-04-23 20:40
Re: Another in the wild sighting (11 replies, posted in PunBB 1.2 show off)
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.
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.