<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Форум АлаичЪ'а о SEO - Изменить User_id]]></title>
	<link rel="self" href="https://talk.alaev.info/feed/atom/topic/1245/" />
	<updated>2014-08-17T17:06:59Z</updated>
	<generator>PunBB</generator>
	<id>https://talk.alaev.info/topic/1245/</id>
		<entry>
			<title type="html"><![CDATA[Изменить User_id]]></title>
			<link rel="alternate" href="https://talk.alaev.info/post/8552/#p8552" />
			<content type="html"><![CDATA[<p>Опишу суть проблемы чтобы было понятней, что нужно. <br />Сайт: ribalka-rf.ru<br />Установлен модуль комментариев icomm v6 (вывод последних комментариев). Для того чтобы выводились и комментарии гостей в базу данных был добавлен пользователь iComm_user (1 картинка) имеющий значение user id =0 (я уже сменил на 400).<br />Был установлен форум logicBoard. Из за этого пользователя (iComm_user) Форум зацикливался когда там писал гость, и создавалось очень много сообщений. Сменив&nbsp; user id на 400 форум заработал. Но естественно комментарии гостей не сайте не выводятся. Они будут выводиться если комментарии гостей в базе данных будут иметь id=400. <br />Вопрос в том как сделать так, чтобы при добавлении гостем комментария, его id был равен не 0 а 400.<br /><span class="postimg"><img src="http://i66.fastpic.ru/big/2014/0817/f8/3003108c1305dffc7e962811e2ebdff8.jpg" alt="http://i66.fastpic.ru/big/2014/0817/f8/3003108c1305dffc7e962811e2ebdff8.jpg" /></span><br />Пример того что надо.<br /><span class="postimg"><img src="http://i65.fastpic.ru/big/2014/0817/ef/9c82bc0111ed82c861c54fc3632fbbef.jpg" alt="http://i65.fastpic.ru/big/2014/0817/ef/9c82bc0111ed82c861c54fc3632fbbef.jpg" /></span><br />Подозреваю что изменений для этого нужно сделать незначительно, но сам абсолютно ничего не понимаю в php</p><p>Либо изменить код php модуля Icomm чтоб он публиковал комментарии гостей как то по другому.<br />Вот собственно весь код:<br />&lt;?php</p><p>/*====================================================<br /> Author: RooTM<br />------------------------------------------------------<br /> Web-site: http://weboss.net/<br />=====================================================*/</p><p>if( ! defined( &#039;DATALIFEENGINE&#039; ) ) {<br />&nbsp; &nbsp; die( &quot;Hacking attempt!&quot; );<br />}</p><p>$max_comm = ( is_numeric(trim($max_comm)) ) ? $max_comm : 10;<br />$max_text = ( is_numeric(trim($max_text)) ) ? $max_text : 10000;<br />$max_title = ( is_numeric(trim($max_title)) ) ? $max_title : 32;<br />$groups_color = ( $groups_color ) ? $groups_color : &#039;group_1:FF0000,group_2:CC33CC,group_3:009900,group_4:3333FF,group_5:666666&#039;;<br />if( $stop_category ) $stop_category = &quot;AND p.category NOT IN ( {$stop_category} )&quot;;</p><p>$config_hash = md5($max_comm.$max_text.$max_title.$groups_color.$stop_category);</p><p>$is_change = false;</p><p>if ($config[&#039;allow_cache&#039;] != &quot;yes&quot;) { $config[&#039;allow_cache&#039;] = &quot;yes&quot;; $is_change = true;}</p><p>$iComm = dle_cache( &quot;news_comm_iComm_&quot;, $config[&#039;skin&#039;].$config_hash );</p><p>if( $iComm === false ) {<br />&nbsp; &nbsp; <br />require_once ENGINE_DIR . &#039;/classes/templates.class.php&#039;;</p><p>$tpl = new dle_template ( );<br />$tpl-&gt;dir = ENGINE_DIR . &#039;/modules/iComm/&#039;;<br />define ( &#039;TEMPLATE_DIR&#039;, $tpl-&gt;dir );</p><p>if ($config[&#039;version_id&#039;] &lt; &#039;9.8&#039;) { $flag = &#039;, p.flag&#039;; } else { $flag = &#039;&#039;; }</p><p>$db-&gt;query( &quot;SELECT c.id as comid, c.post_id, c.date, c.user_id, c.is_register, c.text, c.autor, c.email, c.approve,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p.id, p.date as newsdate, p.title, p.category, p.comm_num, p.alt_name {$flag},<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; u.foto, u.user_group, u.user_id<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM &quot; . PREFIX . &quot;_comments as c, &quot; . PREFIX . &quot;_post as p, &quot; . PREFIX . &quot;_users as u<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE p.id=c.post_id AND c.user_id = u.user_id AND c.approve = 1 {$stop_category} {$from_category}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ORDER BY c.date DESC LIMIT 0, &quot; . $max_comm );&nbsp; <br />&nbsp; &nbsp; <br />$tpl-&gt;load_template ( &#039;skin.tpl&#039; );</p><p>function iCommDate($format, $time_add) {<br />global $langdate, $config;<br />$today = strtotime(date(&quot;Y-m-d.&quot;, time()+ ($config[&#039;date_adjust&#039;]*60)));<br />if ($time_add &gt; $today) return &quot;Сегодня в &quot; . date (&quot;H:i:s&quot;, $time_add);<br />elseif ($time_add &gt; ($today - 86400)) return &quot;Вчера в &quot;. date (&quot;H:i:s&quot;, $time_add);<br />else return @strtr(@date($format, $time_add), $langdate);<br />}</p><p>&nbsp; &nbsp; &nbsp; while ( $row = $db-&gt;get_row() ) {<br />&nbsp; &nbsp; <br />//======================================================================</p><p>$on_page = FALSE;&nbsp; &nbsp; <br />if($row[&#039;comm_num&#039;] &gt; $config[&#039;comm_nummers&#039;]) $on_page = &#039;page,1,&#039;.ceil($row[&#039;comm_num&#039;] / $config[&#039;comm_nummers&#039;]).&#039;,&#039;;<br />&nbsp; &nbsp; <br />if( $config[&#039;allow_alt_url&#039;] == &quot;yes&quot; ) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( $row[&#039;flag&#039;] and $config[&#039;seo_type&#039;] ) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( $row[&#039;category&#039;] and $config[&#039;seo_type&#039;] == 2 ) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />$full_link = $config[&#039;http_home_url&#039;] . get_url( intval( $row[&#039;category&#039;] ) ) . &quot;/&quot; .$on_page. $row[&#039;id&#039;] . &quot;-&quot; . $row[&#039;alt_name&#039;] . &quot;.html&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $full_link = $config[&#039;http_home_url&#039;] .$on_page. $row[&#039;id&#039;] . &quot;-&quot; . $row[&#039;alt_name&#039;] . &quot;.html&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $full_link = $config[&#039;http_home_url&#039;] . get_url( intval( $row[&#039;category&#039;] ) ) . &quot;/&quot; .$on_page. $row[&#039;id&#039;] . &quot;-&quot; . $row[&#039;alt_name&#039;] . &quot;.html&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $full_link = $config[&#039;http_home_url&#039;] . &quot;index.php?newsid=&quot; . $row[&#039;id&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>$full_link = $full_link.&#039;#comment&#039;;</p><p>//======================================================================</p><p>if( dle_strlen( $row[&#039;text&#039;], $config[&#039;charset&#039;] ) &gt; $max_text ) $text = dle_substr( $row[&#039;text&#039;], 0, $max_text, $config[&#039;charset&#039;] ) . &quot; ...&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; else $text = $row[&#039;text&#039;];</p><p>//======================================================================</p><p>if( dle_strlen( $row[&#039;title&#039;], $config[&#039;charset&#039;] ) &gt; $max_title ) $title = dle_substr( $row[&#039;title&#039;], 0, $max_title, $config[&#039;charset&#039;] ) . &quot; ...&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; else $title = $row[&#039;title&#039;];</p><p>$title = stripslashes($title);</p><p>//======================================================================</p><p>$color = stristr($groups_color, &#039;group_&#039;.$row[&#039;user_group&#039;].&#039;:&#039; );<br />$color = reset(explode(&#039;,&#039;,$color));<br />$color = trim(str_replace(&#039;group_&#039;.$row[&#039;user_group&#039;].&#039;:&#039;,&#039;&#039;,$color));</p><p>if($row[&#039;is_register&#039;] == 1){</p><p>if( $config[&#039;allow_alt_url&#039;] == &quot;yes&quot; ) $go_page = $config[&#039;http_home_url&#039;] . &quot;user/&quot; . urlencode( $row[&#039;autor&#039;] ) . &quot;/&quot;;<br />&nbsp; else $go_page = &quot;$PHP_SELF?subaction=userinfo&amp;amp;user=&quot; . urlencode( $row[&#039;autor&#039;] );<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />$author = &quot;&lt;a onclick=\&quot;ShowProfile(&#039;&quot; . urlencode( $row[&#039;autor&#039;] ) . &quot;&#039;, &#039;&quot; . $go_page . &quot;&#039;); return false;\&quot; href=\&quot;&quot; . $go_page . &quot;\&quot;&gt;&lt;span style=\&quot;color:#&quot;.$color.&quot;\&quot;&gt;&quot; . $row[&#039;autor&#039;] . &quot;&lt;/span&gt; &lt;/a&gt;&quot;;<br />&nbsp; &nbsp; <br />}else{</p><p>$author = &quot;&lt;a href=\&quot;mailto:&quot;.$row[&#039;email&#039;].&quot;\&quot;&gt;&lt;span style=\&quot;color:#&quot;.$color.&quot;\&quot;&gt;&quot;.$row[&#039;autor&#039;].&quot;&lt;/span&gt;&lt;/a&gt;&quot;;</p><p>}<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />//======================================================================</p><p>$row[&#039;foto&#039;]&nbsp; = ($row[&#039;foto&#039;] == &#039;&#039;) ? &#039;templates/&#039; . $config[&#039;skin&#039;] . &#039;/images/noavatar.png&#039; : &#039;uploads/fotos/&#039;.$row[&#039;foto&#039;];</p><p>if( $config[&#039;allow_alt_url&#039;] == &quot;yes&quot; ) $user_url = $config[&#039;http_home_url&#039;] . &quot;user/&quot; . urlencode( $row[&#039;autor&#039;] ) . &quot;/&quot;;<br />&nbsp; &nbsp;&nbsp; else $user_url = &quot;$PHP_SELF?subaction=userinfo&amp;amp;user=&quot; . urlencode( $row[&#039;autor&#039;] );</p><p>if($row[&#039;is_register&#039;] != 1) $user_url = &#039;mailto:&#039;.$row[&#039;email&#039;];</p><p>$tpl-&gt;set ( &#039;{hash}&#039;, md5($text.$author.$title) );<br />$tpl-&gt;set ( &#039;{text}&#039;, $text );<br />$tpl-&gt;set ( &#039;{date}&#039;, iCommDate(&quot;j F Y&quot;,strtotime($row[&#039;date&#039;])) );<br />$tpl-&gt;set ( &#039;{foto}&#039;, $config[&#039;http_home_url&#039;] . $row[&#039;foto&#039;] );<br />$tpl-&gt;set ( &#039;{user_url}&#039;, $user_url );<br />$tpl-&gt;set ( &#039;{user_name}&#039;, $row[&#039;autor&#039;] );<br />$tpl-&gt;set ( &#039;{title}&#039;, $title );<br />$tpl-&gt;set ( &#039;{author}&#039;, $author );<br />$tpl-&gt;set ( &#039;{full_link}&#039;, $full_link );<br />$tpl-&gt;set ( &#039;{THEME}&#039;, $config[&#039;http_home_url&#039;].&quot;engine/modules/iComm&quot; );</p><p>$tpl-&gt;compile ( &#039;skin&#039; );</p><p>//======================================================================</p><p>&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; $db-&gt;free();<br />&nbsp; &nbsp; &nbsp;$tpl-&gt;clear();</p><p>$iComm = $tpl-&gt;result[&#039;skin&#039;];</p><p>if(!$iComm) $iComm = &#039;&lt;center&gt;&lt;b&gt;Нет комментариев&lt;/b&gt;&lt;/center&gt;&#039;;</p><p>&nbsp; &nbsp; create_cache( &quot;news_comm_iComm_&quot;, $iComm, $config[&#039;skin&#039;].$config_hash );</p><p>}</p><p>//======================================================================</p><p>if( $user_group[$member_id[&#039;user_group&#039;]][&#039;allow_hide&#039;] ) $iComm = preg_replace( &quot;&#039;\[hide\](.*?)\[/hide\]&#039;si&quot;, &quot;\\1&quot;, $iComm );<br />&nbsp; &nbsp; &nbsp; &nbsp; else $iComm = preg_replace ( &quot;&#039;\[hide\](.*?)\[/hide\]&#039;si&quot;, &quot;&lt;div class=\&quot;quote\&quot;&gt;&quot; . $lang[&#039;news_regus&#039;] . &quot;&lt;/div&gt;&quot;, $iComm );</p><p>//======================================================================</p><p>echo &quot;&lt;script type=\&quot;text/javascript\&quot; src=\&quot;engine/classes/min/index.php?charset=windows-1251&amp;amp;f={$config[&#039;http_home_url&#039;]}engine/modules/iComm/hint/show.js&amp;amp;7\&quot;&gt;&lt;/script&gt;&quot;;</p><p>echo &#039;&lt;div class=&quot;iComm&quot; id=&quot;iComm&quot;&gt;&lt;ul&gt;&#039;.$iComm.&#039;&lt;/ul&gt;&lt;/div&gt;&#039;;</p><p>if ($is_change) $config[&#039;allow_cache&#039;] = false;</p><p>?&gt;</p>]]></content>
			<author>
				<name><![CDATA[xwildx]]></name>
				<uri>https://talk.alaev.info/user/938/</uri>
			</author>
			<updated>2014-08-17T17:06:59Z</updated>
			<id>https://talk.alaev.info/post/8552/#p8552</id>
		</entry>
</feed>
