TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

February 26, 2024, 02:37:41 PM

Login with username, password and session length
Members
  • Total Members: 3,881
  • Latest: fords8
Stats
  • Total Posts: 195,080
  • Total Topics: 21,209
  • Online today: 104
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 74
  • Total: 74

Truble with add tag on Russian

Started by saks, October 01, 2010, 01:49:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

saks

I use TinyPortal 1.0 RC1 and older versions and tags in Russian is not add in system, only on English. Russian-UTF8 characters

saks

Sorry for duble question. I have this problem again after update TP for last version. but not find fix for it. Please help my!

IchBin

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!

saks

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

IchBin

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.

saks

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

IchBin

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]/";

saks

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