Jump to content


Photo
- - - - -

Customize join form with search form


  • Please log in to reply
3 replies to this topic

#1 coutureleclerc

coutureleclerc

    Member

  • Customers
  • Pip
  • 9 posts

Posted 02 November 2009 - 11:20 PM

I would be good to have the possibility to add field in profile/join form for I can create a custom search.

Example, I would add field "language spoken" for I can create a search that allow user to find people who speak in the same language that them.

It would be wonderful!

#2 austingrd

austingrd

    Member

  • Banned
  • PipPipPip
  • 68 posts

Posted 20 July 2013 - 01:16 PM

Bumping this up please. Would be nice if this feature gets considered please.

#3 alexstorm

alexstorm

    Verified Member

  • Customers
  • PipPipPip
  • 623 posts

Posted 21 July 2013 - 09:04 PM

Language choice is handled through cookies. All languages are available to all users. There is no entry in the dbase when someone is using a particular language, so there is no data to transfer to allow this search.

You could search by country that the member puts in their profile, but I think only a few members do that. You could also search by IP addresses that belong to a country, but there is no easy way to do that and the IP is currently hidden for admin only.

So adding this feature would require custom new addition to the dbase as well as a question that members answer when they join.

#4 alexstorm

alexstorm

    Verified Member

  • Customers
  • PipPipPip
  • 623 posts

Posted 04 June 2014 - 04:46 PM

ATTENTION:  Much of the code below is a custom mod and WILL NOT WORK directly in your Clip-Share site until everything is tuned and tested.  Always backup your files and use names for any test files below with a beta version in the file name to test anything on a live site so the normal files continue to work.

 

