Author Topic: PHP Taunt maker - [23/05: Azerty support added]  (Read 9762 times)

0 Members and 2 Guests are viewing this topic.

Offline DePhille

  • Flagrunner
  • ****
  • Posts: 623
  • SoldatPage Webmaster
    • SoldatPage
Re: PHP Taunt maker
« Reply #20 on: May 14, 2007, 01:38:37 pm »
This is the submit form:
Code: [Select]
<form method="POST" accept-charset="UTF-8">
<table>
<?php
$taunts
=safestr($taunts);
foreach(
$taunts as $curkey=>$curval) { 
?>

<tr>
<td> <?php echo $tauntkeys[$curkey]; ?> </td>
<td><input type="text" name="taunt<?php echo $curkey?>" size="50" value="<?php echo $curval?>"></td>
</tr>
<? } ?>
</table>
<br>
<br>
<INPUT type="submit" value="Make Taunts.txt">
</form>

And this is the header for the download:
Code: [Select]
<?php
header
("Content-type: application/txt");
header('Content-Disposition: attachment; filename="taunts.txt"');
$taunts=file_get_contents("dump/tauntmaker_output.txt");
echo 
iconv("UTF-8""UTF-16LE"$taunts);
?>


I tried:
- Removing my self-made safestr() function, that changed nothing.
- Playing with utf8_encode and utf8_decode.
- Playing with the enctype and accept-charset settings.

The problem is already there within the $_POST[] values, so I'd normally think changing the enctype or accept-encoding should've done the trick. I did find a solution on the net to convert the $_POST[] values to numeric values, but there's no solution to make the numeric values into unicode characters other than using the HTML charcodes (the & #1080 you mentioned, without the space). Alot of topics died with the comment "Good luck with Unicode and PHP, seems like we'll see you again here very often" .
I did find alot of topics saying that PHP6 will support Unicode.

Grtz, DePhille
« Last Edit: May 14, 2007, 01:40:23 pm by DePhille »
This signature was broken. Feel free to fix it.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: PHP Taunt maker
« Reply #21 on: May 14, 2007, 03:16:39 pm »
Well, i see in your script that you make the output of the taunts from a file, where i guess you have all the tautns stored. The only thing i can think about that is causing the problem is when you write or read that file. Why don't you do the output directly from the post data?
It has to work, because it works perfectly for me.

test it yourself
« Last Edit: May 14, 2007, 03:21:17 pm by PerroAZUL »
urraka

Offline DePhille

  • Flagrunner
  • ****
  • Posts: 623
  • SoldatPage Webmaster
    • SoldatPage
Re: PHP Taunt maker
« Reply #22 on: May 14, 2007, 03:25:39 pm »
Unfortunately that isn't the problem, I tried using the POST method directly.
The values stored in the $_POST[] already generate the &" 1080 HTML codes when echo'ed or compared to another string. I've tried manipulating them with several functions but it never showed the correct output. Also, the file always showed the same contents as the echo'ed output, so I really think the output-file-download method isn't causing the problem.
I rather think it's somewhere in the PHP settings or version. I'll test your script on my server soon, but I've got no time now.

Grtz, DePhille
This signature was broken. Feel free to fix it.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: PHP Taunt maker
« Reply #23 on: May 14, 2007, 05:09:54 pm »
I forgot to mention that the numeric HTML codes aren't generated anymore, now i see like random symbols, like the 2 bytes of a character are treated as 2 different characters.
urraka

Offline DePhille

  • Flagrunner
  • ****
  • Posts: 623
  • SoldatPage Webmaster
    • SoldatPage
