mahz
06-26-2010, 04:02 AM
Hey,
I'm modifying SHOWTHREAD so that each thread acts like a team and users can click a custom "Join Team" or "Leave Team" button at the top of each thread.
I have a custom "teams" table that just takes "userid" and "threadid" fields.
Basically, I just want to the user to click on Join Team which simply inserts them into the teams table. Really basic query stuff here. However, what's the easiest way to do this?
Here's what I'm trying (excerpt):
echo "<form action=\"/forum/showthread.php?t=\"".$thread['threadid']."\" method=\"post\">";
//Pass user security token
$form_code .= '<input type="hidden" name="securitytoken" value="'.$bbuserinfo[securitytoken].'" /><br />';
if ($is_already_in_team == 1) //If user is already in the team
{
//Generate LEAVEbutton
$form_code .= "<input type=\"submit\" value=\"Leave Team\" name=\"action\" />";
} else {
//Generate JOIN button
$form_code .= "<input type=\"submit\" value=\"Join Team\" name=\"action\" />";
}
echo '</form>';
The security token passes when I press the submit button, but the style is broken and no images load.
I'm modifying SHOWTHREAD so that each thread acts like a team and users can click a custom "Join Team" or "Leave Team" button at the top of each thread.
I have a custom "teams" table that just takes "userid" and "threadid" fields.
Basically, I just want to the user to click on Join Team which simply inserts them into the teams table. Really basic query stuff here. However, what's the easiest way to do this?
Here's what I'm trying (excerpt):
echo "<form action=\"/forum/showthread.php?t=\"".$thread['threadid']."\" method=\"post\">";
//Pass user security token
$form_code .= '<input type="hidden" name="securitytoken" value="'.$bbuserinfo[securitytoken].'" /><br />';
if ($is_already_in_team == 1) //If user is already in the team
{
//Generate LEAVEbutton
$form_code .= "<input type=\"submit\" value=\"Leave Team\" name=\"action\" />";
} else {
//Generate JOIN button
$form_code .= "<input type=\"submit\" value=\"Join Team\" name=\"action\" />";
}
echo '</form>';
The security token passes when I press the submit button, but the style is broken and no images load.