* @version DS-E V/2 */ //12.8.07: bio und long_bio zusammengelegt, evtl sind dadurch einige Abfragen überflüssig geworden $str_filename = basename(__FILE__); require_once('common.php'); require_once(LIB_PATH.'picture.lib.php'); $access_control->su_check(access_control::SU_RIGHT_BIOS,true); // Suchmaske $arr_form = array( 'account_id' =>'AccountID ODER Login,int', 'biotype' =>'Biotyp,enum,0,Alle,1,Standardbios,2,Verlängerte Bios,3,Tierbios,4,Knappenbios,5,Zusatzinfo,6,Goldpartner', 'biolocked' =>'Gesperrt?,enum,0,Alle,1,Nur ungesperrte,2,Nur gesperrte', 'message' =>'Stichwortsuche in Bios', 'orderby' =>'Sortieren nach,enum,biotime DESC,Letzter Edit absteigend,biotime ASC,Letzter Edit aufsteigend,acctid ASC,AcctID aufsteigend,acctid DESC,AcctID absteigend,name ASC,Name', 'results_per_page' =>'Ergebnisse pro Seite,enum,5,5,10,10,25,25,50,50,75,75,100,100' ); $arr_data = array( 'account_id' => $_REQUEST['account_id'], 'biotype' => (int)$_REQUEST['biotype'], 'biolocked' => (int)$_REQUEST['biolocked'], 'message' => $_REQUEST['message'], 'orderby' => (empty($_REQUEST['orderby']) ? 'acctid ASC' : substr($_REQUEST['orderby'],0,12)), 'results_per_page' => (empty($_REQUEST['results_per_page']) ? 5 : (int)$_REQUEST['results_per_page']) ); if( (int)$arr_data['account_id'] == 0 && !empty($arr_data['account_id']) ) { $arr_tmp = db_fetch_assoc(db_query('SELECT acctid FROM accounts WHERE login="'.$arr_data['account_id'].'" LIMIT 1')); if($arr_tmp['acctid'] > 0) { $arr_data['account_id'] = $arr_tmp['acctid']; } else { $arr_data['account_id'] = 0; } } // END Suchmaske page_header('Bio-Check'); output('`c`b`&Bio - Kontrolle`&`b`c`n`n'); // Grundnavi erstellen addnav('Zurück'); grotto_nav(); addnav('Aktionen'); addnav('Start',$str_filename); // END Grundnavi erstellen // Evtl. Fehler / Erfolgsmeldungen anzeigen if($session['message'] != '') { output('`n`b'.$session['message'].'`b`n`n'); $session['message'] = ''; } // END Evtl. Fehler / Erfolgsmeldungen anzeigen function show_bio_search () { global $str_filename,$arr_form,$arr_data,$str_type; $str_out = ''; $str_lnk = $str_filename.'?op=search'; addnav('',$str_lnk); $str_out .= '
'; // Suchmaske zeigen $str_out .= generateform($arr_form,$arr_data,false,'Suchen!'); $str_out .= '

