<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Разрешить отдельной maingrp пользователей публиковать без превалидации</title>
		<link>https://www.cotonti.com</link>
		<description>Son konu mesajları</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sun, 12 Apr 2026 15:08:15 -0000</pubDate>

		<item>
			<title>Kopusha</title>
			<description><![CDATA[<p>Есть такая конструкция</p>

<pre class="brush:php;gutter:false;toolbar:false;">
	if(!$cfg['folio']['preview']){
		$ritem['item_state'] = (!$cfg['folio']['prevalidate'] || $auth['isadmin']) ? 0 : 2;
	}
	else
	{
		$ritem['item_state'] = 1;
	}
</pre>

<p>мне нужно что бы пользователь из user_maingrp 4 но у которого так же членство в группе 9 тоже $ritem['item_state'] = 0 - то есть публиковал folio.</p>

<p>Имеется в виду что в groups_users у него есть дополнительно группа 9. </p>

<p>Но что то я туплю и не понимаю как верно написать - или работает без изменений - для админа 0 для остальных 2 или для всех 0 становится.<br /><br />
Сам auth тут декларируется </p>

<pre class="brush:php;gutter:false;toolbar:false;">
function cot_folio_auth($cat = null)
{
	if (empty($cat))
	{
		$cat = 'any';
	}
	$auth = array();
	list($auth['auth_read'], $auth['auth_write'], $auth['isadmin']) = cot_auth('folio', $cat, 'RWA1');
	return $auth;
}
</pre>

<p>Явно я что то элементарное туплю, спасайте братцы)</p>

<p class="updated"><strong>Added 41 seconds later:</strong></p>

<p>PS <code class="php plain" style="font-size:13.5px;background-color:rgb(250,250,250);white-space:pre;margin-right:0px;margin-left:0px;padding:0px;border-width:0px;background-image:none;font-family:Monaco, Menlo, Consolas, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(51,51,51);float:none;height:auto;line-height:1.3em;width:auto;">!</code><code class="php variable" style="font-size:13.5px;background-color:rgb(250,250,250);white-space:pre;margin-right:0px;margin-left:0px;padding:0px;border-width:0px;background-image:none;font-family:Monaco, Menlo, Consolas, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(0,134,179);float:none;height:auto;line-height:1.3em;width:auto;">$cfg</code><code class="php plain" style="font-size:13.5px;background-color:rgb(250,250,250);white-space:pre;margin-right:0px;margin-left:0px;padding:0px;border-width:0px;background-image:none;font-family:Monaco, Menlo, Consolas, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(51,51,51);float:none;height:auto;line-height:1.3em;width:auto;">[</code><code class="php string" style="font-size:13.5px;background-color:rgb(250,250,250);white-space:pre;margin-right:0px;margin-left:0px;padding:0px;border-width:0px;background-image:none;font-family:Monaco, Menlo, Consolas, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(234,124,30);float:none;height:auto;line-height:1.3em;width:auto;">'folio'</code><code class="php plain" style="font-size:13.5px;background-color:rgb(250,250,250);white-space:pre;margin-right:0px;margin-left:0px;padding:0px;border-width:0px;background-image:none;font-family:Monaco, Menlo, Consolas, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(51,51,51);float:none;height:auto;line-height:1.3em;width:auto;">][</code><code class="php string" style="font-size:13.5px;background-color:rgb(250,250,250);white-space:pre;margin-right:0px;margin-left:0px;padding:0px;border-width:0px;background-image:none;font-family:Monaco, Menlo, Consolas, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(234,124,30);float:none;height:auto;line-height:1.3em;width:auto;">'preview'</code><code class="php plain" style="font-size:13.5px;background-color:rgb(250,250,250);white-space:pre;margin-right:0px;margin-left:0px;padding:0px;border-width:0px;background-image:none;font-family:Monaco, Menlo, Consolas, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace;color:rgb(51,51,51);float:none;height:auto;line-height:1.3em;width:auto;">] верное</code></p>

<p class="updated"><strong>Added 1 minute later:</strong></p>

<p>PPS - тут важна именно проверка на членство по gru_groupid что бы было 9 (там могут быть несколько значений)</p>
<p class="updated"><strong>Added 5 hours later:</strong></p><p>Сделал так<br />
 </p>

<pre class="brush:php;gutter:false;toolbar:false;">
	$iscontributor = $db-&gt;query("SELECT COUNT(*) gru_groupid FROM $db_groups_users WHERE gru_groupid = 9 AND gru_userid=" .$usr['id'])-&gt;fetchColumn();
</pre>

<p>И потом проверка $iscontributor &gt;= 1 то можно публиковать сразу</p>
<p class="updated"><strong>Added 20 seconds later:</strong></p><p>Может и коряво но работает</p>
]]></description>
			<pubDate>Cmt, 04 Nis 2020 09:58:22 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/tr/forums?m=posts&q=8935&d=0#post44551]]></link>
		</item>
	</channel>
</rss>