PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old March 16th, 2007, 07:32 PM   #1 (permalink)
Registered User
 
Zachariah's Avatar
 
Join Date: Nov 2005
Location: Canoga Park, CA
Posts: 3,244
Send a message via ICQ to Zachariah Send a message via AIM to Zachariah Send a message via MSN to Zachariah Send a message via Skype™ to Zachariah
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.
Replace:
Code:
Content visible to verified customers only.
gallery\ecard.php

Find:
Code:
Content visible to verified customers only.
Replace:
title = '" . addslashes($image['title']) . "'

Find:
Code:
Content visible to verified customers only.
Delete

Find:
Code:
Content visible to verified customers only.
Above Add:
Code:
Content visible to verified customers only.
gallery\upload.php

Find:
Code:
Content visible to verified customers only.
Replace:
Code:
Content visible to verified customers only.
Find:
Code:
Content visible to verified customers only.
Replace:
Code:
Content visible to verified customers only.
Zachariah is offline  
Old March 17th, 2007, 08:44 AM   #2 (permalink)
Registered User
 
Join Date: Aug 2005
Posts: 1,229
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.
Thats how I tested it.. and it seemed to work...

Also for urldecoding chinese characters you can use:
Code:
Content visible to verified customers only.
found also in the functions.php

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.
Now if I insert it into the database now.. it will appear correctly when i get it out again..

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.
before the txt is displayed correctly!
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.
thats all...

Luc
Luciano is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link in Category Name? [added 2.2] InterFX Bugs - vBulletin 3.6x 5 March 21st, 2007 03:22 PM
An extra 'return' is being added after each paragraph in the 'description block' criscokid ReviewPost How do I...? 2 August 13th, 2006 12:07 PM
Excluding a category from Recently Added? Vickie Photopost Pro How Do I...? 35 November 30th, 2005 09:09 AM
Punctuation getting added to URL's in product description BryanG ReviewPost Bug Reports 1 July 16th, 2004 06:56 PM


All times are GMT -5. The time now is 12:13 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0