Addon für NickChange von Bräke

Glare
Titel: Addon für NickChange von Bräke
Version: 1.0
Beschreibung: So, mit diesem kleinen Addon werden User, die in den letzten 30 Tagen ihren Nick geändert haben, makiert.

Ich übernehme keine Verantwortung für Schäden oder sonst irgendwas.

Macht unbedingt vorher ein Backup, besonders von der Profile.php, der Datenbank und dem profile.tpl!!!

Viel Spaß, Glare

Edit: Es fehlte leider noch ein Schritt!

Wer es vorher runtergeladen hat, muß noch in der Usercp.php eine Änderung durchführen:

suche:
php:
1:
$db->unbuffered_query("UPDATE bb".$n."_threads SET lastposter='".addslashes($r_username)."' WHERE lastposterid='$wbbuserdata[userid]'",1);


dadrunter:
php:
1:
$db->unbuffered_query("UPDATE bb".$n."_users SET nickchange='".time()."' WHERE userid='$wbbuserdata[userid]'",1);

----
Demo: http://www.NieWiederAlleine.de/profile.php?userid=1

weiter zum Download
Computerspezi
leider kann man das profil nicht sehen, ohne sich bei dir anzumelden. könntest du hier nicht einfach ein pic davon hier anhängen ?
Glare
bitte schön
Jaggl
kan den eintrag $user_info[username] in meiner profile.tpl nicht finden wieso???

Hier mein profile.tpl der eintrag wird wohl einen anderen namen haben nur welchen scheiße ich bin ein noob Augenzwinkern

<?xml version="1.0" encoding="{$lang->items['LANG_GLOBAL_ENCODING']}"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{$lang->items['LANG_GLOBAL_DIRECTION']}" lang="{$lang->items['LANG_GLOBAL_LANGCODE']}" xml:lang="{$lang->items['LANG_GLOBAL_LANGCODE']}">
<head>
<title>$master_board_name | {$lang->items['LANG_MEMBERS_PROFILE_TITLE']}</title>
$headinclude

