![]() |
Image and category name,description fix [added 2.2] There was a problem reported on a Chinese website of not recording or displaying the correct characters on categories and images. category - title - description image - title - description Below fixed the problem. forums\admincp\vba_gallery_admin.php Find: Code: Content visible to verified customers only.Code: Content visible to verified customers only.Find: Code: Content visible to verified customers only.title = '" . addslashes($image['title']) . "' Find: Code: Content visible to verified customers only.Find: Code: Content visible to verified customers only.Code: Content visible to verified customers only.Find: Code: Content visible to verified customers only.Code: Content visible to verified customers only.Code: Content visible to verified customers only.Code: Content visible to verified customers only. |
Thx for the fix.. as a matter of fact i ran into a similar problem when passing chinese characters via javascript (ajax) to a php script. Example: saving title not via the form but via ajax. The problem resides in the fact that you have to be in utf8 for chinese characters to display. and javascript doesnt urlencode those characters the same way as php decodes them. even though vbullentin has a very nice function to strip the html on unicode characters, the & problem is still there. So if you really want that htmlspecialchars function, you can use the vbulletin one for unicode charachters (functions.php must be loaded): Code: Content visible to verified customers only.Also for urldecoding chinese characters you can use: Code: Content visible to verified customers only.Some thoughts: I found (by trying) 2 ways of correctly inserting chinese image title into the database and getting it out again with no problem: the database has to be in utf8 collation! For all table and text-or-varchar fields in utf8_general_ci You cant do it later..(or its a pain in t.a...) It has to be done at setup!!! I think this must be the major problem.. because I do NOT have that problem other than when sending the text by javascript!!!!.. (I spent 2 full days setting the database up correctly) 1. using the built in vbulletin functions: the text arrives via post or get --> before inserting it into the databse: Code: Content visible to verified customers only.BUT .. if I want to display it immediately (after saving it.. but without getting it from the database again!! before displaying it) I will have to convert all & to &!!! (dont ask me why!!!) It seems that the database does that automatically... maybe it depends on the version? i'm using MySQL4.19 I then need your function: Code: Content visible to verified customers only.So thats what i did (It worked on my tests but i only tested with a couple of chinese characters..) A yes and for those who do not want the vbulletin functions.. here is the second way ( I got it to work like that the first time): Code: Content visible to verified customers only.Luc |
| All times are GMT -5. The time now is 08:24 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0