Jump to content

Craig Hopson

Members
  • Posts

    212
  • Joined

  • Last visited

Posts posted by Craig Hopson

  1. Thanks that work fine for reducing the CSS size still the z-index issue and while im here how can i reduce this

    $(document).ready(function(){		 $(".boxcont").show();    $('.show_hide').click(function(){    $(".boxcont").slideToggle();    });});$(document).ready(function(){	    $(".boxcont2").show();    $('.show_hide2').click(function(){    $(".boxcont2").slideToggle();    });});$(document).ready(function(){	    $(".boxcont3").show();    $('.show_hide3').click(function(){    $(".boxcont3").slideToggle();    });});$(document).ready(function(){	    $(".boxcont4").show();    $('.show_hide4').click(function(){    $(".boxcont4").slideToggle();    });});

  2. hi guys i have a few questions about dragable divs hers the codeHTML

    <div id="box1"><div class="boxtop1">BOX 1<a href="#" class="show_hide">Show/Hide</a></div><div class="boxcont1">This is some content<a href="#">THIS IS A LINK</a></div> </div><div id="box2"><div class="boxtop2">BOX 2<a href="#" class="show_hide2">Show/Hide</a></div><div class="boxcont2">This is some content<a href="#">THIS IS A LINK</a></div></div>

    JQuary

    $(document).ready(function() {	$("#box1").draggable({		containment: 'parent' ,		snap: "#box1", snapMode: "inner" ,		snapTolerance: 3	  	});  });  $(document).ready(function() {	$("#box2").draggable({		containment: 'parent' ,		snap: "#box2", snapMode: "inner" ,		snapTolerance: 3	  	});  });

    CSS

    #box1 {border: solid 2px #b7ddf2;background: url('plugins/Login/templates/backg.png') no-repeat center center ;background-size:cover;border-radius: 6px;-webkit-border-radius: 6px;-moz-border-radius: 6px;width:470px;position:fixed;top:30px;left:5px;z-index:1;}.boxtop1{background:red;width:100%;height:25px;border-bottom:1px solid;border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;}.boxcont1{height:240px;}.show_hide1{float:right;}#box2 {border: solid 2px #b7ddf2;background: url('plugins/Login/templates/backg.png') no-repeat center center ;background-size:cover;border-radius: 6px;-webkit-border-radius: 6px;-moz-border-radius: 6px;width:470px;position:fixed;top:30px;right:5px;z-index:1;}.boxtop2{background:red;width:100%;height:25px;border-bottom:1px solid;border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;}.boxcont2{height:240px;}.show_hide2{float:right;}

    OkProblem 1 THE SIZE all this code i have 6 boxes so i have 6 lots of codeQ1:How do i reduce the amont off code Problem 2 div #box1 is always under #box2, #box1 & #box2 is under #box3 and so on (after moving them about)Q2:how to make the last moved box ontop Demo chsites.co.uk/chsites.php?page=project

  3. how about thisSOLVED

    $result = mysql_query("SELECT SUM(malai) FROM orders WHERE delivered = 0");while($row=mysql_fetch_array($result)){echo $row['SUM(malai)'];}

    but instead of while loop how else could this be done?

  4. hi all cant get this to work where am i going wrong?

    $result = mysql_query("SELECT SUM(malai) FROM orders WHERE delivery = 0");while($row = mysql_fetch_array($result))  {echo $row['malai'];   }

    i get Resource id #7 from this what i want is to add the total from colum and then echo it

  5. ok guys ive tried and tried but cant figure this out here are 2 functions from a class I KNOW its vulnerable but i cant seem to stop them from getting my batabase details

    		function index(){		$cat = sql_query('select * from '.tb().'downloads_cat order by category asc');		set_title(t('Downloads'));		section_content('<ul class="gallery">');		while($row = mysql_fetch_array($cat)){		$available = sql_query('select * from '.tb().'downloads where cat_id = "'.$row['id'].'"');		$numav = mysql_num_rows($available);		section_content('<li>		<div valign="top"><a href="index.php?p=downloads/downloadpg&id='.$row['id'].'" ><b>'.$row['category'].'</b></a></div>		<div valign="middle" style="height:30%;"><font size="1">'.$row['description'].'</font>	  		</div>		<div valign="bottom" style="bottom:0px;"><a href="index.php?p=downloads/downloadpg&id='.$row['id'].'" title="View Details"><img src="'.$uhome.'/modules/downloads/Folder.png" /></a><br><font size="1">Available<br />'.$numav.'</font>		</li>');		}		section_content('</ul>');		}	  function downloadpg() {$getcat = mysql_query('select * from '.tb().'downloads_cat where id = '.mysql_real_escape_string($_GET['id']).'');$catname = mysql_fetch_array($getcat);  set_title(t(''.$catname['category'].''));$filedetails = sql_query('select * from '.tb().'downloads where cat_id = "'.mysql_real_escape_string($_GET['id']).'" order by download_total desc');section_content('<div style="font-size:1.5em;">'.$catname['category'].'</div><br><A HREF="downloads" onClick="history.back();return false;">Back</a>');section_content(' <ul class="gallery">');while($row = mysql_fetch_array($filedetails)){  section_content('   <li>   <div valign="top" style="height:18%;"><a href="index.php?p=downloads/viewdetail&id='.$row['download_id'].'" ><u><b>'.$row['download_title'].'</b></u></a></div>  <div valign="middle" style="height:40%; ">'.$row['download_desc'].'  <div valign="bottom">   </div>  </div>   <div valign="bottom" style="height:13%;">  ');     section_content('  <a href="index.php?p=downloads/viewdetail&id='.$row['download_id'].'" title="View Details"><img src="'.$uhome.'/modules/downloads/download-button.png" /></a><br><font size="1">Downloads: '.$row['download_total'].'</font></div>  </li>');  }  section_content('</ul>');}

    The full class can be viewed HERE EDIT:-Ok ive put this

    $_GET['id'] = preg_replace('/[^0-9]/', '',$_GET['id']);

    at the top of the class would this be ok? id will always be a number! Will this stop SQL injections?

  6. Hey guys just wanted to say a big thanks to all who have helped me with building my new site please feel free to check it out logo.pngAny advice on improving PLEASE tell me Thanks again guys.

    • Like 1
  7. hi guys using thishttp://www.simonerodriguez.com/ajax-form-submit-example/ here is my form

    <form name="MyForm" action="feedxx.php" method="post" onsubmit="xmlhttpPost('feedxx.php', 'MyForm', 'MyResult', 'Wait'); return false;">  <input name="sample_text" type="text" size="30px" placeholder="Type a Message" />  <input name="send_button" type="submit" value="Send" /></form>

    after i submit i need to clear the form i tried this

    <form name="MyForm" action="feedxx.php" method="post" onsubmit="xmlhttpPost('feedxx.php', 'MyForm', 'MyResult', 'Wait');this.form.reset(); return false;">

    but didnt work? how do i do it????

  8. hi guys using this but it flickers wen reloading how can i stop it

    <script type="text/JavaScript">// Customise those settingsvar seconds = 5;var divid = "timediv";var url = "feedx.php";//////////////////////////////////// Refreshing the DIV//////////////////////////////////function refreshdiv(){// The XMLHttpRequest objectvar xmlHttp;try{xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari}catch (e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer}catch (e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch (e){alert("Your browser does not support AJAX.");return false;}}}// Timestamp for preventing IE caching the GET requestfetch_unix_timestamp = function(){return parseInt(new Date().getTime().toString().substring(0, 10))}var timestamp = fetch_unix_timestamp();var nocacheurl = url+"?t="+timestamp;// The code...xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){document.getElementById(divid).innerHTML=xmlHttp.responseText;setTimeout('refreshdiv()',seconds*1000);}}xmlHttp.open("GET",nocacheurl,true);xmlHttp.send(null);}// Start the refreshing processvar seconds;window.onload = function startrefresh(){setTimeout('refreshdiv()',seconds*1000);}    </script>

    Thanks

  9. yeah i looked at that didnt understand but i got it working like this

    $result = mysql_query("SELECT * FROM emails WHERE subject = '$id' ORDER BY date DESC LIMIT 5");while($row = mysql_fetch_array($result)) {$result2 = mysql_query("SELECT * FROM files WHERE email_id = '$row[id]'");while($row2 = mysql_fetch_array($result2)) {  $IMAGE = 'uploads/'.$id.'/thumbnail/'.$row2['filename'];  $IMAGEID = $row2['email_id'];}if($IMAGEID == $row['id']) {  echo '<img src="'.$IMAGE.'" width="100px" style="border:0px">';} else {  echo '<img src="images/avatar.png" width="100px" style="border:0px">';}echo $row['from'];echo $row['body'];echo '<br>';}

  10. hi guys i really need some help with this i just cant get my head round it i have two tables emails and filesEMAILS has id, from, subject, body, dateFILES has id, email_id, filename, mime, subject i need to display the email body and IF it had a picture attached to the email it will have the details logged in files so here's what i have so far

    $result = mysql_query("SELECT * FROM emails WHERE subject = '$id' ORDER BY date DESC LIMIT 2");echo date('H:i:s', time());echo '<br>';while($row = mysql_fetch_array($result)) {$result2 = mysql_query("SELECT * FROM files WHERE subject = '$id' ORDER BY id DESC LIMIT 2");while($row2 = mysql_fetch_array($result2)) {  if($row2['email_id'] == $row['id']) {   echo '<img src="uploads/'.$id.'/thumbnail/'.$row2['filename'].'" style="border:0px">';   echo $row['from'];   echo $row['body'];   echo '<br>';  } else {   echo '<img src="images/avatar.png" width="100px" style="border:0px">';   echo $row['from'];   echo $row['body'];   echo '<br>';  }}}

    but this gives 4 outputs same 2 emails duplicated 1 with pic 1 without

  11. hi guys i have this error

    mysql_fetch_array() expects parameter 1 to be resource, boolean given in on line :
    comes from this code
    <?php$result = mysql_query("SELECT * FROM files ORDER BY RAND() LIMIT 10");while ($row = mysql_fetch_array($result)) {    $result2 = mysql_query("SELECT * FROM members WHERE id = $row[subject] ");    while ($row2 = mysql_fetch_array($result2)) {	    if ($row2['public'] == "1") {		    $img = 'uploads/' . $row['subject'] . '/' . $row['filename'];		    echo '<img src="' . $img . '"  style="border:0px;"/>';	    }    }}?>

    just started for giving error i dont know why?

×
×
  • Create New...