2
2007
BoonEx Dolphin Script
I recently stumbled on a pretty cool social networking script called Dolphin (by BoonEx.com). It is an open-source script, however, you do need to pay for licensing fee if you want to remove references to BoonEx on your site.
My brother is launching a new social networking site based on this script for wine lovers. Check it out at http://www.winehappy.com
Since I'm playing with this script, I will have a few customization tips and tricks that I'll share with my readers.
Please keep in mind that I have version 6.0.0003 installed
First is a MOD that will add an Admin member as a friend to all other members. This MOD will only add the Admin as a friend AFTER you have the MOD installed. It doesn't roll back and add the Admin member to your existing members - this could be done, though.
Here is the file with the MOD included:
http://winehappy.com/join_form.txt
Be sure to rename join_form.txt to join_form.php
Back up your join_form.php first in case you screw it upHere is the MOD detail for those Do-It-Yourself'ers:
Open join_form.php
Find this code:
Line 374: if ( getParam('autoApproval_ifNoConfEmail') == 'on' )
Insert before line 374:
$dump = db_res("INSERT INTO FriendList SET `ID` = '{$IDnormal}', `Profile` = 1, `Check` = 1″);
You may want to change `Profile` = 1 to a value of the member ID that you are making this as the friend you are adding to all future new members.
That should do it! Please leave a rating if you like this MOD: http://www.expertzzz.com/Downloadz/view/1481
If you are MODDING (cool… I'm making this a verb, first to call it!) a Dolphin version other than 6.0.0003 then the place to insert the code may be different. So always backup a copy of your original file so you can roll back to it if you mess up something.
- Codersteve
RELATED POSTS
WordPress database error: [Can't find FULLTEXT index matching the column list]
SELECT ID, post_title, post_content,MATCH (post_name, post_content) AGAINST ('boonex dolphin script') AS score FROM wp_posts WHERE MATCH (post_name, post_content) AGAINST ('boonex dolphin script') AND post_date <= '2008-08-20 05:08:50' AND (post_status IN ( 'publish', 'static' ) && ID != '8') AND post_password ='' ORDER BY score DESC LIMIT 5


Good work - and thanks for making this free! You have a new feed subscriber, so keep those mods coming…
I've added this, but I can't get it going. I have 6.0.3 and I've added it where it says. If I change Profile` = 1 to Profile` = 2, do I also change to Check` = 1 too?
No, you don't need to change the Check value.
Do note that this will only take effect to future members. Let me know if you are still having trouble.
I realized that it is redundant to put that line of code in two places, so I have reduced it to just one place. Please read through the MOD again.
Hi, it unfortunatelly did not work for me. I hope someone can help. I also have 6.003 but the code was on line 369. I put it in line 368 and returned the error (crushed the site).
Please help!
There should only be one place where this code appears:
if ( getParam('autoApproval_ifNoConfEmail') == 'on' )
You would then place the MOD right above that line.
Make sure you use notepad or simple text editor to change your PHP files!
I did exactly what you mentioned but it crashed when I tried to create another member. Please review it and let us know if you work it out. I really want to have this modification. I have been searching for it for while now.
thanks in advance
Leo… a little more information would help, what do you mean by "crashed"?
Hi again, I did actually use Dreavweaver and am advanced user (web designer) so this was not the problem. When this line was added the site took to load forever and then reported error on line 368, so yes it crashed…
p.S. also on this page the protecton code is not working properly. It says it was not 'passed' where it was typed exactly.
Hey Bia,
I'm not sure what protection code you are talking about, and my MOD simply adds a line of PHP code in join_form.php file. It is mostly likely your Dreamweaver editor is messing up the code.
I would advice highly against using any editors other than notepad or textpad (or any other text editors), such as frontpage, dreamweaver, Nvu, or what have yous, to edit a scripting file.
The join_form.txt with the MOD included is here:
http://winehappy.com/join_form.txt
Let me know if that helps.
Hi sent you an email. This file totally crushed the site. It must be something simple if it works for you…
>
Hey i had the same problem with the code crashing my site until i just copied the code he posted directly over my join form, the code is as follows…..
$join_pages_num )
$page = 'done';
// check fields from previous page
if ( 'done' != $page )
$join_page_check_limit = " AND `join_page` = 1000″;
else
$join_page_check_limit = ";
//———————————————————–
// ————— [ END ] GET/POST actions
// ————— page components
$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode();
// ————— [END] page components
PageCode();
// ————— page components functions
/**
* page code function
*/
function PageCompPageMainCode()
{
global $site;
global $dir;
global $tmpl;
global $page;
global $join_page_check_limit;
global $join_pages_num;
global $p_arr;
global $_page;
global $en_aff;
global $oTemplConfig;
global $newusernotify;
$enable_security_image = getParam('enable_security_image');
$autoApproval_ifJoin = isAutoApproval('join');
ob_start();
session_start();
switch ( $page )
{
// fill inputs with values from precede join pages
case ( $page > 1 ) :
$hidden_vals = ";
// inputs with POST values
$respd = db_res("SELECT * FROM ProfilesDesc WHERE `visible` & 2 AND ( FIND_IN_SET('0′,show_on_page) OR FIND_IN_SET('".(int)$_page['name_index']."',show_on_page)) $join_page_check_limit ORDER BY `order` ASC");
while ( $arrpd = mysql_fetch_array($respd) )
{
$fname = get_input_name( $arrpd );
switch ( $arrpd['type'] )
{
case 'set': // set of checkboxes
$vals = preg_split ("/[,\'] /", $arrpd['extra'], -1, PREG_SPLIT_NO_EMPTY);
$p_arr[$fname] = ";
foreach ( $vals as $v )
{
if ( strlen(trim($v)) ';
$p_arr[$fname."_".$v] = process_pass_data($_POST[$fname."_".$v]);
if ( $_POST[$fname."_".$v] == 'on' )
{
if ( strlen($p_arr[$fname]) )
$p_arr[$fname] .= ",$v";
else
$p_arr[$fname] .= $v;
}
}
break;
case 'date':
$p_arr[$fname] = sprintf("d-d-d",
(int)$_POST[$fname . '_year'],
(int)$_POST[$fname . '_month'],
(int)$_POST[$fname . '_day']
);
$hidden_vals .= ";
$hidden_vals .= ";
$hidden_vals .= ";
break;
default:
if ( $arrpd['get_value'] )
{
$funcbody = $arrpd['get_value'];
$func = create_function('$arg0′, $funcbody);
$hidden_vals .= ";
$p_arr[$fname] = process_pass_data($func($_POST));
}
else
{
$hidden_vals .= ";
$p_arr[$fname] = process_pass_data($_POST[$fname]);
}
break;
}
}
// check values
$query = "SELECT * FROM ProfilesDesc
WHERE `visible` & 2 AND ( FIND_IN_SET('0′,show_on_page) OR FIND_IN_SET('".(int)$_page['name_index']."',show_on_page)) $join_page_check_limit
ORDER BY `join_page` ASC";
$respd = db_res($query);
while ( $arrpd = mysql_fetch_array($respd) )
{
if ( !strlen($arrpd['check']) ) continue;
$fname = get_input_name ( $arrpd );
$funcbody = $arrpd[check];
$func = create_function('$arg0′, $funcbody);
if ( !$func($p_arr[$fname]))
{
$add_on .= report_err( _t($arrpd['because'], $arrpd['min_length'],$arrpd['max_length']) );
}
}
$page = (!$add_on) ? $page : $page-1;
break;
break;
case 'done':
// fill array with POST values
$respd = db_res("SELECT * FROM ProfilesDesc WHERE `visible` & 2 AND ( FIND_IN_SET('0′,show_on_page) OR FIND_IN_SET('".(int)$_page['name_index']."',show_on_page)) $join_page_check_limit ORDER BY `order` ASC");
while ( $arrpd = mysql_fetch_array($respd) )
{
$fname = get_input_name( $arrpd );
switch ( $arrpd['type'] )
{
case 'set': // set of checkboxes
$vals = preg_split ("/[,\'] /", $arrpd['extra'], -1, PREG_SPLIT_NO_EMPTY);
$p_arr[$fname] = ";
foreach ( $vals as $v )
{
if ( strlen(trim($v)) ';
$p_arr[$fname."_".$v] = process_pass_data($_POST[$fname."_".$v]);
if ( $_POST[$fname."_".$v] == 'on' )
{
if ( strlen($p_arr[$fname]) )
$p_arr[$fname] .= ",$v";
else
$p_arr[$fname] .= $v;
}
}
break;
case 'date':
$p_arr[$fname] = sprintf("d-d-d",
(int)$_POST[$fname . '_year'],
(int)$_POST[$fname . '_month'],
(int)$_POST[$fname . '_day']
);
$hidden_vals .= ";
$hidden_vals .= ";
$hidden_vals .= ";
break;
default:
if ( $arrpd['get_value'] )
{
$funcbody = $arrpd['get_value'];
$func = create_function('$arg0′,$funcbody);
$hidden_vals .= ";
$p_arr[$fname] = process_pass_data($func($_POST));
}
else
{
$hidden_vals .= ";
$p_arr[$fname] = process_pass_data($_POST[$fname]);
}
break;
}
}
// check values
if ( $enable_security_image )
{
if (!isset($_POST['securityImageValue']) || !isset($_SESSION['strSec']) || md5($_POST['securityImageValue']) != $_SESSION['strSec'])
{
$page = $join_pages_num;
$add_on .= report_err ( _t("_SIMG_ERR") );
}
}
$respd = db_res("SELECT * FROM ProfilesDesc WHERE `visible` & 2 AND ( FIND_IN_SET('0′,show_on_page) OR FIND_IN_SET('".(int)$_page['name_index']."',show_on_page)) $join_page_check_limit AND `join_page` > 0 ORDER BY `order` ASC");
while ( $arrpd = mysql_fetch_array($respd) )
{
if ( !strlen(trim($arrpd['check'])) ) continue;
$fname = get_input_name ( $arrpd );
$funcbody = $arrpd['check'];
$func = create_function('$arg0′, $funcbody);
if ( !$func($p_arr[$fname]))
{
$page = floor($arrpd['join_page'] / 1000);
$add_on .= report_err( _t($arrpd['because'], $arrpd['min_length'], $arrpd['max_length']) );
}
}
break;
default:
break;
}
switch( $page )
{
default:
global $tmpl;
if( $oTemplConfig -> customize['join_page']['showPageText'] )
$page_text = _t( "_JOIN1″, $page );
echo $add_on;
break;
}
switch ( $page )
{
case 'done':
// new profile creation
$cl_values = "INSERT INTO `Profiles` SET ";
$cl_first = 0;
$respd = db_res("SELECT * FROM ProfilesDesc WHERE `visible` & 2 AND `to_db` = 1 AND ( FIND_IN_SET('0′,show_on_page) OR FIND_IN_SET('".(int)$_page['name_index']."',show_on_page)) $join_page_check_limit ORDER BY `order` ASC");
while ( $arrpd = mysql_fetch_array($respd) )
{
$fname = get_input_name( $arrpd );
$dbname = get_field_name( $arrpd );
$fval = $p_arr[$fname];
if ($dbname == 'zip')
$fval = strtoupper( str_replace(' ', ", $fval) );
switch ( $arrpd['type'] )
{
case 'set': // set of checkboxes
case 'r': // reference to array for combo box
case 'a': // text Area
case 'c': // input box
case 'rb': // radio buttons
case 'e': // enum combo box
case 'en': // enum combo box with numbers
case 'eny': // enum combo box with numbers
case 'date': // date
$fval = process_db_input( $fval, 0, 1 );
$cl_values .= " `$dbname` = '$fval'";
$cl_values .= ", ";
break;
case 'p':
$fval = md5( process_pass_data( $fval ) );
$cl_values .= " `$dbname` = '$fval'";
$cl_values .= ", ";
break;
}
}
$cl_values .= " `LastReg` = NOW()";
db_res($cl_values);
$IDnormal = mysql_insert_id();
$IDcrypt = crypt( $IDnormal, "secret_string" ); // encrypted ID for security purposes
setcookie( "IDc", $IDcrypt, 0 , "/" );
$_COOKIE['IDc'] = $IDcrypt;
// Affiliate and friend checking
if ( $en_aff && $_COOKIE['idAff'] )
{
$res = db_res("SELECT `ID` FROM `aff` WHERE `ID` = {$_COOKIE['idAff']} AND `Status` = 'active'");
if ( mysql_num_rows( $res ) )
{
$res = db_res("INSERT INTO `aff_members` (`idAff`,`idProfile`) VALUES ({$_COOKIE['idAff']}, $IDnormal)");
}
}
if ( $en_aff && $_COOKIE['idFriend'] )
{
$idFriend = getID( $_COOKIE['idFriend'] );
if ( $idFriend )
{
$res = db_res( "UPDATE `Profiles` SET `aff_num` = `aff_num` 1 WHERE `ID` = '$idFriend'" );
createUserDataFile( $idFriend );
}
}
if ( strcmp( crypt( $IDnormal, 'secret_string' ), $_COOKIE['IDc'] ) != 0 )
{
ob_end_clean();
$_page['header'] = _t( "_Error" );
$ret = "";
$ret .= _t( "_MUST_HAVE_COOKIES" );
$ret .= "";
return $ret;
}
/* scc MOD: default friend */
$dump = db_res("INSERT INTO FriendList SET `ID` = '{$IDnormal}', `Profile` = 1, `Check` = 1″);
/* scc end MOD */
if ( getParam('autoApproval_ifNoConfEmail') == 'on' )
{
if ( getParam('autoApproval_ifJoin') )
{
db_res("UPDATE `Profiles` SET `Status`='Active' WHERE `ID`='{$IDnormal}'");
$page_text = _t( "_USER_ACTIVATION_SUCCEEDED" ) . $ret . $add_on;
$message = getParam("t_Activation");
$subject = getParam('t_Activation_subject');
sendMail( $p_arr['Email'], $subject, $message, $IDnormal );
}
else
{
db_res("UPDATE `Profiles` SET `Status`='Approval' WHERE `ID`='{$IDnormal}'");
$page_text = _t( "_USER_CONF_SUCCEEDED" ) . $add_on;
}
if ( $newusernotify )
{
$message =
"New user {$p_arr['NickName']} with email {$p_arr['Email']} has been confirmed,
his/her ID is {$IDnormal}.
–
{$site['title']} mail delivery system
";
$subject = "New user confirmed";
sendMail( $site['email_notify'], $subject, $message );
}
}
else
{
$page_text = _t( "_JOIN3″ ) . $add_on;
$page_text .= activation_mail( $IDnormal );
$page_text .= "" . _t( "_UPLOAD_WHILE_WAITING", $site['url'] ) . "";
}
modules_add($IDnormal);
if ( !$autoApproval_ifJoin )
modules_block($IDnormal);
createUserDataFile( $IDnormal );
// ———————————————————-
echo "";
echo "";
echo "$page_text";
break;
default:
echo "";
echo "";
//———————————————————–
do
{
$join_page_limit = ('done' == $page ) ? " AND join_page > '" . ($join_pages_num * 1000) . "'" :
" AND join_page > '" . ($page * 1000) . "' AND join_page '" . ($join_pages_num * 1000) . "'" :
" AND join_page > '" . ($page * 1000) . "' AND join_page ";
//———————————————————–
echo "
" : ">") . "
$hidden_vals
$page_text
";
$first_row = 1;
$respd = db_res("SELECT * FROM ProfilesDesc
WHERE `visible` & 2 AND ( FIND_IN_SET('0′,show_on_page) OR FIND_IN_SET('".(int)$_page['name_index']."',show_on_page)) $join_page_limit
ORDER BY `join_page` ASC");
if( $oTemplConfig -> customize['join_page']['show_3rd_col'] )
$columns = 3;
else
$columns = 2;
while ( $arrpd = mysql_fetch_array($respd) )
{
$fname = get_input_name( $arrpd );
if ( $arrpd['get_value'] && $arrpd['to_db'] == 0 )
{
$funcbody = $arrpd['get_value'];
$func = create_function('$arg0′,$funcbody);
$p_arr[$fname] = $func($p_arr);
}
$not_first_row = 0;
switch ($arrpd['type'])
{
case 'set': // set of checkboxes
echo print_row_set ( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
case 'rb': // radio buttons
echo print_row_radio_button ( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
case 'r': // reference to array for combo box
if ( $fname == 'Country' )
{
$onchange = "flagImage = document.getElementById('flagImageId'); flagImage.src = '{$site['flags']}' this.value.toLowerCase() '.gif';";
if ( strlen($p_arr[$fname]) == 0 )
$p_arr[$fname] = getParam( 'default_country' );
$imagecode = ";
}
else
{
$onchange = ";
$imagecode = ";
}
echo print_row_ref ( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns, ", 0, $onchange, $imagecode );
break;
case '0′: // divider
echo print_row_delim( $first_row, $arrpd, "panel", $columns );
$not_first_row = 1;
$first_row = 1;
break;
case 'e': // enum combo box
echo print_row_enum( $first_row, $arrpd, $p_arr[$fname], "table", $javascript, 0 );
break;
case 'en': // enum combo box with numbers
echo print_row_enum_n( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
case 'eny': // enum combo box with years
echo print_row_enum_years( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
case 'date': //date
echo print_row_date( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
case 'a': // text Area
echo print_row_area( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
case 'c': // input box
echo print_row_edit( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
case 'p': // input box password
echo print_row_pwd( $first_row, $arrpd, $p_arr[$fname], "table", 0, $columns );
break;
default:
$not_first_row = 1;
break;
}
if ( !$not_first_row && $first_row == 1 )
$first_row = 0;
}
echo "";
// show on the last page of join form
if ( $join_pages_num == $page )
{
?>
');
return false;
}
–>
\n";
if ( $enable_security_image )
{
echo "
" .
_t( "_Enter what you see:" ) . "";
}
echo "";
$ret =
function id_registration()
{
oCheckBox = document.getElementById( "boonex_id" );
if( oCheckBox.checked )
window.open( 'http://www.boonex.com/id/', ", 'width=800, height=600, menubar=yes, status=yes, resizable=yes, scrollbars=yes, toolbar=yes, location=yes')
}
ID;
echo $ret;
echo "
" . _t("_I AGREE", $site['url']) . " \n";
// BoonEx ID implementation
// " . _t("_ID_CREATE", "http://www.boonex.com/id/" ) . " ";
}
echo "";
break;
}
global $memberID;
echo "";
echo "";
echo "";
echo "";
$action = "login";
$text = _t( '_Member Login' );
$table = "Profiles";
$login_page = "{$site['url']}member.php";
$join_page = "{$site['url']}join_form.php";
$forgot_page = "{$site['url']}forgot.php";
$template = "{$dir['root']}templates/tmpl_{$tmpl}/join_login_form.html";
echo LoginForm( $text,$action,$table,$login_page,$forgot_page,$template );
echo "";
if( getParam( 'enable_get_boonex_id' ) )
{
echo "";
$action = "boonex";
$text = " . _t( '_Import BoonEx ID' ) . ";
$table = "Profiles";
$login_page = "{$site['url']}member.php";
$join_page = "{$site['url']}join_form.php";
$forgot_page = ";
$template = "{$dir['root']}templates/tmpl_{$tmpl}/join_login_form.html";
echo LoginForm( $text,$action,$table,$login_page,$forgot_page,$template );
echo "";
}
echo "";
$ret = ob_get_clean();
return $ret;
}
/**
* print error message
*/
function report_err( $str )
{
return "" . _t( "_Error" ) . ": $str";
}
function LoginForm( $text, $action, $table, $login_page, $forgot_page, $template = " )
{
global $site;
global $dir;
global $tmpl;
$aFormReplace = array();
$name_label = _t("_Nickname");
$aFormReplace['header_text'] = $site['title'] . ' ' . $mem . ' Login';
if( $action == "login" )
{
$aFormReplace['warning_text'] = $text;
$aFormReplace['submit_label'] = _t("_Log In");
$aFormReplace['form_onsubmit'] = 'return true;';
}
elseif( $action == 'boonex' )
{
$aFormReplace['warning_text'] = $text .
" .
'' .
_t( '_Get BoonEx ID' ) .
''.
";
$aFormReplace['submit_label'] = _t("_Import");
$aFormReplace['form_onsubmit'] = 'getBoonexId( this, document.forms.jform ); return false;';
}
$aFormReplace['action_url'] = $login_page;
$aFormReplace['relocate_url'] = $_SERVER['PHP_SELF'];
$aFormReplace['name_label'] = $name_label;
$aFormReplace['password_label'] = _t("_Password");
if( $forgot_page )
{
$aFormReplace['forgot_page_url'] = $forgot_page;
$aFormReplace['forgot_label'] = _t("_forgot_your_password") . '?';
}
else
{
$aFormReplace['forgot_page_url'] = ";
$aFormReplace['forgot_label'] = ";
}
if( !strlen( $template ) )
$template = "{$dir['root']}templates/tmpl_{$tmpl}/join_login_form.html";
$ret = file_get_contents( $template );
foreach( $aFormReplace as $key => $val )
$ret = str_replace( "__{$key}__", $val, $ret );
return $ret;
}
?>
Alright, guys & gals…
the line of code should read:
$dump = db_res("INSERT INTO FriendList SET `ID` = '{$IDnormal}', `Profile` = 1, `Check` = 1?);
This should do it.
Hello CoderSteve,
How are you? I would love to use your Mod but I am worried if I have the correct information. my site is running perfectly so I am being very careful about what I do.
I have noticed that the difference in the code you've posted is
12/02/07 original posting: 'check' = 1″)
01/02/08 posting: 'check' = 1?)
The ending is the difference. Which is correct?
Sincerely,
Ron
Hi Ron,
Go with the one I posted on 1/2/2008. As always, make a backup copy of your original php file, and make sure you swap the files during wee hours when there is least activity on your site =).
Thanks,
Steve
Hello Steve,
How are you? I backed up my join.php as instructed, modified a copy, and received an error when I performed a test. I went back in and changed that ending 'check' = 1?) back to a 'check' = 1″) and it worked perfected! Thank you. Also, I have Dolphin version 6.0.0002 installed.
My Dolphin-based web site is a creative community open to everyone, including models and photographers, writers and editors, singers and dancers, and programmers and code writers. It would be my please if you'd take a moment and check it out. I'm sure you'll want to join, and you are most welcome.
Ron
The Bleu Phoenix Creative Society
http://bleuphoenix.net
hi thanks for the free mod it works great
Hi, I'm receiving a database query error when I try to sign up using this mod.
It doesn't work for me with either version??? Same error about line 378???
Hi! I totally love you, i was looking for a mod like this, you rock! And free! OMG!
Is it true this won't work properly if someone has a lot of friends, due to lack of pagination of the friends list in Dolphin? I'd love to try and get this to work, but don't want to slow my site right down.
Hm I just can make it work for some reason, I'm always getting an error. Can someone help, I'm using 6.0.0003 version.
If someone has a working join file for this version maybe you can send it to me at cobo1981@gmail.com , I would be very grateful
Angela,
This MOD will not go back to your existing members and make admin a friend. The MOD will only work on new members.
Goran,
Here is the join file with the MOD included:
http://winehappy.com/join_form.txt
Back up your join_form.php, download join_form.txt, rename to join_form.php and drop it in your site and it should work.
Hi, thanks for the reply. I managed to get this to work now, but I had to do it using the snipped from your uncluded text page. For some reason the code you provide in your download gives a syntax error!
Anyway, thanks for this…it's just what I needed!
Thanks for this free mod! Any clue on how to actually make my profile pages show up?
Hi everyone, does this mod work with Dolphin 6.0.0005?
I was wondering if you would happen to have this mod for version 6.1? Thanks for the great mod, it worked great on 6.0.0005…
Hi! This doesn't appear to work with the new version 6.1.1. Any plans to update? Thanks!
Hi there. I'm using Dolphin 6.1.1. There is no join_form.php for this version. However, the line of code:
if ( getParam('autoApproval_ifNoConfEmail') == 'on' )
is found in a totally different file: BxDolProfilesController.php. When I try to insert the code you mentioned, my site will go blank when I try to join. Does this mean that the code will not work in 6.1.1 at all?