<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[vldPersonals Forum - Show news only in session language]]></title>
		<link>http://www.vldpersonals.com/forum/topic/6873/show-news-only-in-session-language/</link>
		<description><![CDATA[The most recent posts in Show news only in session language.]]></description>
		<lastBuildDate>Sat, 20 Feb 2010 23:19:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/36512/#p36512</link>
			<description><![CDATA[<p>Very good customization - thanks, <strong>mystec</strong>. <br />But not for all,&nbsp; minimal HTML knowledge is required.<br />By the way, if used HTML editor for addition&nbsp; &lt;div&gt; to news (it&#039;s&nbsp; logically to use it), assignment of variable must be:<br />$filter_lng = &#039;&lt;DIV class=&#039;.$SESSION-&gt;conf[&#039;language&#039;].&#039;-news&#039;; <br />because HTML editor remove &quot; &quot; and write &quot;DIV&quot; instead of &quot;div&quot;.</p>]]></description>
			<author><![CDATA[dummy@example.com (Plebejus)]]></author>
			<pubDate>Sat, 20 Feb 2010 23:19:44 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/36512/#p36512</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/36257/#p36257</link>
			<description><![CDATA[<div class="quotebox"><cite>radioact wrote:</cite><blockquote><p>I suppose it is. Just edit ext.news.php similar way.</p></blockquote></div><p>This i have allready done, i have news page content respecting sessions language.</p><p>But if i add in homepahe.tpl&nbsp; this :</p><p>&nbsp; &nbsp; &lt;h3 class=&quot;news&quot;&gt;{lang:&quot;core&quot;,&quot;home_latest_news&quot;}&lt;/h3&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;block news&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; {news:limit=5,cache_time=0}<br />&nbsp; &nbsp; &lt;/div&gt;</p><p>I get news in all languages, so no respect for session language on homepage.</p>]]></description>
			<author><![CDATA[dummy@example.com (matrimo)]]></author>
			<pubDate>Tue, 09 Feb 2010 23:42:51 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/36257/#p36257</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/36249/#p36249</link>
			<description><![CDATA[<p>I suppose it is. Just edit ext.news.php similar way.</p>]]></description>
			<author><![CDATA[dummy@example.com (radioact)]]></author>
			<pubDate>Tue, 09 Feb 2010 03:50:11 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/36249/#p36249</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/36247/#p36247</link>
			<description><![CDATA[<p>If i want add Last 5 News on homepage.tpl is possible to have content respecting sessions language too, like in /news/ page ?</p>]]></description>
			<author><![CDATA[dummy@example.com (matrimo)]]></author>
			<pubDate>Tue, 09 Feb 2010 00:43:44 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/36247/#p36247</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34089/#p34089</link>
			<description><![CDATA[<div class="quotebox"><cite>rombest wrote:</cite><blockquote><p>It works PERFECT. I recommand it !</p></blockquote></div><p>Nice to see it is working:)</p><p>I have forgotten totalnews because i did not have enough news. I saw it on your site and added it. It will be totally done after replacing one more line. See the first message step 2 please.</p>]]></description>
			<author><![CDATA[dummy@example.com (mystec)]]></author>
			<pubDate>Tue, 01 Dec 2009 07:57:14 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34089/#p34089</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34088/#p34088</link>
			<description><![CDATA[<p>It works PERFECT. I recommand it !</p>]]></description>
			<author><![CDATA[dummy@example.com (matrimo)]]></author>
			<pubDate>Tue, 01 Dec 2009 07:50:31 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34088/#p34088</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34087/#p34087</link>
			<description><![CDATA[<div class="quotebox"><cite>radioact wrote:</cite><blockquote><p>Oh, actually they will <img src="http://www.vldpersonals.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p></blockquote></div><p>We will see:)</p>]]></description>
			<author><![CDATA[dummy@example.com (mystec)]]></author>
			<pubDate>Tue, 01 Dec 2009 07:27:17 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34087/#p34087</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34086/#p34086</link>
			<description><![CDATA[<p>Oh, actually they will <img src="http://www.vldpersonals.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (radioact)]]></author>
			<pubDate>Tue, 01 Dec 2009 07:12:53 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34086/#p34086</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34085/#p34085</link>
			<description><![CDATA[<div class="quotebox"><cite>radioact wrote:</cite><blockquote><p>It&#039;s good enough and easy to reapply on every new vldP version if it comes.<br />One suggestion to try:<br /></p><div class="codebox"><pre><code>AND body LIKE &#039;%$filter_lng%&#039;</code></pre></div><p>Could be:<br /></p><div class="codebox"><pre><code>AND body LIKE &#039;$filter_lng%&#039;</code></pre></div><p>This will search only at beginning of news body.<br />Because of we put &lt;div class=&quot;english-news&quot;&gt; at the start no need to seek it all over the news body text.</p></blockquote></div><p>Edited it. I hope people wont add &lt;div class=&quot;.. after that default &lt;br&gt;</p>]]></description>
			<author><![CDATA[dummy@example.com (mystec)]]></author>
			<pubDate>Tue, 01 Dec 2009 06:52:26 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34085/#p34085</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34082/#p34082</link>
			<description><![CDATA[<p>It&#039;s good enough and easy to reapply on every new vldP version if it comes.<br />One suggestion to try:<br /></p><div class="codebox"><pre><code>AND body LIKE &#039;%$filter_lng%&#039;</code></pre></div><p>Could be:<br /></p><div class="codebox"><pre><code>AND body LIKE &#039;$filter_lng%&#039;</code></pre></div><p>This will search only at beginning of news body.<br />Because of we put &lt;div class=&quot;english-news&quot;&gt; at the start no need to seek it all over the news body text.</p>]]></description>
			<author><![CDATA[dummy@example.com (radioact)]]></author>
			<pubDate>Tue, 01 Dec 2009 06:40:16 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34082/#p34082</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34081/#p34081</link>
			<description><![CDATA[<div class="quotebox"><cite>radioact wrote:</cite><blockquote><p>Nice and easy to implement solution. Approved! <img src="http://www.vldpersonals.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p></blockquote></div><p>Yes, this is the easiest way i think, sure not the most professional one <img src="http://www.vldpersonals.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (mystec)]]></author>
			<pubDate>Tue, 01 Dec 2009 06:26:41 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34081/#p34081</guid>
		</item>
		<item>
			<title><![CDATA[Re: Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34079/#p34079</link>
			<description><![CDATA[<p>Nice and easy to implement solution. Approved! <img src="http://www.vldpersonals.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (radioact)]]></author>
			<pubDate>Tue, 01 Dec 2009 06:10:01 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34079/#p34079</guid>
		</item>
		<item>
			<title><![CDATA[Show news only in session language]]></title>
			<link>http://www.vldpersonals.com/forum/post/34071/#p34071</link>
			<description><![CDATA[<p>Hi,</p><p>Yesterday there was a topic someone (i think rombest) asking how it would be possible to show news only in users language. But now i can not find that topic. I hope it was not a dream.</p><p>Here the solution is:</p><p>1. Open ext.news.php</p><p>Find:<br /></p><div class="codebox"><pre><code>        $result = $DB-&gt;query(&quot;SELECT * FROM &quot; . DB_PREFIX . &quot;news WHERE active=&#039;1&#039; ORDER BY $orderby $orderdir LIMIT $limit&quot;);</code></pre></div><p>Replace:<br /></p><div class="codebox"><pre><code>        $filter_lng = &#039;&lt;div class=&quot;&#039;.$SESSION-&gt;conf[&#039;language&#039;].&#039;-news&quot;&#039;;
        $result = $DB-&gt;query(&quot;SELECT * FROM &quot; . DB_PREFIX . &quot;news WHERE active=&#039;1&#039; AND body LIKE &#039;$filter_lng%&#039; ORDER BY $orderby $orderdir LIMIT $limit&quot;);</code></pre></div><p>2. Open lib.news.php</p><p>Find:<br /></p><div class="codebox"><pre><code>            $result = $DB-&gt;query(&quot;SELECT * FROM &quot; . DB_PREFIX . &quot;news WHERE active=&#039;1&#039; ORDER BY postdate DESC, news_id DESC LIMIT &quot; . (($page - 1) * $PREFS-&gt;conf[&#039;news_per_page&#039;]) . &quot;, &quot; . $PREFS-&gt;conf[&#039;news_per_page&#039;]);</code></pre></div><p>Replace:<br /></p><div class="codebox"><pre><code>$filter_lng = &#039;&lt;div class=&quot;&#039;.$SESSION-&gt;conf[&#039;language&#039;].&#039;-news&quot;&#039;;
$result = $DB-&gt;query(&quot;SELECT * FROM &quot; . DB_PREFIX . &quot;news WHERE active=&#039;1&#039; AND body LIKE &#039;$filter_lng%&#039; ORDER BY postdate DESC, news_id DESC LIMIT &quot; . (($page - 1) * $PREFS-&gt;conf[&#039;news_per_page&#039;]) . &quot;, &quot; . $PREFS-&gt;conf[&#039;news_per_page&#039;]);</code></pre></div><p><strong>(For totalpages)</strong><br />Find:<br /></p><div class="codebox"><pre><code>$result = $DB-&gt;query(&quot;SELECT COUNT(*) as total FROM &quot; . DB_PREFIX . &quot;news WHERE active=&#039;1&#039;&quot;);</code></pre></div><p>Replace:<br /></p><div class="codebox"><pre><code>$filter_lng = &#039;&lt;div class=&quot;&#039;.$SESSION-&gt;conf[&#039;language&#039;].&#039;-news&quot;&#039;;
$result = $DB-&gt;query(&quot;SELECT COUNT(*) as total FROM &quot; . DB_PREFIX . &quot;news WHERE active=&#039;1&#039; AND body LIKE &#039;$filter_lng%&#039;&quot;);</code></pre></div><p>3. While publishing news, at body section use the structure below.</p><p>Example English: &lt;div class=&quot;english-news&quot;&gt;English news body bla bla bla... &lt;/div&gt;</p><p>Example French: &lt;div class=&quot;french-news&quot;&gt;French news body bla bla bla... &lt;/div&gt;</p><p>Example Turkish: &lt;div class=&quot;turkish-news&quot;&gt;Turkish news body bla bla bla... &lt;/div&gt;</p><p>If you have any questions feel free to ask.</p><p>Note: This could be done with adding an extra field for news too. But i think this is easier. </p><p>Important: Be sure news body starts with &lt;div class=&quot; not with &lt;br&gt;</p>]]></description>
			<author><![CDATA[dummy@example.com (mystec)]]></author>
			<pubDate>Tue, 01 Dec 2009 02:50:10 +0000</pubDate>
			<guid>http://www.vldpersonals.com/forum/post/34071/#p34071</guid>
		</item>
	</channel>
</rss>

