TinyPortal

Development => Feedback => Bugs/Errors => Topic started by: saks on October 01, 2010, 01:49:10 PM

Title: Truble with add tag on Russian
Post by: saks on October 01, 2010, 01:49:10 PM
I use TinyPortal 1.0 RC1 and older versions and tags in Russian is not add in system, only on English. Russian-UTF8 characters
Title: Re: Truble with add tag on Russian
Post by: saks on September 14, 2011, 07:38:18 AM
Sorry for duble question. I have this problem again after update TP for last version. but not find fix for it. Please help my!
Title: Re: Truble with add tag on Russian
Post by: IchBin on September 14, 2011, 03:30:13 PM
This is something I don't know very much about, but I suppose you could add in the Russian characters to allow them.

In TPortalAdmin.php look for this line
$allowed = "/[^a-zA-Z0-9_]/";

For now I'd suggest you add any additional characters you'd like to that line like this:
$allowed = "/[^a-zA-Z0-9_чл]/";

Hope that works!
Title: Re: Truble with add tag on Russian
Post by: saks on September 15, 2011, 03:13:43 AM
Thank you very much! But after updating for me in general have ceased to work TAGs, at attempt to add new, the error message stands out: Error of database , /Sources/TPortalAdmin.php string 2735

2735 string is end of this code :

// check the value, only letters and underscore allowed
$allowed = "/[^a-zA-Z0-9_чл]/";
$value = preg_replace($allowed, '', $value);
if(!empty($value))
$smcFunc['db_query']('REPLACE',
'{db_prefix}tp_variables',
array('value1' => 'string', 'type' => 'string'),
array($value,'globaltag'),
array('id')
);


and in error log:

http://www.paraplanoff.net/index.php?pretty;action=tpadmin

Database error:

smf_tp_variables

file: /usr/local/www/data-dist/saks/Sources/TPortalAdmin.php
String: 2735

http://www.paraplanoff.net/index.php?pretty;action=tpadmin

2: mysql_errno(): supplied argument is not a valid MySQL-Link resource

file: /usr/local/www/data-dist/saks/Sources/Subs-Db-mysql.php
String: 415

http://www.paraplanoff.net/index.php?pretty;action=tpadmin

2: mysql_error(): supplied argument is not a valid MySQL-Link resource

file: /usr/local/www/data-dist/saks/Sources/Subs-Db-mysql.php
String: 414
Title: Re: Truble with add tag on Russian
Post by: IchBin on September 15, 2011, 03:18:11 AM
Replace:
$smcFunc['db_query']

With:
$smcFunc['db_insert']

For any errors you run into, a quick search on the board and you'll find that I've posted fixes for the majority of them already.
Title: Re: Truble with add tag on Russian
Post by: saks on September 15, 2011, 02:15:11 PM
Quote from: IchBinâ,,¢ on September 15, 2011, 03:18:11 AM

With:
$smcFunc['db_insert']
It`s work well!
But string $allowed = "/[^a-zA-Z0-9_чл]/"; is not work and russian worlds not add and if i am use string  $allowed = "/[^a-zA-Z0-9а-яА-Я_] in tag add only first letter
Title: Re: Truble with add tag on Russian
Post by: IchBin on September 15, 2011, 04:15:22 PM
Don't type it A-Я. I think php will only take english alphabet when doing a range of characters like A-Z. You'll need to put in each character that you want to allow.

$allowed = "/[^a-zA-Z0-9_abcdefg]/";
Title: Re: Truble with add tag on Russian
Post by: saks on September 16, 2011, 02:16:23 AM
Yes, I think so! I use string
$allowed = "/[^a-zA-Z0-9абвгдеÑ'жзийклмнопрсÑ,уÑ,,Ñ...цчшщыьъэюяАÐ'Ð'Ð"Ð"ЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЫЬЪЭЮЯ_]/";
and it work!. Thank you for support!