'; return($str_out); } // MAIN SWITCH $str_op = ($_REQUEST['op'] ? $_REQUEST['op'] : ''); switch($str_op) { // Suchergebisse case 'search': $str_baselnk = $str_filename . '?op=search&'; foreach($arr_data as $key => $val) { $str_baselnk .= $key.'='.urlencode($val).'&'; } $str_has_long_bio = '(a.marks>='.CHOSEN_FULL.' OR aei.has_long_bio)'; $str_where = ' WHERE 1 '.($arr_data['biotype'] == 1 ? ' AND !'.$str_has_long_bio : '').' '.($arr_data['biotype'] == 2 ? ' AND '.$str_has_long_bio : '').' '.($arr_data['biotype'] == 3 ? ' AND aei.ext_mount !=""' : '').' '.($arr_data['biotype'] == 4 ? ' AND aei.ext_disciple !=""' : '').' '.($arr_data['biotype'] == 5 ? ' AND aei.bio_extra_info !=""' : '').' '.($arr_data['biotype'] == 6 ? ' AND g.description !=""' : '').' '.($arr_data['biolocked'] == 1 ? ' AND aei.biotime < "'.BIO_LOCKED.'" ' : '').' '.($arr_data['biolocked'] == 2 ? ' AND aei.biotime = "'.BIO_LOCKED.'" ' : '').' '.($arr_data['account_id'] > 0 ? ' AND aei.acctid = '.$arr_data['account_id'] : '').' '.(!empty($arr_data['message']) ? ' AND IF( '.$str_has_long_bio.', aei.long_bio LIKE "%'.$arr_data['message'].'%", aei.bio LIKE "%'.$arr_data['message'].'%")' : ''); $str_count_sql = ' SELECT COUNT( * ) AS c FROM account_extra_info aei LEFT JOIN accounts a USING( acctid ) LEFT JOIN goldpartner g USING( acctid )' .$str_where; $str_data_sql = ' SELECT long_bio AS bio, aei.biotime, aei.has_long_bio, aei.html_locked, aei.ext_disciple, aei.ext_mount, aei.bio_extra_info, g.description AS gp_desc, g.Name AS gp_name, IF(a.marks>='.CHOSEN_FULL.',1,0) AS chosen, a.name, a.acctid, a.login FROM account_extra_info aei LEFT JOIN accounts a USING( acctid ) LEFT JOIN goldpartner g USING( acctid )' .$str_where.' ORDER BY '.$arr_data['orderby']; $arr_res = page_nav($str_baselnk,$str_count_sql,$arr_data['results_per_page']); $str_data_sql .= ' LIMIT '.$arr_res['limit']; $str_out .= show_bio_search(); $str_out .= '`n '; $str_tr_class = 'trlight'; $res = db_query($str_data_sql); if(db_num_rows($res) == 0) { $str_out .= '`iKeine Ergebnisse gefunden!`i'; } // Rechte ermitteln $bool_useredit = $access_control->su_check(access_control::SU_RIGHT_EDITORUSER); $bool_lockhtml = $access_control->su_check(access_control::SU_RIGHT_LOCKHTML); $bool_lockbio = $access_control->su_check(access_control::SU_RIGHT_LOCKBIOS); // Ergebnisse zeigen while($l = db_fetch_assoc($res)) { $str_out .= ''; } $str_out .= '
`bID '.$l['acctid'].': '.jslib_getmenuuserlink( $l, $l, true ). ' | '.( $l['biotime'] == BIO_LOCKED ? '`$gesperrt`0' : ($l['biotime'] != '0000-00-00 00:00:00' ? '`&'.date('d.m.Y H:i',strtotime($l['biotime'])) : '') ).'`b' .($bool_useredit ? ' - '.create_lnk('Usereditor','user.php?op=edit&userid='.$l['acctid']) : '') .($bool_lockhtml ? ' - '.create_lnk('HTML '.($l['html_locked'] ? 'entsperren' : 'sperren'),$str_filename.'?op=lock_html&uid='.$l['acctid'].'&ret='.urlencode($str_baselnk.$page)) : '') .($bool_lockbio ? ' - '.create_lnk('Bio '.($l['biotime'] == BIO_LOCKED ? 'entsperren' : 'sperren'),$str_filename.'?op=lock_bio&uid='.$l['acctid'].'&ret='.urlencode($str_baselnk.$page),true,false,($l['biotime'] == BIO_LOCKED ? '' : 'Bio wirklich sperren?')) : '') .(($bool_useredit && $l['gp_desc']!='') ? ' - '.create_lnk('Goldpartner löschen',$str_filename.'?op=delete_goldpartner&uid='.$l['acctid'].'&ret='.urlencode($str_baselnk.$page),true,false,'User wirklich von Goldpartner löschen?') : '') .'
`n'; // Bio anzeigen, Jetzt haben wir das Gedöns schon 4x, da wäre eigentlich ne Funktion angebracht $l['bio'] = soap(closetags($l['bio'],'`b`c`i')); $allow_tags = ($l['html_locked'] ? '' : ''); $l['bio'] = strip_tags($l['bio'],$allow_tags); picture::replace_pic_tags($l['bio'],$l['acctid'],null,null,true); $str_out .= plu_mi('bio'.$l['acctid'],($arr_data['biotype'] < 3 ? 1 : 0),false).'`b`QBio:`0`b`n'; $str_out .= '
'.$l['bio'].'
'; if($l['ext_disciple']!='') //Knappenbio anzeigen { $l['ext_disciple'] = soap(closetags($l['ext_disciple'],'`b`c`i')); $allow_tags = ($l['html_locked'] ? '' : ''); $l['ext_disciple'] = strip_tags($l['ext_disciple'],$allow_tags); picture::replace_pic_tags($l['ext_disciple'],$l['acctid']); $str_out .= '`n
'.plu_mi('dbio'.$l['acctid'],($arr_data['biotype'] == 4 ? 1 : 0),false).'`b`QKnappenbio:`0`b`n'; $str_out .= '
'.$l['ext_disciple'].'
'; } if($l['ext_mount']!='') //Tierbio anzeigen { $l['ext_mount'] = soap(closetags($l['ext_mount'],'`b`c`i')); $allow_tags = ($l['html_locked'] ? '' : ''); $l['ext_mount'] = strip_tags($l['ext_mount'],$allow_tags); picture::replace_pic_tags($l['ext_mount'],$l['acctid']); $str_out .= '`n
'.plu_mi('mbio'.$l['acctid'],($arr_data['biotype'] == 3 ? 1 : 0),false).'`b`QTierbio:`0`b`n'; $str_out .= '
'.$l['ext_mount'].'
'; } if($l['bio_extra_info']!='') //Zusatzinfo anzeigen { $l['bio_extra_info'] = soap(closetags($l['bio_extra_info'],'`b`c`i')); $allow_tags = ($l['html_locked'] ? '' : ''); $l['bio_extra_info'] = strip_tags($l['bio_extra_info'],$allow_tags); picture::replace_pic_tags($l['bio_extra_info'],$l['acctid']); $str_out .= '`n
'.plu_mi('xbio'.$l['acctid'],($arr_data['biotype'] == 5 ? 1 : 0),false).'`b`QExtra-Info:`0`b`n'; $str_out .= '
'.$l['bio_extra_info'].'
'; } if($l['gp_desc']!='') //Goldpartner-Beschreibung anzeigen { $l['gp_desc'] = soap(closetags($l['gp_desc'],'`b`c`i')); $l['gp_desc'] = strip_tags($l['gp_desc'],''); $str_out .= '`n
'.plu_mi('goldp'.$l['acctid'],($arr_data['biotype'] == 6 ? 1 : 0),false).'`b`^Goldpartner:`0`b`n'; $str_out .= '
`^Name: `0'.$l['gp_name'].'`n`^Beschreibung: `0'.$l['gp_desc'].'
'; } $str_out .= '
 