<script type="text/javascript">
<!--
function rating(userid) {
window.open("misc.php?action=userrating&userid="+userid+"&sid=$session[hash
]", "moo", "toolbar=no,scrollbars=yes,resizable=yes,width=350,height=205");
}
function wen_geworben(userid) {
window.open("guthaben.php?action=wen_geworben&userid="+userid+"&sid=$sessio
n[hash]", "moo", "toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300");
}
//-->
</script>
</head>

<body>
$header
<table cellpadding="{$style['tableincellpadding']}" cellspacing="{$style['tableincellspacing']}" border="{$style['tableinborder']}" style="width:{$style['tableinwidth']}" class="tableinborder">
<tr>
<td class="tablea"><table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr class="tablea_fc">
<td align="left"><span class="smallfont"><b><a href="index.php?sid=$session[hash]">$master_board_name</a> &raquo; {$lang->items['LANG_MEMBERS_PROFILE_TITLE']}</b></span></td>
<td align="right"><span class="smallfont"><b>$usercbar</b></span></td>
</tr>
</table></td>
</tr>
</table><br />
<table cellpadding="{$style['tableincellpadding']}" cellspacing="{$style['tableincellspacing']}" border="{$style['tableinborder']}" style="width:{$style['tableinwidth']}" class="tableinborder">
<tr>
<td class="tabletitle" align="left" colspan="2"><table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr class="tabletitle_fc">
<td style="width:100%" align="left"><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_TITLE']}</b></spa
n></td>
<td style="width:200px" align="center" nowrap="nowrap"><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_CAPTION']}</b></s
pan></td>
</tr>
</table></td>
</tr>
<tr>
<td class="tablea" style="width:100%"><table style="width:100%" class="tablea_fc">
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_REGDATE']}</b></s
pan></td>
<td><span class="normalfont">$regdate</span></td>
</tr>
<tr align="left">
<td valign="top"><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_RANK']}</b></span
></td>
<td><span class="normalfont">$user_info[ranktitle] $rankimages</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_POSTS']}</b></spa
n></td>
<td><span class="normalfont">$user_info[userposts] ({$lang->items['LANG_MEMBERS_PROFILE_POSTSPERDAY']})</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_GUTHABEN']}</b></
span></td>
<td><span class="normalfont">$user_guthaben $waehrung</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_KONTONUMMER']}</b
></span></td>
<td><span class="normalfont">$user_info[userid]</span></td>
</tr>
<if($wbbuserdata['a_can_guthaben_change'] == 1)>
<then>
<form name="gutedit" method="post" action="profile.php?userid=$user_info[userid]&sid=$session[hash]">
<input name="action" type="hidden" value="gutedit" />
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_GUTEDIT']}</b></s
pan></td>
<td><span class="normalfont"><input name="gutedit" type="radio" value="1" /> {$lang->items['LANG_MEMBERS_PROFILE_LASTSCHRIFT']} <input type="radio" name="gutedit" value="2" /> {$lang->items['LANG_MEMBERS_PROFILE_GUTSCHRIFT']}</span> <input name="send" type="submit"></td>
</tr>
<tr align="left">
<td>&nbsp;</td>
<td><input name="betrag" type="text" size="5" maxlength="10" /> <span class="normalfont">$waehrung</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><font color="#FF0000"><b>$gfehler</b></font></span></td>
<td><input name="grund" type="text" size="20" maxlength="50" /></td>
</tr>
</form>
</then></if>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_LASTACTIVITY']}</
b></span></td>
<td><span class="normalfont">$la_date <span class="{time}">$la_time</span></span></td>
</tr>

<if($userlocation!="")>
<then>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_LOCATION']}</b></
span></td>
<td><span class="normalfont">$userlocation</span></td>
</tr>
</then>
</if>

<if($showlastpost==1)>
<then>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_LASTPOST']}</b></
span></td>
<td><span class="normalfont"><b>&raquo; <a href="thread.php?postid=$lastpost[postid]&amp;sid=$session[hash]#post$lastp
ost[postid]">$lastpost[topic]</a></b></span><br />
<span class="smallfont">{$lang->items['LANG_MEMBERS_PROFILE_POSTED_ON']} $lastpostdate <span class="time">$lastposttime</span><br />
Forum: <b><a href="board.php?boardid=$lastpost[boardid]&amp;sid=$session[hash]">$lastpos
t[title]</a></b></span></td>
</tr>
</then>
</if>

<tr>
<td align="left" colspan="2"><hr size="{$style['tableincellspacing']}" class="threadline" /></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_ICQ']}</b></span>
</td>
<td><span class="normalfont">$user_info[icq]</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_AIM']}</b></span>
</td>
<td><span class="normalfont">$user_info[aim]</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_YIM']}</b></span>
</td>
<td><span class="normalfont">$user_info[yim]</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_MSN']}</b></span>
</td>
<td><span class="normalfont">$user_info[msn]</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_EMAIL']}</b></spa
n></td>
<td><span class="normalfont">$useremail</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_HOMEPAGE']}</b></
span></td>
<td><span class="normalfont">$userhomepage</span></td>
</tr>
<tr>
<td align="left" colspan="2"><hr size="{$style['tableincellspacing']}" class="threadline" /></td>
<tr>
<td align="left" colspan="2"><hr size="{$style['tableincellspacing']}" class="threadline" /></td>
</tr>
<tr>
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_GEWORBEN']}</b></
span></td>
<if($gwuser_g > 0)>
<then>
<td><span class="normalfont"><a href="java script:wen_geworben($user_info[userid])">$gwuser_g</a></span></td
>
</then>
<else>
<td><span class="normalfont">$gwuser_g</span></td>
</else>
</if>
</tr>
<tr>
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_GEWORBEN_VON']}</
b></span></td>
<td><span class="normalfont">$gwuser_v</span></td>
</tr>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_GENDER']}</b></sp
an></td>
<td><span class="normalfont">$gender</span></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_BIRTHDAY']}</b></
span></td>
<td><span class="normalfont">$birthday</span></td>
</tr>
<tr>
<td align="left" colspan="2"><hr size="{$style['tableincellspacing']}" class="threadline" /></td>
</tr>
<tr align="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_XQUIZ_GESAMTE']}:
</b></span></td>
<td><span class="normalfont">$xquiz_gesamt</span></td>
</tr>
<tr align ="left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_XQUIZ_RICHTIGE']}
:</b></span></td>
<td><span class="normalfont">$xquiz_richtig</span></td>
</tr>
<tr align = "left">
<td><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_XQUIZ_FALSCHE']}:
</b></span></td>
<td><span class="normalfont">$xquiz_falsch</span></td>
</tr>
<if($profilefields)>
<then>
<tr>
<td align="left" colspan="2"><hr size="{$style['tableincellspacing']}" class="threadline" /></td>
</tr>
</then>
</if>
$profilefields
</table></td>
<td class="tableb" style="width:200px" align="center">$useravatar<br /><span class="normalfont">$galpic$user_text</span>$userrating<br />$userlevel<p><if($user_online==1)>
<then><img src="{$style['imagefolder']}/user_online.gif" border="0" alt="{$lang->items['LANG_MEMBERS_USERONLINE']}" title="{$lang->items['LANG_MEMBERS_USERONLINE']}" /></then>
<else><img src="{$style['imagefolder']}/user_offline.gif" border="0" alt="{$lang->items['LANG_MEMBERS_USEROFFLINE']}" title="{$lang->items['LANG_MEMBERS_USEROFFLINE']}" /></else>
</if></p><img src="{$style['imagefolder']}/spacer.gif" width="159" height="1" border="0" alt="" title="" /></td>
</tr>
<tr>
<td class="tabletitle" colspan="2"><table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr class="tabletitle_fc">
<td align="left"><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_CONTACT']}</b></s
pan></td>
<td align="right">

<if($user_info['showemail']==0 && $user_info['usercanemail']==1)>
<then><a href="formmail.php?userid=$user_info[userid]&amp;sid=$session[hash]"><img src="{$style['imagefolder']}/email.gif" border="0" alt="{$lang->items['LANG_MEMBERS_SENDEMAIL']}" title="{$lang->items['LANG_MEMBERS_SENDEMAIL']}" /></a></then>
</if>

<if($user_info['receivepm']==1 && $wbbuserdata['can_use_pms']==1)><then><a href="pms.php?action=newpm&amp;userid=$user_info[userid]&amp;sid=$session[h
ash]"><img src="{$style['imagefolder']}/pm.gif" border="0" alt="{$lang->items['LANG_MEMBERS_PM']}" title="{$lang->items['LANG_MEMBERS_PM']}" /></a></then></if>

