Showing posts with label community site. Show all posts
Showing posts with label community site. Show all posts

Saturday, August 29, 2009

Add Group Delete Function for Dolphin 6.x

OPEN ::
/ group_actions.php
FIND:::

case 'delmem':
if( $arrGroup['creatorID'] == $memberID )
{
$mem = (int)$_REQUEST['mem'];
if( $mem )
{
if( $mem != $memberID )
{
$oGroups->resignGroupMember( $mem, $groupID );
Header( "Location: {$site['url']}grp.php?action=mygroups" );
exit;
}
else
{
$_page['header'] = _t( "_Group member delete error" );
$_page['header_text'] = _t( "_Group member delete error" );
$_page_cont[$_ni]['page_main_code'] = MsgBox(_t( "_You cannot delete yourself from group because you are group creator" ));
}
}
exit;
}
else
{
$_page['header'] = _t( "_Group member delete error" );
$_page['header_text'] = _t( "_Group member delete error" );
$_page_cont[$_ni]['page_main_code'] = MsgBox(_t( "_You cannot delete group member because you are not group creator" ));
}
break;

(AFTER IT...) ADD:

case 'delgrp': // start delete group function
if( $arrGroup['creatorID'] == $memberID )
{
// put delete function here
$sql = "DELETE FROM `Groups` WHERE `ID` = '".$groupID."' ";
db_res ( $sql);
$sql = " DELETE FROM `GroupsGallery` WHERE `groupID` = '".$groupID."' ";
db_res ( $sql) ;
if( $_SERVER['HTTP_REFERER'] )
Header( "Location: {$_SERVER['HTTP_REFERER']}" );
else
Header( "Location: {$site['url']}grp.php" );
exit;
}

else
{
$_page['header'] = _t( "_Group member delete error" );
$_page['header_text'] = _t( "_Group member delete error" );
$_page_cont[$_ni]['page_main_code'] = MsgBox(_t( "_You cannot delete group because you are not group creator" ));
}
break; // end delete group

OPEN :::
/inc/classes/BxDolGroups.php
FIND :::
if ( $aGroupInfo['creatorID'] == $iMemberID ){
$sRetHtml .= $this->genGroupActionBtn( 'Edit group', "{$this->sCurrFile}?action=edit&ID={$iGroupID}" );
}

CHANGE TO :::
if ( $aGroupInfo['creatorID'] == $iMemberID ){
$sRetHtml .= $this->genGroupActionBtn( 'Delete group', "group_actions.php?a=delgrp&ID={$iGroupID}", true );
$sRetHtml .= $this->genGroupActionBtn( 'Edit group', "{$this->sCurrFile}?action=edit&ID={$iGroupID}" );
}

Thursday, August 6, 2009

Adding a page to Dolphin Site.


I have been asked many times "How do I add a new page to my Dolphin Community Site?"

Other than using the Page Builder, in your admin area - which has some limitations, there is another simple way to add a page to your site.

First: Open /faq.php and save it as something new (like detailed_info.php)

Then look for the following code.

function PageCompPageMainCode()
{
global $oTemplConfig;

$ret = _t( "_FAQ_INFO" );


return DesignBoxContent(_t( "_FAQ_H1", $site['title'] ), $ret, $oTemplConfig -> PageCompThird_db_num );
}

Notice the line -> $ret = _t( "_FAQ_INFO" );
<- this tells the dolphin script to get that key from the language table.

Now change the _FAQ_H1 to _MORE_INFO (or anything else you'd like to use, and resave the file.

Go into your dolphin admin area, click on language settings, then Add New and enter the key ( _MORE_INFO (or whatever you named it) and enter the value for each language your site has available.

Done. Now just link to that file, by adding a link to the navigation menu, or anywhere.

Just a quick post and simple instructions, I know - but let me know if you need any further description on how to add a page to your Dolphin web site.

D