'; // END Ergebnisse zeigen output($str_out, true); jslib_initmenu(); break; // END Suchergebnisse case 'lock_html': $int_uid = (int)$_GET['uid']; $arr_user = user_get_aei('html_locked', $int_uid); $arr_user['html_locked'] = ($arr_user['html_locked'] ? 0 : 1); user_set_aei( array('html_locked'=>$arr_user['html_locked']), $int_uid); if($arr_user['html_locked']) { systemmail($int_uid,'`$HTML gesperrt!`0','`@'.$session['user']['name'].'`& hat HTML für deine Bio deaktiviert. Wahrscheinlich hast du es mit der Nutzung von Bildern übertrieben. Wenn du dir nicht sicher bist, solltest du vielleicht mal in einer Mail nach dem Grund fragen.'); systemlog('`qSperrung des Bio-HTML für:`0 ',$session['user']['acctid'],$int_uid); $session['message'] = '`$HTML für AcctID '.$int_uid.' gesperrt!'; } else { systemmail($int_uid,'`@HTML entsperrt!`0','`@'.$session['user']['name'].'`& hat HTML für deine Bio wieder aktiviert.'); systemlog('`qEntSperrung des Bio-HTML für:`0 ',$session['user']['acctid'],$int_uid); $session['message'] = '`@HTML für AcctID '.$int_uid.' entsperrt!'; } redirect( urldecode($_GET['ret']) ); break; case 'lock_bio': $int_uid = (int)$_GET['uid']; $arr_user = user_get_aei('biotime', $int_uid); $arr_user['biotime'] = ($arr_user['biotime'] == BIO_LOCKED ? '0000-00-00' : BIO_LOCKED); $str_biotxt = ($arr_user['biotime'] == BIO_LOCKED ? '`b`c`$Bio von der Administration gesperrt!`0`c`b' : ''); //user_set_aei( array('biotime'=>$arr_user['biotime'], 'bio'=>$str_biotxt, 'long_bio'=>$str_biotxt), $int_uid); user_set_aei( array('biotime'=>$arr_user['biotime']), $int_uid); if($arr_user['biotime'] == BIO_LOCKED) { systemmail($int_uid,'`$Bio gesperrt!`0','`@'.$session['user']['name'].'`& hat deine komplette Bio deaktiviert. Wahrscheinlich hast du unpassende oder gegen das Urheberrecht verstoßende Inhalte eingefügt! Wenn du dir nicht sicher bist, solltest du vielleicht mal in einer Mail nach dem Grund fragen.'); systemlog('`qSperrung der Bio für:`0 ',$session['user']['acctid'],$int_uid); $session['message'] = '`$Bio für AcctID '.$int_uid.' gesperrt!'; } else { systemmail($int_uid,'`@Bio entsperrt!`0','`@'.$session['user']['name'].'`& hat deine Bio wieder aktiviert.'); systemlog('`qEntSperrung der Bio für:`0 ',$session['user']['acctid'],$int_uid); $session['message'] = '`@Bio für AcctID '.$int_uid.' entsperrt!'; } redirect( urldecode($_GET['ret']) ); break; case 'delete_goldpartner': $int_uid = (int)$_GET['uid']; $sql='DELETE FROM goldpartner WHERE acctid='.$int_uid.' LIMIT 1'; db_query($sql); systemmail($int_uid,'`$Rauswurf bei Goldpartner!`0','`@'.$session['user']['name'].'`& hat dich bei Goldpartner gelöscht. Wahrscheinlich hattest du unpassende oder anstößige Inhalte! Wenn du dir nicht sicher bist, solltest du vielleicht mal in einer Mail nach dem Grund fragen.'); systemlog('`qLöschung bei Goldpartner von:`0 ',$session['user']['acctid'],$int_uid); $session['message'] = '`@AcctID '.$int_uid.' bei Goldpartner entfernt!'; redirect( urldecode($_GET['ret']) ); break; // Hm.. default: redirect($str_filename. '?op=search'); break; } page_footer(); ?>