Jump to content

cooldude832

Members
  • Posts

    4,793
  • Joined

  • Last visited

    Never

Everything posted by cooldude832

  1. realized the date parameters were making it write giant arrays that were 99.999% blank
  2. I have a "growing" div container on a page and for some reason this code is executing really slowly http://kseego.com/e_cal.php that is the demo of it the code running it is function ecal_date_toggle(ecal_day){ if(in_array(ecal_day,ecal_dates_open)){ document.getElementById('ecal_day_'+ecal_day).innerHTML=""; document.getElementById('ecal_day_'+ecal_day).style.display='none'; ecal_dates_open[ecal_day] = 0; } else{ maker_date = new Date(ecal_day.substr(0,4)+","+ecal_day.substr(4,2)+","+ecal_day.substr(6)); maker_date = new Date(ecal_day.substr(0,4)+","+ecal_day.substr(4,2)+","+ecal_day.substr(6)); ecal_dates_open[ecal_day] = ecal_day; var box = "<div id='ecal_day_"+ecal_day+"' class='ecal_dates'>"+maker_date+" <input type='text' name='ecal_date_start[ecal_day]' value='start time' /><input type='text' name='ecal_date_end[ecal_day]' value='end time' /><img src='/images/icons/delete.png' alt='delete' onclick='cal_date_toggle(ecal_day);' />"; document.getElementById('ecal_date_toggle').innerHTML=document.getElementById('ecal_date_toggle').innerHTML+box; } } basically it checks to see if a div is added, if so then destroy the content in it and set it to off, otherwise write the new div and add it on to the bigger box. any suggestions would be useful.
  3. IE says object doesn't support this property.
  4. Apparently I'm being old school or something but using the <a name="top"></a> <a href="#top">Top</a> is causing an error in firefox and a fatal error in IE. Any idea how to do this right?
  5. I did a work around putting the content in a hidden div not pretty but worked
  6. So I have this bit of code that pulls content into a center column (You can see it working kseego.com click the left column) and I am trying to setup an array of values in the called php script so they are set in the parent document so I can access them. The bit of code does this <?php if(mysql_num_rows($r) >0){ echo "<script type=text/javascript'>"; echo "var events_ids=new Array();"; echo "var events_dates=new Array();"; echo "var events_cats=new Array();"; echo "var events_open=new Array();"; echo "</script>"; $i = 0; while($row = mysql_fetch_assoc($r)){ write_ebox($row['EventID'],$row['ImageID'],$row['Ext'],$row['Title'],$row['StartDate'],$row['UserID'],$row['Poster'],$row['StartTime'], $row['EndTime'],$i,$row['CatID']); $i++; } } ?> In the write_ebox function I populate those 4 arrays with values using <?php echo "<script type=text/javascript'>"; echo "events_ids[".$i."]='event_div_".$id."'"; echo "events_dates[".$i."]='".date('j',strtotime($date))."'"; echo "events_cats[".$i."]='".$cat."'"; echo "events_open[".$i."]=0"; echo "</script>"; ?> However when I look in firebug I don't see those arrays even showing up any ideas on how to do this?
  7. its only issues on new uploads so I am wondering if my server got updated without me knowing
  8. notepad++ ANSI DOS/Windows not sure if I changed something from it before but its doing it on multiple pages.
  9. have a bit of code <span style='color:#cc0000; font-size: 14px;'>* </span>Location name and the are failing to render in FF and chrome. Page does validate in w3 just fine encoding is <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> have it on other pages working just fine so???
  10. solved it called it from a new spot but didn't make sense Also it didn't error report any illegal var names
  11. I have been using this ajax request without an issue function get_my_events(ads){ var xmlhttp; if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject){ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else{ alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4){ document.getElementById('events_center').innerHTML=""; document.getElementById('events_center').innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","e_get.php?type=mine&ad="+ads,true); xmlhttp.send(null); } However when i try to adapt it in a new function any altercations to it at all and the browser doesn't do anything. Firebug doesn't even show the request going and I don't see any errors comming through. Any ideas? I am calling it within a function of a function i.e get_cats() calls get_subcats() calls get_my_events2(); What else I am noticing is firefox doesn't even error when I go to call to an undefined function when the calling name does not match the function name i.e function setup_cats(CatID){ var xmlhttp; if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject){ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else{ alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4){ cats=xmlhttp.responseText; cats_split=cats.split(","); i = 0; cats = cats_split.length; cats_status = new Array(cats); cats_open = new Array(cats); while(i<cats){ cats_status[i] = 1; cats_open[i] = cats_split[i]; i++; } #SEE THIS LINE BELOW IS GET_MYEVENTS2 BUT NO FUNCTION CALLED THIS ANYWHERE! get_my_events2(1); events_toggle('open'); } } xmlhttp.open("GET","cats2.php?p="+CatID,true); xmlhttp.send(null); } and there is no get_my_events2 it is now e_dat but no error (and no loading) function e_data(ads){ var xmlhttp; if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject){ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else{ alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4){ document.getElementById('events_center').innerHTML=""; document.getElementById('events_center').innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","e_get.php?type=cat=&ad="+ads,true); xmlhttp.send(""); } Any help be great on this cause I'm totally confused
  12. sorry how this get in the ajax baord went to php?
  13. then why am I getting: Fatal error: Cannot instantiate non-existent class: easyimageeditor in /homepages/26/d294404313/htdocs/kseego/scripts/functions.php on line 132
  14. I have a class written in another file that handles my image resizing. Can I do this (php says I can't calling a non-existent class), but I know its there becuase the require doesn't fail above <?php <?php require_once("image_load.php"); ... .... function image_upload($tmp_name,$imgid){ $image = new easyImageEdit(); $image->load(UPLOADS.$tmp_name); $image->resizeToWidth(250); } ?>
  15. Page is w3 compliant for both css and xhtml (transitional) however everypage load my firefox error console fills with: Warning: Expected end of value for property but found 'vertical-align'. Error in parsing value for property 'width'. Declaration dropped. Source File: http://kseego.com/ Line: 0 any ideas? the Line: 0 is what is confusing me the most
  16. using this block (modify the png functions for jpeg/gif) works fine on jpg/gif no good on pngs gives a oversized black box <?php $image_p = imagecreatetruecolor($width,$height); $im = imagecreatefrompng("uploads/".$tmp_name); imagecopyresampled($image_p, $im, 0, 0, 0, 0, $i_dat[0],$i_dat[1], $width, $height); $ipath = "images/icons/users/".$imgid.".png"; $fp = fopen($ipath,"x"); fclose($fp); imagepng($image_p,$ipath); unlink($tmp_pos); $q = "Update `".IMAGES_TABLE."` Set Ext = 'png' Where ImageID = '".input_clean($imgid)."' LIMIT 1"; $r = mysql_query($q) or die(mysql_error()."<br /><br />".$q); ?>
  17. I have a page with some categories and a calendar. I want users to be able to update what content is collected without a go button, but I can image querying the database every time a day is toggled is going to lead to DOS errors really quickly. If I put a delay in it users might start to click a million times causing more problems. The content being displayed is some event display boxes, a styled with a 75x75 image in it. Any ideas here how to do this. I can see it working when the data set is reduced by tracking what is displayed in a JS array and just knocking out items that are no long included.
  18. Nvm my bad I had float:right on it solved
  19. http://www.kseego.net Looks great in FF valid css IE is unpredictable behavior.
  20. I like using onClick events to activate changes on containers like <td> <div> however I notice that the cursor is a prompt (the I). Is there a quick way to get it to be a anchor tag cursor or no change?
  21. Side note you want to verify that UserID in the ajax.php and limit the query to 1 row because you could accidentally update all the rows at once
  22. I have a left menu on a site that has a strucutre like [b]<ul id='cat_top'> <li> <a onclick='cat_toggle(1);'>arts</a> <ul class='cat_inner' id='1'></ul> </li> <li> <a onclick='cat_toggle(3);'>bars</a> <ul class='cat_inner' id='3'></ul> </li> <li> <a onclick='cat_toggle(2);'>greek</a> <ul class='cat_inner' id='2'></ul> </li> </ul> When I click on the title the sub cats load in fine and the sub cats of those load in just fine using this AJAX Request function cat_toggle(CatID){ if(cat_open == CatID){ document.getElementById(CatID).style.display='none'; cat_open = 0; } else{ document.getElementById(CatID).style.display='block'; cat_open = CatID; var xmlhttp; if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else if (window.ActiveXObject){ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else{ alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState==4){ document.getElementById(CatID).innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","cats.php?p="+CatID,true); xmlhttp.send(null); } } The issue I am having is when I have a 2 level deep menu open it takes 2 click to close down the parent when I would expect 1. You can see it at http://kseego.net
  23. try (a few mistakes here or there on yours, and the logic seems off still) <?php mysql_connect("$hostname", $dbuser, $dbpass) or die(mysql_error()); mysql_select_db("$db") or die(mysql_error()); $query = "SELECT email, username FROM `profiles` WHERE username = 'username' AND 'email' = '".mysql_real_escape_string($_POST[email])."'"; #this line was wrong $result=mysql_query($query) or die(mysql_error()."<br /><br />".$query); if(mysql_num_rows($result) >0){ echo "<select name=\"email\">\n"; while($row = mysql_fetch_array($result)){ echo "<option value='".$row['email']."' "; if($_POST['email'] == $row['email']){ echo "selected='selected' "; } echo ">".$row['username']."</option>\n"; } echo "</select>"; } else{ echo "<b>Error No users found.</b>"; } ?>
×
×
  • 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.