well, within double quotes, you can safely use single quotes and within single quotes you can safely use double quotes. it's only when you want the same quote types within the same value and that forces you to escape the markup from the variable and so on.
Hmm, the css hasnt done exactly what i want but i suppose its looking a bit better.
I fixed my double quotes too.
Now should i carry on doing this and working revisions etc into it or is someone gonna implement marks considerably better edit on the spot idea?
not atall. http://www.badassg.me.uk/lussumo/dictionary.phps It's my usual messy and poor if-it-does-the-job-leave-it trick. But hey! I also borrowed a couple of lines from marks code because i'm lazy and it was easier than looking it up on php.net. I've never worked with files before.
if you could work out why it doesnt like the random lines it misses feel free to tell me.
And any improvements you wanna suggest/add/just take it and make it actually good.
I'll have a whack at it when I wake up and see what I can do, my php is hacktastic at best but this doesn't look to be impossible to crack into :)
I haven't looked yet, but can you or mark confirm the method in which vanilla writes out to the settings.php file? is it only for the settings.php or is it a global function which can be branched off to edit other files as well?
haha lech, hacktastic probably sums up my abilities quite well too.
The way i write the file is the same way mark writes the extension file, which i assume is similar if not identical to the way he writes the settings file.
N.B Martis effort is considerably better and more sensible than mine - out of interest marti, why do you choose to blank the file by writing <<<EOF to it as opposed to just opening and truncating it using the 'wb' flags as opposed to the 'w' flag in fopen()?
Mark, while this might seem like a semi-insane idea, why not switch the language dictionaries over to raw but simple xml? The reason I suggest this is probably for accesibility purposes when updating or writing new up-to-date language files. The end-user could simply load a recent copy straight off of the server or say a hosted mirror, and write it back to their installation as needed. Future thoughts.
http://www.secondagenda.com/vanilla/english.xml
took the liberty of sorting it out the best I could based on comments. Mark, I bet you've either extended or have rewritten this, but either way, it's just a practice file.
I won't be switching it to xml. It's already a HUGE array that probably is pretty heavy on php being that it is loaded on every page. I'm not adding the extra overhead of pulling it from an xml file and parsing it out.
Also, just because it's in xml format doesn't mean that it's any easier to save it to a file. Why not just save it as php code in a text file the way I've done with the appg/settings.php file? It's basically doing the same thing, but not wasting any processor time on parsing xml.
it does look prettier in xml though....
So do you want someone to carry on working on this mark or do you want to implement your idea? (Or anyone else, i know i couldnt do it)
I already brought this up in another discussion, but what about GNU gettext? I don't know much about it, but I bet it's faster than including a php language file because the language files it uses are in binary. It can also handle different types of plural forms.
Mark, I wasn't implying that it should be in xml the entire time. Simply saying that before it gets written out to proper associative arrays like it is currently, it's stored as xml, then comes along the dictionary editor, pulling the default values from the xml file, and the dictionary writer stores the associative arrays to the final output file like they are currently.
This would probably be useful in the whole ping for update routine, instead of pulling php or phps files from the master server, it's simply loading up xml. I wouldn't want vanilla parsing through a possibly larger xml file either. You understand that, right? It's just a little suggestion which could go a long way later.
Comments
$foo = '<input class="bar">wheeee!</input>'; echo $foo;
Here's the source:
http://marti.labidas.com/project/vanilla/dictionary_lister.phps
And here's the script: http://marti.labidas.com/project/vanilla/dictionary_lister.php
It should create 2 files, "English.php" and "English.phps" in the "languages/" folder.
GNU's manual for gettext is quite lengthy, but there's plenty of other material about it that should b e enough to see how it is used. Here's one article about it: http://mel.melaxis.com/devblog/2005/08/06/localizing-php-web-sites-using-gettext/