PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Usersuche nach eMail-Addy



Bonian
25.11.2007, 20:34
HIho ;)

Ich hab zur Zeit die einfache Usersuche nach Klamm-ID.

(Ich glaube!, dass ich die Usersuchen ausm DL Bereich habe (Klick! (http://designerscripte.net/downloads.php?do=file&id=78))

Da allerdings immer mal wieder ein paar Supportanfragen kommen, die ohne Klamm-ID sind, wäre es für mich ganz hilfreich den User auch anhand seiner Emailadresse zu "identifizieren".

Weiß jemand, wie man die Usersuche so erweitern könnte?

dude32
25.11.2007, 20:52
mit dieser version kannst du user nach ID, Nick und Email suchen
gabs mal im dl bereich zu wbb zeiten

<?
//Variablen
$gfx_status[0] = '<img src="images/gelb.gif" width="15" height="15" border="0" alt="Account nicht freigeschaltet">';
$gfx_status[1] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="Account aktiviert">';
$gfx_status[2] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="Account gesperrt">';

$aus_status[0] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="Auszahlung gesperrt">';
$aus_status[1] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="Auszahlung aktiviert">';

$emp_status[0] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="NL deaktiviert">&nbsp;/&nbsp;<img src="images/rot.gif" width="15" height="15" border="0" alt="PM deaktiviert">';
$emp_status[1] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="NL aktiviert">&nbsp;/&nbsp;<img src="images/rot.gif" width="15" height="15" border="0" alt="PM deaktiviert">';
$emp_status[2] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="NL deaktiviert">&nbsp;/&nbsp;<img src="images/gruen.gif" width="15" height="15" border="0" alt="PM aktiviert">';
$emp_status[3] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="NL aktiviert">&nbsp;/&nbsp;<img src="images/gruen.gif" width="15" height="15" border="0" alt="PM aktiviert">';

$coltestresult = array();

//prüfen auf vorhandensein (falls andere Spaltennamen oder Tabellennamen benutzt werden anpassen)
$coltest1 = db_query("show columns from ".$db_prefix."_userdaten like 'a_free'");
if (mysql_num_rows($coltest1) > 0) $coltestresult[1] = true;
else $coltestresult[1] = false;

$coltest2 = db_query("show columns from ".$db_prefix."_userdaten like 'nickname'");
if (mysql_num_rows($coltest2) > 0) $coltestresult[2] = true;
else $coltestresult[2] = false;

$coltest3 = db_query("SHOW TABLES LIKE 'laendercode'");
if (mysql_num_rows($coltest3) > 0) $coltestresult[3] = true;
else $coltestresult[3] = false;

//Functionen
Function list_searchresult(){
global $gfx_status, $aus_status, $emp_status, $coltestresult, $kontodaten, $userdaten, $emaildaten, $land;
$tmp_searchresult = '<tr bgcolor="#f0f0f0">
<td align="center"><a href="?content=/usersystem/userbearbeiten&uid='.$kontodaten['uid'].'" target="_self">'.$gfx_status[$kontodaten['status']].'</a></td>';
if($coltestresult[1] == true) $tmp_searchresult .= '<td align="center"><a href="?content=/usersystem/userbearbeiten&uid='.$kontodaten['uid'].'" target="_self">'.$aus_status[$userdaten['a_free']].'</a></td>';
$tmp_searchresult .= '<td align="center"><a href="http://www.klamm.de/partner/unter_nickpage.php?directsearch='.$kontodaten['uid'].'" target="_blank">'.$kontodaten['uid'].'</a></td>';
if($coltestresult[2] == true) $tmp_searchresult .= '<td align="center"><a href="http://www.klamm.de/partner/unter_nickpage.php?directsearch='.$kontodaten['uid'].'" target="_blank">'.$userdaten['nickname'].'</a></td>';
$tmp_searchresult .= '<td align="center"><a href="?content=/usersystem/buchungen&uid='.$kontodaten['uid'].'">'.number_format($kontodaten['kontostand'],2,",",".").'</a></td>
<td align="center">'.$userdaten['vorname'].' '.$userdaten['nachname'].'</td>
<td align="center">'.$emaildaten['emailadresse'].'&nbsp;/&nbsp;'.$emp_status[$emaildaten['freigabe_fuer']].'</td>
<td align="center">'.date("d.m.y - H:i",$userdaten['angemeldet_seit']).'</td>';
if($coltestresult[3] == true) $tmp_searchresult .= '<td align="center">'.$land.'</td>';
$tmp_searchresult .= '<td align="center">'.$kontodaten['klicks'].'</td>
</tr>';
return $tmp_searchresult;
}
Function list_header(){
global $coltestresult;
$tmp_header = '<br><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#c0c0c0">
<tr bgcolor="#c0c0c0">
<td align="center"><b>Stat</b></td>';
if($coltestresult[1] == true) $tmp_header .= '<td align="center"><b>Ausz.</b></td>';
$tmp_header .= '<td align="center"><b>ID</b></td>';
if($coltestresult[2] == true) $tmp_header .= '<td align="center"><b>Nick</b></td>';
$tmp_header .= '<td align="center"><b>Konto</b></td>
<td align="center"><b>Name</b></td>
<td align="center"><b>Emailadresse/NL/PM</b></td>
<td align="center"><b>Angemeldet</b></td>';
if($coltestresult[3] == true) $tmp_header .= '<td align="center"><b>Land</b></td>';
$tmp_header .= '<td align="center"><b>Klicks</b></td>
</tr>';
return $tmp_header;
}
Function list_noresult(){
$tmp_noresult = '<br><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#c0c0c0">
<tr bgcolor="#c0c0c0">
<td align="center">Nichts gefunden :(</td>
</tr>';
return $tmp_noresult;
}

if (!isset($_POST['searchvalue'])) $_POST['searchvalue'] = '';
if (!isset($_POST['searchtyp'])) $_POST['searchtyp'] = '';

if ($_POST['searchvalue'] != '' && $_POST['searchtyp'] != ''){
// werte übernehmen
$seldropdown[$_POST['searchtyp']] = " selected";

// Suche nach Userid
if ($_POST['searchtyp'] == '1'){
$sqlsearch = db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid like '%".$_POST['searchvalue']."%'");
if (mysql_num_rows($sqlsearch) > 0){
$searchresult = list_header();
while ($kontodaten = mysql_fetch_array($sqlsearch)) {
$userdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid='".$kontodaten['uid']."'"));
$emaildaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE uid='".$kontodaten['uid']."'"));
if($coltestresult[3] == true){
$land = '';
if ($kontodaten['login_ip'] != ''){
$ccode_array = mysql_fetch_array(db_query("SELECT * FROM laendercode WHERE IP_FROM<=inet_aton('".$kontodaten['login_ip']."') AND IP_TO>=inet_aton('".$kontodaten['login_ip']."');"));
$land=$ccode_array['land'];
}
}
$searchresult .= list_searchresult();
}
}
else $searchresult = list_noresult();
}

// Suche nach Nickname
if ($_POST['searchtyp'] == '2'){
$sqlsearch = db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE nickname like '%".$_POST['searchvalue']."%'");
if (mysql_num_rows($sqlsearch) > 0){
$searchresult = list_header();
while ($userdaten = mysql_fetch_array($sqlsearch)) {
$kontodaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid='".$userdaten['uid']."'"));
$emaildaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE uid='".$userdaten['uid']."'"));
if($coltestresult[3] == true){
$land = '';
if ($kontodaten['login_ip'] != ''){
$ccode_array = mysql_fetch_array(db_query("SELECT * FROM laendercode WHERE IP_FROM<=inet_aton('".$kontodaten['login_ip']."') AND IP_TO>=inet_aton('".$kontodaten['login_ip']."');"));
$land=$ccode_array['land'];
}
}
$searchresult .= list_searchresult();
}
}
else $searchresult = list_noresult();
}

// Suche nach eMail
if ($_POST['searchtyp'] == '3'){
$sqlsearch = db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE emailadresse like '%".$_POST['searchvalue']."%'");
if (mysql_num_rows($sqlsearch) > 0){
$searchresult = list_header();
while ($emaildaten = mysql_fetch_array($sqlsearch)) {
$kontodaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid='".$emaildaten['uid']."'"));
$userdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid='".$emaildaten['uid']."'"));
if($coltestresult[3] == true){
$land = '';
if ($kontodaten['login_ip'] != ''){
$ccode_array = mysql_fetch_array(db_query("SELECT * FROM laendercode WHERE IP_FROM<=inet_aton('".$kontodaten['login_ip']."') AND IP_TO>=inet_aton('".$kontodaten['login_ip']."');"));
$land=$ccode_array['land'];
}
}
$searchresult .= list_searchresult();
}
}
else $searchresult = list_noresult();
}

$searchresult .= '</table>';
}
head("Usersuche Pro");?>
<form action="" method="post">
<div align="center"><select size="1" name="searchtyp"><option selected value="1"<?=$seldropdown[1];?>>Userid</option><?if($coltestresult[2] = true){?><option value="2"<?=$seldropdown[2];?>>Nickname</option><?}?><option value="3"<?=$seldropdown[3];?>>eMail</option></select>&nbsp;&nbsp;&nbsp;<input name="searchvalue" type="text" size="6" value="<?=$_POST['searchvalue'];?>">&nbsp;&nbsp;&nbsp;<input type="Submit" name="search" value="Suche starten"></div>
</form>
<?=$searchresult;?>
<?foot();?>

Bonian
26.11.2007, 18:48
THX ;)

Das ist genau, dass was ich suchte. Aber wo muss ich dass denn genau hochladen :oops:?

maniwelt
26.11.2007, 19:24
Speichere es einfach als usersuche.php in:

Adminforce - Content - unsersystem


Vorher dein altes sichern, falls was schief geht ;)

marcaust
30.12.2010, 03:18
Da es gesucht wurde, hier eine Variante die auch gesperrte User inkl. Hinweis anzeigten kann



<?
//Variablen
$gfx_status[0] = '<img src="images/gelb.gif" width="15" height="15" border="0" alt="Account nicht freigeschaltet">';
$gfx_status[1] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="Account aktiviert">';
$gfx_status[2] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="Account gesperrt">';

$aus_status[0] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="Auszahlung gesperrt">';
$aus_status[1] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="Auszahlung aktiviert">';

$emp_status[0] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="NL deaktiviert">&nbsp;/&nbsp;<img src="images/rot.gif" width="15" height="15" border="0" alt="PM deaktiviert">';
$emp_status[1] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="NL aktiviert">&nbsp;/&nbsp;<img src="images/rot.gif" width="15" height="15" border="0" alt="PM deaktiviert">';
$emp_status[2] = '<img src="images/rot.gif" width="15" height="15" border="0" alt="NL deaktiviert">&nbsp;/&nbsp;<img src="images/gruen.gif" width="15" height="15" border="0" alt="PM aktiviert">';
$emp_status[3] = '<img src="images/gruen.gif" width="15" height="15" border="0" alt="NL aktiviert">&nbsp;/&nbsp;<img src="images/gruen.gif" width="15" height="15" border="0" alt="PM aktiviert">';

$coltestresult = array();

//prüfen auf vorhandensein (falls andere Spaltennamen oder Tabellennamen benutzt werden anpassen)
$coltest1 = db_query("show columns from ".$db_prefix."_userdaten like 'a_free'");
if (mysql_num_rows($coltest1) > 0) $coltestresult[1] = true;
else $coltestresult[1] = false;

$coltest2 = db_query("show columns from ".$db_prefix."_userdaten like 'nickname'");
if (mysql_num_rows($coltest2) > 0) $coltestresult[2] = true;
else $coltestresult[2] = false;

$coltest3 = db_query("SHOW TABLES LIKE 'laendercode'");
if (mysql_num_rows($coltest3) > 0) $coltestresult[3] = true;
else $coltestresult[3] = false;

//Functionen
Function list_searchresult(){
global $gfx_status, $aus_status, $emp_status, $coltestresult, $kontodaten, $userdaten, $emaildaten, $land;
$tmp_searchresult = '<tr bgcolor="#f0f0f0">
<td align="center"><a href="?content=/usersystem/userbearbeiten&uid='.$kontodaten['uid'].'" rel="nofollow" target="_self">'.$gfx_status[$kontodaten['status']].'</a></td>';
if($coltestresult[1] == true) $tmp_searchresult .= '<td align="center"><a href="?content=/usersystem/userbearbeiten&uid='.$kontodaten['uid'].'" rel="nofollow" target="_self">'.$aus_status[$userdaten['a_free']].'</a></td>';
$tmp_searchresult .= '<td align="center"><a href="http://www.klamm.de/partner/unter_nickpage.php?directsearch='.$kontodaten['uid'].'" rel="nofollow" target="_blank">'.$kontodaten['uid'].'</a></td>';
if($coltestresult[2] == true) $tmp_searchresult .= '<td align="center"><a href="http://www.klamm.de/partner/unter_nickpage.php?directsearch='.$kontodaten['uid'].'" rel="nofollow" target="_blank">'.$userdaten['nickname'].'</a></td>';
$tmp_searchresult .= '<td align="center"><a href="?content=/usersystem/buchungen&uid='.$kontodaten['uid'].'">'.number_format($kontodaten['kontostand'],2,",",".").'</a></td>
<td align="center">'.$userdaten['vorname'].' '.$userdaten['nachname'].'</td>
<td align="center">'.$emaildaten['emailadresse'].'&nbsp;/&nbsp;'.$emp_status[$emaildaten['freigabe_fuer']].'</td>
<td align="center">'.date("d.m.y - H:i",$userdaten['angemeldet_seit']).'</td>';
if($coltestresult[3] == true) $tmp_searchresult .= '<td align="center">'.$land.'</td>';
$tmp_searchresult .= '<td align="center">'.$kontodaten['klicks'].'</td>';
$tmp_searchresult .= '<td align="center">'.$kontodaten['hinweis'].'</td>
</tr>';
return $tmp_searchresult;
}
Function list_header(){
global $coltestresult;
$tmp_header = '<br><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#c0c0c0">
<tr bgcolor="#c0c0c0">
<td align="center"><b>Stat</b></td>';
if($coltestresult[1] == true) $tmp_header .= '<td align="center"><b>Ausz.</b></td>';
$tmp_header .= '<td align="center"><b>ID</b></td>';
if($coltestresult[2] == true) $tmp_header .= '<td align="center"><b>Nick</b></td>';
$tmp_header .= '<td align="center"><b>Konto</b></td>
<td align="center"><b>Name</b></td>
<td align="center"><b>Emailadresse/NL/PM</b></td>
<td align="center"><b>Angemeldet</b></td>';
if($coltestresult[3] == true) $tmp_header .= '<td align="center"><b>Land</b></td>';
$tmp_header .= '<td align="center"><b>Klicks</b></td>
</tr>';
return $tmp_header;
}
Function list_noresult(){
$tmp_noresult = '<br><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#c0c0c0">
<tr bgcolor="#c0c0c0">
<td align="center">Nichts gefunden :(</td>
</tr>';
return $tmp_noresult;
}

if (!isset($_POST['searchvalue'])) $_POST['searchvalue'] = '';
if (!isset($_POST['searchtyp'])) $_POST['searchtyp'] = '';

if ($_POST['searchvalue'] != '' && $_POST['searchtyp'] != ''){
// werte übernehmen
$seldropdown[$_POST['searchtyp']] = " selected";

// Suche nach Userid
if ($_POST['searchtyp'] == '1'){
$sqlsearch = db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid like '%".$_POST['searchvalue']."%'");
if (mysql_num_rows($sqlsearch) > 0){
$searchresult = list_header();
while ($kontodaten = mysql_fetch_array($sqlsearch)) {
$userdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid='".$kontodaten['uid']."'"));
$emaildaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE uid='".$kontodaten['uid']."'"));
if($coltestresult[3] == true){
$land = '';
if ($kontodaten['login_ip'] != ''){
$ccode_array = mysql_fetch_array(db_query("SELECT * FROM laendercode WHERE IP_FROM<=inet_aton('".$kontodaten['login_ip']."') AND IP_TO>=inet_aton('".$kontodaten['login_ip']."');"));
$land=$ccode_array['land'];
}
}
$searchresult .= list_searchresult();
}
}
else $searchresult = list_noresult();
}

// Suche nach Nickname
if ($_POST['searchtyp'] == '2'){
$sqlsearch = db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE nickname like '%".$_POST['searchvalue']."%'");
if (mysql_num_rows($sqlsearch) > 0){
$searchresult = list_header();
while ($userdaten = mysql_fetch_array($sqlsearch)) {
$kontodaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid='".$userdaten['uid']."'"));
$emaildaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE uid='".$userdaten['uid']."'"));
if($coltestresult[3] == true){
$land = '';
if ($kontodaten['login_ip'] != ''){
$ccode_array = mysql_fetch_array(db_query("SELECT * FROM laendercode WHERE IP_FROM<=inet_aton('".$kontodaten['login_ip']."') AND IP_TO>=inet_aton('".$kontodaten['login_ip']."');"));
$land=$ccode_array['land'];
}
}
$searchresult .= list_searchresult();
}
}
else $searchresult = list_noresult();
}

// Suche nach eMail
if ($_POST['searchtyp'] == '3'){
$sqlsearch = db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE emailadresse like '%".$_POST['searchvalue']."%'");
if (mysql_num_rows($sqlsearch) > 0){
$searchresult = list_header();
while ($emaildaten = mysql_fetch_array($sqlsearch)) {
$kontodaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE uid='".$emaildaten['uid']."'"));
$userdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid='".$emaildaten['uid']."'"));
if($coltestresult[3] == true){
$land = '';
if ($kontodaten['login_ip'] != ''){
$ccode_array = mysql_fetch_array(db_query("SELECT * FROM laendercode WHERE IP_FROM<=inet_aton('".$kontodaten['login_ip']."') AND IP_TO>=inet_aton('".$kontodaten['login_ip']."');"));
$land=$ccode_array['land'];
}
}
$searchresult .= list_searchresult();
}
}
else $searchresult = list_noresult();
}

$searchresult .= '</table>';
}

//gesperrte User auflisten
if ($_POST['searchtyp'] == '4'){
$sqlsearch = db_query("SELECT * FROM ".$db_prefix."_kontodaten WHERE status = 2 ORDER BY uid ASC");
if (mysql_num_rows($sqlsearch) > 0){
$searchresult = list_header();
while ($kontodaten = mysql_fetch_array($sqlsearch)) {
$userdaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_userdaten WHERE uid='".$kontodaten['uid']."'"));
$emaildaten = mysql_fetch_array(db_query("SELECT * FROM ".$db_prefix."_emaildaten WHERE uid='".$kontodaten['uid']."'"));
if($coltestresult[3] == true){
$land = '';
if ($kontodaten['login_ip'] != ''){
$ccode_array = mysql_fetch_array(db_query("SELECT * FROM laendercode WHERE IP_FROM<=inet_aton('".$kontodaten['login_ip']."') AND IP_TO>=inet_aton('".$kontodaten['login_ip']."');"));
$land=$ccode_array['land'];
}
}
$searchresult .= list_searchresult();
}
}
else $searchresult = list_noresult();
}

head("Usersuche Pro");?>
<form action="" method="post">
<div align="center"><select size="1" name="searchtyp">
<option selected value="1"<?=$seldropdown[1];?>>Userid</option>
<?if($coltestresult[2] = true){?>
<option value="2"<?=$seldropdown[2];?>>Nickname</option><?}?>
<option value="3"<?=$seldropdown[3];?>>eMail</option>
<option value="4"<?=$seldropdown[4];?>>gesperrte User</option>
</select>&nbsp;&nbsp;&nbsp;<input name="searchvalue" type="text" size="6" value="<?=$_POST['searchvalue'];?>">&nbsp;&nbsp;&nbsp;<input type="Submit" name="search" value="Suche starten"></div>
</form>
<?=$searchresult;?>
<?foot();?>

DJschatz27
30.12.2010, 14:56
Danke marcaust das klappt sehr hilfreich

noch eine frage kann ich die funktion auch in die userliste im admin einfügen wenn ja was brauch ich alles dafür?

marcaust
30.12.2010, 17:38
ja, das geht

so auf Anhieb würde ich sagen indem du in der startseite.php vom Adminforce das:



<form action="suche.php" method="post">
<div align="center"><select size="1" name="searchtyp">
<option selected value="1">Userid</option>
<option value="2">Nickname</option>
<option value="3">eMail</option>
<option value="4">gesperrte User</option>
</select>&nbsp;&nbsp;&nbsp;<input name="searchvalue" type="text" size="6" value="">&nbsp;&nbsp;&nbsp;<input type="Submit" name="search" value="Suche starten"></div>
</form>


achte aber darauf das bei:
<form action="suche.php" method="post">
der richtige Dateiname für die Suche angegeben ist und der Pfad stimmt.

Allerdings: Ungetestet

DJschatz27
30.12.2010, 18:55
Und wieder ien Dankeschön hat geklappt :thumb: