2006-10-10, 04:36 PM
Note: my forums are example.com/forums and this page is in example.com
Could someone please change this form field below and make it hidden, and display the bbusername instead of what it shows now, i have tryed loads of different ways, but i just cant do it.
Here is the page:
If you havnt got a clue what i am talking about but you think you could help me, please post and ask me to explain, thanks.
______________________________________________
here is what i have tried:
to get the vars from /forums/global.php
then:
i tried different things after that but nothing!
Could someone please change this form field below and make it hidden, and display the bbusername instead of what it shows now, i have tryed loads of different ways, but i just cant do it.
<input type="text" name="name" value="<?php echo $name?>">
Here is the page:
<?php
/*-----------FIRST GET THE OLD MESSAGES FROM messages.htm-----------*/
// Read file into an array
$message_array = file("messages.htm");
// Compile the string
for ($counter = 1; $counter < 20; $counter++) {/*INSTEAD OF 20 WRITE SOMETHING ELSE, SAY 30*/
$old_messages .= $message_array[$counter];
}
/*-----------SECOND GET AND MODIFY THE NEW MESSAGE-----------*/
//ADD TIME
$time = date("H:i");
//ADD URL
if($url)
$link_html .= " <a href=\"$url\" target=\"_new\">".
"<font face=\"wingdings\">2</font></a>";
//ADD EMAIL
if($mail)
$link_html .= " <a href=\"mailto: $mail\" target=\"_new\">".
"<font face=\"wingdings\">*</font></a>";
$new_message = "<font color=\"$color\"><b><i>$name</i></b>".
" $link_html <font size=\"1\">($time)</font> : $message</font><br>\n";
/*-----------THIRD MAKE THE HEADER AND THE FOOTER-----------*/
// It's important that there are no newline
// characters except at the end of the string.
// This keeps all the headers together.
$header = "<html><head><meta http-equiv=\"refresh\" content=\"8\">". /*INCREASE THE REFRESH TIME FROM 8 TO 20*/
"<meta name=\"robots\" content=\"noindex\"></head>".
"<body bgcolor=\"#ffffff\" text=\"#000000\">\n";
$footer = "<p align=\"center\"><font color=\"#000000\">".
"<a href='mailto:[email protected]'>© Vineet Sharda</a></font></p></body></html>";
// Opens file for writing and truncates file length to zero.
$open_file = fopen("messages.htm", "w");
/*-----------FOURTH UPDATE THE messages.htm-----------*/
// write file header...
fputs($open_file, $header);
// ... new line...
// (stripSlashes because we don't want all
// our escape characters appearing in the
// message file)
fputs($open_file, stripslashes($new_message));
// ... old lines ...
fputs($open_file, $old_messages);
// ... and footer.
fputs($open_file, $footer);
// Close the file when you're done. Don't forget to wash your hands
fclose($open_file);
?>
<html>
<head>
</head>
<body>
<form name="inpform" action="chat.php" method="post">
<table>
<tr>
<td>Name :
</td>
<td><input type="text" name="name" value="<?php echo $name?>">
</td>
</tr>
<tr>
<td>Color:
</td>
<td><input type="text" name="color" value="<?php echo $color?>">
</td>
</tr>
<tr>
<td>Message :
</td>
<td><input type="text" name="message" size="100">
</td>
</tr>
<tr>
<td><input type="submit" value="Send">
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>Email :
</td>
<td><input type="text" name="mail" value="<?php echo $mail?>">
</td>
</tr>
<tr>
<td>URL :
</td>
<td><input type="text" name="url" value="<?php echo $url?>">
</td>
</tr>
</table>
</form>
<script language="javascript">
document.inpform.message.focus();
</script>
</body>
</html>
If you havnt got a clue what i am talking about but you think you could help me, please post and ask me to explain, thanks.
______________________________________________
here is what i have tried:
<?php
chdir('forums'); // path to MyBB
require './global.php';
?>
to get the vars from /forums/global.php
then:
<?php
if($mybb->user['uid'])
i tried different things after that but nothing!