All pastes #818402 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-16 08:11 UTC
rendered paste body
....
echo "<input class=\"forum\" type=\"text\" size=\"50\" name=\"text\" value=\"New thread name\"><br><br>";
echo "<input class=\"forumbuttons\" type=\"submit\" name=\"submit[addthread]\" value=\"Submit\"></p>";
....

	*******************************************************************/
	Function addthread($text,$level,$userid){
		if($level==9){
			$query = '
				INSERT INTO forum_threads_'.$_SESSION["lang"].' (
				forum_threads_id ,
				forum_threads_name ,
				forum_threads_user ,
				forum_threads_active
				)
				VALUES (
				"0",
				"'.quote_smart($text).'",
				"'.quote_smart($userid).'",
				"1"
				)';
		} else {
			$query = '
				INSERT INTO forum_threads_'.$_SESSION["lang"].' (
				forum_threads_id ,
				forum_threads_name ,
				forum_threads_user ,
				forum_threads_active
				)
				VALUES (
				"0",
				"'.quote_smart($text).'",
				"'.quote_smart($userid).'",
				"0"
				)';
			sendMail($this->email,"New thread on your site","\n\nNew thread on your site\n".$text);
		}
		$result = mysql_query($query);
	}


	Function list_threads($logat,$level,$userid){
...
	$query = "select * from forum_threads_".$_SESSION["lang"]." where forum_threads_active = 1  ORDER by forum_threads_name";
	$result = mysql_query($query) or die (mysql_error());
		echo "<ul>";
		While ( $row = mysql_fetch_array($result) )
		{
...
			$forum_threads_name = htmlspecialchars($row["forum_threads_name"]);
			echo "&nbsp;<a href=\"{$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}&amp;forum_threads=".$row["forum_threads_id"]."\">".$forum_threads_name."</a> (".$this->threads_count($row["forum_threads_id"]).")";
			echo "</li>";
...
	}