2000 or $height > 2000) { return 0; } else { switch($type) { case 1: $old = imagecreatefromgif($src); break; case 2: $old = imagecreatefromjpeg($src); break; case 3: $old = imagecreatefrompng($src); break; case 15: $old = imagecreatefromwbmp($src); break; default: return 0; } if ($newwidth <= 0 && $newheight <= 0) { $newwidth= $width; $newheight= $height; } else { if ($newwidth <= 0) { $raport= $newheight / $height; $newwidth= $width * $raport; } elseif ($newheight <= 0) { $raport= $newwidth / $width; $newheight= $height * $raport; }} if (($newwidth >= $width) || ($newheight >= $height)) { $newwidth= $width; $newheight= $height; } $aux= imagecreatetruecolor($newwidth, $newheight); imagecopyresampled($aux, $old, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagejpeg($aux, $newsrc); return 1; } } function exploder($array, $element, $explode) { $a = explode($explode, $array); return $a[$element]; } if ($SCRIPT == "members" and $PARAMETER1 == "!" and isset($PARAMETER2) and $PARAMETER2 == "data" and $PARAMETER3 == "") { exit; if (isset($PARAMETER4)) { $lastdate = str_replace("$source"; } $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $finish = $time; $totaltime = ($finish - $scriptstart); error_log($_SERVER["SCRIPT_NAME"] . " {$_SERVER['REQUEST_URI']} script took $totaltime \n=====================================================================================================================================", 0); exit; } if ($SCRIPT == "polls" and isset($PARAMETER1) and $PARAMETER1 == "vote" and isset($PARAMETER2) and is_numeric($PARAMETER2) and isset($PARAMETER3) and is_numeric($PARAMETER3)) { if (isset($US_ID)) $u = $US_ID; else $u = $_SERVER['REMOTE_ADDR']; $sql = "select * from PO_PollQuestions where POQ_ID = " . mysql_real_escape_string($PARAMETER2) . " and POQ_Status = 'L'"; $res = mysql_query($sql); while($row = mysql_fetch_array($res)) { #if (isset($US_TYPE)) { $sql_del = "delete from PO_PollAnswers where POA_Poll = " . mysql_real_escape_string($PARAMETER2) . " and POA_User = '$u' limit 1"; mysql_query($sql_del); $sql_ins = "insert into PO_PollAnswers values(0, " . mysql_real_escape_string($PARAMETER2) . ", '$u', " . mysql_real_escape_string($PARAMETER3) . ")"; mysql_query($sql_ins); #} if ($row['POQ_User'] == 0) $u = ""; else { $row2 = mysql_fetch_row(mysql_query("select US_Username from US_Users where US_ID = {$row['POQ_User']}")) or exit; $u = $row2[0]; } header("location: $PATH/members/$u/polls/$PARAMETER2/" . storyTitle($row['POQ_Question'])); exit; } } if ($SCRIPT == "polls" and $PARAMETER1 == "js") { # create javascript for polls if (isset($PARAMETER3) and ($PARAMETER3 == '.gitignore')) exit; header('Content-Type: application/javascript'); $colours = "'#aa0000', '#000088', '#007700', '#ff9900', '#0099ff', '#ff0000', '#00ff00', '#0000ff', '#ffff00', '#33CC99', '#660066', '#663300'"; if (isset($PARAMETER3)) { #if (substr_count($PARAMETER3, 'size:large') > 0) { $chartwidth = 100; $chartheight = 100; } if (substr_count($PARAMETER3, 'type:barchart') > 0) { $charttype = "BarChart"; } } #if (!isset($chartwidth)) { $chartwidth = 400; $chartheight = 240; } if (!isset($charttype)) { $charttype = "PieChart"; } $started = 'n'; $pies = explode("|", $PARAMETER2); foreach ($pies as &$value) { if (!is_numeric($value)) exit; if ($started == 'n') print "initGalleryCharts(); var chartsData = {}; function initGalleryCharts() { google.setOnLoadCallback(initCharts); } function initCharts() { $(window).resize(drawCharts); setupData(); drawCharts(); } function setupData() {"; $started = 'y'; $sql = "select * from PO_PollQuestions where POQ_ID = " . mysql_real_escape_string($value) . " limit 1"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) { $poll_title = stripslashes($row['POQ_Question']); $answers = explode("\n", $row['POQ_Answers']); $poll_data = ""; foreach ($answers as $x => $v) { $sql2 = "select count(*) as cnt from PO_PollAnswers where POA_Poll = {$row['POQ_ID']} and POA_Answer = " . ($x+1); $res2 = mysql_query($sql2); while ($row2 = mysql_fetch_array($res2)) { if ($poll_data != "") $poll_data .= ","; $poll_data .= "['" . trim(addslashes(stripslashes($v))) . "', " . $row2['cnt'] . "]"; } } print "chartsData.chart{$row['POQ_ID']} = {}; chartsData.chart{$row['POQ_ID']}.data = new google.visualization.DataTable(); chartsData.chart{$row['POQ_ID']}.data.addColumn('string', 'Answer'); chartsData.chart{$row['POQ_ID']}.data.addColumn('number', 'votes'); chartsData.chart{$row['POQ_ID']}.data.addRows([$poll_data]); chartsData.chart{$row['POQ_ID']}.chart = new google.visualization.$charttype(document.getElementById('chart{$row['POQ_ID']}')); chartsData.chart{$row['POQ_ID']}.options = { is3D:true, width:\"90%\", height:\"90%\", colors: [$colours]};\n\n"; } } print "} function drawCharts() { $(\".chart_container\").each(function() { var id = $(this).attr(\"id\"); if (chartsData[id]) chartsData[id].chart.draw(chartsData[id].data, chartsData[id].options); });}"; exit; } if ($SCRIPT == "polls" and $PARAMETER1 == "poll-delete" and isset($US_ID) and is_numeric($PARAMETER2)) { if ($US_TYPE == "A" or $US_TYPE == "S") { $res = mysql_query("update PO_PollQuestions set POQ_Status = 'D' where POQ_ID = " . mysql_real_escape_string($PARAMETER2) . " limit 1"); } else { $sql = "select * from PO_PollQuestions where POQ_ID = " . mysql_real_escape_string($PARAMETER2) . " limit 1"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) if ($row['POQ_User'] == $US_ID) $res = mysql_query("update PO_PollQuestions set POQ_Status = 'D' where POQ_ID = " . mysql_real_escape_string($PARAMETER2) . " limit 1"); } header ("location: $PATH/members/!/polls/"); exit; } if ($SCRIPT == "members" and isset($PARAMETER1) and $PARAMETER1 != "!" and $PARAMETER1 != "") { # get user details if supplied. err if banned/deleted etc $sql = "select * from US_Users where US_Username = \"" . mysql_real_escape_string($PARAMETER1) . "\" limit 1"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) { $us_id = $row['US_ID']; $username = $row['US_Username']; $us_type = $row['US_Type']; $extra = explode("~", stripslashes($row['US_Extra'])); } if (!isset($us_type) or $us_type == "D" or $us_type == "B" or $us_type == "" or $us_type == "V") { require("fb_top.php"); print "

Error


Sorry, this user profile doesn't exist. Please contact $SUPPORT if you believe there to be an error"; require("fb_bottom.php"); exit;} } ######## LIVE #if ($SCRIPT == "members" and (!isset($PARAMETER2) or (isset($PARAMETER2) and $PARAMETER2 != "data")) and (!isset($PARAMETER3) or $PARAMETER3 == '' or (isset($PARAMETER3) and is_numeric($PARAMETER3)))) { if ($SCRIPT == "members" and (!isset($PARAMETER2) or (isset($PARAMETER2) and $PARAMETER2 != "data")) and (!isset($PARAMETER3) or $PARAMETER3 == '' or (isset($PARAMETER3) and is_numeric($PARAMETER3)))) { if (!isset($PARM_PAGE)) $PARM_PAGE = 1; if (!isset($PARAMETER2)) $PARAMETER2 = ""; $start = ($PARM_PAGE - 1) * $pagelength; if ($PARAMETER2 == "") { # ALL ACTIVITY FOR USER/SITE $PARAMETER2 = "posts"; # if (isset($us_id)) { # $PAGE_TITLE = "All site contributions from $username"; # $sql = "select MBT_Text AS txt, MBT_Date1 AS dte, MBT_ID as data, MBT_Subject as title, 'F' as type, MBT_User as user from MB_Threads where MBT_User = $us_id union # select BL_Intro AS txt, BL_DateTime AS dte, BL_ID as data, BL_Title as title, 'B' as type, BL_Author as user from BL_Blogs where BL_Author = $us_id and BL_DateTime < now() union # select '' AS txt, PLE_DateTime AS dte, PLE_Match as data, '' as title, 'Q' as type, PLE_User as user from Football_PL_Predictions where PLE_User = $us_id union # select NC_Comment AS txt, NC_DateTime as dte, concat_ws('~', NC_Story, NC_ID) as data, NE_Title as title, 'comment' as type, NC_User as user from NC_NewsComments, NE_News where NC_Story = NE_ID and NC_User = $us_id order by dte desc limit $start, $pagelength"; #} # else { # $PAGE_TITLE = "What's happening now on $SITE_NAME"; # $sql = "select LV_Text AS txt, LV_DateTime as dte, LV_Data as data, LV_Title as title, LV_Type as type, LV_User as user from LV_Live where LV_Domain = $SITE_ID order by LV_DateTime desc limit $start, $pagelength"; } } if ($PARAMETER2 == "posts") { if (isset($us_id)) { $PAGE_TITLE = "Latest forum posts by $username"; $sql = "select MBT_Text AS txt, MBT_Date1 AS dte, MBT_ID as data, MBT_Subject as title, 'F' as type, MBT_User as user from MB_Threads where MBT_User = $us_id union select MBR_Text AS txt, MBR_Date AS dte, MBR_ID as data, MBR_Subject as title, 'f' as type, MBR_User as user from MB_Replies where MBR_User = $us_id and MBR_Initial = 0 order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "Latest forum posts"; $sql = "select LV_Text AS txt, LV_DateTime as dte, LV_Data as data, LV_Title as title, LV_Type as type, LV_User as user from LV_Live where LV_Domain = $SITE_ID and LV_Type = 'F' order by LV_DateTime desc limit $start, $pagelength"; } } if ($PARAMETER2 == "comments") { if (isset($us_id)) { $PAGE_TITLE = "Latest news and blog comments by $username"; $sql = "select NC_Comment AS txt, NC_DateTime as dte, NC_ID as data, NC_Story as title, 'C' as type, NC_User as user from NC_NewsComments where NC_Status != 'D' and NC_User = $us_id union select NC_Comment AS txt, NC_DateTime as dte, NC_ID as data, NC_Story as title, 'c' as type, NC_User as user from BC_BlogComments where NC_User = $us_id order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "Latest news and blog comments"; $sql = "select LV_Text AS txt, LV_DateTime as dte, LV_Data as data, LV_Title as title, LV_Type as type, LV_User as user from LV_Live where LV_Domain = $SITE_ID and (LV_Type = 'C' or LV_Type = 'c') order by LV_DateTime desc limit $start, $pagelength"; } } if ($PARAMETER2 == "polls") { if (isset($us_id)) { $PAGE_TITLE = "Latest polls by $username"; $sql = "select POQ_Answers AS txt, POQ_DateTime as dte, POQ_ID as data, POQ_Question as title, 'P' as type, POQ_User as user from PO_PollQuestions where POQ_User = $us_id and POQ_Status != 'D' order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "Latest polls"; $sql = "select POQ_Answers AS txt, POQ_DateTime as dte, POQ_ID as data, POQ_Question as title, 'P' as type, POQ_User as user from PO_PollQuestions where POQ_Domain = $SITE_ID and POQ_Status != 'D' order by dte desc limit $start, $pagelength"; } } if ($PARAMETER2 == "ratings") { if (isset($us_id)) { $PAGE_TITLE = "Latest ratings by $username"; $sql = "select '' AS txt, max(PRV_DateTime) as dte, PRV_Match as data, '' as title, 'R' as type, PRV_User as user from Football_PV_PlayerVotes where PRV_User = $us_id group by PRV_Match, PRV_User order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "Latest polls"; $sql = "select '' AS txt, max(PRV_DateTime) as dte, PRV_Match as data, '' as title, 'R' as type, PRV_User as user from Football_PV_PlayerVotes group by PRV_Match, PRV_User order by dte desc limit $start, $pagelength"; } } if ($PARAMETER2 == "reports") { if (isset($us_id)) { $PAGE_TITLE = "Latest Your Reports by $username"; $sql = "select YR_Text AS txt, YR_DateTime as dte, YR_Match as data, '' as title, 'Y' as type, YR_User as user from Football_YR_YourReport where YR_User = $us_id and YR_Flag = 'A' order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "Latest polls"; $sql = "select YR_Text AS txt, YR_DateTime as dte, YR_Match as data, '' as title, 'Y' as type, YR_User as user from Football_YR_YourReport where YR_Flag = 'A' order by dte desc limit $start, $pagelength"; } } if ($PARAMETER2 == "predictions") { if (isset($us_id)) { $PAGE_TITLE = "Latest predictions by $username"; $sql = "select '' AS txt, PLE_DateTime as dte, PLE_Match as data, '' as title, 'Q' as type, PLE_User as user from Football_PL_Predictions where PLE_User = $us_id order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "Latest polls"; $sql = "select '' AS txt, PLE_DateTime as dte, PLE_Match as data, '' as title, 'Q' as type, PLE_User as user from Football_PL_Predictions order by dte desc limit $start, $pagelength"; } } if ($PARAMETER2 == "team-selector") { if (isset($us_id)) { $PAGE_TITLE = "Latest team selections by $username"; $sql = "select '' AS txt, TS_DateTime as dte, TS_ID as data, TS_Title as title, 'S' as type, TS_User as user from Football_TS_TeamSelector where TS_Domain = $SITE_ID and TS_User = $us_id and TS_Status = 'L' order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "Latest team selections"; $sql = "select '' AS txt, TS_DateTime as dte, TS_ID as data, TS_Title as title, 'S' as type, TS_User as user from Football_TS_TeamSelector where TS_Domain = $SITE_ID and TS_Status = 'L' order by dte desc limit $start, $pagelength"; } } if ($PARAMETER2 == "blogs") { if (isset($us_id)) { $PAGE_TITLE = "Blogs from $username"; $sql = "select BL_Intro AS txt, BL_DateTime AS dte, BL_ID as data, BL_Title as title, 'B' as type, BL_Author as user from BL_Blogs where BL_Domain = $SITE_ID and BL_Author = $us_id and BL_DateTime < now() order by dte desc limit $start, $pagelength"; } else { $PAGE_TITLE = "$SITE_NAME blogs"; $sql = "select BL_Intro AS txt, BL_DateTime AS dte, BL_ID as data, BL_Title as title, 'B' as type, BL_Author as user from BL_Blogs where BL_Domain = $SITE_ID and BL_DateTime < now() order by dte desc limit $start, $pagelength"; } } $res = mysql_query($sql); $recs = 0; $source = ""; $lastdate = 0; $newuser = ""; while ($row = mysql_fetch_array($res)) { if ($recs < $pagelength) { $sql_user = "select * from US_Users where US_ID = " . $row['user'] . " limit 1"; $res_user = mysql_query($sql_user); $avatar = ""; $US_Username = ""; while ($row_user = mysql_fetch_array($res_user)) { if (!isset($us_id)) $newuser = " by {$row_user['US_Username']}"; if (is_file("images/avatars/{$row['user']}.gif")) $avatar = ""; else $avatar = ""; $US_Username = $row_user['US_Username']; } if ($avatar == "") $avatar = ""; $date = date("H:i j M Y", strtotime($row['dte'])); if ($row['type'] == "B") $row['txt'] = strip_tags($row['txt']); if ($row['type'] == 'F') $source .= "
$avatar
Forum
Thread
" . stripslashes($row['title']) . "
$newuser at $date

" . processText($row['txt']) . "
"; if ($row['type'] == 'f') { if ($row['title'] == "") $row['title'] = "No subject"; $s = "select MBR_Thread from MB_Replies where MBR_ID = " . mysql_real_escape_string($row['data']); $r = mysql_query($s); while ($w = mysql_fetch_array($r)) $thread = $w['MBR_Thread']; $source .= "
$avatar
Forum
Reply
" . stripslashes($row['title']) . "
$newuser at $date

" . processText($row['txt']) . "
"; } if ($row['type'] == 'B') $source .= "
$avatar
Blog
" . stripslashes($row['title']) . "
$newuser at $date

" . processText($row['txt']) . "
"; if ($row['type'] == 'S') $source .= "
$avatar
Team
Selector
" . stripslashes($row['title']) . "
$newuser at $date

" . processText("[team:{$row['data']}]") . "
"; if ($row['type'] == 'C') { $s = "select NE_Title from NE_News where NE_ID = " . mysql_real_escape_string($row['title']); $r = mysql_query($s); while ($w = mysql_fetch_array($r)) $title = $w['NE_Title']; $source .= "
$avatar
News
Comment
$title
$newuser at " . date("H:i:s", strtotime($row['dte'])) . "

" . processText($row['txt']) . "
"; } if ($row['type'] == 'c') { $s = "select BL_Title from BL_Blogs where BL_ID = " . mysql_real_escape_string($row['title']); $r = mysql_query($s); while ($w = mysql_fetch_array($r)) $title = $w['BL_Title']; $source .= "
$avatar
Blog
Comment
$title
$newuser at " . date("H:i:s", strtotime($row['dte'])) . "

" . processText($row['txt']) . "
"; } if ($row['type'] == 'P') { if (isset($polls)) $polls .= "|"; else $polls = ""; $polls .= $row['data']; $source .= "
$avatar
Poll
" . stripslashes($row['title']) . " $newuser at " . date("H:i:s", strtotime($row['dte'])) . "
"; } if ($row['type'] == 'Q') { $s = "select PLG_HomeTeam, PLG_AwayTeam from Football_GA_Games where PLG_ID = {$row['data']} limit 1"; $r = mysql_query($s); while ($w = mysql_fetch_array($r)) $text = "{$w['PLG_HomeTeam']} v {$w['PLG_AwayTeam']}"; $source .= "
$avatar
Prediction
Prediction Logged by $newuser at " . date("H:i:s", strtotime($row['dte'])) . "
$text prediction logged
"; } if ($row['type'] == 'R') { $s = "select PLG_HomeTeam, PLG_AwayTeam from Football_GA_Games where PLG_ID = {$row['data']} limit 1"; $r = mysql_query($s); while ($w = mysql_fetch_array($r)) $text = "{$w['PLG_HomeTeam']} v {$w['PLG_AwayTeam']}"; $source .= "
$avatar
Rating
Match Ratings $newuser at " . date("H:i:s", strtotime($row['dte'])) . "
$text match ratings added
"; } if ($row['type'] == 'Y') { $s = "select PLG_HomeTeam, PLG_AwayTeam from Football_GA_Games where PLG_ID = {$row['data']} limit 1"; $r = mysql_query($s); while ($w = mysql_fetch_array($r)) $text = "{$w['PLG_HomeTeam']} v {$w['PLG_AwayTeam']}"; $source .= "
$avatar
Your
Report
$text Your Report added$newuser at " . date("H:i:s", strtotime($row['dte'])) . "
" . processText($row['txt']) . "
"; } $recs++; if ($row['dte'] > $lastdate) $lastdate = $row['dte']; } } if ($PARAMETER1 == "!" and $PARM_PAGE == 1 and $PARAMETER2 == "") { $ajaxurl = "$PATH/members/!/data/"; if (isset($PARAMETER2)) $ajaxurl .= $PARAMETER2; $ajaxurl .= "/"; $JAVASCRIPT = " "; } } if ($SCRIPT == "members" and isset($PARAMETER2) and $PARAMETER2 == "polls" and isset($PARAMETER3) and is_numeric($PARAMETER3)) { # display poll $sql = "select * from PO_PollQuestions where POQ_ID = " . mysql_real_escape_string($PARAMETER3) . " and POQ_Status != 'D' limit 1"; $res = mysql_query($sql); $page = ""; while ($row = mysql_fetch_array($res)) { $polls = $PARAMETER3; $page .= "

{$row['POQ_Question']}

"; $PAGE_TITLE = "Poll: {$row['POQ_Question']}"; $answers = explode("\n", $row['POQ_Answers']); if ($row['POQ_Status'] == "P") $page .= "
The Result:
"; else $page .= "
Your Vote:
"; $a = 1; #if (!isset($US_ID)) $page .= "

You need to be logged in to vote on our site polls

"; # else { $sql2 = "select * from PO_PollAnswers where POA_Poll = {$row['POQ_ID']} and POA_User = $US_ID limit 1"; $res2 = mysql_query($sql2); while ($row2 = mysql_fetch_array($res2)) $user_answer = $row2['POA_Answer']; if ($US_TYPE == "A" or $US_TYPE == "S" or $row['POQ_User'] == $US_ID) $page .= "
Click here to delete this poll

"; # } if ($row['POQ_Status'] == "P") $page .= ""; foreach ($answers as &$answer) { #if (isset($US_ID)) { if ($row['POQ_Status'] == "L") { $page .= "" . stripslashes($answer) . ""; if (isset($user_answer) and $user_answer == $a) $page .= "  (Your current vote)"; $page .= "

"; } else { $sql2 = "select count(*) as cnt from PO_PollAnswers where POA_Poll = {$row['POQ_ID']} and POA_Answer = $a and POA_User not like '%.%'"; $res2 = mysql_query($sql2); while ($row2 = mysql_fetch_array($res2)) $ta = $row2['cnt']; $sql2 = "select count(*) as cnt from PO_PollAnswers where POA_Poll = {$row['POQ_ID']} and POA_Answer = $a and POA_User like '%.%'"; $res2 = mysql_query($sql2); while ($row2 = mysql_fetch_array($res2)) $tb = $row2['cnt']; $page .= ""; } #} $a++; } if ($row['POQ_Status'] == "P") $page .= "
MembersNon-MembersTotal
" . stripslashes($answer) . "$ta$tb" . ($ta+$tb) . "
"; $page .= "


To embed this in a blog, comment, forum post etc, use [poll_{$row['POQ_ID']}]

"; } if (isset($polls)) $page .= " "; } if ($PARAMETER1 == "forum-update") { # if (isset($US_ID)) { # $res = mysql_query("update US_UserSettings US_Value = '" . mysql_real_escape_string($_POST['resolution']) . "' where US_ID = $US_ID and US_Key = 'RES'"); if (mysql_affected_rows()==0) $res = mysql_query("insert into US_UserSettings values($US_ID, 'RES', '" . mysql_real_escape_string($_POST['resolution']) . "'"); # $res = mysql_query("update US_UserSettings US_Value = '" . mysql_real_escape_string($_POST['refresh']) . "' where US_ID = $US_ID and US_Key = 'REF'"); if (mysql_affected_rows()==0) $res = mysql_query("insert into US_UserSettings values($US_ID, 'REF', '" . mysql_real_escape_string($_POST['refresh']) . "'"); # $res = mysql_query("update US_UserSettings US_Value = '" . mysql_real_escape_string($_POST['hider']) . "' where US_ID = $US_ID and US_Key = 'HID'"); if (mysql_affected_rows()==0) $res = mysql_query("insert into US_UserSettings values($US_ID, 'HID', '" . mysql_real_escape_string($_POST['hider']) . "'"); # $res = mysql_query("update US_UserSettings US_Value = '" . mysql_real_escape_string($_POST['viewmode']) . "' where US_ID = $US_ID and US_Key = 'MBMODE'"); if (mysql_affected_rows()==0) $res = mysql_query("insert into US_UserSettings values($US_ID, 'MBMODE', '" . mysql_real_escape_string($_POST['viewmode']) . "'"); # $res = mysql_query("update US_UserSettings US_Value = '" . mysql_real_escape_string($_POST['timeformat']) . "' where US_ID = $US_ID and US_Key = 'TFMT'"); if (mysql_affected_rows()==0) $res = mysql_query("insert into US_UserSettings values($US_ID, 'TFMT', '" . mysql_real_escape_string($_POST['timeformat']) . "'"); # $res = mysql_query("update US_UserSettings US_Value = '" . mysql_real_escape_string($_POST['avatar']) . "' where US_ID = $US_ID and US_Key = 'AVP'"); if (mysql_affected_rows()==0) $res = mysql_query("insert into US_UserSettings values($US_ID, 'AVP', '" . mysql_real_escape_string($_POST['avatar']) . "'"); # $res = mysql_query("update US_UserSettings US_Value = '" . mysql_real_escape_string($_POST['repeat']) . "' where US_ID = $US_ID and US_Key = 'ROP'"); if (mysql_affected_rows()==0) $res = mysql_query("insert into US_UserSettings values($US_ID, 'ROP', '" . mysql_real_escape_string($_POST['repeat']) . "'"); # } if (isset($_POST['resolution'])) if (is_numeric($_POST['resolution'])) setcookie("RES",$_POST['resolution'],time()+(10*365*24*3600), "/"); if (isset($_POST['refresh'])) if (is_numeric($_POST['refresh'])) setcookie("REF",intval($_POST['refresh']),time()+(10*365*24*3600), "/"); if (isset($_POST['hider'])) if (is_numeric($_POST['hider'])) setcookie("HID",$_POST['hider'],time()+(10*365*24*3600), "/"); if (isset($_POST['viewmode'])) setcookie("MBMODE",$_POST['viewmode'],time()+(10*365*24*3600), "/"); if (isset($_POST['timeformat'])) setcookie("TFMT",$_POST['timeformat'],time()+(10*365*24*3600), "/"); if (isset($_POST['wc2014'])) setcookie("WC",$_POST['wc2014'],time()+(10*365*24*3600), "/"); # if (isset($_POST['avatar'])) setcookie("AVP",$_POST['avatar'],time()+(10*365*24*3600), "/"); # if (isset($_POST['repeat'])) setcookie("ROP",$_POST['repeat'],time()+(10*365*24*3600), "/"); header("location: $PATH/settings/forum-updated"); exit; } #$STYLESHEET = "#submenu{ padding: 0 5px 0 0; width: 100%; background: transparent; voice-family: inherit;} #submenu ul{ font: bold 10pt Calibri; margin:0; margin-left: 0px; padding: 0; list-style: none; } #submenu li{ display: inline; margin: 0 2px 0 0; padding: 0; } #submenu a{ float: left; display: block; color: white; margin: 0 1px 0 0; padding: 5px 10px; text-decoration: none; letter-spacing: 1px; background-color: black; border-bottom: 1px solid white; } #submenu a:hover{ background-color: #$TP_BORDER2; } #submenu #current a{ background-color: #$TP_BORDER1; border-color: #$TP_BORDER1; } #submenuline {clear:both; padding:0 5px 0 0; height:5px; line-height:5px; background:#$TP_BORDER1; margin-bottom:5px; }"; $STYLESHEET = "#acttext { border-style: dotted; margin:0 5px 5px 0; padding:5px 5px 10px 0; border-width: 0px 0px 1px 0px; border-color: #cccccc; } #acttitle { font-size:1.2em; font-style:italic; } label { width: 160px; float: left; text-align: left; margin-right: 0.5em; display: block; font-weight: bold }"; if ($SCRIPT == "team-selector") { $JAVASCRIPT = ""; } require("fb_top.php"); # MENUS ######################################## if ($SCRIPT == "settings") { # settings menu if ($PARAMETER1 == "") $PARAMETER1 = "about-me"; print "
 
\n"; } else if ($SCRIPT == "members" and isset($PARAMETER1) and ($PARAMETER1 == "!" or $PARAMETER1 == "")) { # live menu print "
 
"; } else if (isset($username)) { # profile menu if (!isset($PARAMETER2)) $PARAMETER2 = ""; print "
"; print "
 
"; } # end of menus ################################# print "'; $elements = explode("\n", $row_q['POQ_Answers']); $q = 1; foreach ($elements as &$element) { $element = rtrim($element); print ''; $q++; } print '
"; if ($SCRIPT == "members" and isset($US_ID) and isset($PARAMETER2) and $PARAMETER2 == "team-selector") print "\n"; if ($SCRIPT == "members" and isset($US_ID) and isset($PARAMETER2) and $PARAMETER2 == "polls") print "\n"; if ($SCRIPT == "members" and !isset($US_ID) and isset($PARAMETER2) and $PARAMETER2 == "blogs") print "\n"; if ($SCRIPT == "members" and isset($US_ID) and isset($PARAMETER2) and $PARAMETER2 == "blogs" and $US_BLOGGER != "Y") print "\n"; if ($SCRIPT == "members" and isset($US_ID) and isset($PARAMETER2) and $PARAMETER2 == "blogs" and $US_BLOGGER == "Y") print "\n"; if ($SCRIPT == "members" and isset($PARAMETER2) and $PARAMETER2 == "polls" and isset($PARAMETER3) and is_numeric($PARAMETER3)) { # display poll print $page; } else if ($SCRIPT == "members") { if ($PARAMETER1 == "!" and $PARAMETER2 == "" and $PARM_PAGE == 1) print "
This page will automatically update
"; print "
$source
"; if (isset($US_ID)) { print "
  • "; if ($PARM_PAGE == 1) print "< previous
  • "; else print "< previous"; for ($x = ($PARM_PAGE - 5); $x <= ($PARM_PAGE + 5); $x++) { if ($PARM_PAGE == $x) print "
  • $x
  • "; else if ($x < 1) print ""; else if ($x == 1) print "
  • $x
  • "; else print "
  • $x
  • "; #if ($x == ($PARM_PAGE + 5)) $x = $pagecount + 1; } if ($recs == $pagelength) print "
  • next >
  • "; else print "
  • next >
  • "; print "
"; } else print "Please log in to use all the site's facilities"; if (isset($polls)) print ""; } if ($PARAMETER1 == "dsppoll") { # display poll if ($INPUT_poll != "") { $sql_poll = "select * from PO_PollQuestions where POQ_ID = " . $INPUT_poll; $res_poll = mysql_query($sql_poll); while ($row_poll = mysql_fetch_array($res_poll)) { $title = stripslashes($row_poll['POQ_Question']); $status = $row_poll['QH_Status']; } print '

' . $title . '


'; ?>
'; print '
Vote now!
' . stripslashes($element) . '
'; } } } if ($PARAMETER1 == "dspratings") { # display poll print "

$username Player Ratings

"; $mom = "0"; $best = 0; $sql2 = "select sum(PRV_Vote) / count(*) as a, sum(PRV_Vote) as b, count(*) as c, PRV_Player, PLP_Forename, PLP_Surname from PV_PlayerVotes, PL_Players where PLP_ID = PRV_Player and PRV_Player > 0 and PRV_IP = " . $INPUT_id . " group by PRV_Player order by a desc"; $res2 = mysql_query($sql2); print "
"; while ($row2 = mysql_fetch_array($res2)) { $COUNT2 = $row2['c']; $CUM = $row2['b']; $PLAYER = $row2['PRV_Player']; if (($CUM / $COUNT2) > $best) { $mom = $PLAYER; $best = ($CUM / $COUNT2); } print ""; } print "
" . stripslashes($row2['PLP_Forename']) . " " . stripslashes($row2['PLP_Surname']) . ""; $width = $row2['a']; printf ("%01.2f", $width); print "

"; } if ($PARAMETER1 == "userreport") { # display reports by a person print "\n"; $sql = "select * from Football_GA_Games where (PLG_HomeTeam = '" . $TEAM_NAME . "' or PLG_AwayTeam = '" . $TEAM_NAME . "') and PLG_Date > " . $mindate . " and PLG_HomeScore > -1 order by PLG_Date"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) { $match = $row['PLG_ID']; $hometeam = $row['PLG_HomeTeam']; $awayteam = $row['PLG_AwayTeam']; $type = $row['PLG_Type']; $round = $row['PLG_Round']; $matchdate = $row['PLG_Date']; $matchtime = $row['PLG_Time']; if ($type == "F") $desc = "FAC"; elseif ($type == "C") $desc = "CC"; elseif ($type == "P") $desc = "PO"; else $desc = ""; $desc = $desc . $round; $mom = "0"; $best = 0; $sql2 = "select count(*) a, sum(PRV_Vote) b, PRV_Player from PV_PlayerVotes where PRV_Match = " . $match . " and PRV_Team = $TEAM_NUMBER and PRV_Player > 0 and PRV_IP = $INPUT_id group by PRV_Player order by b desc limit 1"; $res2 = mysql_query($sql2); while ($row2 = mysql_fetch_array($res2)) { $COUNT2 = $row2['a']; $CUM = $row2['b']; $PLAYER = $row2['PRV_Player']; if (($CUM / $COUNT2) > $best) { $mom = $PLAYER; $best = ($CUM / $COUNT2); } } $sql2 = "select PLP_ID, PLP_Surname, PLP_Forename from PL_Players where PLP_ID = " . $mom; $res2 = mysql_query($sql2); while ($row2 = mysql_fetch_array($res2)) { $mom = "MoM: " . $row2['PLP_Forename'] . " " . $row2['PLP_Surname']; } if ($mom == "0") { $mom = ""; } print "\n"; $sql2 = "select * from YR_YourReport where YR_Match = " . $match . " and YR_Flag != 'D' and YR_User = $INPUT_id"; $comment = ""; $res2 = mysql_query($sql2); while ($row2 = mysql_fetch_array($res2)) { $comment = processText($row2['YR_Text']); } echo ""; if ($mom != "") echo ""; } print "
" . date("j M", strtotime($matchdate)) . "" . $row['PLG_HomeTeam'] . " " . $row['PLG_HomeScore'] . " - " . $row['PLG_AwayScore'] . " " . $row['PLG_AwayTeam'] . " $desc
$comment
" . $mom . "
\n"; } # SETTINGS ######################################################################################################################################################################## if ($SCRIPT == "settings" and !isset($US_ID)) { header("location: $PATH/"); exit; } else if ($SCRIPT == "settings") { $sql = "select US_Email, US_ID, US_Type, US_Username, US_Extra from US_Users where US_ID = \"" . mysql_real_escape_string($US_ID) . "\" limit 1"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) { $us_id = $row['US_ID']; $username = $row['US_Username']; $us_type = $row['US_Type']; $email = $row['US_Email']; $extra = explode("~", stripslashes($row['US_Extra'])); } } if ($SCRIPT == "settings" and $PARAMETER1 == "about-me-update" and isset($US_ID)) { $swearerr = "N"; if (swearcheck($_POST['text']) == "Y") { print "
Edit About Me

Error: Please remove the bad language from this text

"; print "

"; } else { $extra[1] = str_replace("~", "-", $_POST['text']); $newextra = implode("~", $extra); $sql_upd = "update US_Users set US_Extra = \"" . mysql_real_escape_string($newextra) . "\" where US_ID = $US_ID limit 1"; mysql_query($sql_upd); $PARAMETER1 = "about-me"; } } if ($SCRIPT == "settings" and $PARAMETER1 == "about-me" and isset($US_ID)) { print "
About Me
" . processText($extra[1]); if ($extra[1] == "") print "You currently do not have anything set in your About Me text. Feel free to tell us something about yourself, but as this information is publicly available please don't put any personal details that could identify you such as your name, address, phone number or social media links, although that is up to you."; print "

"; } if ($SCRIPT == "settings" and $PARAMETER1 == "about-me-edit" and isset($US_ID)) { print "
Edit About Me
"; print "

"; } if ($SCRIPT == "settings" and substr($PARAMETER1, 0, 5) == "forum") { print "
Change Site Settings"; $sel1 = ""; $sel2 = ""; $sel3 = ""; $sel4 = ""; if (isset($_COOKIE['MBMODE']) and $_COOKIE['MBMODE'] == "bs") $sel1 = "selected"; else if (isset($_COOKIE['MBMODE']) and $_COOKIE['MBMODE'] == "bc") $sel2 = "selected"; else if (isset($_COOKIE['MBMODE']) and $_COOKIE['MBMODE'] == "td") $sel3 = "selected"; else if (isset($_COOKIE['MBMODE']) and $_COOKIE['MBMODE'] == "tu") $sel4 = "selected"; if ($FORUM_FORMAT != "S") print "

"; $sel1 = ""; $sel2 = ""; if (isset($_COOKIE['HID']) and $_COOKIE['HID'] == 1) $sel1 = "selected"; else if (isset($_COOKIE['HID']) and $_COOKIE['HID'] == 0) $sel2 = "selected"; print "

"; # $sel1 = ""; $sel2 = ""; if (isset($_COOKIE['AVP']) and $_COOKIE['AVP'] == 'R') $sel1 = "selected"; else if (isset($_COOKIE['AVP']) and $_COOKIE['AVP'] == 'L') $sel2 = "selected"; # print "

"; # $sel1 = ""; $sel2 = ""; $sel3 = ""; if (isset($_COOKIE['ROP']) and $_COOKIE['ROP'] == 'Y') $sel1 = "selected"; else if (isset($_COOKIE['ROP']) and $_COOKIE['ROP'] == 'N') $sel2 = "selected"; # print "

"; $sel1 = ""; $sel2 = ""; $sel3 = ""; if (isset($_COOKIE['REF']) and $_COOKIE['REF'] == 0) $sel1 = "selected"; else if (isset($_COOKIE['REF']) and $_COOKIE['REF'] == 1) $sel2 = "selected"; else if (isset($_COOKIE['REF']) and $_COOKIE['REF'] == 5) $sel3 = "selected"; print "

"; $sel1 = ""; $sel2 = ""; $sel3 = ""; if (isset($_COOKIE['RES']) and $_COOKIE['RES'] == 1) $sel1 = "selected"; else if (isset($_COOKIE['RES']) and $_COOKIE['RES'] == 2) $sel2 = "selected"; else if (isset($_COOKIE['RES']) and $_COOKIE['RES'] == 3) $sel3 = "selected"; print "

"; $sel1 = ""; $sel2 = ""; if (isset($_COOKIE['TFMT']) and $_COOKIE['TFMT'] == 'a') $sel1 = "selected"; else if (isset($_COOKIE['TFMT']) and $_COOKIE['TFMT'] == 'r') $sel2 = "selected"; print "

"; #$sel1 = ""; $sel2 = ""; if (isset($_COOKIE['WC']) and $_COOKIE['WC'] == 'Y') $sel1 = "selected"; else $sel2 = "selected"; #print "

"; print "

"; if ($PARAMETER1 == "forum-updated") print "Your settings have been saved "; print "

Back to the forum

"; print "

Please note: these settings are saved to your current browser and are not permanent, so you may need to update these from time to time. This is to allow you to have different settings at home, work, on your mobile phone etc.

"; print "
"; } if ($SCRIPT == "settings" and $PARAMETER1 == "avatar" and isset($US_ID)) { print "
Upload New Avatar
"; print "



NB. The image will be resized to 100 x 100 pixels.
For best results use a square image.
"; } if ($SCRIPT == "settings" and $PARAMETER1 == "avatar-update" and isset($US_ID)) { if ($_FILES['avatar']['name']!="") { if ($_FILES["avatar"]["error"] > 0) { print "

Error!


Sorry, there was a problem with the file you selected. It might have been too big, I'm not sure... please try again by clicking here."; } else { if (isset($TWTD)) $upurl = "/home/twtd/public_html/images/avatars/"; else $upurl = "/home/fansnetwork/public_html/images/avatars/"; if (resize($_FILES['avatar']['tmp_name'], 100, 100,"$upurl{$US_ID}.gif") == 1) print "

Upload Complete



Your new avatar has been uploaded and can be seen below:



If you find that your avatar hasn't updated on other pages, just refresh the page to download all the latest images."; else print "

Error!


Sorry, the image you uploaded was too big. The avatar will ultimately be 100 x 100 pixels in size, and the image you uploaded was greater than 2000 pixels. Please resize the image or select a different one and try again."; } } } if ($SCRIPT == "settings" and $PARAMETER1 == "signature-update" and isset($US_ID)) { if (swearcheck($_POST['sig']) == "Y") { $msg = "Signature contains unacceptable language. Please correct and continue   "; $PARAMETER1 = "signature"; } else { $extra[0] = str_replace("~", "-", $_POST['sig']); $newextra = implode("~", $extra); $sql_upd = "update US_Users set US_Extra = \"" . mysql_real_escape_string($newextra) . "\" where US_ID = $US_ID limit 1"; mysql_query($sql_upd); $msg = "Your changes have been saved   "; $PARAMETER1 = "signature"; } } if ($SCRIPT == "settings" and $PARAMETER1 == "signature" and isset($US_ID)) { print "
Edit Forum Signature

"; if (isset($msg)) print $msg; print "

Back to the forum

"; } if ($SCRIPT == "settings" and $PARAMETER1 == "security-update" and isset($US_ID)) { $msg = ""; if ($_POST['pwd1'] != $_POST['pwd2']) $msg .= "New passwords don't match
"; if ((strlen($_POST['pwd1']) < 5) or (strlen($_POST['pwd1']) > 20)) $msg .= "New passwords should be in the range of 6-20 characters
"; $sql_pwd = "select US_ID from US_Users where US_ID = $US_ID and US_Password = '" . md5($_POST['oldpwd']) . "' limit 1"; $res_pwd = mysql_query($sql_pwd); $rowcount_pwd = mysql_num_rows($res_pwd); if ($rowcount_pwd != 1) { $sql_user = "select * from US_Users where US_ID = $US_ID limit 1"; $res_user = mysql_query($sql_user); while ($row_user = mysql_fetch_array($res_user)) { if (password_verify($_POST['oldpwd'], $row_user['US_Password'])) { # great } else { $msg .= "Old password doesn't match what is held on file
"; } } } if(!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) $msg .= "Email address must be in the format of user@domain.com
"; if ($msg == "") { $sql_upd = "update US_Users set US_Password = '" . md5($_POST['pwd1']) . "', US_Email = '" . mysql_real_escape_string(($_POST['email'])) . "' , US_System = '', US_DatePasswordChange = now(), US_FailedPasswords = 0, US_TimeSinceLastFail = '0000-00-00 00:00:00' where US_ID = $US_ID limit 1"; mysql_query($sql_upd); $msg = "Your changes have been saved"; } $PARAMETER1 = "security"; } if ($SCRIPT == "settings" and $PARAMETER1 == "security" and isset($US_ID)) { $sql = "select US_Email from US_Users where US_ID = \"" . mysql_real_escape_string($US_ID) . "\" limit 1"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) $email = $row['US_Email']; if (substr($email, 0, 7) == "http://") { print "
Update Security Settings

You are logged in by using your Twitter or Facebook account, so there is nothing to be updated here.

"; } else { print "
Update Security Settings
"; print "

"; print "

"; print "

"; print "

 

"; print "

"; print "

If you've forgotten your password, click here

"; print "

"; if (isset($msg)) print "$msg"; print "

"; print "
"; } } if ($SCRIPT == "settings" and $PARAMETER1 == "ignore-member" and isset($US_ID)) { $sql_user = "select * from US_Users where US_Username = '" . mysql_real_escape_string($PARAMETER2) . "' and US_ID != $US_ID limit 1"; $res_user = mysql_query($sql_user); $ignor = "N"; while ($row_user = mysql_fetch_array ($res_user)) { $ignor = "Y"; if ($row_user['US_Type'] == "A") { $msg = "Sorry, admins can't be ignored!"; } else { $upd_ignore = "update US_Users set US_Ignored = concat(US_Ignored, 'U," . $row_user['US_ID'] . ";') where US_ID = $US_ID limit 1"; if (mysql_query($upd_ignore)) $msg = "Member added to your ignore list. To remove, go to your settings page."; else $msg = "Sorry, that didn't work for some reason. Please contact $SUPPORT if you believe there to be a problem."; } } if ($ignor == "N") $msg = "Sorry, that didn't work for some reason. Please contact $SUPPORT if you believe there to be a problem."; $PARAMETER1 = "ignore"; } if ($SCRIPT == "settings" and $PARAMETER1 == "ignore-remove" and isset($US_ID) and is_numeric($PARAMETER2)) { $US_IGNORED = str_replace("U," . mysql_real_escape_string($PARAMETER2) . ";", "", $US_IGNORED); $upd_ignore = "update US_Users set US_Ignored = \"$US_IGNORED\" where US_ID = $US_ID limit 1"; mysql_query($upd_ignore); $msg = "Your changes have been saved"; $PARAMETER1 = "ignore"; } if ($SCRIPT == "settings" and $PARAMETER1 == "ignore-thread-remove" and isset($US_ID) and is_numeric($PARAMETER2)) { $upd_ignore = "update MB_Threads set MBT_BadPost = replace(MBT_BadPost, '<$US_ID>', '') where MBT_ID = " . mysql_real_escape_string($PARAMETER2) . " limit 1"; mysql_query($upd_ignore); $msg = "Your changes have been saved"; $PARAMETER1 = "ignore"; } if ($SCRIPT == "settings" and $PARAMETER1 == "ignore" and isset($US_ID)) { if (isset($msg)) print "

$msg

"; print "
Ignored Members"; $sql_user = "select * from US_Users where US_ID = $US_ID limit 1"; $res_user = mysql_query($sql_user); while ($row_user = mysql_fetch_array ($res_user)) $US_IGNORED = $row_user['US_Ignored']; $ignored = explode(";", $US_IGNORED); $igd = 0; foreach ($ignored as &$value) { $userfinder = substr($value, 2,100); $usignoretype = substr($value, 0,1); if (is_numeric($userfinder) and $usignoretype == 'U') { $sql_user = "select * from US_Users where US_ID = " . $userfinder . " limit 1"; $res_user = mysql_query($sql_user); while ($row_user = mysql_fetch_array($res_user)) { if ($row_user['US_LastOnline'] > $earlier) $useronline = "online"; else $useronline = "offline"; print "
"; if (is_file("images/avatars/{$row_user['US_Username']}.gif")) print ""; else print ""; print "
{$row_user['US_Username']}

"; } $igd++; } } if ($igd == 0) print "

No posters are currently ignored. To add a person to this list, click the icon underneath their avatar. This will prevent you from seeing their posts in the future.

"; print "


Hidden Threads"; $sql = "select * from MB_Threads, US_Users where MBT_BadPost like \"%<$US_ID>%\" and MBT_User = US_ID order by MBT_Date1"; $res = mysql_query($sql); while ($row = mysql_fetch_array($res)) { print "" . stripslashes($row['MBT_Subject']) . " by {$row['US_Username']} posted " . twitter_time_format($row['MBT_Date1']) . "
"; } print "
"; } if (($PARAMETER1 == "insertblog") and ($US_BLOGGER == "Y")) { # insert blog $err = ""; $swearerr = swearcheck($INPUT_title); if ($swearerr == "Y") $err .= "Your blog title contains unacceptable language
"; $swearerr = swearcheck($INPUT_text); if ($swearerr == "Y") $err .= "Your blog text contains unacceptable language
"; if ($INPUT_title == "") $err .= "Please supply a title for your blog
"; if ($INPUT_text == "") $err .= "You didn't supply a blog
"; if ($err != "") { $PARAMETER1 = "addblog"; $err .= "
"; } else { # $sql_ins = "insert into BL_Blogs values (0, $US_ID, now(), '" . mysql_real_escape_string($INPUT_title) . "', '" . mysql_real_escape_string($INPUT_text) . "', '')"; mysql_query($sql_ins); $sql_upd = "update US_Users set US_Blogs = US_Blogs + 1 where US_ID = $US_ID limit 1"; mysql_query($sql_upd); $intro = ""; $mainstory = ""; $text = str_replace("\r", "", $INPUT_text); $paras = explode("\n\n", $text); foreach ($paras as &$para) { $x++; if ($x == 1) $intro = $para; else $mainstory .= "

" . $para . "

"; } $mainstory = "This blog has been submitted by $US_USERNAME. To view more from this author click here. TWTD blogs are added by site users unedited by the admins. Want to become a TWTD blogger? Simply send us your first article via the Contact Us page.\n\n" . $mainstory; $later = mktime(date("G"), date("i"), 0, date("m"), date("d")+1, date("y")); $datetime = date("Y-m-d G:i:00", $later); $sql_ins = "insert into NE_News values (0, '[Blog] " . mysql_real_escape_string($INPUT_title) . "', '" . mysql_real_escape_string($intro) . "', '" . mysql_real_escape_string($mainstory) . "', 0, 'I', '$datetime', 'S', 'N', 0, $US_ID)"; mysql_query($sql_ins); $storyid = mysql_insert_id(); $sql_abuse = "select US_ID from US_Users where US_Type = 'A'"; $res_abuse = mysql_query($sql_abuse); while ($row_abuse = mysql_fetch_array($res_abuse)) { $subject = "Blog Added"; $url = "A blog has been added and will go live this time tomorrow.\n\nClick here to view the news story: http://$SITE_DOMAIN/news.php?storyid=$storyid"; sendPM($US_ID, $row_abuse['US_ID'], $subject, $url); } echo '
Blog Added

Your new blog has been added. You will now be redirected back to the Edit Profile" page in five seconds...'; } } if (($PARAMETER1 == "addblog") and ($US_BLOGGER == "Y")) { # add blog echo '
Add Blog

' . $err . '
Title:


Text:
'; echo '

'; } if ($PARAMETER1 == "deleteblog") { # delete blog $sql_upd = "update US_Users set US_Blogs = US_Blogs - 1 where US_ID = $US_ID limit 1"; mysql_query($sql_upd); $sql_upd = "update BL_Blogs set BL_Status = 'D' where BL_ID = " . $INPUT_blog . " and BL_User = $US_ID limit 1"; mysql_query($sql_upd); echo '
Blog Deleted

Your blog has been deleted. You will now be redirected back to the "edit profile" page in five seconds...'; } if ($PARAMETER1 == "edit_music") { # music tab print "

TWTD FM is a collection of your favourite music tracks from YouTube. You can then rate the tracks and those submitted by other TWTD members. You can then play your track playlists, members' lists, even the TWTD 'station' in which everyone listens to the same track at the same time.

"; print "

Add YouTube Music Track


Place the YouTube URL of the music track that you want to add:

"; print "



NB. Please don't add tracks with advertising. "; $sql = "select * from MT_MusicTracks where MT_User = $US_ID"; $res = mysql_query($sql); print ""; while ($row = mysql_fetch_array ($res)) { print ""; } print "
{$row['MT_Title']}{$row['MT_Duration']}
"; } if ($PARAMETER1 == "edit_addmusic") { # music tab $err = ""; if (substr($_POST['url'], 0, 23) != "http://www.youtube.com/") $err .= "YouTube address must begin with \"http://www.youtube.com/\""; $rest = substr($_POST['url'], 23, 999); $pos = strpos($rest, "v="); if ($pos === false) $err .= "Error with YouTube address"; else { $pos = $pos + 2; $rest = substr($rest, $pos, 999); $pos = strpos($rest, "&"); if ($pos !== false) $rest = substr($rest, 0, $pos); $youtube = file_get_contents("http://www.youtube.com/watch?v=$rest"); $pos = strpos($youtube, "length_seconds="); if ($pos === false) $err .= "Error retrieving track duration"; else { $pos = $pos + 15; $endpos = strpos($youtube, "&", $pos); $duration = substr($youtube, $pos, ($endpos - $pos)); if (!is_numeric($duration)) $err .= "Error retrieving track duration (endpos)$duration"; else { $pos = strpos($youtube, "Add YouTube Music Track
Your track has been added and will load in a few moments..."; } else { print "

Add YouTube Music Track


$err
Place the YouTube URL of the music track that you want to add:

"; print "



NB. Please don't add tracks with advertising. "; } } if ($PARAMETER1 == "music_playtrack") { # music tab $sql = "select * from MT_MusicTracks where MT_ID = " . mysql_real_escape_string($_REQUEST['track']) . " limit 1"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) { print "

{$row['MT_Title']}

"; print ''; print '
Search for related downloads at Amazon
'; } } print ""; if (isset($US_TYPE) and ($US_TYPE == "A" or $US_TYPE == "S")) $admin = "

Ban User | IP List | Edit User"; else $admin = ""; if ($SCRIPT == "members" and $PARAMETER1 != "!" and $PARAMETER1 != "") { print "
"; if (is_file("images/avatars/$us_id.gif")) print ""; else print ""; print "

$username


$admin
"; } if ($SCRIPT == "settings") { print "
"; if (is_file("images/avatars/$US_ID.gif")) print ""; else print ""; print "

$US_USERNAME


$admin
"; } if ($SCRIPT == "members" and $PARAMETER1 != "!" and $PARAMETER1 != "" and isset($US_ID) and $US_ID != $us_id) print "

Send Private Message

Click here to send a message to $username

"; if ($SCRIPT == "members" and $PARAMETER1 != "!" and $PARAMETER1 != "" and isset($US_ID) and $US_ID != $us_id) print "

Ignore User

Click here to ignore $username

"; # $sql = "select count(*) from MB_Replies where MBR_BadPost like \"%[$us_id]%\""; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score - $row['cnt']; # $sql = "select count(*) from MB_Replies where MBR_GoodPost like \"%[$us_id]%\""; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score + $row['cnt']; $adtype = "SuperMPU"; include ("adserver.php"); if ($SCRIPT == "members" and $PARAMETER1 != "!" and $PARAMETER1 != "") { print "

Site Scores

"; $cumscore = 0; $score = 0; # $sql = "SELECT (LENGTH(MBR_BadPost) - LENGTH(REPLACE(MBR_BadPost, '[', ''))) / 1 AS cnt FROM MB_Replies WHERE MBR_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score - $row['cnt']; # $sql = "SELECT (LENGTH(MBT_BadPost) - LENGTH(REPLACE(MBT_BadPost, '[', ''))) / 1 AS cnt FROM MB_Threads WHERE MBT_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score - $row['cnt']; # $sql = "SELECT (LENGTH(MBR_GoodPost) - LENGTH(REPLACE(MBR_GoodPost, '[', ''))) / 1 AS cnt FROM MB_Replies WHERE MBR_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score + $row['cnt']; # $sql = "SELECT (LENGTH(MBT_GoodPost) - LENGTH(REPLACE(MBT_GoodPost, '[', ''))) / 1 AS cnt FROM MB_Threads WHERE MBT_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score + $row['cnt']; # print ""; $cumscore = $cumscore + $score; # # $score = 0; # $sql = "SELECT (LENGTH(NC_BadPost) - LENGTH(REPLACE(NC_BadPost, '[', ''))) / 1 AS cnt FROM NC_NewsComments WHERE NC_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score - $row['cnt']; # $sql = "SELECT (LENGTH(NC_GoodPost) - LENGTH(REPLACE(NC_GoodPost, '[', ''))) / 1 AS cnt FROM NC_NewsComments WHERE NC_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score + $row['cnt']; # $sql = "SELECT (LENGTH(BC_BadPost) - LENGTH(REPLACE(BC_BadPost, '[', ''))) / 1 AS cnt FROM BC_NewsComments WHERE NC_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score - $row['cnt']; # $sql = "SELECT (LENGTH(BC_GoodPost) - LENGTH(REPLACE(BC_GoodPost, '[', ''))) / 1 AS cnt FROM BC_NewsComments WHERE NC_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score + $row['cnt']; # $sql = "SELECT (LENGTH(YR_BadPost) - LENGTH(REPLACE(YR_BadPost, '[', ''))) / 1 AS cnt FROM Football_YR_YourReport WHERE NC_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score - $row['cnt']; # $sql = "SELECT (LENGTH(YR_GoodPost) - LENGTH(REPLACE(YR_GoodPost, '[', ''))) / 1 AS cnt FROM Football_YR_YourReport WHERE NC_User = $us_id ORDER BY cnt DESC"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $score + $row['cnt']; # print ""; $cumscore = $cumscore + $score; $score = 0; $sql = "select PLU_Points from Football_PL_Users where PLU_Key = $us_id limit 1"; $res = mysql_query($sql); while ($row = mysql_fetch_array ($res)) $score = $row['PLU_Points']; print ""; $cumscore = $cumscore + $score; print ""; print "
Forum Votes: $score
Comment Votes: $score
Prediction League: $score
TOTAL: $cumscore
"; } if ($PARAMETER1 == "music_playtrack") { print "

Tracks Submitted by $username

"; $sql = "select * from MT_MusicTracks where MT_User = $US_ID"; $res = mysql_query($sql); print ""; while ($row = mysql_fetch_array ($res)) { print ""; } print "
{$row['MT_Title']}
"; } print ""; require("fb_bottom.php"); ?>