Re: PHP Taunt maker
« Reply #24 on: May 23, 2007, 01:22:06 pm »
Yeah, that's closest I could get. I was hoping, in a wild dream, that it might've been the correct characters on a PC with language packs. (I don't have the language packs installed on my PC).
I'll just have to wait until PHP6 :(.

Grtz, DePhille

Date Posted: 15-05-2007, 16:12:47
I added support for Azerty keyboards. Now users with an azerty keyboard (usually Belgian and French people) can easily create a tauntsfile too. Simply select "Azerty" as keybard layout and then fill in the fields.

Grtz, DePhille
This signature was broken. Feel free to fix it.

Offline NinjaGimp369

  • Veteran
  • *****
  • Posts: 1474
  • Wa-Poww!
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #25 on: May 25, 2007, 08:33:16 am »
I was editting my taunts today and wondering what that was for lol.
"You should've used the pythagoras theorum, b*tch."
[/url]

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #26 on: May 25, 2007, 01:20:59 pm »
Would anyone mind sending me a blank file as I can't be bothered registering there and I broke my taunts file.
-=Gradius wuz you=-

Offline Shadow G-Unit

  • Veteran
  • *****
  • Posts: 1101
  • IRC: S[Ex]eh-Legend
    • Fractured Forums
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #27 on: May 25, 2007, 04:32:43 pm »
I LOVE YOU
« Last Edit: May 25, 2007, 04:50:10 pm by Shadow G-Unit »


Ingame: King Legend.10- | Clan: In10sitY | Prev. Clan: OXiD | M79 Slag

Offline DePhille

  • Flagrunner
  • ****
  • Posts: 623
  • SoldatPage Webmaster
    • SoldatPage
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #28 on: May 26, 2007, 03:49:17 am »
ghg: The registration has a few reasons. First of all, I'm trying to relaunch the SoldatPage community, and by making the features available for registered users only, I'm hoping to contact a bigger audience. Secondly there's abuse, using the accounts I can very easily ban those who excessively abuse the scripts.
As for the blank taunts file, you can simply create a new taunts.txt file with notepad. The first 10 lines contain ALT+0 to ALT+9, the next lines are the alphabet: ALT+A to ALT+Z. Add a ^ as the first character for a teamchat taunt.

Grtz, DePhille
This signature was broken. Feel free to fix it.

Offline Shadow G-Unit

  • Veteran
  • *****
  • Posts: 1101
  • IRC: S[Ex]eh-Legend
    • Fractured Forums
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #29 on: July 06, 2007, 09:51:00 am »
Hey, DePhille anyway you can make this into a program?


Ingame: King Legend.10- | Clan: In10sitY | Prev. Clan: OXiD | M79 Slag

Offline DePhille

  • Flagrunner
  • ****
  • Posts: 623
  • SoldatPage Webmaster
    • SoldatPage
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #30 on: July 06, 2007, 10:28:34 am »
Yeah, that isn't hard at all.
Any specific thoughts on how I should make the GUI?

Grtz, DePhille
This signature was broken. Feel free to fix it.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #31 on: July 06, 2007, 10:56:32 am »
I've made a taunt editor already, feel free to use it. The only instruction is to enter the path to the taunts.txt file the first time you run the program.

Here I posted it.
urraka

Offline DePhille

  • Flagrunner
  • ****
  • Posts: 623
  • SoldatPage Webmaster
    • SoldatPage
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #32 on: July 06, 2007, 11:44:17 am »
Oh alright, then I don't think it's that important for me to make another Taunt-editor anymore. I'll create one whenever I get bored.

Grtz, DePhille
This signature was broken. Feel free to fix it.

Offline Shadow G-Unit

  • Veteran
  • *****
  • Posts: 1101
  • IRC: S[Ex]eh-Legend
    • Fractured Forums
Re: PHP Taunt maker - [23/05: Azerty support added]
« Reply #33 on: July 06, 2007, 02:18:29 pm »
I've made a taunt editor already, feel free to use it. The only instruction is to enter the path to the taunts.txt file the first time you run the program.

Here I posted it.
Thanks, you're awesome.


Ingame: King Legend.10- | Clan: In10sitY | Prev. Clan: OXiD | M79 Slag