<a href="search.php?action=user&amp;userid=$user_info[userid]&amp;sid=$session
[hash]"><img src="{$style['imagefolder']}/search.gif" border="0" alt="{$lang->items['LANG_MEMBERS_SEARCH']}" title="{$lang->items['LANG_MEMBERS_SEARCH']}" /></a>

<a href="usercp.php?action=buddy&amp;add=$user_info[userid]&amp;sid=$session[h
ash]"><img src="{$style['imagefolder']}/homie.gif" border="0" alt="{$lang->items['LANG_MEMBERS_BUDDY']}" title="{$lang->items['LANG_MEMBERS_BUDDY']}" /></a></td>
</tr>
</table></td>
</tr>
</table>
<if(checkAdminPermissions("a_can_users_edit") || checkAdminPermissions("a_can_users_delete"))>
<then>
<p align="center"><span class="smallfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_ADMINOPTIONS']}</b
>
<if(checkAdminPermissions("a_can_users_edit"))><then><a href="acp/index.php?url=users.php%3Faction%3Dedit%26userid%3D$user_info[use
rid]" target="_blank">{$lang->items['LANG_MEMBERS_PROFILE_USEREDIT']}</a></then><
/if>
<if(checkAdminPermissions("a_can_users_edit") && checkAdminPermissions("a_can_users_delete"))><then> | </then></if>
<if(checkAdminPermissions("a_can_users_delete"))><then><a href="acp/index.php?url=users.php%3Faction%3Ddelete%26userid%5B%5D%3D$user_
info[userid]" target="_blank">{$lang->items['LANG_MEMBERS_PROFILE_USERDEL']}</a></then></
if></span></p>
</then>
</if>
$footer
</body>
</html>
auron16
Genau , habe das gleiche Problem.

