-
Posts
45 -
Joined
-
Last visited
Never
About greenday
- Birthday 02/10/1977
Profile Information
-
Gender
Male
-
Location
New Zealand
greenday's Achievements

Member (2/5)
0
Reputation
-
Please could you look at: http://www.vineyardroads.co.nz/testsite/ In a screen resolution of 1024 x 768 in IE7, the body background image (top centered aligned) doesnt line up with the main verticle repeating background (also center aligned) in a div called 'outset'. This looks fine in FF at all resolutions, and only seams to break in IE7 at the lower screen size. Any ideas please?
-
Thanks for your help. I managed to get it working with your help. I will post all the code i have ever written in a new thread for you
-
Hi thanks for your quick reply. I have never come across mysql_data_seek before. I looked it up, but still cant work out where to put it in the code, please could you show me? Also, could you tell me why I need to do this on this occassion, as i have never had to do this before? Thanks.
-
I have a sql array, but i can only out it in a while loop once. If try to put the same result in another while loop, the results are blank. Has anyone had this problem before? My php / mysql is within javascript, but i dont think this has anything to do with it. Here is the code : <script type="text/javascript"> //<![CDATA[ var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GScaleControl()); map.setCenter(new GLatLng(<?php echo $row_mapsize['lat']; ?>, <?php echo $row_mapsize['lon']; ?>), <?php echo $row_mapsize['zoom']; ?>, G_NORMAL_MAP); // Creates a marker whose info window displays the given number function createMarker(point, number) { var marker = new GMarker(point); // Show this markers index in the info window when it is clicked var html = number; GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);}); return marker; }; <?php $regionid=$HTTP_GET_VARS['id']; mysql_select_db($database_admin, $admin); $query_bizlist = "SELECT * FROM wineries where region = '$regionid' AND "; If($_GET['tastings'] == 'full') { $tastings = $_GET['tastings']; $query_bizlist =$query_bizlist. "full_desc != ' ' AND "; } If($_GET['tastings'] == 'openpublic') { $tastings = $_GET['tastings']; $query_bizlist =$query_bizlist. "open_public_tastings = '1' AND "; } If($_GET['bordeaux_style_blends'] >= '1') { $bordeaux_style_blends = $_GET['bordeaux_style_blends']; $query_bizlist =$query_bizlist. "bordeaux_style_blends = '1' AND "; } $sql = rtrim($query_bizlist," AND "); $bizlist = mysql_query($sql, $admin) or die(mysql_error()); $row_bizlist = mysql_fetch_assoc($bizlist); $totalRows_bizlist = mysql_num_rows($bizlist); while ($row_bizlist = mysql_fetch_assoc($bizlist)) { echo "var point = new GLatLng(" . $row_bizlist['lat'] . "," . $row_bizlist['lon'] . ");\n"; echo "var marker = createMarker(point, '<div id=\"mapWindow\" ><strong><a href=details.php?id=".$row_bizlist['id']." > ".$row_bizlist['name']." </a></strong><br /><form method=post name=form1 action=$editFormAction><input type=submit value=Add to My Wine Trail><input type=hidden name=wtentryid value=><input type=hidden name=username value=".$user->data['username']."> <input type=hidden name=wineryid value=".$row_bizlist['id']."><input type=hidden name=MM_insert value=form1></form> <br/> ".$row_bizlist['address']." <br /> Ph: ".$row_bizlist['phone']." <br/> <a target=_blank href= ".$row_bizlist['website']." > ".$row_bizlist['website']." </a> <br /><a href=mailto:".$row_bizlist[email]." >Email Winery</a> <br />Cellar Hours: ".$row_bizlist[cellar_hours]." </div>');\n"; echo "map.addOverlay(marker);\n"; echo "\n"; } ?> //]]> </script>
-
Sorry for the REALLY late reply, got so busy, and then couldnt find this post in the forum. The first suggestion works good, but removes the whole last loop, not just the last "to:" The second suggetsion works perfectly. The only main differance I can see is the second suggestion echos out the output with <pre>? Anyway thanks very much for your help, it solved my problem
-
I have a while loop like this: <?php do { ?> <?php echo $row_mapdirections['name']; ?>@<?php echo $row_mapdirections['lat']; ?>, <?php echo $row_mapdirections['lon']; ?> to: <?php } while ($row_mapdirections = mysql_fetch_assoc($mapdirections)); ?> This will ouput something like: Name@lat, lon to: Name@lat, lon to: Name@lat, lon to: How can I store the above output as a vairable? The reason i want to to do this is to echo the result later with a right trim on to remove the unwanted 'to' at the end. Thanks!
-
Hi I am using PHP File Upload add on to Dreamweaver, and am getting some serious cross browser probs. Its an extension which allows form data file fields to upload to a directory, and insert the name into a DB. There are options to limit file size and dimensions etc. If the dimensions of the intended image are too big, an alert box will pop up with a message saying the size is too big. If you still try to submit the form regardless, the alert will come up again, and not allow the form to submit. This works fine in IE6, but in IE7 and FF3, the alerts will not appear (except if the file is not an image), and allows the form to be submitted, going to a detail error page with a back button. Once the back back is pressed, the form has lost all the inputed data, and the user gives up. Here is an extract from the js file which should give the alert: function showImageDimensions(fieldImg) { var is_ns6 = (!document.all && document.getElementById ? true : false); var img = (fieldImg && !is_ns6 ? fieldImg : this); if (img.width > 0 && img.height > 0) { if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) { alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); img.field.uploadOK = false; return; } if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) { alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); img.field.uploadOK = false; return; } if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) { alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); img.field.uploadOK = false; return; } if (img.saveWidth != '') { document.PU_uploadForm[img.saveWidth].value = img.width; } if (img.saveHeight != '') { document.PU_uploadForm[img.saveHeight].value = img.height; } if (document.PU_uploadForm[img.field.name+'_width']) { document.PU_uploadForm[img.field.name+'_width'].value = img.width; } if (document.PU_uploadForm[img.field.name+'_height']) { document.PU_uploadForm[img.field.name+'_height'].value = img.height; } img.field.uploadOK = true; } } Any help much appreciated
-
Great, thanks so much, got it them to work together now Here is the final code incase it may help others out: /* var accordion; var accordionTogglers; var accordionContents; var checkboxHeight = "25"; var radioHeight = "25"; var selectWidth = "190"; /* No need to change anything after this */ document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; z-index: 5; }</style>'); var Custom = { init: function() { var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active; for(a = 0; a < inputs.length; a++) { if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") { span[a] = document.createElement("span"); span[a].className = inputs[a].type; if(inputs[a].checked == true) { if(inputs[a].type == "checkbox") { position = "0 -" + (checkboxHeight*2) + "px"; span[a].style.backgroundPosition = position; } else { position = "0 -" + (radioHeight*2) + "px"; span[a].style.backgroundPosition = position; } } inputs[a].parentNode.insertBefore(span[a], inputs[a]); inputs[a].onchange = Custom.clear; span[a].onmousedown = Custom.pushed; span[a].onmouseup = Custom.check; document.onmouseup = Custom.clear; } } inputs = document.getElementsByTagName("select"); for(a = 0; a < inputs.length; a++) { if(inputs[a].className == "styled") { option = inputs[a].getElementsByTagName("option"); active = option[0].childNodes[0].nodeValue; textnode = document.createTextNode(active); for(b = 0; b < option.length; b++) { if(option[b].selected == true) { textnode = document.createTextNode(option[b].childNodes[0].nodeValue); } } span[a] = document.createElement("span"); span[a].className = "select"; span[a].id = "select" + inputs[a].name; span[a].appendChild(textnode); inputs[a].parentNode.insertBefore(span[a], inputs[a]); inputs[a].onchange = Custom.choose; } } }, pushed: function() { element = this.nextSibling; if(element.checked == true && element.type == "checkbox") { this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px"; } else if(element.checked == true && element.type == "radio") { this.style.backgroundPosition = "0 -" + radioHeight*3 + "px"; } else if(element.checked != true && element.type == "checkbox") { this.style.backgroundPosition = "0 -" + checkboxHeight + "px"; } else { this.style.backgroundPosition = "0 -" + radioHeight + "px"; } }, check: function() { element = this.nextSibling; if(element.checked == true && element.type == "checkbox") { this.style.backgroundPosition = "0 0"; element.checked = false; } else { if(element.type == "checkbox") { this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; } else { this.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; group = this.nextSibling.name; inputs = document.getElementsByTagName("input"); for(a = 0; a < inputs.length; a++) { if(inputs[a].name == group && inputs[a] != this.nextSibling) { inputs[a].previousSibling.style.backgroundPosition = "0 0"; } } } element.checked = true; } }, clear: function() { inputs = document.getElementsByTagName("input"); for(var b = 0; b < inputs.length; b++) { if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; } else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 0"; } else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; } else if(inputs[b].type == "radio" && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 0"; } } }, choose: function() { option = this.getElementsByTagName("option"); for(d = 0; d < option.length; d++) { if(option[d].selected == true) { document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue; } } } } window.onload = function() { Custom.init(); { accordionTogglers = document.getElementsByClassName('accToggler'); accordionTogglers.each(function(toggler){ //remember the original color toggler.origColor = toggler.getStyle('background-color'); //set the effect toggler.fx = new Fx.Color(toggler, 'background-color'); }); accordionContents = document.getElementsByClassName('accContent'); accordion = new Fx.Accordion(accordionTogglers, accordionContents,{ //when an element is opened change the background color to blue onActive: function(toggler){ toggler.fx.toColor('#6899CE'); }, onBackground: function(toggler){ //change the background color to the original (green) //color when another toggler is pressed toggler.setStyle('background-color', toggler.origColor); } }); }}
-
Ken2k7, thanks for your help, but you need to be more specific, i mentioned that i am new to javascript. I made the change as suggested and it doesnt work. Is that all i need to do? Should i copy and paste one script into he other aswell? If so which script at the begining? I really need fool proof advice as i am new. Thanks.
-
thanks both for your help. I am not sure on the syntax to group them together. Here are the two scripts, if anyone could show me how to group them together, it would be a useful lesson. thanks. var checkboxHeight = "25"; var radioHeight = "25"; var selectWidth = "190"; /* No need to change anything after this */ document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: ' + selectWidth + 'px; opacity: 0; z-index: 5; }</style>'); var Custom = { init: function() { var inputs = document.getElementsByTagName("input"), span = Array(), textnode, option, active; for(a = 0; a < inputs.length; a++) { if((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") { span[a] = document.createElement("span"); span[a].className = inputs[a].type; if(inputs[a].checked == true) { if(inputs[a].type == "checkbox") { position = "0 -" + (checkboxHeight*2) + "px"; span[a].style.backgroundPosition = position; } else { position = "0 -" + (radioHeight*2) + "px"; span[a].style.backgroundPosition = position; } } inputs[a].parentNode.insertBefore(span[a], inputs[a]); inputs[a].onchange = Custom.clear; span[a].onmousedown = Custom.pushed; span[a].onmouseup = Custom.check; document.onmouseup = Custom.clear; } } inputs = document.getElementsByTagName("select"); for(a = 0; a < inputs.length; a++) { if(inputs[a].className == "styled") { option = inputs[a].getElementsByTagName("option"); active = option[0].childNodes[0].nodeValue; textnode = document.createTextNode(active); for(b = 0; b < option.length; b++) { if(option[b].selected == true) { textnode = document.createTextNode(option[b].childNodes[0].nodeValue); } } span[a] = document.createElement("span"); span[a].className = "select"; span[a].id = "select" + inputs[a].name; span[a].appendChild(textnode); inputs[a].parentNode.insertBefore(span[a], inputs[a]); inputs[a].onchange = Custom.choose; } } }, pushed: function() { element = this.nextSibling; if(element.checked == true && element.type == "checkbox") { this.style.backgroundPosition = "0 -" + checkboxHeight*3 + "px"; } else if(element.checked == true && element.type == "radio") { this.style.backgroundPosition = "0 -" + radioHeight*3 + "px"; } else if(element.checked != true && element.type == "checkbox") { this.style.backgroundPosition = "0 -" + checkboxHeight + "px"; } else { this.style.backgroundPosition = "0 -" + radioHeight + "px"; } }, check: function() { element = this.nextSibling; if(element.checked == true && element.type == "checkbox") { this.style.backgroundPosition = "0 0"; element.checked = false; } else { if(element.type == "checkbox") { this.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; } else { this.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; group = this.nextSibling.name; inputs = document.getElementsByTagName("input"); for(a = 0; a < inputs.length; a++) { if(inputs[a].name == group && inputs[a] != this.nextSibling) { inputs[a].previousSibling.style.backgroundPosition = "0 0"; } } } element.checked = true; } }, clear: function() { inputs = document.getElementsByTagName("input"); for(var b = 0; b < inputs.length; b++) { if(inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight*2 + "px"; } else if(inputs[b].type == "checkbox" && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 0"; } else if(inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight*2 + "px"; } else if(inputs[b].type == "radio" && inputs[b].className == "styled") { inputs[b].previousSibling.style.backgroundPosition = "0 0"; } } }, choose: function() { option = this.getElementsByTagName("option"); for(d = 0; d < option.length; d++) { if(option[d].selected == true) { document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue; } } } } window.onload = Custom.init; var accordion; var accordionTogglers; var accordionContents; window.onload = function() { accordionTogglers = document.getElementsByClassName('accToggler'); accordionTogglers.each(function(toggler){ //remember the original color toggler.origColor = toggler.getStyle('background-color'); //set the effect toggler.fx = new Fx.Color(toggler, 'background-color'); }); accordionContents = document.getElementsByClassName('accContent'); accordion = new Fx.Accordion(accordionTogglers, accordionContents,{ //when an element is opened change the background color to blue onActive: function(toggler){ toggler.fx.toColor('#6899CE'); }, onBackground: function(toggler){ //change the background color to the original (green) //color when another toggler is pressed toggler.setStyle('background-color', toggler.origColor); } }); }
-
Hi I have 2 linked .js files in my page, each uses the onload to trigger the script. Only one of the scripts will work at a time. Is there anything i can do to get them both to work? I am new to javascript! Here are the links: <script src="scripts/custom-form-elements.js" type="text/javascript"></script> Has this at the very END of the script: window.onload = Custom.init; And the other linked .js file is: <script src="scripts/accordian.js" type="text/javascript"></script> Which has this at this at the begining after the variables are set: window.onload = function() { Any help much apreciated
-
aschk, thanks alot for your help, your sql statement gives me 1 record exactaly how i need, by selecting the highest articleid gives me the latest. However, I am looking to get the 'latest' article that is in each articlecategoriy. My origional group by done this, but it used the first results 'oldest' and lowest articleid. Any ideas? maybe i need to somehow combine the group by and the join? cheers.
-
thanks for your suggestion, but this gives me the entire records. I used group by as I want just one articlesummary for each articlecategoryid. Can you think of another way? Cheers.
-
thanks, but that doesnt seem to work, even when i group by articles.articlecategoryid as suggested. I think the problem is that any ordering happens after the results have been got, so its only ordering the same results differantly. Where as I am needing to get differant results in the first place. Maybe my topic title was wrong. Any other ideas?
-
Hi, I am getting results from 2 tables using the group by method. The reason for 2 tables is one contains all the news details and categoryid, and the other contains the categoryid and categoryid title. Here is the code SELECT articles.articlesummary, articles.articleid, articles.articlecategoryid, articlecategory.articlecategoryname FROM articles, articlecategory WHERE articles.articlecategoryid = articlecategory.articlecategoryid GROUP BY articlecategory.articlecategoryname ORDER BY articles.articlecategoryid ASC LIMIT 0 , 30 Works great, just as i want, except that its getting the first(oldest) articleid listing from the table for each article. I want the last(newest) articleid listing for each. Any help please? Thanks.