Mod steps to make this happen:

  1. Add lang column to dbase table signup
  2. (Optional if you want the user to declare language at signup)  Add language question with pulldown options in /templates/signup.tpl
  3. (Optional) Declare and update language variable insert command for dbase code area under if ( $err == '') {
  4. Update and change language preferences in my_profile.php and templates/my_profile.tpl so the user can see and adjust their language preference.
  5. (Optional) Choose if you want to tie in the language preference to change automatically with the language translations of the site or not.  If yes, then pull the code from /templates/head1.tpl {$select_language} and make it work in signup.tpl and my_profile.tpl.  Otherwise, don't bother and let the user choose from the already active flag pull down.
  6. Make info available for other members to see in uprofile.php, members.php and their templates.
  7. Add a sort using switch ( $Category)  in members.php and sort links in /templates/members.tpl - Sort links are easier to create and use an include file "head_bottom/memextralnks.tpl"

Sample custom /head_bottom/memextralnks.tpl file that includes many sorts:

Language sort options are not in these samples.  You would have to add them.

<br> </br>
<a href="{seourl rewrite="community/$avatar/mr/$page" url="members.php?category=mr"}">{translate item='members.most_recent'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/rl/$page" url="members.php?category=rl"}">{translate item='members.recent_logon'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/mw/$page" url="members.php?category=mw"}">{translate item='members.most_videos_viewed'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/mp/$page" url="members.php?category=mp"}">{translate item='members.most_profile_views'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/mv/$page" url="members.php?category=mv"}">{translate item='members.most_videos'}</A>
<p> </p/>
<a href="{seourl rewrite="community/$avatar/lj/$page" url="members.php?category=lj"}">{translate item='members.longest_member'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/az/$page" url="members.php?category=az"}">A-Z</A>
<a href="{seourl rewrite="community/$avatar/nu/$page" url="members.php?category=nu"}">#</A>
<a href="{seourl rewrite="community/$avatar/aa/$page" url="members.php?category=aa"}">A</A>
<a href="{seourl rewrite="community/$avatar/bb/$page" url="members.php?category=bb"}">B</A>
<a href="{seourl rewrite="community/$avatar/cc/$page" url="members.php?category=cc"}">C</A>
<a href="{seourl rewrite="community/$avatar/dd/$page" url="members.php?category=dd"}">D</A>
<a href="{seourl rewrite="community/$avatar/ee/$page" url="members.php?category=ee"}">E</A>
<a href="{seourl rewrite="community/$avatar/ff/$page" url="members.php?category=ff"}">F</A>
<a href="{seourl rewrite="community/$avatar/gg/$page" url="members.php?category=gg"}">G</A>
<a href="{seourl rewrite="community/$avatar/hh/$page" url="members.php?category=hh"}">H</A>
<a href="{seourl rewrite="community/$avatar/ii/$page" url="members.php?category=ii"}">I</A>
<a href="{seourl rewrite="community/$avatar/jj/$page" url="members.php?category=jj"}">J</A>
<a href="{seourl rewrite="community/$avatar/kk/$page" url="members.php?category=kk"}">K</A>
<a href="{seourl rewrite="community/$avatar/ll/$page" url="members.php?category=ll"}">L</A>
<a href="{seourl rewrite="community/$avatar/mm/$page" url="members.php?category=mm"}">M</A>
<a href="{seourl rewrite="community/$avatar/nn/$page" url="members.php?category=nn"}">N</A>
<a href="{seourl rewrite="community/$avatar/oo/$page" url="members.php?category=oo"}">O</A>
<a href="{seourl rewrite="community/$avatar/pp/$page" url="members.php?category=pp"}">P</A>
<a href="{seourl rewrite="community/$avatar/qq/$page" url="members.php?category=qqrr"}">Q</A>
<a href="{seourl rewrite="community/$avatar/rr/$page" url="members.php?category="}">R</A>
<a href="{seourl rewrite="community/$avatar/ss/$page" url="members.php?category=ss"}">S</A>
<a href="{seourl rewrite="community/$avatar/tt/$page" url="members.php?category=tt"}">T</A>
<a href="{seourl rewrite="community/$avatar/uu/$page" url="members.php?category=uu"}">U</A>
<a href="{seourl rewrite="community/$avatar/vv/$page" url="members.php?category=vv"}">V</A>
<a href="{seourl rewrite="community/$avatar/ww/$page" url="members.php?category=ww"}">W</A>
<a href="{seourl rewrite="community/$avatar/xx/$page" url="members.php?category=xx"}">X</A>
<a href="{seourl rewrite="community/$avatar/yy/$page" url="members.php?category=yy"}">Y</A>
<a href="{seourl rewrite="community/$avatar/zz/$page" url="members.php?category=zz"}">Z</A>
<a href="{seourl rewrite="community/$avatar/za/$page" url="members.php?category=za"}">Z-A</a>
<p> </p/>
<a href="{seourl rewrite="community/$avatar/ma/$page" url="members.phpcategory=ma?"}">{translate item='members.male'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/ms/$page" url="members.phpcategory=ms?"}">{translate item='members.single'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/mt/$page" url="members.phpcategory=mt?"}">{translate item='members.taken'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/mo/$page" url="members.phpcategory=mo?"}">{translate item='members.open'}</A>
<font color="gray"> &nbsp; &nbsp; &nbsp; </font>
<a href="{seourl rewrite="community/$avatar/fe/$page" url="members.php?category=fe"}">{translate item='members.female'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/fs/$page" url="members.php?category=fs"}">{translate item='members.single'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/ft/$page" url="members.php?category=ft"}">{translate item='members.taken'}</A>
<font color="gray"> |</font>
<a href="{seourl rewrite="community/$avatar/fo/$page" url="members.php?category=fo"}">{translate item='members.open'}</A>
 

These sort have to be setup in custom members.php example:

<?php
require('include/config.php');
require('include/function.php');
require('classes/pagination.class.php');
require('language/' .$_SESSION['language']. '/members.lang.php');
require('language/' .$_SESSION['language']. '/index.lang.php');
$category 	= ( isset($_REQUEST['category']) && strlen($_REQUEST['category']) == 2 ) ? $_REQUEST['category'] : 'rj';
$uid 	= mysql_real_escape_string($_SESSION['UID']);

switch ( $category ) {
case 'rl':
$sql_add	= " ORDER BY logintime DESC";
$st='Recent Login';
break;
case 'mw':
$sql_add	= " ORDER BY video_viewed DESC";
$st='Most Videos Viewed';
break;
case 'mp':
$sql_add	= " ORDER BY profile_viewed DESC";
$st='Most Profile Views';
break;
case 'lj':
$sql_add	= " ORDER BY UID";
$st='Longest Membership';
break;
case 'ma':
$sql_add	= " and gender ='Male' ORDER BY username";
$st='Male';
break;
case 'ms':
$sql_add	= " and gender ='Male' and relation='Single' ORDER BY logintime Desc";
$st='Male & Single';
break;
case 'mt':
$sql_add	= " and gender ='Male' and relation='Taken' ORDER BY logintime Desc";
$st='Male & Taken';
break;
case 'mo':
$sql_add	= " and gender ='Male' and relation='Open' ORDER BY logintime Desc";
$st='Male & Open';
break;
case 'fe':
$sql_add	= " and gender ='Female' ORDER BY username";
$st='Female';
break;
case 'fs':
$sql_add	= " and gender ='Female' and relation='Single' ORDER BY logintime Desc";
$st='Female & Single';
break;
case 'ft':
$sql_add	= " and gender ='Female' and relation='Taken' ORDER BY logintime Desc";
$st='Female & Taken';
break;
case 'fo':
$sql_add	= " and gender ='Female' and relation='Open' ORDER BY logintime Desc";
$st='Female & Open';
break;
case 'aa':
$sql_add	= " AND username REGEXP '^[aA].*$' Order by username";
$st='A';
break;
case 'bb':
$sql_add	= " AND username REGEXP '^[bB].*$' Order by username";
$st='B';
break;
case 'cc':
$sql_add	= " AND username REGEXP '^[cC].*$' Order by username";
$st='C';
break;
case 'dd':
$sql_add	= " AND username REGEXP '^[dD].*$' Order by username";
$st='D';
break;
case 'ee':
$sql_add	= " AND username REGEXP '^[eE].*$' Order by username";
$st='E';
break;
case 'ff':
$sql_add	= " AND username REGEXP '^[fF].*$' Order by username";
$st='F';
break;
case 'gg':
$sql_add	= " AND username REGEXP '^[gG].*$' Order by username";
$st='G';
break;
case 'hh':
$sql_add	= " AND username REGEXP '^[hH].*$' Order by username";
$st='H';
break;
case 'ii':
$sql_add	= " AND username REGEXP '^[iI].*$' Order by username";
$st='I';
break;
case 'jj':
$sql_add	= " AND username REGEXP '^[jJ].*$' Order by username";
$st='J';
break;
case 'kk':
$sql_add	= " AND username REGEXP '^[kK].*$' Order by username";
$st='K';
break;
case 'll':
$sql_add	= " AND username REGEXP '^[lL].*$' Order by username";
$st='L';
break;
case 'mm':
$sql_add	= " AND username REGEXP '^[mM].*$' Order by username";
$st='M';
break;
case 'nn':
$sql_add	= " AND username REGEXP '^[nN].*$' Order by username";
$st='N';
break;
case 'oo':
$sql_add	= " AND username REGEXP '^[oO].*$' Order by username";
$st='O';
break;
case 'pp':
$sql_add	= " AND username REGEXP '^[pP].*$' Order by username";
$st='P';
break;
case 'qq':
$sql_add	= " AND username REGEXP '^[qQ].*$' Order by username";
$st='Q';
break;
case 'rr':
$sql_add	= " AND username REGEXP '^[rR].*$' Order by username";
$st='R';
break;
case 'ss':
$sql_add	= " AND username REGEXP '^[sS].*$' Order by username";
$st='S';
break;
case 'tt':
$sql_add	= " AND username REGEXP '^[tT].*$' Order by username";
$st='T';
break;
case 'uu':
$sql_add	= " AND username REGEXP '^[uU].*$' Order by username";
$st='U';
break;
case 'vv':
$sql_add	= " AND username REGEXP '^[vV].*$' Order by username";
$st='V';
break;
case 'ww':
$sql_add	= " AND username REGEXP '^[wW].*$' Order by username";
$st='W';
break;
case 'xx':
$sql_add	= " AND username REGEXP '^[xX].*$' Order by username";
$st='X';
break;
case 'yy':
$sql_add	= " AND username REGEXP '^[yY].*$' Order by username";
$st='Y';
break;
case 'zz':
$sql_add	= " AND username REGEXP '^[zZ].*$' Order by username";
$st='Z';
break;
case 'nu':
$sql_add	= " AND username REGEXP '^[0-9].*$' Order by username";
$st='#';
break;
case 'az':
$sql_add	= " ORDER BY username";
$st='A-Z (alpha)';
break;
case 'za':
$sql_add	= " ORDER BY username DESC";
$st='Z-A (alpha)';
break;
case 'mv':
$st='Most Videos';
break;
default:
case 'rj':
$sql_add	= " ORDER BY UID DESC";
$st='Most Recent';
break;
}

$placement      = NULL;
$page           = ( isset($_REQUEST['page']) && is_numeric($_REQUEST['page']) ) ? $_REQUEST['page'] : 1;
$type           = ( isset($_REQUEST['type']) && $_REQUEST['type'] == 'avatar' ) ? 'avatar' : NULL;

if ($category == 'mv') {
	$sql_av        = ( $type ) ? " AND s.photo != ''" : NULL;
	$sql_count      = "SELECT count(s.UID) as total_users FROM signup as s left join video as v on s.UID=v.UID WHERE s.account_status = 'Active' and s.emailverified = 'yes' " .$sql_av. " group by s.UID having count(v.VID) > 0";
	$ars            = $conn->execute($sql_count);
	$total          = $ars->fields['total_users'];
	STemplate::assign('total',$total);
	$pagination     = new Pagination($config['items_per_page']);
	$limit          = $pagination->getLimit($total);
	$sql            = "SELECT *, count(VID) as tvids from video as v left join signup as s on s.UID=v.UID WHERE s.account_status = 'Active' AND s.emailverified = 'yes' " .$sql_av. " group by v.UID having count(v.VID) > 0 order by count(v.VID) DESC LIMIT " .$limit;
	$rs             = $conn->execute($sql);
	$users          = $rs->getrows();
	$pagination_add = ( $type ) ? 'avatar/' : NULL;
	$pagination_url = $config['BASE_URL']. '/community/' .$pagination_add.  $category.'/{#PAGE#}';
	$page_link      = $pagination->getPagination($pagination_url);
	$start_num      = $pagination->getStartItem();
	$end_num        = $pagination->getEndItem();
	$tvids          = $rs->fields['tvids'];
	STemplate::assign('tvids', $tvids);
}
else {
	$sql_av        = ( $type ) ? " AND photo != ''" : NULL;
	$sql_count      = "SELECT count(UID) AS total_users FROM signup WHERE account_status = 'Active' and emailverified = 'yes'" .$sql_av. $sql_add;
	$rs             = $conn->execute($sql_count);
	$total          = $rs->fields['total_users'];
	STemplate::assign('total',$total);
	$pagination     = new Pagination(($config['items_per_page']/2)+2);
	$limit          = $pagination->getLimit($total);
	$sql            = "SELECT * FROM signup WHERE account_status = 'Active' and emailverified = 'yes'" .$sql_av. $sql_add." LIMIT " .$limit;
	$rs             = $conn->execute($sql);
	$users          = $rs->getrows();
	$pagination_add = ( $type ) ? 'avatar/' : NULL;
	$pagination_url = $config['BASE_URL']. '/community/' .$pagination_add. $category. '/{#PAGE#}';
	$page_link      = $pagination->getPagination($pagination_url);
	if ($total == 0) {
		$start_num = 0;
		$end_num = 0;
	}
	else {
		$start_num      = $pagination->getStartItem();
		$end_num         = $pagination->getEndItem();
	}
}



$sql_count	= "SELECT count(VID) AS total_videos FROM video WHERE UID = '" .mysql_real_escape_string($UID). "' AND type = '" .mysql_real_escape_string($type). "' AND active='1' ";
	$ars            = $conn->execute($sql_count);
    $total          = $ars->fields['total_videos'];

$sql        = "SELECT access, username FROM signup WHERE UID = '" .$uid. "' LIMIT 1";
$rs         = $conn->execute($sql);
$access   = $rs->fields['access'];
STemplate::assign('access', $access);
STemplate::assign('uname', $username);

$sql_tot      = "SELECT count(UID) as gtu FROM signup WHERE account_status = 'Active' and emailverified = 'yes'";
$crs          = $conn->execute($sql_tot);
$gtot         = $crs->fields['gtu'];
STemplate::assign('gtot',$gtot);

$n                ="- Members";
STemplate::assign('n',$n);
STemplate::assign('err',$err);
STemplate::assign('msg',$msg);
STemplate::assign('page',$page);
STemplate::assign('start_num',$start_num);
STemplate::assign('end_num',$end_num);
STemplate::assign('limit',$limit);
STemplate::assign('tmbnum',$limit);
STemplate::assign('placement',$placement);
STemplate::assign('page_link',$page_link);
STemplate::assign('category',$category);
STemplate::assign('sortyp',$st);
STemplate::assign('avatar',$type);
STemplate::assign('answers',$users);
STemplate::display('head1.tpl');
STemplate::display('err_msg.tpl');
STemplate::display('members.tpl');
STemplate::display('footer_ac.tpl');
STemplate::gzip_encode();
?>

.htaccess Rewrite Rules to make the Seourl work correctly.  They need to be inside the
 
<IfModule mod_rewrite.c>
RewriteEngine On
# Add RewiteRule here
</IfModule>
 
 
RewriteRule ^community/avatar/([a-z][a-z])/([0-9]+)$ members.php?type=avatar&category=$1&page=$2 [L]
RewriteRule ^community/([a-z][a-z])/([0-9]+)$ members.php?category=$1&page=$2 [L]
RewriteRule ^community/([a-z][a-z])$ members.php?category=$1&page=1 [L]
RewriteRule ^community/avatar/?$ members.php?type=avatar [L]
RewriteRule ^community$ members.php [L]

ATTENTION:  Much of the code above is a custom mod and WILL NOT WORK directly in your Clip-Share site until everything is tuned and tested.  Always backup your files and use names with a beta version in the file name to test anything on a live site so the normal files continue to work.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users