![]() |
Hello
Well, I have a problem with the 'last Post by User XY' display on the mainpage (the page where you can see all the boards being enabled) of the vB. I have scripted a new form, with some dropdowns and so on... for posting a new post. Everything works, the post turns up in the forum, the username is added, the url is correct, the user receives a new point and everything looks nice. But one thing does not work :|. The display of 'last Post by User XY' - the URL is showed correctly but the usernam is wrong. I do not know why but the script or the forum does not use and show respectively the username of the user having posted the last posting with my new form. Do you have any idea why that problem exists and what I could do to eliminate it? Thank's a lot RitterWilliam PS: Sorry for my bad English, I hope that you will understand my posting ;). |
Without knowing exactly what you did it would be almost impossible to know what's wrong.
|
Well, right. Here is the mainpart of the sourcecode.
------------------------------------------------------------------------------ <?php if ($send) { //************************************************** **************************** //*************************P A S S W O R T A B F R A G E********************** //************************************************** **************************** $db = mysql_connect("", "", ""; $res = mysql_db_query("forum79", "select password from user where username like '$username_eing'"); $num = mysql_num_rows($res); if ($num == 1) { $password_forum = mysql_result($res, "password"); if ($password_forum == $password_eing) echo "<p>"; else { echo "$username_eing, du hast ein falsches Passwort angegeben, bitte benutzte den Zurückbutton deines Browsers, um es zu korrigieren.<p>"; echo "Wenn du dein Passwort vergessen haben solltest, klicke <a href=http://aoe2-forum.gamigo.de/member.php?action=lostpw>hier</a>."; exit; } } else echo "<p>$username_eing, du bist in diesem Forum nicht registriert. Um dich für das <a href=http://aoe2-forum.gamigo.de>AoE2.de Forum</a> zu registrieren klicke <a href=http://aoe2-forum.gamigo.de/member.php?action=signup>hier</a>."; mysql_close($db); //************************************************** **************************** //*Insert Daten in Schlachtfeld Tab (non-board-db)** //************************************************** **************************** $db = mysql_connect("", "", ""); $termin = mktime($stunde,$minute,0,$monat,$tag,2001); $datum = date("d.m.Y",$termin); $uhrzeit = date("H:i",$termin); $sqlab = "insert schlachtfeld"; $sqlab .= "(termin, spielort1, spielort2, spieler1, spieler2, spieltyp, karte, groesse, schwierigkeitsgrad, rohstoffe, bevlimit, geschwindigkeit, kartensicht, startzeitalter, sieg, farbe, kommentar, beschreibung) values "; $sqlab .= "('$termin', '$spielort1', '$spielort2', '$spieler1', '$spieler2', '$spieltyp', '$karte', '$groesse', '$schwierigkeitsgrad', '$rohstoffe', '$bevlimit', '$geschwindigkeit', '$kartensicht', '$startzeitalter', '$sieg', '$farbe', '$kommentar', '$beschreibung')"; mysql_db_query("aoe2de", $sqlab); $num = mysql_affected_rows(); mysql_close($db); if ($num>0) { //************************************************** **************************** //****D E K L A R I E R E N D E R E I N Z E L N E N V A R I A B L E N***** //************************************************** **************************** $post_datum = time(); $title = $datum." | ".$uhrzeit." Uhr | ".$spieler1." on ".$spieler2." | ".$kommentar; $subject = "Online Schlachtfeld - Spiel:"; $forumid = 18; $open = 1; $visible = 1; $iconid = 2; $beschreibung=nl2br($beschreibung); $userindex=$username_eing; $userindex=strtolower($userindex); $inhalt = "<table id=tabelle>"; $inhalt .= "<tr><td><b>Termin:</td><td>".$datum." | ".$uhrzeit." Uhr</td></tr>"; $inhalt .= "<tr><td><b>Spielort:</td><td>".$spielort1."</td></tr>"; $inhalt .= "<tr><td><b>Room / IP:</td><td>".$spielort2."</td></tr>"; $inhalt .= "<tr><td><b>Spieler:</td><td>".$spieler1." on ".$spieler2."</td></tr>"; $inhalt .= "<tr><td><b>Spieltyp:</td><td>".$spieltyp."</td></tr>"; $inhalt .= "<tr><td><b>Karte:</td><td>".$karte."</td></tr>"; $inhalt .= "<tr><td><b>Größe:</td><td>".$groesse."</td></tr>"; $inhalt .= "<tr><td><b>Schwierigkeitsgrad:</td><td>".$schwierigkeitsgrad."</td></tr>"; $inhalt .= "<tr><td><b>Rohstoffe:</td><td>".$rohstoffe."</td></tr>"; $inhalt .= "<tr><td><b>Bevölkerungslimit:</td><td>".$bevlimit."</td></tr>"; $inhalt .= "<tr><td><b>Geschwindigkeit:</td><td>".$geschwindigkeit."</td></tr>"; $inhalt .= "<tr><td><b>Startzeitalter:</td><td>".$startzeitalter."</td></tr>"; $inhalt .= "<tr><td><b>Kartensicht:</td><td>".$kartensicht."</td></tr>"; $inhalt .= "<tr><td><b>Sieg:</td><td colspan=3>".$sieg."</td></tr>"; $inhalt .= "<tr><td><b>Ich bestehe auf folgende Farbe ;):</td><td>".$farbe."</td></tr>"; $inhalt .= "<tr><td valign=top><b>Beschreibung:</td><td>".$beschreibung."</td></tr>"; $inhalt .= "</table>"; //************************************************** **************************** //******************************Insert Daten in Forum Table [Threads]************* //************************************************** **************************** // [threadid] title=$title lastpost=$post_datum forumid=$forumid open=$open // [replycount] postusername=$username_eing lastposter=$username_ //eing dateline=$post_datum [views] iconid=2 [notes] visible=$visible // subjectindex=$subject threadindex=$inhalt userindex='$userindex' //************************************************** **************************** //************************************************** **************************** $db = mysql_connect("", "", ""); $sqlab = "insert thread"; $sqlab .= "(title, lastpost, forumid, open, postusername, lastposter, dateline, iconid, visible, subjectindex, threadindex, userindex) values "; $sqlab .= "('$title', '$post_datum', '$forumid', '$open', '$username_eing', '$username_eing', '$post_datum', '$iconid', '$visible', '$subject', '$inhalt', '$userindex')"; mysql_db_query("forum79", $sqlab); $num = mysql_affected_rows(); if ($num>0) { //************************************************** **************************** //******************Insert Daten in Forum Table [Posts]*************************** //************************************************** **************************** // [postid] threadid=$threadid username=$username_eing userid=$selectArray[0] // title=$title dateline=$post_datum pagetext=$inhalt allowsmilie=1 email=1 // signature=1 ipaddress=$ipaddress iconid=$iconid visible=$visible //************************************************** **************************** //************************************************** **************************** $select=mysql_db_query("forum79", "select * from user where username like '$username_eing'"); $selectArray=mysql_fetch_array($select); $thread_id=mysql_db_query("forum79", "select threadid from thread where dateline like '$post_datum'"); $threadid=mysql_result($thread_id, "threadid"); $ipaddress=getenv("REMOTE_ADDR"); $sqlab = "insert post"; $sqlab .= "(threadid, userid, title, dateline, pagetext, allowsmilie, email, signature, ipaddress, iconid, visible) values "; $sqlab .= "('$threadid', '$selectArray[0]', '$title', '$post_datum', '$inhalt', 1, 1, 1, '$ipaddress', '$iconid', '$visible')"; mysql_db_query("forum79", $sqlab); $num = mysql_affected_rows(); if ($num>0) { $res = mysql_db_query("forum79", "select posts from user where username like '$username_eing'"); $posts_org = mysql_result($res, "posts"); $posts_neu= $posts_org + 1; $user="update user set"; $user.=" posts='$posts_neu' where username like '$username_eing'"; mysql_db_query("forum79", $user); $num_user=mysql_affected_rows(); if($num_user>0) { echo "Game is posted"; exit; } else { echo "ERROR!<p>"; exit; } } else { echo "Es ist ein Fehler beim Eintragen des Spieles unterlaufen, bitte alle eingegebenen Daten überprüfen!<p>"; exit; } } else { echo "Es ist ein Fehler beim Eintragen des Spieles unterlaufen, bitte alle eingegebenen Daten überprüfen!<p>"; exit; } mysql_close($db); } else { echo "Es ist ein Fehler beim Eintragen des Spieles unterlaufen, bitte alle eingegebenen Daten überprüfen!<p>"; } mysql_close($db); } ?> ---------------------------------------------------- All the variables being insert in the "Schlachtfeld Table" are given by an extra form which works. RitterWIlliam |
These are the fields and the variables being added in the Table 'Threads':
//******************************Insert Daten in Forum Table [Threads]************* //************************************************** **************************** // [threadid] title=$title lastpost=$post_datum forumid=$forumid open=$open // [replycount] postusername=$username_eing lastposter=$username_ //eing dateline=$post_datum [views] iconid=2 [notes] visible=$visible // subjectindex=$subject threadindex=$inhalt userindex='$userindex' //************************************************** **************************** These are the fields and the variables being added in the Table 'Posts': //******************Insert Daten in Forum Table [Posts]*************************** //************************************************** **************************** // [postid] threadid=$threadid username=$username_eing userid=$selectArray[0] // title=$title dateline=$post_datum pagetext=$inhalt allowsmilie=1 email=1 // signature=1 ipaddress=$ipaddress iconid=$iconid visible=$visible //************************************************** **************************** These are the fields and the variables being added/updated in the Table 'User': posts=$posts_neu ------------------------------------------------------------------------------------ All the fields standing in [] have no special variables. RitterWilliam |
Could you please enter your vB license info into your user profile? See my sig for details. Thanks!
|
|
It's the customer number and password you got when you purchased vBulletin, and what you use to access the Members Area.
And you should really upgrade, I won't list the many reasons. |
Yes, I have already edited my last posting, thanks ;).
Yeah - version vB2 - maybe I will upgrade it later. |
Hmm... does anyone help me?
William |
To get support on this you'll need to add your license info to your user profile.
|
All times are GMT. The time now is 09:08 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|