форум vBSupport.ru > vBulletin > Вопрос — Ответ > International vBulletin > English Forums
Register Меню vBsupport Изображения Files Manager О рекламе Today's Posts Search
  • Родная гавань
  • Блок РКН снят
  • Premoderation
  • For English speaking users
  • Каталог Фрилансеров
  • If you want to buy some product or script
  • Администраторам
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'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота.
Убедительная просьба: при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
 
 
 
 
randoooom
Простоузер
Default Private Messages between User Groups
0

Hello, i have 3 User Groups. But i want to make that group 1 and 2 cant send private messages to group 3. And group 3 not to 1 and 2.
The right Hook is "private_insertpm_process", but i need the code for the check when the user sends a message.

When a user from group 1 send a message to a user from group 3 i want to become a custom error message.

Sorry, but i'm not soooo good in the code.
Thank you guys!
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
kerk
k0t
 
kerk's Avatar
Default
0

before data manager processing "send message", you must run sql query to grab usergroups of selected users
look function set_recipients() in data manager file class_dm_pm.php
this func can help you to understand how this work =)
 
 
randoooom
Простоузер
Default
0

Quote:
before data manager processing "send message", you must run sql query to grab usergroups of selected users
look function set_recipients() in data manager file class_dm_pm.php
this func can help you to understand how this work =)
...and i understand nothing. ^^

Now i have loaded class_dm_pm.php and opened it with Dreamweaver.
It looks good, but i have no idea what i can write for the check.

Maybe if ($vbulletin->userinfo['usergroupid'] == 1) and than the check command. But im a noob in coding. :(

randoooom добавил 09-25-2012 в 05:44 PM
Now i have tested it with if ($vbulletin->userinfo['usergroupid'] == 1) and a error message, but it dont works. :(

Any idea?

Last edited by randoooom : 09-25-2012 at 06:44 PM. Reason: Добавлено сообщение
 
 
kerk
k0t
 
kerk's Avatar
Default
1

I NOT tested this code, use it at your own risk =)

PHP Code:
$user_groups_allowed_from '2,6';
$user_groups_allowed_to '2,5,6,7';
// #### end config ####
$vbulletin->userinfo['allowed_ug_from'] = explode(","$user_groups_allowed_from);
$vbulletin->userinfo['allowed_ug_to'] = explode(","$user_groups_allowed_to);
if(!empty(
$vbulletin->userinfo['allowed_ug_from']) AND is_member_of($vbulletin->userinfo$vbulletin->userinfo['allowed_ug_from']))
{
      if(!empty(
$pm['recipients']))
      {
            if(
preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/'$pm['recipients'])) // multiple recipients attempted
            
{
                  
$recipientlist preg_split('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/'$pm['recipients'], -1PREG_SPLIT_NO_EMPTY);
                  foreach(
$recipientlist AS $recipient)
                  {
                        
$recipient trim($recipient);
                        if(
$recipient != '')
                        {
                              
$names[] = htmlspecialchars_uni($recipient);
                        }
                  }
            }else{
                  
$names[] = htmlspecialchars_uni($recipientlist);
            }
            
// query recipients
            
$checkusers $vbulletin->db->query_read("
                  SELECT user.userid, user.username, user.usergroupid, user.membergroupids
                  FROM " 
TABLE_PREFIX "user AS user
                  WHERE user.username IN('" 
implode('\', \''array_map(array($vbulletin->db'escape_string'), $names)) . "')
                  ORDER BY user.username
            "
);
            
$allowed_ug_user = array();
            while(
$checkuser $vbulletin->db->fetch_array($checkusers))
            {
                  if(
is_member_of($checkuser$vbulletin->userinfo['allowed_ug_to']))
                  {
                        
$allowed_ug_user["$checkuser[userid]"] = $checkuser;
                  }
            }
            
$vbulletin->db->free_result($checkusers);
            if(empty(
$allowed_ug_user))
            {
                  
print_no_permission();
                  
// Or your custom ERROR
            
}
      }

 
 
randoooom
Простоузер
Default
0

Thank you, but how can i use this code?
When i put it into class_dm_pm.php is nothing.
 
 
kerk
k0t
 
kerk's Avatar
Default
1

create new module
product - vbulletin
hook - private_insertpm_process
php code - code above
==
and...
you must define your values in the "config" - first 2 lines of my code
 
 
randoooom
Простоузер
Default
0

Okay. But i have a question.
When i define from 5 to 6, can 6 write a pm to 5?

randoooom добавил 09-25-2012 в 08:22 PM
It works! Thank you!
How i can now define a custom error message?

Last edited by randoooom : 09-25-2012 at 09:22 PM. Reason: Добавлено сообщение
 
 
kerk
k0t
 
kerk's Avatar
Default
1

create new phrase
phrase type - error messages
variable - test_var_error <= create your own "readable" variable!
text - your text

in the module put this code instead of print_no_permission()

$errors[] = fetch_error('test_var_error');
 
 
randoooom
Простоузер
Default
0

It works! Thanks!
 


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




All times are GMT +4. The time now is 09:38 AM.


Powered by vBulletin® Version 4.x.fuck
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.