authenticate(); $Username = $user['U_Username']; $Password = $user['U_Password']; $html = new html; if (!$user['U_Username']) { $html -> not_right ($ubbt_lang['NO_AUTH'],$Cat); } // ----------------------------------------- // Get the current profile for this username $Username_q = addslashes($Username); $query = " SELECT U_Username,U_Display,U_View,U_PostsPer,U_TextCols,U_TextRows,U_StyleSheet,U_Preview,U_PictureView,U_PicturePosts,U_Language,U_FlatPosts,U_TimeOffset,U_FrontPage,U_StartPage,U_ShowSigs,U_TimeFormat FROM {$config['tbprefix']}Users WHERE U_Username = '$Username_q' "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); // -------------------------------- // Make sure we found this Username list($UserCheck,$Display,$View,$PostsPer,$TextCols,$TextRows,$StyleSheet,$Preview,$PictureView,$PicturePost,$chosenlanguage,$FlatPosts,$TimeOffset,$FrontPage,$startpage,$sigview,$timeformat) = $dbh -> fetch_array($sth); $dbh -> finish_sth($sth); if (!$UserCheck){ $html -> not_right("{$ubbt_lang['NO_PROF']} '$Username'",$Cat); } // ------------------------------- // What is the default front page? $mainpage = "ubbthreads"; if ($config['catsonly']) { $mainpage = "categories"; } if (!$FrontPage) { $FrontPage = $mainpage; } if ($FrontPage == "categories") { $categories = "selected=\"selected\""; } else { $ubbthreads = "selected=\"selected\""; } // -------------------------- // Assign the retrieved data if (!$TextCols) { $TextCols = $theme['TextCols']; } if (!$TextRows) { $TextRows = $theme['TextRows']; } if (!$TimeOffset) { $TimeOffset = 0; } // ------------------------- // Give a default stylesheet if (!$StyleSheet) { $StyleSheet = $theme['stylesheet']; } // --------------------------- // Where do they want to start if ($startpage == "mi") { $mi = "selected=\"selected\""; } else { $cp = "selected=\"selected\""; } // -------------------------------------------------- // Find out if they already have a display preference if($Display == "flat") { $flat = "selected=\"selected\""; }; if($Display == "threaded") { $threaded = "selected=\"selected\""; } // ------------------------------- // Find out what language they use // and setup the HTML for the selection $query = " SELECT L_Language,L_Description FROM {$config['tbprefix']}Languages WHERE L_Active='1' ORDER BY L_Language "; $sth = $dbh -> do_query($query,__LINE__,__FILE__); $languageoptions = ""; while(list($langdir,$langdesc) = $dbh -> fetch_array($sth)) { $selected = ""; if (!$chosenlanguage) { if ($config['language'] == $langdir) { $selected = "selected=\"selected\""; } } else { if ($chosenlanguage == $langdir) { $selected = "selected=\"selected\""; } } $languageoptions .= ""; } // --------------------------------------- // Find out if they have a view preference if($View == "collapsed") { $collapsed = "selected=\"selected\""; } if($View == "expanded") { $expanded = "selected=\"selected\""; } // ---------------------------------------------------------------- // Find out if they have a preference for total flat posts per page if (!$FlatPosts) { $FlatPosts = $theme['flatposts']; } if (!$PictureView) { $PictureView = "on"; } // ------------------------------- // Find out if they preview or not if ($Preview != "off") { $previewon = "selected=\"selected\""; } else { $previewoff = "selected=\"selected\""; } // --------------------------------- // Set the default for picture views if ($PictureView == "on") { $yespictureview = "checked=\"checked\""; } else { $nopictureview = "checked=\"checked\""; } // --------------------------------- // Set the default for picture in posts $picturepost = ""; $nopicturepost = ""; if ($PicturePost != "off") { $picturepost = "checked=\"checked\""; } else { $nopicturepost = "checked=\"checked\""; } // ---------------------------- // Set the default for sigview if ($sigview == "no") { $nosigview = "checked=\"checked\""; } else { $yessigview = "checked=\"checked\""; } // ------------------------------ // What time format are we using? if (!$timeformat) { $timeformat = $theme['timeformat']; } if ($timeformat == "long") { $long = "SELECTED"; } elseif ($timeformat == "short1") { $short1 = "SELECTED"; } elseif ($timeformat == "short2") { $short2 = "SELECTED"; } elseif ($timeformat == "short3") { $short3 = "SELECTED"; } elseif ($timeformat == "short4") { $short4 = "SELECTED"; } elseif ($timeformat == "short5") { $short5 = "SELECTED"; } // --------------------------------------------------------- // Ok, we found the profile, now lets put it all onto a page $html -> send_header("{$ubbt_lang['DISP_HEAD']} $Username",$Cat,0,$user); // ------------------------------- // Let's list out the style sheets if ($StyleSheet == "usedefault") { $defselected = "selected=\"selected\""; } $stylesheets = ""; $styles = split(",",$theme['availablestyles']); $size = sizeof($styles); for ($i=0;$i<$size;$i++) { list($style,$desc) = split(":",$styles[$i]); $style = trim($style); $desc = trim($desc); $desc = str_replace("\'","'",$desc); $extra = ""; if ($StyleSheet == $style) { $extra = "selected=\"selected\""; } $stylesheets .= ""; } $date = $html -> get_date(); $time = $html -> convert_time($date); if ($theme['PictureView'] == 1) { $pictureview = " {$ubbt_lang['PROF_PICVIEW']}
{$ubbt_lang['TEXT_YES']} {$ubbt_lang['TEXT_NO']}

{$ubbt_lang['VIEW_PICS']}
{$ubbt_lang['TEXT_YES']} {$ubbt_lang['TEXT_NO']}

"; } else { $pictureview = ""; } // Generate a key for the profile page to make sure the // submission is legit $rightnow = time(); list($usec, $sec) = explode(' ', microtime()); srand((float) $sec + ((float) $usec * 100000)); $random = rand(); $profilehash = md5("$rightnow$random"); $profilehash_q = addslashes($profilehash); $query = " UPDATE {$config['tbprefix']}Users SET U_ProfileHash='$profilehash_q' WHERE U_Number='{$user['U_Number']}' "; $dbh->do_query($query,__LINE__,__FILE__); // --------------------- // Grab the tablewrapper list($tbopen,$tbclose) = $html -> table_wrapper(); if (!$debug) { include("$thispath/templates/$tempstyle/editdisplay.tmpl"); } $html -> send_footer(); ?>