<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Random Slider for DarkPortal</title>
		<link>https://www.cotonti.com</link>
		<description>Останні повідомлення в темі</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sun, 12 Apr 2026 21:10:00 -0000</pubDate>

		<item>
			<title>ToM</title>
			<description><![CDATA[This is function for random picture/screen in slider that use &lt;li&gt;&lt;/li&gt; tags. It is designed for Dark Portal skin . I saw few question on Cotonti forom about random pictures in Dark Portal skin.<br />
<br />
<br />
1.<br />
------<br />
EDIT:<br />
(put in tpl file) index.tpl<br />
<br />
	{SLIDER_SHOW}<br />
<br />
(instead of)<br />
<br />
	{PHP.cfg.freetext8}<br />
<br />
<br />
2.<br />
------<br />
ADD:<br />
(into file) index.inc.php (in system\core\index) bellow &quot;$t = new XTemplate($mskin);&quot; line:<br />
<br />
<br />
function rnd_slider($fragments)<br />
{<br />
<br />
	$fragment_count = 0;<br />
	$fragment_rndmatch_counter = 0;<br />
	$fragment_rndmatch = array(&quot;&quot;);<br />
<br />
<br />
	$rnd_number = 0;<br />
	$rnd_match = 0;<br />
	$rnd_dismatch_countr = 0;<br />
	$rndmatch = array(&quot;&quot;);<br />
<br />
	$slider_rnd_content = array(&quot;&quot;);<br />
<br />
<br />
	preg_match_all('/.*/',$fragments,$slider_fragmenty_prepare);<br />
<br />
	$slider_fragmenty_join = join(&quot;&quot;, $slider_fragmenty_prepare[0]);<br />
<br />
	preg_match_all('/\&lt;li.+?li&gt;/',$slider_fragmenty_join,$slider_fragmenty_parse);<br />
<br />
	$fragment_count = count($slider_fragmenty_parse[0]);<br />
<br />
	while ($fragment_rndmatch_counter &lt; $fragment_count)<br />
	{<br />
<br />
		$rnd_match = 0;<br />
		$rnd_number = mt_rand(1,$fragment_count);<br />
	<br />
		for ($rnd_dismatch_countr = 0; $rnd_dismatch_countr &lt; $fragment_count; )<br />
		{<br />
		<br />
			if ($rndmatch[$rnd_dismatch_countr] != $rnd_number)<br />
			{<br />
				$rnd_dismatch_countr++;<br />
			}<br />
			else<br />
			{<br />
				$rnd_match = 1;<br />
				break;<br />
			}<br />
		}<br />
	<br />
		if ($rnd_match == 0)<br />
		{<br />
			array_push($rndmatch,$rnd_number);<br />
<br />
			$fragment_rndmatch_counter++;<br />
<br />
			array_push($slider_rnd_content,$slider_fragmenty_parse[0][($rnd_number -1)]);<br />
		}<br />
	}	<br />
<br />
	return $slider_rnd_content;<br />
<br />
}<br />
<br />
$t-&gt;assign(&quot;SLIDER_SHOW&quot;, join(&quot;&quot;,rnd_slider($cfg['freetext8'])));<br />
<br />
==================================================================<br />
This is just function that could be useful for any user but it would be grateful if somebody is able to make a plug-in from it maybe <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" /> .]]></description>
			<pubDate>Вт, 04 Січ 2011 18:15:11 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/ua/forums?m=posts&q=6107&d=0#post27747]]></link>
		</item>
	</channel>
</rss>