<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>BuddyDev Premium Forum &#187; Topic: unique group names</title>
		<link>http://buddydev.com/forums/topic/unique-group-names</link>
		<description>BuddyDev Premium Forum</description>
		<language>en-US</language>
		<pubDate>Tue, 07 Feb 2012 16:47:13 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://buddydev.com/forums/search.php</link>
		</textInput>
		<atom:link href="http://buddydev.com/forums/rss/topic/unique-group-names" rel="self" type="application/rss+xml" />

		<item>
			<title>Patrick on "unique group names"</title>
			<link>http://buddydev.com/forums/topic/unique-group-names#post-2770</link>
			<pubDate>Mon, 21 Jun 2010 03:37:08 +0000</pubDate>
			<dc:creator>Patrick</dc:creator>
			<guid isPermaLink="false">2770@http://buddydev.com/forums/</guid>
			<description>&#60;p&#62;@brajesh&#60;/p&#62;
&#60;p&#62;Thanks for this. Brilliantly simple as always :-)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gwu on "unique group names"</title>
			<link>http://buddydev.com/forums/topic/unique-group-names#post-2766</link>
			<pubDate>Mon, 21 Jun 2010 00:18:42 +0000</pubDate>
			<dc:creator>gwu</dc:creator>
			<guid isPermaLink="false">2766@http://buddydev.com/forums/</guid>
			<description>&#60;p&#62;too good. Just copy paste and it works.&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Shane_NY_777 on "unique group names"</title>
			<link>http://buddydev.com/forums/topic/unique-group-names#post-2723</link>
			<pubDate>Sat, 19 Jun 2010 18:01:33 +0000</pubDate>
			<dc:creator>Shane_NY_777</dc:creator>
			<guid isPermaLink="false">2723@http://buddydev.com/forums/</guid>
			<description>&#60;p&#62;I tried it.  it worked for me.  thanks  :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Brajesh Singh on "unique group names"</title>
			<link>http://buddydev.com/forums/topic/unique-group-names#post-2720</link>
			<pubDate>Sat, 19 Jun 2010 06:38:34 +0000</pubDate>
			<dc:creator>Brajesh Singh</dc:creator>
			<guid isPermaLink="false">2720@http://buddydev.com/forums/</guid>
			<description>&#60;p&#62;It can be done via hooking on the filter&#60;br /&#62;
&#34;groups_group_name_before_save&#34; but there is no other way to do it&#60;/p&#62;
&#60;p&#62;Put this function in your theme's functions.php&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;groups_group_name_before_save&#38;quot;,&#38;quot;allow_unique_names_only&#38;quot;);
function allow_unique_names_only($name){
    global $bp;

  $groups=BP_Groups_Group::search_groups($name);//search groups
  $duplicate=false;
  if(&#38;#39;group-details&#38;#39;==$bp-&#38;gt;groups-&#38;gt;current_create_step&#38;amp;&#38;amp;!empty($groups)&#38;amp;&#38;amp;$groups[&#38;#39;total&#38;#39;]&#38;gt;0){
      //we have match, but is there an exact match
      foreach($groups[&#38;#39;groups&#38;#39;] as $g){
         $group=new BP_Groups_Group($g-&#38;gt;group_id);

         if($group-&#38;gt;name==$name){
              $duplicate=true;//found duplicate
              break;//break the loop;
          }
      }
if($duplicate){
        bp_core_add_message(&#38;quot;Duplicate group name&#38;quot;,&#38;quot;error&#38;quot;);
        bp_core_redirect( $bp-&#38;gt;root_domain . &#38;#39;/&#38;#39; . $bp-&#38;gt;groups-&#38;gt;slug . &#38;#39;/create/step/&#38;#39; . $bp-&#38;gt;groups-&#38;gt;current_create_step . &#38;#39;/&#38;#39; );
  }

}
 return $name;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and then try creating duplicate group.&#60;br /&#62;
Please let me know if it works for you or not ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gwu on "unique group names"</title>
			<link>http://buddydev.com/forums/topic/unique-group-names#post-2706</link>
			<pubDate>Fri, 18 Jun 2010 22:19:13 +0000</pubDate>
			<dc:creator>gwu</dc:creator>
			<guid isPermaLink="false">2706@http://buddydev.com/forums/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Can anyone tel me how to have unique group names, same functionality as the username ?&#60;/p&#62;
&#60;p&#62;May be even prompt user with error message saying group by this name already exists.&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>

