Jump to content

Dada78

Members
  • Posts

    358
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Dada78's Achievements

Member

Member (2/5)

0

Reputation

  1. Does it have to be in php solution? Have you looked in RSS/XML feed? You are going to need to have the entire schedule layout out somewhere or you have to manually update the match ups from week to week anyways.
  2. Go to the page below and then click on the first display. Scroll down to the comments and you will see it says "No comments for this display, be the first to leave one". Then click submit and the comments will show. I have tested this on two different computers and two browsers and it did the same thing every time. Since you have to hit submit to display the comments, it then inserts a blank comment. http://www.mesquitechristmas.com/local/browse.php
  3. Well it contains a bunch of unrelavant code to the comments but here it is... <?php // connect to database include ('db_connect.php'); include ('utiles.php'); // start code for showing display information if (isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); $sql = "SELECT * FROM users WHERE id = $id;"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $id = $row["id"]; $displayname = $row["displayname"]; $owner = $row["owner"]; $displaytype = $row["displaytype"]; $address = $row["address"]; $city = $row["city"]; $state = $row["state"]; $postal = $row["postal"]; $country = $row["country"]; $StartDateMonth = $row['StartDateMonth']; $StartDateDay = $row['StartDateDay']; $EndDateMonth = $row['EndDateMonth']; $EndDateDay = $row['EndDateDay']; $StartTimeHour = $row['StartTimeHour']; $StartTimeMin = $row['StartTimeMin']; $EndTimeHour = $row['EndTimeHour']; $EndTimeMin = $row['EndTimeMin']; $meridiem = $row['meridiem']; $animated = $row['animated']; $TotalLights = $row['TotalLights']; $description = $row['description']; $website = $row['website']; $rating = $row['rating']; $votes = $row['votes']; $imgurl = $row['imgurl']; $imgurl2 = $row['imgurl2']; } else { die("No user found"); } } else { die(mysql_error()); } } // end code for showing display information // Start code for inserting comments if(isset($_POST['timeout'])) { if(time() < $_POST['timeout']) unset($_POST); $firstname = $_POST['firstname']; $location = $_POST['location']; $comment_date = date("m-d-Y"); $comment = $_POST['comment']; $id = $_POST['id']; // setup our query $query ="INSERT INTO comments (firstname, location, comment_date, comment, id) VALUES ('$firstname', '$location', '$comment_date', '$comment', '$id')"; $result=mysql_query($query) or die(mysql_error()); // run our query header("Location: {$_SERVER['REQUEST_URI']}"); exit(); // end code for inserting comments } // start code for displaying comments function show_data(){ $id = array(); $firstname = array(); $location = array(); $comment_date = array(); $comment = array(); $id = mysql_real_escape_string($_GET['id']); $i=0; if(isset($id)) { $limit = 5; { $sql = "SELECT * FROM comments WHERE id = '$id' ORDER BY comment_date DESC"; $site['url'] = "http://www.mesquitechristmas.com/local/display.php?id=$id"; $PageNav = swPagination( $sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE ); $result = $PageNav['RowList']; #Don't think I need the stuff above IF ( !$PageNav['TotalRes'] ) echo("<div class='commentsInner'>No Comments left for this Display. Be the first to leave one.</div>"); $i = 0; while ($row = mysql_fetch_array ($result)) { $color = ($i%2== 0 || $i == 0)?'#F4F4F4':'#E4E4E4'; $id[$i] = $row["id"]; $firstname[$i] = $row["firstname"]; $location[$i] = $row["location"]; $comment_date[$i] = $row["comment_date"]; $comment[$i] = $row["comment"]; print"<div class='commentsOutter'> <div class='commentsInner'> <div class='comments'>$comment[$i] <div class='commentsDetails'>Left By: $firstname[$i] | From: $location[$i] | Date: $comment_date[$i] </div> </div> </div> </div>"; ++$i; } } } print"<table width='100%'> <tr> <td> <div align='right'>$PageNav[HrefNav]</div></td> </tr> </table>"; } // end code for displaying comments ?> <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="<? echo $row['city']; ?>,<? echo $row['state']; ?> <? echo $row['description']; ?>" /> <meta name="keywords" content="Mesquite, Texas, Country Christmas" /> <link rel="stylesheet" type="text/css" href="/stylesheet.css" media="screen" /> <script type="text/javascript" src="/drop_down.js"></script> <title>A Mesquite Country Christmas - <? echo $row['displayname']; ?></title> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAHsqGZjU15T9Ax9NeNmkr3BTBG4OpKDapRX640iwTNUvuS9ZsRhRAhx93j_0sEqAt5jDYsfdAlZ8gmw" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ var map = null; var geocoder = null; var xmasIcon = new GIcon(); function load() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("Gmap")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GScaleControl()); // Create our custom marker icon xmasIcon.image = "/images/markerdisplay.gif"; xmasIcon.iconSize = new GSize(13, 17); xmasIcon.iconAnchor = new GPoint (6, 20); xmasIcon.infoWindowAnchor = new GPoint (5, 1); geocoder = new GClientGeocoder(); } showAddress('<? echo $address; ?> <? echo $city; ?>,<? echo $state; ?> <? echo $postal; ?>'); } function showAddress(address) { if (geocoder) { geocoder.getLatLng( address, function(point) { if (!point) { map.setCenter(new GLatLng(32.7668, -96.5992), 11); map.openInfoWindowHtml(new GLatLng(32.7668, -96.5992),"<br>"+address+" is not found"); } else { map.setCenter(point, 14); var marker = new GMarker(point, xmasIcon); map.addOverlay(marker); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml("<strong><? echo $displayname; ?></strong><br>"+ address +"<br /><a href='http://maps.google.com/maps?saddr=" + address + "' target='_blank'>Get Directions</a>"); }); } } ); } } //]]> </script> <style type="text/css"> p.c6 {text-align: center} textarea.c5 {width: 540px;} table.c4 {border-top: 1px solid #990000;} </style> </head> <body onload="load();populate()" onunload="GUnload()"> <div id="wrap"> <a href="/index.html"> <img id="frontphoto" src="/images/mcc_header1.gif" alt="Mesquite Country Christmas" border="0" /></a> <div id="menu"> <h2 class="hide">Menu:</h2> <ul id="avmenu"> <li><a href="/index.html">Home</a></li> <li><a href="/christmasstory.html">The Christmas Story</a></li> <li><a href="/directions.html">Directions</a></li> <li><a href="#">Information</a><ul> <li><a href="/information.html">Display Facts & Info</a></li> <li><a href="/faq.html">FAQ</a></li> <li><a href="/playlist.html">2008 Playlist</a></li> <li><a href="#">Christmas History</a></li> </ul></li> <li><a href="#">Photos</a> <ul> <li><a href="/2007photos.html">2007</a></li> </ul></li> <li><a href="#">Videos</a> <ul> <li><a href="/2007videos.html">2007</a></li> </ul></li> <li><a href="/guestbook.php">Guestbook</a></li> <li><a href="/webcam.html">Web Cam</a></li> <li><a href="/webradio.html">Internet Radio</a></li> <li><a href="http://www.noradsanta.org/" target="_blank">Track Santa</a></li> <li><a href="/projects.html">Projects & How Tos</a></li> <li><a href="/links.html">Links</a></li> <li><a href="/contact_us.html">Contact Us</a></li> </ul> <div class="c1"><a href="http://www.toysfortots.org/" target="_blank"><img src="/images/toys_for_tots.jpg" alt="toys for tots" border="0" width="110" height="153" vspace="10" /></a></div> <div class="c1"><a href="http://christmas.bronners.com/2007/house/534.html"><img src="http://christmas.bronners.com/voteforme/vote.jpg" border="0" width="110" height="153" alt="christmas decorations" vspace="10" /></a></div> </div> <div class="fadebox" id="content"> <h2><? echo $row['displayname']; ?></h2> <hr /> <table class="imgBox" width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="center"> <table class="fullbox" align="center" width="100%" cellpadding="3" cellspacing="1"> <tr> <td align="center"><img src="/local/submitted/<? echo $row['imgurl1']; ?>" alt="<? echo $row['displayname']; ?>" class="border" width="520" height="320" id="big" /></td> </tr> <tr> <td align="center"><img src="/local/submitted/<? echo $row['imgurl1']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl2']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl3']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl4']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> <img src="/local/submitted/<? echo $row['imgurl5']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" /> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td></tr></table> </td> </tr> </table> <div class="b1"><a href='browse.php'><img src="images/return.gif" alt="return to list" /></a></div> <table border="0" cellpadding="0" cellspacing="0" class="fullbox" width="100%"> <tr> <td class="title">About This Display...</td> </tr> </table> <table border='0' cellpadding='2' cellspacing='0' class='fullbox' width='100%'> <tr><td class="bg1" width="115"><b>Display Name</b>:</td><td class="bg1"> <? echo $row['displayname']; ?></td></tr> <tr><td class="bg2" width="120"><b>Owner/Operated By</b>:</td><td class="bg2"> <? echo $row['owner']; ?></td></tr> <tr><td class="bg1"><b>Display Type</b>:</td><td class="bg1"> <? echo $row['displaytype']; ?></td></tr> <tr><td class="bg2" valign="top"><b>Address</b>:</td><td class="bg2"> <? echo $row['address']; ?><br /> <? echo $row['city']. "," . $row['state']. " " . $row['postal']; ?><br /> <? echo $row['country']; ?></td></tr> <tr><td class="bg1"><b>Dates</b>:</td><td class="bg1"> <? echo $row['StartDateMonth']; ?> <? echo $row['StartDateDay']; ?> <strong>to</strong> <? echo $row['EndDateMonth']; ?> <? echo $row['EndDateDay']; ?></td></tr> <tr><td class="bg2"><b>Times</b>:</td><td class="bg2"> <? echo $row['StartTimeHour']; ?>:<? echo $row['StartTimeMin']; ?> <? echo $row['meridiem']; ?> <strong>to</strong> <? echo $row['EndTimeHour']; ?>:<? echo $row['EndTimeMin']; ?> <? echo $row['meridiem']; ?></td></tr> <tr><td class="bg1"><b>Animated</b>:</td><td class="bg1"> <? echo $row['animated']; ?></td></tr> <tr><td class="bg2"><b>Total Lights</b>:</td><td class="bg2"> <? echo $row['TotalLights']; ?></td></tr> <tr><td class="bg1"><b>Description</b>:</td><td class="bg1"> <? echo $row['description']; ?></td></tr> <tr><td class="bg2"><b>Website</b>:</td><td class="bg2"> <a href="<? echo $row['website']; ?>"><? echo $row['website']; ?></a></td></tr> <tr><td class="bg1" valign="top"><b>Current Conditions</b>:</td><td class="bg1"> <?php include("http://www.mesquitechristmas.com/hw/hw3.php?config=&forecast=zandh&pands=$postal&alt=display_current"); ?></td></tr> <tr><td class="bg2" valign="top"><b>Sponsor Links</b>:</td><td class="bg2"> <script type="text/javascript"><!-- google_ad_client = "pub-8048181801684156"; /* 234x60, created 2/2/08 */ google_ad_slot = "1119945783"; google_ad_width = 234; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td></tr></table> <br /> <table border='0' cellpadding='0' cellspacing='0' class='fullbox' width='100%'> <tr> <td class="title">Directions to <? echo $row['displayname']; ?>...</td> </tr> </table> <table class="fullboxGmap" width="100%" cellpadding="3" cellspacing="1"> <tr> <td><div id="Gmap"></div></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td></tr></table> <div class="b2"><?php include("http://www.mesquitechristmas.com/hw/hw3.php?config=&forecast=zandh&pands=$postal&alt=extended_forecast"); ?></div> <div class="b1"><?php include("http://www.mesquitechristmas.com/hw/hw3.php?config=&forecast=zandh&pands=$postal&alt=display_warnings"); ?></div> <div class="title">Comments For <? echo $row['displayname']; ?>...</div> <div class="fullbox"> <?php show_data(); ?> </div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> </tr> </table> <a name="comments" id="comments"></a> <form method="post" action="display.php?id=<?php echo $row['id']."#comments"; ?>"> <input type="hidden" name="id" value="<?php echo $id; ?>" /> <div class="boxWrapper"> <div class="commentsInner commentsInput"> <table border="0" cellpadding="4" cellspacing="0" width="100%"> <tr> <td width="203">Name: <input type="text" name="firstname" value="Anonymous" onclick="this.value=''" /></td> <td width="287">Location: <input type="text" name="location" value="Anonymous" onclick="this.value=''" /></td> </tr> <tr> <td colspan="2"><br /> Comment (Max 255 characters):<br /> <textarea name="comment" rows="5" cols="50" class="c5" onkeydown="javascript:limittext(this.form.comment);"> </textarea></td> </tr> <tr> <td colspan="2" align="right"><input type="reset" value="Reset" /> <input type="submit" value="Submit" name="timeout" /></td> </tr> </table> </div> </div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> <td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td> </tr> </table> </form> <div class="b1"><a href='browse.php'><img src="images/return.gif" alt="return to list" /></a></div> </div> </div> <div id="footer">© 2007-2008 Mesquite Country Christmas<br /> This site best viewed with <a href="http://www.spreadfirefox.com/node&id=0&t=219"><img border="0" alt="Firefox 3" title="Firefox 3" src="http://sfx-images.mozilla.org/affiliates/Buttons/firefox2/ff2b80x15.gif" /></a> <p align="center"> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a> <a href="http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.mesquitechristmas.com%2Fstylesheet.css&profile=css21&usermedium=all&warning=1/"><img class="c1" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a> </p> <script type="text/javascript"><!-- google_ad_client = "pub-8048181801684156"; //468x60, created 1/8/08 google_ad_slot = "0360766123"; google_ad_width = 468; google_ad_height = 60; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </body> </html>
  4. This is the code for displaying the comments. // start code for displaying comments function show_data(){ $id = array(); $firstname = array(); $location = array(); $comment_date = array(); $comment = array(); $id = mysql_real_escape_string($_GET['id']); $i=0; if(isset($id)) { $limit = 5; { $sql = "SELECT * FROM comments WHERE id = '$id' ORDER BY comment_date DESC"; $site['url'] = "http://www.mesquitechristmas.com/local/display.php?id=$id"; $PageNav = swPagination( $sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE ); $result = $PageNav['RowList']; #Don't think I need the stuff above IF ( !$PageNav['TotalRes'] ) echo("<div class='commentsInner'>No Comments left for this Display. Be the first to leave one.</div>"); $i = 0; while ($row = mysql_fetch_array ($result)) { $color = ($i%2== 0 || $i == 0)?'#F4F4F4':'#E4E4E4'; $id[$i] = $row["id"]; $firstname[$i] = $row["firstname"]; $location[$i] = $row["location"]; $comment_date[$i] = $row["comment_date"]; $comment[$i] = $row["comment"]; print"<div class='commentsOutter'> <div class='commentsInner'> <div class='comments'>$comment[$i] <div class='commentsDetails'>Left By: $firstname[$i] | From: $location[$i] | Date: $comment_date[$i] </div> </div> </div> </div>"; ++$i; } } } print"<table width='100%'> <tr> <td> <div align='right'>$PageNav[HrefNav]</div></td> </tr> </table>"; } // end code for displaying comments
  5. Ok, so what would be causing the comments to not show unless you hit the submit button when you first visit the page?
  6. For reference what is the purpose of exit();? That seems to resolve the refresh problem. Only problem I am still having is the comments do no show when you first visit the page. You have to hit submit in order to get the comments to show which then inserts an empty entry. Any idea why this could be happening? -Thanks
  7. Just curious, I have noticed the two codes that were posted were about the same except one has if(isset and one doesn't have the isset. What is the difference?
  8. I understand that part but this... session_start(); Has to be at the very top of the page before any HTML is outtputed correct?
  9. Ok this is what I have done as suggested, is this correct? It seems to have cured the one problem with the refresh but want to make sure. // setup our query $query ="INSERT INTO comments (firstname, location, comment_date, comment, id) VALUES ('$firstname', '$location', '$comment_date', '$comment', '$id')"; $result=mysql_query($query) or die(mysql_error()); // run our query header("Location: {$_SERVER['REQUEST_URI']}"); // end code for inserting comments }
  10. No it can not be where ever I want it. Session Start has to be and the top of the page before and HTML is outputted. You are right, I don't know how sessions work which is why I am here asking for help. I don't deal with php, I strictly deal with XHTML and CSS. This is was a project started by me and a friend as he knew php. So he was going to do the php and I was going to do the layout and design, which I have done. Only thing is he couldn't finish it because he was killed in a car wreck. So it has left me to try to figure it out and finish. So can anyone help?
  11. That doesn't work, nothing shows. Also that means the link as to be at the very top of the page and I don't want it there. Any other ideas?
  12. I am using sessions but if I include that to the top of the pages outside of the control panel. Wouldn't that make it where they had to be logged in to view it? If that is the case that is not what I want.
  13. Hello, I have a website where one section requires a login to get to the user control panel. I would like to add a link on other pages outside of the control panel so that if the user navigates away from the control panel they can click a link to return back to the control panel if they are logged in. How could I go about doing something like this? -Thanks
×
×
  • 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.