Aber hier eine Lösung von mir :

suche:

<td style="width:100%" align="left"><span class="normalfont"><b>{$lang->items['LANG_MEMBERS_PROFILE_TITLE']}</b>

füge hinter </b> , folgendes ein:

&nbsp&nbsp$nickchanged

großes Grinsen

Hab auch mal ein Bild:

[IMG]http://nc0559.eden0.netclusive.de/wbb2/images/newnick.gif[/IMG]
Chrissie
Kann man, anstatt den .gif Bild auch einen kleinen Text anzeigen lassen ?
Guillmaster
wenn ich den usernamen ändern will und speicher, dann bekomme ich diese emeldung.

Zitat:
SQL-DATABASE ERROR

Database error in WoltLab Burning Board (2.1.5): Invalid SQL: UPDATE bb2_users SET nickchange='1108862152' WHERE userid='4'
mysql error: Unknown column 'nickchange' in 'field list'
mysql error number: 1054
mysql version: 3.23.37-log
php version: 4.3.0
Date: 20.02.2005 @ 02:15
Script: /board/usercp.php
Referer: http://www.raymann.org/board/usercp.php?...ofile_edit&sid=

Glare
Dann hast du die SQL Abfrage nicht ausgeführt
Guillmaster
wie mache ich es das es auch im thread bei seinem namen (neben dem nick --> neben männlich/weblich anzeige) angezeigt wird.


Wäre doch bestimmt auch interesant, oder??

Gruß
Guillmaster
ZerberusZero
also bei mir funzt es super großes Grinsen und die Sache mit dem fehlenden Profil eintrag kann ich mir so erklären, das es daran liegt das ich nen WBB 2.2.1 habe (ihr andren beiden vielleicht auch????)

lob auf jedenfall an dich, glare großes Grinsen
Guillmaster
gibt es schon ne idee wie ich es machen kann??

Zitat:
Original von Guillmaster

wie mache ich es das es auch im thread bei seinem namen (neben dem nick --> neben männlich/weblich anzeige) angezeigt wird.



Gruß
Guillmaster
Glare
Achtung, nicht getestet!!!

Schnapp dir den Code, der in die Profile.php kommt

php:
1:
2:
3:
4:
5:
6:
7:
/* nickchanged */
$akttime time();
$nicked $user_info[nickchange] ;
$thirtydays $nicked 2592000; 
if ($akttime $thirtydays && $user_info[nickchange] != "0") {
$nickchanged "<img src='./images/newnick.gif' alt='$user_info[username] hat seinen Usernamen in den letzten 30 Tagen geändert.' title='$user_info[username] hat seinen Usernamen in den letzten 30 Tagen geändert.'>";
}


und pack ihn in die thread.php irgendwo über

php:
1:
2:
eval("\$tpl->output(\"".$tpl->get("thread")."\");");
?>


Dann gehe in die thread_postbit.tpl und füge hinter
code:
1:
$posts[username]</a></b></span>


folgendes ein:

code:
1:
$nickchanged
Guillmaster
schade funktioniert leider nicht.....

bei mir zumindest verwirrt
Glare
Ah, kleinen Fehler entdeckt, ändere

$user_info[nickchange]

in

$posts[nickchange]