Jump to content

lmcgr44

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lmcgr44's Achievements

Member

Member (2/5)

0

Reputation

  1. yes i do know how to insert statements this is mine mysql_select_db("lachlanmcgrath", $con); $sql="INSERT INTO tracker (Date, Time, Amonia, Nitrite, Nitrate, PH, Salinity, Tempreture) VALUES ('$_POST[Date]','$_POST[Time]','$_POST[Amonia]','$_POST[Nitrite]','$_POST[Nitrate]','$_POST[PH]','$_POST[salinity]','$_POST[Tempreture]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?> I'm trying to get at, with the insert what would i put into there for it to insert the logged in user_id
  2. I'll assume you mean "data" not "sql"? I'll assume you ,mean "...user_id field in the table"? I get the feeling you don't know very much SQL (Structured Query Language)? If you wrote the SQL to insert a new record you can add an additional column and value... ok sorry, I'm having trouble wording things because i am new, ill try again, how do i submit the logged in user_id along with the form into the database
  3. ok so thats retrieving the sql? so when I'm adding it to the sql, what would i put into the script to add the user_id to the user_id field in the sql?
  4. That doesn't make sense. You should register a user and they will have perhaps the basic details (Username, Email, Password). They login and are taken to a personalised page where they can enter additional information (E.g. information for their profile). This information is then stored in the database in the same table as their username, email and password using an UPDATE T-SQL statement... I'm not trying to be rude I'm trying to help but no-one can help you if they don't understand your logic... ok i will explain it better, what I'm trying to do really has nothing to do with the login script, only the username they use to login with, or the user_id. so once they are logged in there will be a form for them to add data into about there fish tank (this is an aquarium site) once submitted it goes to the mysql and stores into there, when the person goes to the My Records page it will display all the records that has been added to the database, but the thing i want is with that table, i want it to only show what that user has added to the database not what others users have added is that better? it is hard to explain when you don't know what it is called
  5. ok i have already got my login script set up, i have the add form to database already set up, i also have a table set up retrieving the data from the database, the only thing i can't work out how to do is the add data into the database that is specific to a user and then retrieve that data for that user when he logged in, so know else can view other peoples data, the whole point of me being on here is for help, and that is the point of this forum. am i rite?
  6. I'm sorry like i said I'm new to this, i still do not understand what u mean by that?
  7. yes I'm pretty sure i know what you mean, at the top of my pages i have if (isset($_SESSION['user_id'])) is that what you mean? if so how do i submit the user_id to the database with the form that is being submitted?
  8. ok then how can i accomplish that? can you show me somewhere on the internet that can explain and show me how? thank-you
  9. hey everyone! in new to the whole php and mysql thing and i am stuck with one part, i have got a login script, once loged in it takes them to there account page, on there account page they can added data into there file, to mysql, so what I'm looking for is how to add the username they logged in with to be added into the database with the rest of the information they just submitted, so when they go to retrieve there information into a table they will only get the information that has there username with it. as much help as possible would be great! thank-you
  10. can anyone help me? thanks
  11. helllo when people visit my site the background of my site isnt there, but then the log in, it appears, so it only works when thye are logged in, can someone please look over y code and see why this is happening, i have been stuck on this for 1 week now <?php // Start_session, check if user is logged in or not, and connect to the database all in one included file include_once("scripts/checkuserlog.php"); // Include the class files for auto making links out of full URLs and for Time Ago date formatting include_once("wi_class_files/autoMakeLinks.php"); include_once ("wi_class_files/agoTimeFormat.php"); // Create the two objects before we can use them below in this script $activeLinkObject = new autoActiveLink; $myObject = new convertToAgo; ?> <?php // Include this script for random member display on home page include_once "scripts/homePage_randomMembers.php"; ?> <?php $sql_blabs = mysql_query("SELECT id, mem_id, send_id, the_blab, blab_date FROM blabbing ORDER BY blab_date DESC LIMIT 30"); $blabberDisplayList = ""; // Initialize the variable here while($row = mysql_fetch_array($sql_blabs)){ $blabid = $row["id"]; $uid = $row['send_id'] != 0 ? $row['send_id'] : $row['mem_id'] ; $the_blab = $row["the_blab"]; $notokinarray = array("fag", "gay", "shit", "fuck", "stupid", "idiot", "asshole", "cunt", "douche"); $okinarray = array("gaybo", "homosexual", "poo", "bugger", "dumb", "jerk", "sphincter", "vagina", "douche"); $the_blab = str_replace($notokinarray, $okinarray, $the_blab); $the_blab = ($activeLinkObject -> makeActiveLink($the_blab)); $blab_date = $row["blab_date"]; $convertedTime = ($myObject -> convert_datetime($blab_date)); $whenBlab = ($myObject -> makeAgo($convertedTime)); //$blab_date = strftime("%b %d, %Y %I:%M:%S %p", strtotime($blab_date)); // Inner sql query $sql_mem_data = mysql_query("SELECT id, username, firstname, lastname FROM myMembers WHERE id='$uid' LIMIT 1"); while($row = mysql_fetch_array($sql_mem_data)){ $uid = $row["id"]; $username = $row["username"]; $firstname = $row["firstname"]; if ($firstname != "") {$username = $firstname; } // (I added usernames late in my system, this line is not needed for you) /////// Mechanism to Display Pic. See if they have uploaded a pic or not ////////////////////////// $ucheck_pic = "members/$uid/image01.jpg"; $udefault_pic = "members/0/image01.jpg"; if (file_exists($ucheck_pic)) { $blabber_pic = '<div style="overflow:hidden; width:40px; height:40px;"><img src="' . $ucheck_pic . '" width="40px" border="0" /></div>'; // forces picture to be 100px wide and no more } else { $blabber_pic = "<img src=\"$udefault_pic\" width=\"40px\" height=\"40px\" border=\"0\" />"; // forces default picture to be 100px wide and no more } $blabberDisplayList .= ' <table width="100%" align="center" cellpadding="4" bgcolor="#CCCCCC"> <tr> <td width="7%" bgcolor="#FFFFFF" valign="top"><a href="profile.php?id=' . $uid . '">' . $blabber_pic . '</a> </td> <td width="93%" bgcolor="#EFEFEF" style="line-height:1.5em;" valign="top"><span class="greenColor textsize10">' . $whenBlab . ' <a href="profile.php?id=' . $uid . '">' . $username . '</a> said: </span><br /> ' . $the_blab . '</td> </tr> </table>'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="Description" content="Cookbookers is a community website for people to create and share recipies, make friends or join up with old friends" /> <meta name="Keywords" content="cookbookers, cook, cookbook, cooks, chefs, chef, cookery, book, books, cooking, community, share, communicate,recipies, free, friends, register, shareing, " /> <meta name="author" content="lachlan mcgrath"/> <meta name="ROBOTS" content="INDEX,FOLLOW"/> <meta name="google-site-verification" content="fbI5fgCcTZh3cTw3deqVLevmvZkSOj3C-EwMDS7XMPI" /> <title>CookBookers - Your online cooking community</title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <script src="js/jquery-1.4.2.js" type="text/javascript"></script> <style type="text/css"> .style1 { font-family: Arial; font-size: 18px; } #Layer1 { height:210px; background-image: url(images/top_container_bg_recipes_new.gif); } body { margin-bottom: 0px; background-image: url(images/bg.jpg); background-repeat: repeat-x; background-color: #360904; } .boxHeader { border:#999 1px solid; background-color: #FFF; background-image:url(style/accountStrip1.jpg); background-repeat:repeat-x; padding:5px; margin-left:19px; margin-right:20px; margin-top:6px; color:#060; text-decoration:none; } .style3 {font-size: 20px} #apDiv1 { left:294px; top:308px; width:848px; height:59px; z-index:1; } #apDiv2 { left:283px; top:159px; width:288px; height:126px; z-index:2; } #filter td { filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5; } </style> <script language="javascript" type="text/javascript"> function toggleSlideBox(x) { if ($('#'+x).is(":hidden")) { $(".editBox").slideUp(200); $('#'+x).slideDown(300); } else { $('#'+x).slideUp(300); } } </script> </head> <body> <p> <?php include_once "header_template.php"; ?> </p> <center> <table cellpadding="0px" cellspacing="0px" style="border:0px solid #666666;" width="75%"> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <table cellspacing="0px" border="0" align="center" width="54%" height="25%" style="background-color:transparent"> <tr> <td><a href="http://www.facebook.com/pages/Cookbookers/140615036007324"><img src="images/facebook_button.png" width="87" height="87" align="absmiddle" /></a> <a href="http://twitter.com/cookbookers"><img src="images/Twitter_button.png" width="87" height="87" align="absmiddle"/></a></td> <tr> <td><img src="images/banner_catering.jpg" width="835" height="262" /></td> </tr> </table> <tr></tr> <tr> <td><table width="59%" height="22" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color:#F2F2F2; border:0px solid #666666;"> <tr> <td valign="top" colspan="2" style="background-color:#F2F2F2; border:0px; padding:10px;"> <table border="0" cellpadding="6"> <tr> <td class="style1">Newest Members:</td> <td> <?php print "$MemberDisplayList"; ?> </td> </tr> </table> </td> </tr> <tr> <td width="358" valign="top" style="width:250px; overflow:auto;"> <table width="358" height="152" align="center" cellpadding="4" bgcolor="#F2F2F2" style="border: 0px;"> <tr><td width="344" colspan="2">Recent Posts</td></tr> <tr> <td bgcolor="#F2F2F2" valign="top"><?php print "$blabberDisplayList"; ?></td> </tr> </table> </span> </td> <td width="557" valign="top"> <p>Hello and welcome to cookbookers.com! We are an online cooking community where you can share recipes and communicate with others that love to cook. In your account you can add recipes to share with the public or you can just keep them for yourself inside you own personal cookbook. There'll be more work happening to the website during the next couple of weeks, we're gonna be enhancing the website a bit more, adding garnishes, making it a bit more appealing for everyone. We'll be adding a few new features shortly as well: a forum, you'll be able to comment on recipes and have yours commented, a live chat. But that's just a few of them.</p> <p>If you have any suggestions for the site or any questions; feel free to contact me thought the website, send me a private message or just blab on my page. My name is Lachlan Mcgrath.</p> <p>So please join up, add recipes and make new friends on cookbookers.com today!</p> <p> </p> <p>Happy Sharing!</br> </p> <p>Lachlan McGrath</br> </p> <p>Owner/creator. </p> <p> <?php if(isset($_SESSION['username'])) { } else { include('login.php'); } ?> </p> <p> </p></td> </tr> </table> <p> <?php include_once "footer_template.php"; ?> </p> <p><!-- Histats.com START (standard)--> <script type="text/javascript">document.write(unescape("%3Cscript src=%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script%3E"));</script> <a href="http://www.histats.com" target="_blank" title="free stats" ><script type="text/javascript" > try {Histats.start(1,1395398,4,198,85,17,"00001000"); Histats.track_hits();} catch(err){}; </script></a> <noscript><a href="http://www.histats.com" target="_blank"><img src="http://sstatic1.histats.com/0.gif?1395398&101" alt="free stats" border="0"></a></noscript> <!-- Histats.com END --></p> </body> </html> thanks!
  12. thanks that works but when i go to other people profiles it show my account name, instead of theres, so how would i make it so that it gets that persons profile id and displays there account name? btw thank-you so much for helping me i am trying to learn it
  13. hello thanks for replying, i am trying to get the id of the users account and retrieve the account name for that user
  14. hello i am trying to display account name in a persons profile, when i do it, it just displays Resource id #21 Resource id #22 Resource id #23 Resource id #24 Resource id #25 Resource id #26 instead of showing the admin, or user here is the code to display the account name / Get all the data from the "myMembers" table $result = mysql_query("SELECT * FROM myMembers") or die(mysql_error()); echo "<table border='0'>"; echo "<tr> <th>Name</th></tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo mysql_query("SELECT account_name FROM myMembers WHERE id='{$_SESSION['id']}' LIMIT 1"); echo "</td><td>"; } echo "</table>"; ?> and here is the whole code for the page <?php // Start_session, check if user is logged in or not, and connect to the database all in one included file include_once("scripts/checkuserlog.php"); // Include the class files for auto making links out of full URLs and for Time Ago date formatting include_once("wi_class_files/autoMakeLinks.php"); include_once ("wi_class_files/agoTimeFormat.php"); // Create the two new objects before we can use them below in this script $activeLinkObject = new autoActiveLink; $myObject = new convertToAgo; ?> <?php // ------- INITIALIZE SOME VARIABLES --------- // they must be initialized in some server environments or else errors will get thrown $id = ""; $username = ""; $firstname = ""; $lastname = ""; $mainNameLine = ""; $country = ""; $state = ""; $city = ""; $zip = ""; $bio_body = ""; $website = ""; $youtube = ""; $facebook = ""; $twitter = ""; $twitterWidget = ""; $accounttype = ""; $locationInfo = ""; $user_pic = ""; $blabberDisplayList = ""; $interactionBox = ""; $cacheBuster = rand(999999999,9999999999999); // Put on an image URL will help always show new when changed // ------- END INITIALIZE SOME VARIABLES --------- // ------- ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS --------- if (isset($_GET['id'])) { $id = preg_replace('#[^0-9]#i', '', $_GET['id']); // filter everything but numbers } else if (isset($_SESSION['idx'])) { $id = $logOptions_id; } else { header("location: index.php"); exit(); } // ------- END ESTABLISH THE PAGE ID ACCORDING TO CONDITIONS --------- /*### New form stuff created by PaulRyan [paul_mc_2k6@hotmail.co.uk] ###*/ if(isSet($_POST['friendPost']) && strtolower($_POST['friendPost']) == 'blab' && $_POST['blab_field'] != "" && $_POST['blab_field'] != " ") { $blab = strip_tags(mysql_real_escape_string($_POST['blab_field'])); $addBlab = mysql_query("INSERT INTO blabbing (`mem_id`,`send_id`,`the_blab`,`blab_date`) VALUES ('$id','{$_SESSION['id']}','$blab',now())"); /*### [E-mail Notifications] - added by PaulRyan - [paul_mc_2k6@hotmail.co.uk] ###*/ /*################################################################################*/ if($id != $_SESSION['id'] && $addBlab) { $senderInfo = mysql_query("SELECT username FROM myMembers WHERE id='{$_SESSION['id']}' LIMIT 1"); $recieverInfo = mysql_query("SELECT username,email FROM myMembers WHERE id=$id LIMIT 1"); if(mysql_num_rows($senderInfo) && mysql_num_rows($recieverInfo)) { $senderInfo = mysql_fetch_assoc($senderInfo); $senderName = $senderInfo['username']; $recieverInfo = mysql_fetch_assoc($recieverInfo); $recieverName = $recieverInfo['username']; $sendTo = $recieverInfo['email']; $subject = 'You have a new wall post'; $headers = "From: Cookbookers [No-Reply] <notifications@cookbookers.com>m\r\n"; $headers .= "Reply-To: notifications@cookbookers.com\r\n"; $headers .= "Return-Path: notifications@cookbookers.com\r\n"; $headers .= "CC: notifications@cookbookers.com\r\n"; $headers .= "BCC: notifications@cookbookers.com\r\n"; $message = "Hello $recieverName. \n\n". "$senderName has posted the following message on your wall: \n". "-------------------- \n". "$blab \n". "-------------------- \n\n". "Please login to reply to this wall post. \n". "Login URL: http://cookbookers.com/login.php \n\n". "Thanks, CookBookers Team. \n\n". "If this message appears in your junk folder, please add notifications@cookbookers.com to your contact list."; $message = wordwrap($message, 70); mail($sendTo, $subject, $message, $headers); } } /*################################################################################*/ /*### [E-mail Notifications] - added by PaulRyan - [paul_mc_2k6@hotmail.co.uk] ###*/ header('Location: profile.php?id='.$id.''); exit; } /*### New form stuff created by PaulRyan [paul_mc_2k6@hotmail.co.uk] ###*/ // ------- FILTER THE ID AND QUERY THE DATABASE -------- $id = preg_replace('#[^0-9]#i', '', $id); // filter everything but numbers on the ID just in case $sql = mysql_query("SELECT * FROM myMembers WHERE id='$id' LIMIT 1"); // query the member // ------- FILTER THE ID AND QUERY THE DATABASE -------- // ------- MAKE SURE PERSON EXISTS IN DATABASE --------- $existCount = mysql_num_rows($sql); // count the row nums if ($existCount == 0) { // evaluate the count header("location: index.php?msg=user_does_not_exist"); exit(); } // ------- END MAKE SURE PERSON EXISTS IN DATABASE --------- // ------- WHILE LOOP FOR GETTING THE MEMBER DATA --------- while($row = mysql_fetch_array($sql)){ $username = $row["username"]; $firstname = $row["firstname"]; $lastname = $row["lastname"]; $country = $row["country"]; $state = $row["state"]; $city = $row["city"]; $sign_up_date = $row["sign_up_date"]; $sign_up_date = strftime("%b %d, %Y", strtotime($sign_up_date)); $last_log_date = $row["last_log_date"]; $last_log_date = strftime("%b %d, %Y", strtotime($last_log_date)); $bio_body = $row["bio_body"]; $bio_body = str_replace("&#39;", "'", $bio_body); $bio_body = stripslashes($bio_body); $website = $row["website"]; $youtube = $row["youtube"]; $facebook = $row["facebook"]; $twitter = $row["twitter"]; $friend_array = $row["friend_array"]; /////// Mechanism to Display Pic. See if they have uploaded a pic or not ////////////////////////// $check_pic = "members/$id/image01.jpg"; $default_pic = "members/0/image01.jpg"; if (file_exists($check_pic)) { $user_pic = "<img src=\"$check_pic?$cacheBuster\" width=\"218px\" />"; } else { $user_pic = "<img src=\"$default_pic\" width=\"218px\" />"; } /////// Mechanism to Display Real Name Next to Username - real name(username) ////////////////////////// if ($firstname != "") {; $mainNameLine = "$firstname $lastname ($username)"; $username = $firstname; } else { $mainNameLine = $username; } /////// Mechanism to Display Youtube channel link or not ////////////////////////// if ($youtube == "") { $youtube = ""; } else { $youtube = '<br /><br /><img src="images/youtubeIcon.jpg" width="18" height="12" alt="Youtube Channel for ' . $username . '" /> <strong>YouTube Channel:</strong><br /><a href="http://www.youtube.com/user/' . $youtube . '" target="_blank">youtube.com/' . $youtube . '</a>'; } /////// Mechanism to Display Facebook Profile link or not ////////////////////////// if ($facebook == "") { $facebook = ""; } else { $facebook = '<br /><br /><img src="images/facebookIcon.jpg" width="18" height="12" alt="Facebook Profile for ' . $username . '" /> <strong>Facebook Profile:</strong><br /><a href="http://www.facebook.com/profile.php?id=' . $facebook . '" target="_blank">profile.php?id=' . $facebook . '</a>'; } /////// Mechanism to Display Twitter Tweet Widget or not ////////////////////////// if ($twitter == "") { $twitterWidget = ""; } else { $twitterWidget = "<script src=\"http://widgets.twimg.com/j/2/widget.js\"></script> <script> new TWTR.Widget({ version: 2, type: 'profile', rpp: 5, interval: 6000, width: 218, height: 160, theme: { shell: { background: '#BDF', color: '#000000' }, tweets: { background: '#ffffff', color: '#000000', links: '#0066FF', } }, features: { scrollbar: true, loop: false, live: false, hashtags: true, timestamp: true, avatars: false, behavior: 'all' } }).render().setUser('$twitter').start(); </script>"; } /////// Mechanism to Display Website URL or not ////////////////////////// if ($website == "") { $website = ""; } else { $website = '<br /><br /><img src="images/websiteIcon.jpg" width="18" height="12" alt="Website URL for ' . $username . '" /> <strong>Website:</strong><br /><a href="http://' . $website . '" target="_blank">' . $website . '</a>'; } /////// Mechanism to Display About me text or not ////////////////////////// if ($bio_body == "") { $bio_body = ""; } else { $bio_body = '<div class="infoBody">' . $bio_body . '</div>'; } /////// Mechanism to Display Location Info or not ////////////////////////// if ($country == "" && $state == "" && $city == "") { $locationInfo = ""; } else { $locationInfo = "$city ยท $state<br />$country ".'<a href="#" onclick="return false" onmousedown="javascript:toggleViewMap(\'google_map\');">view map</a>'; } } // close while loop // ------- END WHILE LOOP FOR GETTING THE MEMBER DATA --------- // ------- POST NEW BLAB TO DATABASE --------- $blab_outout_msg = ""; if (isset($_POST['blab_field']) && isSet($_POST['submit']) && $_POST['submit'] == 'Blab' && $_POST['blab_field'] != "" && $_POST['blab_field'] != " "){ $blabWipit = $_POST['blabWipit']; $sessWipit = base64_decode($_SESSION['wipit']); if (!isset($_SESSION['wipit'])) { } else if ($blabWipit == $sessWipit) { // Delete any blabs over 50 for this member $sqlDeleteBlabs = mysql_query("SELECT * FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 50"); $bi = 1; while ($row = mysql_fetch_array($sqlDeleteBlabs)) { $blad_id = $row["id"]; if ($bi > 20) { $deleteBlabs = mysql_query("DELETE FROM blabbing WHERE id='$blad_id'"); } $bi++; } // End Delete any blabs over 20 for this member $blab_field = $_POST['blab_field']; $blab_field = stripslashes($blab_field); $blab_field = strip_tags($blab_field); $blab_field = mysql_real_escape_string($blab_field); $blab_field = str_replace("'", "&#39;", $blab_field); $sql = mysql_query("INSERT INTO blabbing (mem_id, the_blab, blab_date) VALUES('$id','$blab_field', now())") or die (mysql_error()); $blab_outout_msg = ""; } header('Location: profile.php?id='.$id.''); exit; } // ------- END POST NEW BLAB TO DATABASE --------- // ------- MEMBER BLABS OUTPUT CONSTRUCTION --------- /////// Mechanism to Display Pic if (file_exists($check_pic)) { $blab_pic = '<div style="overflow:hidden; height:40px;"><a href="profile.php?id=' . $id . '"><img src="' . $check_pic . '" width="40px" border="0" /></a></div>'; } else { $blab_pic = '<div style="overflow:hidden; height:40px;"><a href="profile.php?id=' . $id . '"><img src="' . $default_pic . '" width="40px" border="0" /></a></div>'; } /////// END Mechanism to Display Pic $sql_blabs = mysql_query("SELECT id, send_id, mem_id, the_blab, blab_date FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 20"); while($row = mysql_fetch_array($sql_blabs)){ $blabid = $row["id"]; $uid = $row['send_id'] != 0 ? $row['send_id'] : $row['mem_id'] ; $the_blab = $row["the_blab"]; $the_blab = ($activeLinkObject -> makeActiveLink($the_blab)); $blab_date = $row["blab_date"]; $convertedTime = ($myObject -> convert_datetime($blab_date)); $whenBlab = ($myObject -> makeAgo($convertedTime)); if($row['send_id'] != $row['mem_id'] && $row['send_id'] != 0) { $tUsername = mysql_fetch_assoc(mysql_query("SELECT username FROM myMembers WHERE id=$uid LIMIT 1")); $tUsername = $tUsername['username']; } else { $tUsername = $username; } $blabberDisplayList .= '<table style="background-color:#FFF; border:#999 1px solid; border-top:none;" cellpadding="5" width="100%"> <tr> <td width="10%" valign="top">' . $blab_pic . '</td> <td width="90%" valign="top" style="line-height:1.5em;"> <span class="greenColor textsize10">' . $whenBlab . ' <a href="profile.php?id=' . $uid . '">' . $tUsername . '</a> said:</span> <br />' . $the_blab . '</td></tr></table>'; } // ------- END MEMBER BLABS OUTPUT CONSTRUCTION --------- // ------- ESTABLISH THE PROFILE INTERACTION TOKEN --------- $thisRandNum = rand(9999999999999,999999999999999999); $_SESSION['wipit'] = base64_encode($thisRandNum); // Will always overwrite itself each time this script runs // ------- END ESTABLISH THE PROFILE INTERACTION TOKEN --------- // ------- EVALUATE WHAT CONTENT TO PLACE IN THE MEMBER INTERACTION BOX ------------------- // initialize some output variables $friendLink = ""; $the_blab_form = ""; if (isset($_SESSION['idx']) && $logOptions_id != $id) { // If SESSION idx is set, AND it does not equal the profile owner's ID // SQL Query the friend array for the logged in viewer of this profile if not the owner $sqlArray = mysql_query("SELECT friend_array FROM myMembers WHERE id='" . $logOptions_id ."' LIMIT 1"); while($row=mysql_fetch_array($sqlArray)) { $iFriend_array = $row["friend_array"]; } $iFriend_array = explode(",", $iFriend_array); if (in_array($id, $iFriend_array)) { $friendLink = '<a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'remove_friend\');">Remove Friend</a>'; } else { $friendLink = '<a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'add_friend\');">Add as Friend</a>'; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $interactionBox = '<br /><br /><div class="interactionLinksDiv"> ' . $friendLink . ' <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'private_message\');">Private Message</a> </div><br />'; /*### Friend Wall Blabbing added by PaulRyan [paul_mc_2k6@hotmail.co.uk] ###*/ $friendArray = explode(',',$friend_array); if(in_array($_SESSION['id'],$friendArray)) { $the_blab_form = '<div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> <form action="profile.php?id='.(int)$_GET['id'].'" method="post" enctype="multipart/form-data" name="blab_from"> <textarea name="blab_field" rows="3" style="width:99%;"></textarea> <strong>Blab away ' . $_SESSION['username'] . '</strong> (220 char max) <input name="friendPost" type="submit" value="Blab" /> </form></div>'; } else { $the_blab_form = '<div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> Only '.$username.'\'s friends can post here. </div>'; } /*### Friend Wall Blabbing added by PaulRyan [paul_mc_2k6@hotmail.co.uk] ###*/ } else if (isset($_SESSION['idx']) && $logOptions_id == $id) { // If SESSION idx is set, AND it does equal the profile owner's ID $interactionBox = '<br /><br /><div class="interactionLinksDiv"> <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'friend_requests\');">Friend Requests</a> </div><br />'; $the_blab_form = ' ' . $blab_outout_msg . ' <div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> <form action="profile.php" method="post" enctype="multipart/form-data" name="blab_from"> <textarea name="blab_field" rows="3" style="width:99%;"></textarea> <input name="blabWipit" type="hidden" value="' . $thisRandNum . '" /> <strong>Blab away ' . $username . '</strong> (220 char max) <input name="submit" type="submit" value="Blab" /> </form></div>'; } else { // If no SESSION id is set, which means we have a person who is not logged in $interactionBox = '<div style="border:#CCC 1px solid; padding:5px; background-color:#E4E4E4; color:#999; font-size:11px;"> <a href="register.php">Sign Up</a> or <a href="login.php">Log In</a> to interact with ' . $username . ' </div>'; $the_blab_form = '<div style="background-color:#BDF; border:#999 1px solid; padding:8px;"> <textarea name="blab_field" rows="3" style="width:99%;"></textarea> <a href="register.php">Sign Up</a> or <a href="login.php">Log In</a> to write on ' . $username . '\'s Board </div>'; } // ------- END EVALUATE WHAT CONTENT TO PLACE IN THE MEMBER INTERACTION BOX ------------------- // ------- POPULATE FRIEND DISPLAY LISTS IF THEY HAVE AT LEAST ONE FRIEND ------------------- $friendList = ""; $friendPopBoxList = ""; if ($friend_array != "") { // ASSEMBLE FRIEND LIST AND LINKS TO VIEW UP TO 6 ON PROFILE $friendArray = explode(",", $friend_array); $friendCount = count($friendArray); $friendArray6 = array_slice($friendArray, 0, 6); $friendList .= '<div class="infoHeader">' . $username . '\'s Friends (<a href="#" onclick="return false" onmousedown="javascript:toggleViewAllFriends(\'view_all_friends\');">' . $friendCount . '</a>)</div>'; $i = 0; // create a varible that will tell us how many items we looped over $friendList .= '<div class="infoBody" style="border-bottom:#666 1px solid;"><table id="friendTable" align="center" cellspacing="4"></tr>'; foreach ($friendArray6 as $key => $value) { $i++; // increment $i by one each loop pass $check_pic = 'members/' . $value . '/image01.jpg'; if (file_exists($check_pic)) { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="' . $check_pic . '" width="54px" border="1"/></a>'; } else { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="members/0/image01.jpg" width="54px" border="1"/></a> '; } $sqlName = mysql_query("SELECT username, firstname FROM myMembers WHERE id='$value' LIMIT 1") or die ("Sorry we had a mysql error!"); while ($row = mysql_fetch_array($sqlName)) { $friendUserName = substr($row["username"],0,12); $friendFirstName = substr($row["firstname"],0,12);} if (!$friendUserName) {$friendUserName = $friendFirstName;} // If username is blank use the firstname... programming changes in v1.32 call for this if ($i % 6 == 4){ $friendList .= '<tr><td><div style="width:56px; height:68px; overflow:hidden;" title="' . $friendUserName . '"> <a href="profile.php?id=' . $value . '">' . $friendUserName . '</a><br />' . $frnd_pic . ' </div></td>'; } else { $friendList .= '<td><div style="width:56px; height:68px; overflow:hidden;" title="' . $friendUserName . '"> <a href="profile.php?id=' . $value . '">' . $friendUserName . '</a><br />' . $frnd_pic . ' </div></td>'; } } $friendList .= '</tr></table> <div align="right"><a href="#" onclick="return false" onmousedown="javascript:toggleViewAllFriends(\'view_all_friends\');">view all</a></div> </div>'; // END ASSEMBLE FRIEND LIST... TO VIEW UP TO 6 ON PROFILE // ASSEMBLE FRIEND LIST AND LINKS TO VIEW ALL(50 for now until we paginate the array) $i = 0; $friendArray50 = array_slice($friendArray, 0, 50); $friendPopBoxList = '<table id="friendPopBoxTable" width="100%" align="center" cellpadding="6" cellspacing="0">'; foreach ($friendArray50 as $key => $value) { $i++; // increment $i by one each loop pass $check_pic = 'members/' . $value . '/image01.jpg'; if (file_exists($check_pic)) { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="' . $check_pic . '" width="54px" border="1"/></a>'; } else { $frnd_pic = '<a href="profile.php?id=' . $value . '"><img src="members/0/image01.jpg" width="54px" border="1"/></a> '; } $sqlName = mysql_query("SELECT username, firstname, country, state, city FROM myMembers WHERE id='$value' LIMIT 1") or die ("Sorry we had a mysql error!"); while ($row = mysql_fetch_array($sqlName)) { $funame = $row["username"]; $ffname = $row["firstname"]; $fcountry = $row["country"]; $fstate = $row["state"]; $fcity = $row["city"]; } if (!$funame) {$funame = $ffname;} // If username is blank use the firstname... programming changes in v1.32 call for this if ($i % 2) { $friendPopBoxList .= '<tr bgcolor="#F4F4F4"><td width="14%" valign="top"> <div style="width:56px; height:56px; overflow:hidden;" title="' . $funame . '">' . $frnd_pic . '</div></td> <td width="86%" valign="top"><a href="profile.php?id=' . $value . '">' . $funame . '</a><br /><font size="-2"><em>' . $fcity . '<br />' . $fstate . '<br />' . $fcountry . '</em></font></td> </tr>'; } else { $friendPopBoxList .= '<tr bgcolor="#E0E0E0"><td width="14%" valign="top"> <div style="width:56px; height:56px; overflow:hidden;" title="' . $funame . '">' . $frnd_pic . '</div></td> <td width="86%" valign="top"><a href="profile.php?id=' . $value . '">' . $funame . '</a><br /><font size="-2"><em>' . $fcity . '<br />' . $fstate . '<br />' . $fcountry . '</em></font></td> </tr>'; } } $friendPopBoxList .= '</table>'; // END ASSEMBLE FRIEND LIST AND LINKS TO VIEW ALL(50 for now until we paginate the array) } // ------- END POPULATE FRIEND DISPLAY LISTS IF THEY HAVE AT LEAST ONE FRIEND ------------------- ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="Description" content="Profile for <?php echo "$username"; ?>" /> <meta name="Keywords" content="<?php echo "$username, $city, $state, $country"; ?>" /> <meta name="rating" content="General" /> <meta name="ROBOTS" content="All" /> <title>Site Profile for <?php echo "$username"; ?></title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <script src="js/jquery-1.4.2.js" type="text/javascript"></script> <style type="text/css"> <!-- .infoHeader { background-color: #BDF; font-size:11px; font-weight:bold; padding:8px; border: #999 1px solid; border-bottom:none; width:200px; } .infoBody{ background-color: #FFF; font-size:11px; padding:8px; border: #999 1px solid; border-bottom:none; width:200px; } /* ------- Interaction Links Class -------- */ .interactionLinksDiv a { border:#B9B9B9 1px solid; padding:5px; color:#060; font-size:11px; background-image:url(style/headerBtnsBG.jpg); text-decoration:none; } .interactionLinksDiv a:hover { border:#090 1px solid; padding:5px; color:#060; font-size:11px; background-image:url(style/headerBtnsBGover.jpg); } /* ------- Interaction Containers Class -------- */ .interactContainers { padding:8px; background-color:#BDF; border:#999 1px solid; display:none; } #add_friend_loader { display:none; } #remove_friend_loader { display:none; } #interactionResults { display:none; font-size:16px; padding:8px; } #friendTable td{ font-size:9px; } #friendTable td a{ color:#03C; text-decoration:none; } #view_all_friends { background-image:url(style/opaqueDark.png); width:270px; padding:20px; position:fixed; top:150px; display:none; z-index:100; margin-left:50px; } #google_map { background-image:url(style/opaqueDark.png); padding:20px; position:fixed; top:150px; display:none; z-index:100; margin-left:50px; } #Layer1 { position:absolute; left:292px; top:170px; width:399px; height:230px; z-index:1; } #Layer2 { position:absolute; left:0px; top:532px; width:1103px; height:386px; z-index:2; } #Layer3 { position:absolute; left:255px; top:517px; width:111px; height:102px; z-index:3; } #Layer4 { position:absolute; left:304px; top:266px; width:637px; height:209px; z-index:4; } body { background-color: #3c60a4; background-image: url(images/bg.jpg); background-repeat: repeat-x; } --> </style> <script language="javascript" type="text/javascript"> // jQuery functionality for toggling member interaction containers function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); } function toggleViewAllFriends(x) { if ($('#'+x).is(":hidden")) { $('#'+x).fadeIn(200); } else { $('#'+x).fadeOut(200); } } function toggleViewMap(x) { if ($('#'+x).is(":hidden")) { $('#'+x).fadeIn(200); } else { $('#'+x).fadeOut(200); } } // Friend adding and accepting stuff var thisRandNum = "<?php echo $thisRandNum; ?>"; var friendRequestURL = "scripts_for_profile/request_as_friend.php"; function addAsFriend(a,b) { $("#add_friend_loader").show(); $.post(friendRequestURL,{ request: "requestFriendship", mem1: a, mem2: b, thisWipit: thisRandNum } ,function(data) { $("#add_friend").html(data).show().fadeOut(12000); }); } function acceptFriendRequest (x) { $.post(friendRequestURL,{ request: "acceptFriend", reqID: x, thisWipit: thisRandNum } ,function(data) { $("#req"+x).html(data).show(); }); } function denyFriendRequest (x) { $.post(friendRequestURL,{ request: "denyFriend", reqID: x, thisWipit: thisRandNum } ,function(data) { $("#req"+x).html(data).show(); }); } // End Friend adding and accepting stuff // Friend removal stuff function removeAsFriend(a,b) { $("#remove_friend_loader").show(); $.post(friendRequestURL,{ request: "removeFriendship", mem1: a, mem2: b, thisWipit: thisRandNum } ,function(data) { $("#remove_friend").html(data).show().fadeOut(12000); }); } // End Friend removal stuff // Start Private Messaging stuff $('#pmForm').submit(function(){$('input[type=submit]', this).attr('disabled', 'disabled');}); function sendPM ( ) { var pmSubject = $("#pmSubject"); var pmTextArea = $("#pmTextArea"); var sendername = $("#pm_sender_name"); var senderid = $("#pm_sender_id"); var recName = $("#pm_rec_name"); var recID = $("#pm_rec_id"); var pm_wipit = $("#pmWipit"); var url = "scripts_for_profile/private_msg_parse.php"; if (pmSubject.val() == "") { $("#interactionResults").html('<img src="images/round_error.png" alt="Error" width="31" height="30" /> Please type a subject.').show().fadeOut(6000); } else if (pmTextArea.val() == "") { $("#interactionResults").html('<img src="images/round_error.png" alt="Error" width="31" height="30" /> Please type in your message.').show().fadeOut(6000); } else { $("#pmFormProcessGif").show(); $.post(url,{ subject: pmSubject.val(), message: pmTextArea.val(), senderName: sendername.val(), senderID: senderid.val(), rcpntName: recName.val(), rcpntID: recID.val(), thisWipit: pm_wipit.val() } , function(data) { $('#private_message').slideUp("fast"); $("#interactionResults").html(data).show().fadeOut(10000); document.pmForm.pmTextArea.value=''; document.pmForm.pmSubject.value=''; $("#pmFormProcessGif").hide(); }); } } // End Private Messaging stuff </script> </head> <body> <p> <?php include_once "header_template.php"; ?> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <table border="0" align="center" cellpadding="0" cellspacing="0" class="mainBodyTable"> <tr> <td style="border-top:0px" width="60%" valign="top"><br /> <table width="95%" border="0" align="center" cellpadding="6"> <tr> <td width="33%" valign="top"><?php echo $user_pic; ?> <?php echo $bio_body; ?> <div class="infoHeader"><?php echo $username; ?>'s Information</div> <div class="infoBody"> <?php echo $locationInfo; ?> <?php echo $website; ?> <?php echo $youtube; ?> <?php echo $facebook; ?> </div> <?php echo $friendList; ?> <div id="view_all_friends"> <div align="right" style="padding:6px; background-color:#FFF; border-bottom:#666 1px solid;"> <div style="display:inline; font-size:14px; font-weight:bold; margin-right:150px;">All Friends</div> <a href="#" onclick="return false" onmousedown="javascript:toggleViewAllFriends('view_all_friends');">close </a> </div> <div style="background-color:#FFF; height:240px; overflow:auto;"> <?php echo $friendPopBoxList; ?> </div> <div style="padding:6px; background-color:#000; border-top:#666 1px solid; font-size:10px; color: #0F0;"> Temporary programming shows 50 maximum. Navigating through the full list is coming soon. </div> </div> <?php echo $twitterWidget; ?> <div class="infoBody" style="border-bottom:#999 1px solid;"></div></td> <td width="67%" valign="top"><span style="font-size:16px; font-weight:800;"><?php echo $mainNameLine; ?></span> <?php echo $interactionBox; ?> <?php ////// admin thing// // Make a MySQL Connection mysql_connect("localhost", "cookbook_lmcgr44", "simon123") or die(mysql_error()); mysql_select_db("cookbook_cookbook") or die(mysql_error()); // Get all the data from the "example" table $result = mysql_query("SELECT * FROM myMembers") or die(mysql_error()); echo "<table border='0'>"; echo "<tr> <th>Name</th></tr>"; // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo "<tr><td>"; echo mysql_query("SELECT account_name FROM myMembers WHERE id='{$_SESSION['id']}' LIMIT 1"); echo "</td><td>"; } echo "</table>"; ?> <? if (isset($_SESSION['idx']) && $logOptions_id == $id) { $sql_pm_check = mysql_query("SELECT id FROM private_messages WHERE to_id='$logOptions_id' AND opened='0'"); $num_new_pm = mysql_num_rows($sql_pm_check); if ($num_new_pm == 0) { echo "<div style='padding-left: 10px;'><a href=\"pm_inbox.php\"><font color='green' face='Arial'>".$num_new_pm." New Message</font></a></div>"; } if ($num_new_pm > 0) { echo "<div style='padding-left: 10px;'><a href=\"pm_inbox.php\"><font color='red' face='Arial'>".$num_new_pm." New Message</font></a></div>"; } } ?> <div class="interactContainers" id="add_friend"> <div align="right"><a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('add_friend');">cancel</a> </div> Add <?php echo "$username"; ?> as a friend? <a href="#" onclick="return false" onmousedown="javascript:addAsFriend(<?php echo $logOptions_id; ?>, <?php echo $id; ?>);">Yes</a> <span id="add_friend_loader"><img src="images/loading.gif" width="28" height="10" alt="Loading" /></span> </div> <div class="interactContainers" id="remove_friend"> <div align="right"><a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('remove_friend');">cancel</a> </div> Remove <?php echo "$username"; ?> from your friend list? <a href="#" onclick="return false" onmousedown="javascript:removeAsFriend(<?php echo $logOptions_id; ?>, <?php echo $id; ?>);">Yes</a> <span id="remove_friend_loader"><img src="images/loading.gif" width="28" height="10" alt="Loading" /></span> </div> <!-- START DIV that serves as an interaction status and results container that only appears when we instruct it to --> <div id="interactionResults" style="font-size:15px; padding:10px;"></div> <!-- END DIV that serves as an interaction status and results container that only appears when we instruct it to --> <!-- START DIV that contains the Private Message form --> <div class="interactContainers" id="private_message"> <form action="javascript:sendPM();" name="pmForm" id="pmForm" method="post"> <font size="+1">Sending Private Message to <strong><em><?php echo "$username"; ?></em></strong></font><br /> <br /> Subject: <input name="pmSubject" id="pmSubject" type="text" maxlength="64" style="width:98%;" /> Message: <textarea name="pmTextArea" id="pmTextArea" rows="8" style="width:98%;"></textarea> <input name="pm_sender_id" id="pm_sender_id" type="hidden" value="<?php echo $_SESSION['id']; ?>" /> <input name="pm_sender_name" id="pm_sender_name" type="hidden" value="<?php echo $_SESSION['username']; ?>" /> <input name="pm_rec_id" id="pm_rec_id" type="hidden" value="<?php echo $id; ?>" /> <input name="pm_rec_name" id="pm_rec_name" type="hidden" value="<?php echo $username; ?>" /> <input name="pmWipit" id="pmWipit" type="hidden" value="<?php echo $thisRandNum; ?>" /> <span id="PMStatus" style="color:#F00;"></span> <br /> <input name="pmSubmit" type="submit" value="Submit" /> or <a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('private_message');">Close</a> <span id="pmFormProcessGif" style="display:none;"><img src="images/loading.gif" width="28" height="10" alt="Loading" /></span> </form> </div> <!-- END DIV that contains the Private Message form --> <div class="interactContainers" id="friend_requests" style="background-color:#FFF; height:240px; overflow:auto;"> <div align="right"><a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers('friend_requests');">close window</a> </div> <h3>The following people are requesting you as a friend</h3> <?php $sql = "SELECT * FROM friends_requests WHERE mem2='$id' ORDER BY id ASC LIMIT 50"; $query = mysql_query($sql) or die ("Sorry we had a mysql error!"); $num_rows = mysql_num_rows($query); if ($num_rows < 1) { echo 'You have no Friend Requests at this time.'; } else { while ($row = mysql_fetch_array($query)) { $requestID = $row["id"]; $mem1 = $row["mem1"]; $sqlName = mysql_query("SELECT username FROM myMembers WHERE id='$mem1' LIMIT 1") or die ("Sorry we had a mysql error!"); while ($row = mysql_fetch_array($sqlName)) { $requesterUserName = $row["username"]; } /////// Mechanism to Display Pic. See if they have uploaded a pic or not ////////////////////////// $check_pic = 'members/' . $mem1 . '/image01.jpg'; if (file_exists($check_pic)) { $lil_pic = '<a href="profile.php?id=' . $mem1 . '"><img src="' . $check_pic . '" width="50px" border="0"/></a>'; } else { $lil_pic = '<a href="profile.php?id=' . $mem1 . '"><img src="members/0/image01.jpg" width="50px" border="0"/></a>'; } echo '<hr /> <table width="100%" cellpadding="5"><tr><td width="17%" align="left"><div style="overflow:hidden; height:50px;"> ' . $lil_pic . '</div></td> <td width="83%"><a href="profile.php?id=' . $mem1 . '">' . $requesterUserName . '</a> wants to be your Friend!<br /><br /> <span id="req' . $requestID . '"> <a href="#" onclick="return false" onmousedown="javascript:acceptFriendRequest(' . $requestID . ');" >Accept</a> OR <a href="#" onclick="return false" onmousedown="javascript:denyFriendRequest(' . $requestID . ');" >Deny</a> </span></td> </tr> </table>'; } } ?> </div> <?php echo $the_blab_form; ?> <div style="width:456px; overflow-x:hidden;"> <?php echo $blabberDisplayList; ?> </div></td> </tr> <tr> <td colspan="2" valign="top"><div id="google_map"> <div align="right" style="padding:4px; background-color:#D2F0D3;"><a href="#" onclick="return false" onmousedown="javascript:toggleViewMap('google_map');">close map</a></div> <iframe width="680" height="280" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo "$city,+$state,+$country";?>&ie=UTF8&hq=&hnear=<?php echo "$city,+$state,+$country";?>&z=12&output=embed"></iframe> <div align="left" style="padding:4px; background-color:#D2F0D3;"><a href="#" onclick="return false" onmousedown="javascript:toggleViewMap('google_map');">close map</a></div> </div></td> </tr> </table> <p><br /> <br /> </p></td> </tr> </table> <p> <?php include_once "footer_template.php"; ?> </p> <p> </p> <p> </p> <p> </p> <table class="mainBodyTable" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> </tr> </table> </body> </html> thank-you
  15. hello on my website i have added a background, and when i view it in safari it shows up then disapears when fully loaded here is my code <?php // Start_session, check if user is logged in or not, and connect to the database all in one included file include_once("scripts/checkuserlog.php"); // Include the class files for auto making links out of full URLs and for Time Ago date formatting include_once("wi_class_files/autoMakeLinks.php"); include_once ("wi_class_files/agoTimeFormat.php"); // Create the two objects before we can use them below in this script $activeLinkObject = new autoActiveLink; $myObject = new convertToAgo; ?> <?php // Include this script for random member display on home page include_once "scripts/homePage_randomMembers.php"; ?> <?php $sql_blabs = mysql_query("SELECT id, mem_id, send_id, the_blab, blab_date FROM blabbing ORDER BY blab_date DESC LIMIT 30"); $blabberDisplayList = ""; // Initialize the variable here while($row = mysql_fetch_array($sql_blabs)){ $blabid = $row["id"]; $uid = $row['send_id'] != 0 ? $row['send_id'] : $row['mem_id'] ; $the_blab = $row["the_blab"]; $notokinarray = array("fag", "gay", "shit", "fuck", "stupid", "idiot", "asshole", "cunt", "douche"); $okinarray = array("sorcerer", "grey", "shug", "farg", "smart", "awesome guy", "asshole", "cake", "dude"); $the_blab = str_replace($notokinarray, $okinarray, $the_blab); $the_blab = ($activeLinkObject -> makeActiveLink($the_blab)); $blab_date = $row["blab_date"]; $convertedTime = ($myObject -> convert_datetime($blab_date)); $whenBlab = ($myObject -> makeAgo($convertedTime)); //$blab_date = strftime("%b %d, %Y %I:%M:%S %p", strtotime($blab_date)); // Inner sql query $sql_mem_data = mysql_query("SELECT id, username, firstname, lastname FROM myMembers WHERE id='$uid' LIMIT 1"); while($row = mysql_fetch_array($sql_mem_data)){ $uid = $row["id"]; $username = $row["username"]; $firstname = $row["firstname"]; if ($firstname != "") {$username = $firstname; } // (I added usernames late in my system, this line is not needed for you) /////// Mechanism to Display Pic. See if they have uploaded a pic or not ////////////////////////// $ucheck_pic = "members/$uid/image01.jpg"; $udefault_pic = "members/0/image01.jpg"; if (file_exists($ucheck_pic)) { $blabber_pic = '<div style="overflow:hidden; width:40px; height:40px;"><img src="' . $ucheck_pic . '" width="40px" border="0" /></div>'; // forces picture to be 100px wide and no more } else { $blabber_pic = "<img src=\"$udefault_pic\" width=\"40px\" height=\"40px\" border=\"0\" />"; // forces default picture to be 100px wide and no more } $blabberDisplayList .= ' <table width="100%" align="center" cellpadding="4" bgcolor="#CCCCCC"> <tr> <td width="7%" bgcolor="#FFFFFF" valign="top"><a href="profile.php?id=' . $uid . '">' . $blabber_pic . '</a> </td> <td width="93%" bgcolor="#EFEFEF" style="line-height:1.5em;" valign="top"><span class="greenColor textsize10">' . $whenBlab . ' <a href="profile.php?id=' . $uid . '">' . $username . '</a> said: </span><br /> ' . $the_blab . '</td> </tr> </table>'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="Description" content="Cookbookers is a community website for people to create and share recipies, make friends or join up with old friends" /> <meta name="Keywords" content="cookbookers, cook, cookbook, cooks, chefs, chef, cookery, book, books, cooking, community, share, communicate,recipies, free, friends, register, shareing, " /> <meta name="author" content="lachlan mcgrath"/> <meta name="ROBOTS" content="INDEX,FOLLOW"/> <meta name="google-site-verification" content="fbI5fgCcTZh3cTw3deqVLevmvZkSOj3C-EwMDS7XMPI" /> <title>CookBookers - Your online cooking community</title> <link href="style/main.css" rel="stylesheet" type="text/css" /> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <script src="js/jquery-1.4.2.js" type="text/javascript"></script> <style type="text/css"> .style1 { font-family: Arial; font-size: 18px; } #Layer1 { height:210px; background-image: url(images/top_container_bg_recipes_new.gif); } body { margin-bottom: 0px; background-image: url(images/bg.jpg); background-repeat: repeat-x; background-color: #000; } .boxHeader { border:#999 1px solid; background-color: #FFF; background-image:url(style/accountStrip1.jpg); background-repeat:repeat-x; padding:5px; margin-left:19px; margin-right:20px; margin-top:6px; color:#060; text-decoration:none; } .style3 {font-size: 20px} #apDiv1 { left:294px; top:308px; width:848px; height:59px; z-index:1; } #apDiv2 { left:283px; top:159px; width:288px; height:126px; z-index:2; } </style> <script language="javascript" type="text/javascript"> function toggleSlideBox(x) { if ($('#'+x).is(":hidden")) { $(".editBox").slideUp(200); $('#'+x).slideDown(300); } else { $('#'+x).slideUp(300); } } </script> </head> <body> <p> <?php include_once "header_template.php"; ?> </p> <center> <table cellpadding="0px" cellspacing="0px" style="border:0px solid #666666;" width="75%"> </p> <p> </p> <p> </p> <p> </p> <table align="50%" width="200" border="0"> <tr> <td><img src="images/logo_cook.png" width="297" height="167" /></td> </tr> </table> <table cellspacing="0px" border="0" align="center" width="54%" height="25%" style="background-color:transparent"> <tr> <td><img src="images/banner_catering.jpg" width="835" height="262" /></td> </tr> </table> <tr></tr> <tr> <td><table width="50%" height="22" border="0" align="center" cellpadding="10" cellspacing="0" style="background-color:#F2F2F2; border:0px solid #666666;"> <tr> <td valign="top" colspan="2" style="background-color:#F2F2F2; border:0px; padding:10px;"> <table border="0" cellpadding="6"> <tr> <td class="style1">Newest Members:</td> <td> <?php print "$MemberDisplayList"; ?> </td> </tr> </table> </td> </tr> <tr> <td width="358" valign="top" style="width:250px; overflow:auto;"> <table width="358" align="center" cellpadding="4" bgcolor="#F2F2F2" style="border: 0px;"> <tr><td width="344" colspan="2">Recent Posts</td></tr> <tr> <td bgcolor="#F2F2F2" valign="top"><?php print "$blabberDisplayList"; ?></td> </tr> </table> </span> </td> <td width="557" valign="top"> <p>Hello and weclome to cookbookers.com we are a cooking community where people can share and comumicate with others that love to cook and share recipies. please sign up and take a look arround out website. In your account you can add recipies to share with the public or you can just keep them to yourself in you own personal cookbook. There will be more work happening to this website over the next couple of weeks, to enhance the website a bit more, we will be adding feature like a forum, commenting on recipies, live chat and also make the website a bit more appealing</p> <p>If you have any ideas for the site please feel fee to contact me thought the website, send me a private message, my name is lachlan mcgrath.</p> <p>so please join up, add recipies and make new friends on cookbookers.com</p> <p> </p> <p>happy shareing</br> </p> <p>Lachlan McGrath</br> </p> <p>Owner/creator. </p> <p> <?php if(isset($_SESSION['username'])) { } else { include('login.php'); } ?> </p> <p> </p></td> </tr> </table> <p> <?php include_once "footer_template.php"; ?> </p> <p><!-- Histats.com START (standard)--> <script type="text/javascript">document.write(unescape("%3Cscript src=%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script%3E"));</script> <a href="http://www.histats.com" target="_blank" title="free stats" ><script type="text/javascript" > try {Histats.start(1,1395398,4,198,85,17,"00001000"); Histats.track_hits();} catch(err){}; </script></a> <noscript><a href="http://www.histats.com" target="_blank"><img src="http://sstatic1.histats.com/0.gif?1395398&101" alt="free stats" border="0"></a></noscript> <!-- Histats.com END --></p> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.