News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

October 17, 2019, 04:16:52 AM

Login with username, password and session length

Recent

Members
  • Total Members: 3756
  • Latest: Ocean
Stats
  • Total Posts: 189090
  • Total Topics: 20764
  • Online Today: 53
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 39
Total: 39

Author Topic: Truble with add tag on Russian  (Read 8182 times)

0 Members and 1 Guest are viewing this topic.

Offline saks

  • Full Member
  • ***
  • Posts: 119
    • Paragliding and kiting in Krasnoyarsk
Truble with add tag on Russian
« on: October 01, 2010, 06:49:10 AM »
I use TinyPortal 1.0 RC1 and older versions and tags in Russian is not add in system, only on English. Russian-UTF8 characters

Offline saks

  • Full Member
  • ***
  • Posts: 119
    • Paragliding and kiting in Krasnoyarsk
Re: Truble with add tag on Russian
« Reply #1 on: September 14, 2011, 12: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!

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Truble with add tag on Russian
« Reply #2 on: September 14, 2011, 08:30:13 AM »
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
Code: [Select]
$allowed = "/[^a-zA-Z0-9_]/";
For now I'd suggest you add any additional characters you'd like to that line like this:
Code: [Select]
$allowed = "/[^a-zA-Z0-9_чл]/";
Hope that works!

Offline saks

  • Full Member
  • ***
  • Posts: 119
    • Paragliding and kiting in Krasnoyarsk
Re: Truble with add tag on Russian
« Reply #3 on: September 14, 2011, 08:13:43 PM »
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 :
Code: [Select]
// 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:
Code: [Select]
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

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Truble with add tag on Russian
« Reply #4 on: September 14, 2011, 08:18:11 PM »
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.

Offline saks

  • Full Member
  • ***
  • Posts: 119
    • Paragliding and kiting in Krasnoyarsk
Re: Truble with add tag on Russian
« Reply #5 on: September 15, 2011, 07:15: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

Offline IchBin™

  • Developer
  • *
  • Posts: 16228
    • My Website
Re: Truble with add tag on Russian
« Reply #6 on: September 15, 2011, 09:15:22 AM »
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]/";

Offline saks

  • Full Member
  • ***
  • Posts: 119
    • Paragliding and kiting in Krasnoyarsk
Re: Truble with add tag on Russian
« Reply #7 on: September 15, 2011, 07:16:23 PM »
Yes, I think so! I use string
Code: [Select]
$allowed = "/[^a-zA-Z0-9абвгдеёжзийклмнопрстуфхцчшщыьъэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЫЬЪЭЮЯ_]/"; and it work!. Thank you for support!