Your fucking browser doesn't support JavaScript, so you can't post here.
VBsupport перешел с домена .ORG на родной .RU
Ура!
Пожалуйста, обновите свои закладки - VBsupport.ru
Блок РКН снят, форум доступен на всей территории России, включая новые терртории, без VPN
На форуме введена премодерация ВСЕХ новых пользователей
Почта с временных сервисов, типа mailinator.com, gawab.com и/или прочих, которые предоставляют временный почтовый ящик без регистрации и/или почтовый ящик для рассылки спама, отслеживается и блокируется, а так же заносится в спам-блок форума, аккаунты удаляются
for English speaking users:
You may be surprised with restriction of access to the attachments of the forum. The reason is the recent change in vbsupport.org strategy:
- users with reputation < 10 belong to "simple_users" users' group
- if your reputation > 10 then administrator (kerk, Luvilla) can decide to move you into an "improved" group, but only manually
Main idea is to increase motivation of community members to share their ideas and willingness to support to each other. You may write an article for the subject where you are good enough, you may answer questions, you may share vbulletin.com/org content with vbsupport.org users, receiving "thanks" equal your reputation points. We should not only consume, we should produce something.
- you may:
* increase your reputation (doing something useful for another members of community) and being improved
* purchase temporary access to the improved category:
10 $ for 3 months. - this group can download attachments, reputation/posts do not matter.
20 $ for 3 months. - this group can download attachments, reputation/posts do not matter + adds eliminated + Inbox capacity increased + files manager increased permissions.
Please contact kerk or Luvilla regarding payments.
Important!:
- if your reputation will become less then 0, you will be moved into "simple_users" users' group automatically.*
*for temporary groups (pre-paid for 3 months) reputation/posts do not matter.
Уважаемые пользователи!
На форуме открыт новый раздел "
Каталог фрилансеров "
и отдельный раздел для платных заказов "
Куплю/Закажу "
Если вы хотите приобрести какой то скрипт/продукт/хак из каталогов перечисленных ниже:
Каталог модулей/хаков
Ещё раз обращаем Ваше внимание: всё, что Вы скачиваете и устанавливаете на свой форум, Вы устанавливаете исключительно на свой страх и риск.
Сообщество vBSupport'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота.
Убедительная просьба : при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
09-03-2010, 08:53 AM
Специалист
Join Date: Aug 2007
Posts: 676
Версия vB: 4.2.х
Пол:
Reputation:
Professional 529
Репутация в разделе: 1
preg_replace и UTF8
0
Вожусь с хаком Медиа Библиотека, не работает поиск именно русскими буквами.
Просмотрев код, нашёл что
$keywords = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['query']);
^\w\s-] - само собой поиск только латиницей.
Пробовал подмену, как обычно а-я и т.д., но вот тут появились проблемы, в цп1251 работает нормально, а вот в утф не хочет.
Может пожалуйста кто нибудь помочь решить проблему.
HTML Code:
if ($do == "search")
{
$title = $vbphrase['media_search'];
$navbits[''] = $vbphrase['media_search'];
$templater = vB_Template::create('8WR_media_search');
$templater->register('title', $title);
$mediaHTML = $templater->render();
}
if ($do == "results")
{
$vbulletin->input->clean_array_gpc('r', array(
'query' => TYPE_STR,
));
$keywords = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['query']);
if (vbstrlen($keyword) < 3)
{
eval(standard_error(fetch_error('media_search_string_too_short')));
}
$keys = explode(" ",$keywords);
foreach ($keys as $key => $keyword)
{
$match .= " OR media.title LIKE '%".$keyword."%' OR media.description LIKE '%".$keyword."%'";
if ($vbulletin->options['media_custom1_name']) { $match .= " OR media.custom1 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom2_name']) { $match .= " OR media.custom2 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom3_name']) { $match .= " OR media.custom3 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom4_name']) { $match .= " OR media.custom4 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom5_name']) { $match .= " OR media.custom5 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom6_name']) { $match .= " OR media.custom6 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom7_name']) { $match .= " OR media.custom7 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom8_name']) { $match .= " OR media.custom8 LIKE '%".$keyword."%'"; }
if ($vbulletin->options['media_custom9_name']) { $match .= " OR media.custom9 LIKE '%".$keyword."%'"; }
}
$match = substr($match, 4);
$results = $vbulletin->db->query_first("
SELECT COUNT(mediaID) AS count
FROM " . TABLE_PREFIX . "media
WHERE ".$match."
");
sanitize_pageresults($results['count'], $pagenumber, $perpage, 30, $vbulletin->options['media_limit_medias']);
if ($vbulletin->GPC['pagenumber'] < 1)
{
$vbulletin-> GPC['pagenumber'] = 1;
}
else if ($vbulletin->GPC['pagenumber'] > ceil(($results['count'] + 1) / $perpage))
{
$vbulletin->GPC['pagenumber'] = ceil(($results['count'] + 1) / $perpage);
}
$pagenav = construct_page_nav($vbulletin->GPC['pagenumber'], $perpage, $results['count'], construct_href_results($keywords, $sort));
$limitlower = ($vbulletin->GPC['pagenumber'] - 1) * $perpage;
$limitupper = ($vbulletin->GPC['pagenumber']) * $perpage;
$medias = $vbulletin->db->query_read("
SELECT media.*, media_service.*, media_category.*, IF(NOT ISNULL(user.userid), user.username, media.username) AS username
FROM " . TABLE_PREFIX . "media AS media
LEFT JOIN " . TABLE_PREFIX . "media_service AS media_service ON(media_service.serviceID = media.serviceID)
LEFT JOIN " . TABLE_PREFIX . "media_category AS media_category ON(media_category.categoryID = media.categoryID)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = media.userID)
WHERE ".$match."
ORDER BY ".$sortQuery." media.dateline DESC
LIMIT $limitlower, $perpage
");
while ($media = $vbulletin->db->fetch_array($medias))
{
$mediabits .= construct_media_bit($media, $vbulletin->options['media_select_bit']);
}
if ($perms['submit'])
{
$submitsmall = construct_submit_small();
}
$sidebar = construct_sidebar();
$href['sort'] = $sort;
$href['dateline'] = construct_href_results($keywords, 'dateline');
$href['rating'] = construct_href_results($keywords, 'rating');
$href['favorites'] = construct_href_results($keywords, 'favorites');
$href['comments'] = construct_href_results($keywords, 'comments');
$href['views'] = construct_href_results($keywords, 'views');
$title = $vbphrase['media_search_results'] . ": " . $keywords;
$description = construct_phrase($vbphrase['media_search_info'], $keywords);
$navbits[''] = $vbphrase['media_search_results'] . ": " . $keywords;
$templater = vB_Template::create('8WR_media_browse');
$templater->register('title', $title);
$templater->register('description', $description);
$templater->register('mediabits', $mediabits);
$templater->register('href', $href);
$templater->register('pagenav', $pagenav);
$templater->register('pagenumber', $pagenumber);
$templater->register('perpage', $perpage);
$templater->register('submitsmall', $submitsmall);
$templater->register('sidebar', $sidebar);
$mediaHTML = $templater->render();
}
if ($do == "advresults")
{
$vbulletin->input->clean_array_gpc('r', array(
'title' => TYPE_STR,
'description' => TYPE_STR,
'custom1' => TYPE_STR,
'custom2' => TYPE_STR,
'custom3' => TYPE_STR,
'custom4' => TYPE_STR,
'custom5' => TYPE_STR,
'custom6' => TYPE_STR,
'custom7' => TYPE_STR,
'custom8' => TYPE_STR,
'custom9' => TYPE_STR,
));
$title = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['title']);
$description = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['description']);
$custom1 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom1']);
$custom2 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom2']);
$custom3 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom3']);
$custom4 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom4']);
$custom5 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom5']);
$custom6 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom6']);
$custom7 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom7']);
$custom8 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom8']);
$custom9 = preg_replace('/[^\w\s-]+/', '', $vbulletin->GPC['custom9']);
Yandex Bot
09-03-2010, 01:22 PM
Эксперт
Join Date: Jun 2006
Location: Петрозаводск
Posts: 249
Версия vB: 3.8.x
Пол:
Reputation:
Expert 1682
Репутация в разделе: 1
Для UTF-8 укажите модификатор 'u'.
Например:
Code:
$keywords = preg_replace('/[^\w\s-]+/u ', '', $vbulletin->GPC['query']);
09-03-2010, 09:42 PM
Специалист
Join Date: Aug 2007
Posts: 676
Версия vB: 4.2.х
Пол:
Reputation:
Professional 529
Репутация в разделе: 1
MDM , спасибо, но это я уже испробовал. Не прокатывает.
10-21-2010, 05:54 AM
Специалист
Join Date: Aug 2007
Posts: 676
Версия vB: 4.2.х
Пол:
Reputation:
Professional 529
Репутация в разделе: 1
Теперь работает вроде бы нормально с утф8, но не работает с русскими буквами. Искать по каталогу можно только латиницей. При чём даже умляюты немецкие выкидывает.
Может у кого есть идеи как подправить?
10-21-2010, 05:20 PM
Специалист
Join Date: Mar 2009
Posts: 367
Версия vB: 3.8.x
Reputation:
Professional 458
Репутация в разделе: 2
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +4. The time now is 11:43 PM .