Возможность редактирвоания первого поста юзеру из определённой группы

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
==========================================================================================================================================
Возможность редактирвоания первого поста юзеру из определённой группы с определённым количеством сообщений.
==========================================================================================================================================
FILE: \includes\class_postbit.php
NEAR LINE: 1002
FIND:
if (
!$this->thread['isdeleted'] AND !$this->post['isdeleted'] AND (
can_moderate($this->thread['forumid'], 'caneditposts') OR
//can_moderate($this->thread['forumid'], 'candeleteposts') OR
(
$this->thread['open'] AND
$this->post['userid'] == $this->registry->userinfo['userid'] AND
($forumperms & $this->registry->bf_ugp_forumpermissions['caneditpost']) AND
( $this->post['dateline'] >= (TIMENOW - ($this->registry->options['edittimelimit'] * 60)) OR
$this->registry->options['edittimelimit'] == 0
)
))
)
REPLACE WITH:
if (
!$this->thread['isdeleted'] AND !$this->post['isdeleted'] AND (
can_moderate($this->thread['forumid'], 'caneditposts') OR
//can_moderate($this->thread['forumid'], 'candeleteposts') OR
(
$this->thread['open'] AND (
$this->post['userid'] == $this->registry->userinfo['userid'] OR (
$this->post['postcount'] == 1 AND // если первый пост в топе
is_member_of($this->registry->userinfo, 2) AND // 2 - group id в которую должен входить пользователь (через запятую можно указывать несколько групп)
$this->registry->userinfo['posts'] >= 5 AND // 5 - минимальное число постов для пользователя из укказанной выше группы
in_array($this->thread['forumid'], array(24)) // 24 - forum id в котором необходимо включить ред-ие первого поста Пример: array(24, 34, 57)
)
) AND
($forumperms & $this->registry->bf_ugp_forumpermissions['caneditpost']) AND
( $this->post['dateline'] >= (TIMENOW - ($this->registry->options['edittimelimit'] * 60)) OR
$this->registry->options['edittimelimit'] == 0
)
))
)
==========================================================================================================================================
FILE: \editpost.php
NEAR LINE: 142
FIND:
if (!can_moderate($threadinfo['forumid'], 'caneditposts'))
REPLACE WITH:
if (!can_moderate($threadinfo['forumid'], 'caneditposts') AND
!($threadinfo['firstpostid'] == $postinfo['postid'] AND
is_member_of($vbulletin->userinfo, 2) AND
$vbulletin->userinfo['posts'] >= 5 AND
in_array($threadinfo['forumid'], array(24))
)
)
==========================================================================================================================================
Шаблоны новых сообщений.
==========================================================================================================================================
STYLE TEMPLATE: newthread
FIND:
<!-- / subject field -->
AFTER ADD:
<!-- Shablon Area -->
<if condition="in_array($forumid, array(2,4,5,6))">
<script type="text/javascript">
<!--
sd = new Array();
sc = new Array();
sd[0] = "[Template 1]</b>";
sc[0] = "Bla Bla \n new line";
sd[1] = "[Template 2]";
sc[1] = "[b]Bla Bla[/b]";
function shab(i)
{
f = document.getElementById("vB_Editor_001_textarea");
f.value = sc[i];
}
//-->
</script>
<table>
<tr></tr>
<tr><td>Post Template:
<script type="text/javascript">
<!--
for(i = 0; i < sd.length; i++)
document.write(" <a href='javascript:shab(" + i + ");'>" + sd[i] +"</a>");
//-->
</script>
</td></tr>
<tr></tr>
</table>
</if>
<!-- / Shablon Area -->
==========================================================================================================================================