<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Uncaught Error: Unsupported operand types</title>
		<link>https://www.cotonti.com</link>
		<description>Останні повідомлення в темі</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Fri, 17 Apr 2026 14:31:47 -0000</pubDate>

		<item>
			<title>Kopusha</title>
			<description><![CDATA[<p>Подскажите как правильно сделать, стал выводить projects циклом на index и ругается на такое:</p>

<p>В projects.list</p>

<pre class="brush:php;gutter:false;toolbar:false;">
switch($sort)
{
	case 'startdateasc':
		$order['startdate'] = 'item_startdate ASC';
		break;
	
	case 'offerscountasc':
		$order['offerscount'] = 'item_offerscount ASC';
		break;

	default:
		$order['startdate'] = 'item_startdate ASC';
		break;
}

$order = ($order) ? 'ORDER BY ' . implode(', ', $order) : '';
</pre>

<p>В плагине payprjtop</p>

<pre class="brush:php;gutter:false;toolbar:false;">
$ordertop['top'] = 'item_top DESC';

$order = $ordertop + $order;</pre>

<p>Ругается на последнюю строчку, <span style="color:rgb(36,39,41);font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;font-size:15px;background-color:rgb(255,255,255);">Uncaught Error: Unsupported operand types on line 14 And A non-numeric value encountered on line 14</span></p>

<p><span style="color:rgb(36,39,41);font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;font-size:15px;background-color:rgb(255,255,255);">Как верно сделать сортировку снячала по </span>ordertop а затем по обычному списку? Все поля - цифры.</p>
<p class="updated"><strong>Added 5 minutes later:</strong></p><p>Что примечательно - в самом projects.list запрос такого вида<br />
 </p>

<pre style="color:rgb(0,0,0);">
WHERE item_state=0
	ORDER BY item_top DESC, item_startdate ASC</pre>

<p>И это то что нужно в принципе, ругается ТОЛЬКО на index.</p>
<p class="updated"><strong>Added 11 minutes later:</strong></p><p>Насколько я понимаю на index либо item_top либо item_startdate это <span style="color:rgb(36,39,41);font-family:Arial, 'Helvetica Neue', Helvetica, sans-serif;font-size:15px;text-align:justify;background-color:rgb(255,255,255);">non-numeric value... Оба поля - </span><span style="color:rgb(0,0,0);font-size:13.12px;white-space:nowrap;background-color:rgb(255,255,255);">int(10)...</span></p>
<p class="updated"><strong>Added 10 minutes later:</strong></p><p>Разобрался... </p>

<p>В projects.index.php не хватало $order = array(); и иза за этого не ловило что такое <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;">$order</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;">'startdate'</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;">'item_startdate ASC'</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><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>https://github.com/Cmsworks/cot-freelance/blob/master/modules/projects/projects.index.php</p>
]]></description>
			<pubDate>Ср, 18 Лис 2020 16:09:21 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ua/forums?m=posts&q=9050&d=0#post45238]]></link>
		</item>
	</channel>
</rss>