<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Query Groups, Set Values, and Pass to Javascript UI]]></title>
		<link>https://punbb.informer.com/forums/topic/21053/query-groups-set-values-and-pass-to-javascript-ui/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/21053/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Query Groups, Set Values, and Pass to Javascript UI.]]></description>
		<lastBuildDate>Thu, 05 Feb 2009 08:12:26 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124129/#p124129</link>
			<description><![CDATA[<p>Thank you, that&#039;s exactly what I needed.</p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Thu, 05 Feb 2009 08:12:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124129/#p124129</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124128/#p124128</link>
			<description><![CDATA[<p>This <a href="http://punbb.informer.com/wiki/punbb13/faq#how_to_work_with_query_results">article</a> should help you to work with query results.</p>]]></description>
			<author><![CDATA[null@example.com (Slavok)]]></author>
			<pubDate>Thu, 05 Feb 2009 08:00:06 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124128/#p124128</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124124/#p124124</link>
			<description><![CDATA[<p>I&#039;m getting this error:<br /></p><div class="codebox"><pre><code>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/..removed../admin/settings.php(337) : eval()&#039;d code on line 173

Catchable fatal error: Object of class mysqli_result could not be converted to string in /home/..removed../admin/settings.php(337) : eval()&#039;d code on line 175</code></pre></div><p>What am I missing? Did I format that incorrectly?</p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Thu, 05 Feb 2009 03:25:42 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124124/#p124124</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124123/#p124123</link>
			<description><![CDATA[<p>This might be a long shot but I&#039;m looking all over the place for how PunBB does it&#039;s $forum_config variable and keeps it updated.</p><p>Anyone know where to look?</p><p>Right now I&#039;ve got this in the &lt;install&gt; portion of the addon:<br /></p><div class="codebox"><pre><code>$jchat_group_query = array(
    &#039;SELECT&#039;    =&gt; &#039;g_id, g_title&#039;,
    &#039;FROM&#039;        =&gt; &#039;groups&#039;
);
$jchat_config = $forum_db-&gt;query_build($jchat_group_query) or error(__FILE__, __LINE__);
$jchat_config = mysql_fetch_array($jchat_config);</code></pre></div><p>Is that all I need and it&#039;ll stay usable as $jchat_config[&#039;<em>group_id</em>&#039;] to display group names throughout the script?</p><p>Sorry if my question is somewhat naive, I&#039;m learning as I go along.</p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Thu, 05 Feb 2009 01:58:12 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124123/#p124123</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124119/#p124119</link>
			<description><![CDATA[<p>Thank you KeyDog. <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Wed, 04 Feb 2009 23:49:35 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124119/#p124119</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124115/#p124115</link>
			<description><![CDATA[<p><a href="http://fluxbb.org/wiki/v1.3:developing_extensions">http://fluxbb.org/wiki/v1.3:developing_extensions</a></p><p>that maybe...</p><p><a href="http://fluxbb.org/wiki/v1.3:developing_extensions#using_query_builder">http://fluxbb.org/wiki/v1.3:developing_ … ry_builder</a></p>]]></description>
			<author><![CDATA[null@example.com (KeyDog)]]></author>
			<pubDate>Wed, 04 Feb 2009 23:12:30 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124115/#p124115</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124114/#p124114</link>
			<description><![CDATA[<p>Is there somewhere that has a reference on how to use those functions aside from looking through the source code at 10 different examples and trying to figure it out from there?</p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Wed, 04 Feb 2009 23:09:31 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124114/#p124114</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124104/#p124104</link>
			<description><![CDATA[<p>If you are making an extension, make sure to use the db layer functions and not the specific mysql_ ones.</p>]]></description>
			<author><![CDATA[null@example.com (MattF)]]></author>
			<pubDate>Wed, 04 Feb 2009 16:10:17 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124104/#p124104</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124082/#p124082</link>
			<description><![CDATA[<p>Okay, I think I&#039;ve got it:</p><div class="codebox"><pre><code>$dbhandle = mysql_connect($db_host, $db_username, $db_password) or print(mysql_error());
$selected = mysql_select_db($db_name,$dbhandle) or print(mysql_error());
$result = mysql_query(&#039;SELECT g_id, g_title FROM &#039;.$db_prefix.&#039;groups&#039;);
while ($row = mysql_fetch_array($result)) {
    print(&#039;ID:&#039;.$row{&#039;g_id&#039;}.&#039; Name:&#039;.$row{&#039;g_title&#039;}.&#039;&lt;br /&gt;&#039;);
};</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Wed, 04 Feb 2009 12:03:23 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124082/#p124082</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124077/#p124077</link>
			<description><![CDATA[<p>This is kind of a noobish question but, can I just query the database since it&#039;s already connected or do I have to pull the $db_username $db_password and all that to connect?</p><p>And if it&#039;s already connected, would this work?</p><div class="codebox"><pre><code>$result = mysql_query(&#039;SELECT g_id, g_title FROM &#039;.$db_prefix.&#039;groups&#039;);
if (!$result) {
    print(&#039;Invalid query: &#039; . mysql_error());
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Wed, 04 Feb 2009 11:28:00 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124077/#p124077</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124072/#p124072</link>
			<description><![CDATA[<p>There is one way to get it - by means of an SQL-query, group id and group names aren&#039;t cached. But you can cache them for your purposes in your extension.</p>]]></description>
			<author><![CDATA[null@example.com (Slavok)]]></author>
			<pubDate>Wed, 04 Feb 2009 09:33:27 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124072/#p124072</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124069/#p124069</link>
			<description><![CDATA[<p>So there is no way to print out a list of all the group ID&#039;s (not just the current user, which is what I&#039;m getting from $forum_user[&#039;g_id&#039;]) and their associated group names?</p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Wed, 04 Feb 2009 08:15:28 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124069/#p124069</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124068/#p124068</link>
			<description><![CDATA[<p>There is no special function to get a user group, but you can get a group id using the global array $forum_user, key &#039;g_id&#039;</p>]]></description>
			<author><![CDATA[null@example.com (Slavok)]]></author>
			<pubDate>Wed, 04 Feb 2009 07:51:24 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124068/#p124068</guid>
		</item>
		<item>
			<title><![CDATA[Re: Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124065/#p124065</link>
			<description><![CDATA[<p>So, basically, what&#039;s the command to list all of the user groups and their g_id&#039;s without having to query the SQL server for them?</p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Wed, 04 Feb 2009 07:07:03 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124065/#p124065</guid>
		</item>
		<item>
			<title><![CDATA[Query Groups, Set Values, and Pass to Javascript UI]]></title>
			<link>https://punbb.informer.com/forums/post/124060/#p124060</link>
			<description><![CDATA[<p>I&#039;m trying to work out a way to:<br /></p><ol class="alpha"><li><p>Set up an Admin Panel</p><ol class="decimal"><li><p>List out all user groups on my extension&#039;s admin panel (separate from the group permissions admin panel).</p></li><li><p>Put all the groups in to an array(); I think this would be the easiest way to work with them. Let me know if it isnt...</p></li><li><p>Allow the user to assign groups to four different permission levels. Most likely using a text field(permission level) &amp; Label(group name) field they can just type 1-4 on each of them to set it.</p></li><li><p>Store each of the values into the $forum_config[&#039;values&#039;]... somehow... Can I do something like &quot;&#039;o_extensionname_groupperm_&#039;.$id&quot; or something?</p></li><li><p>Each permission level (0-3) would start off at the most restrictive (only admins, but can be changed by the user), then a little less restrictive, while still keeping the previous groups in it. (ie: group[0] = &#039;admins&#039;; group[1] = &#039;admins, mods, privuser&#039;; group[2] = &#039;admins, mods, privuser, default users&#039;; group[3] = &#039;admins, mods, privuser, default users, guests&#039;;)<br /></p></li></ol></li><li><p>Next, pass along certain values to a javascript ui</p><ol class="decimal"><li><p>Send which group(0-3) the user&#039;s group falls into via $_POST to the javascript.</p></li><li><p>The user will be able to pick (from the javascript ui) a group(0-3) level that they can send messages but they can&#039;t receive or send messages higher than what is set in the admin panel (option will be grayed out).</p></li></ol></li></ol><p>I know how to call the proper hook to make the admin panel, but I&#039;m clueless on how to list out all the user groups and allow the admin the ability to assign them to my groups for chat privileges(group(0-3)). I think once I can get them assigned, they&#039;ll be easy to send to the javascript via $_POST. Does that sound correct or am I making this too complicated? If you haven&#039;t already realized it, this is for a javascript chat extension and I&#039;m trying to have different permission levels that can be selected when sending messages (never higher than what permissions their group is given in the admin panel) and then they can only receive up to their permission level, and anything they can receive is shown in different colors (so admin messages are red, next level down is orange, next level is green, lowest public level that everyone can see is black).</p><p>I can do the javascript for what I need, I just need help to know which functions built into PunBB to use in php since I&#039;m not that accustomed to it yet.</p><p>Can anyone throw any bit of insight (mainly how to list out all the groups and store them in $forum_config with the selected values in my extensions admin panel in a way that if the groups are ever modified or removed in punbb, it won&#039;t cause problems with my extension or the javascript ui)? I&#039;m going cross-eyed trying to look through all the functions in admin/groups.php without knowing exactly what I&#039;m looking for.</p>]]></description>
			<author><![CDATA[null@example.com (slickplaid)]]></author>
			<pubDate>Wed, 04 Feb 2009 00:44:32 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/124060/#p124060</guid>
		</item>
	</channel>
</rss>
