<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged pints</title>
<link>https://www.question2answer.org/qa/tag/pints</link>
<description>Powered by Question2Answer</description>
<item>
<title>Issue with points calculation as per user role</title>
<link>https://www.question2answer.org/qa/20332/issue-with-points-calculation-as-per-user-role</link>
<description>

&lt;p&gt;
	Please refer this question&amp;nbsp;&lt;a href=&quot;http://www.question2answer.org/qa/20321/best-way-to-override-qa_db_points_calculations-function&quot; rel=&quot;nofollow&quot;&gt;http://www.question2answer.org/qa/20321/best-way-to-override-qa_db_points_calculations-function&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;
	Based on this question I am creating a plugin for allowing additional setup for Admin point system. Calculation for Admin role itself works fine. Example: If I want to multiply by 2 it just works fine but when I re calculating the points its double the Basic users piont for the tilme till they do some action which adds the point. Once they do than all points go back to the original calculation. 4 hours I tried to understand but nothing happening.&lt;/p&gt;


&lt;p&gt;
	In fact I tried to add additional input form for Admin Points that also not working. I am trying to do by something below code&lt;/p&gt;


&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;if( qa_get_logged_in_level() &amp;gt; QA_USER_LEVEL_MODERATOR )&amp;nbsp;&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;return array(&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'aposts' =&amp;gt; array(&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'multiple' =&amp;gt; $options['points_multiple']*$options['points_post_a']*2, &lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt;// here I am multiplying by 2&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'formula' =&amp;gt; &quot;COUNT(*) AS aposts FROM ^posts AS userid_src WHERE userid~ AND type='A'&quot;,&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;),&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#a9a9a9;&quot;&gt;//.......... continue .........&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;} else {&lt;/span&gt;&lt;span style=&quot;color:#a9a9a9;&quot;&gt; // rest of the user role it shuld calculate with default point system&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;return array(&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'qposts' =&amp;gt; array(&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'multiple' =&amp;gt; $options['points_multiple']*$options['points_post_q'],&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'formula' =&amp;gt; &quot;COUNT(*) AS qposts FROM ^posts AS userid_src WHERE userid~ AND type='Q'&quot;,&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;),&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'aposts' =&amp;gt; array(&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'multiple' =&amp;gt; $options['points_multiple']*$options['points_post_a'],&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;'formula' =&amp;gt; &quot;COUNT(*) AS aposts FROM ^posts AS userid_src WHERE userid~ AND type='A'&quot;,&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;),&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#a9a9a9;&quot;&gt;//.......... continue .........&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;color:#b22222;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;</description>
<category>Plugins</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/20332/issue-with-points-calculation-as-per-user-role</guid>
<pubDate>Wed, 02 Jan 2013 06:06:35 +0000</pubDate>
</item>
</channel>
</rss>