Jump to content

Matpatnik

Members
  • Content Count

    227
  • Joined

  • Last visited

Everything posted by Matpatnik

  1. Hi guys, I came with a problem and can't find the solution. I looked on internet everywhere I could and here is the closest I found but still not right. The problem here is it cut the last part of the my longest table. The 2 tables doesn't have the same rows number but I need them all and I only need 1 category to be shown. So I need the 2 tables be glued together side by side filtered by category ( both table share the same categories ) with no missing data (of that category) So far this is what I got. I tried to join but it keep duplicating rows so instead of getting 200 rows I get like 3k rows. I tried union too and no success. I'm out of inspiration right now. If you can point a right or better path it would be great. Here's my query so far: SELECT t1.`id`, t1.c1, t1.`total`, t2.`id`, t2.c2, t2.`total` FROM ( SELECT @i:=@i+1 AS rowId, `id`, `categories` as c1, `total` FROM extable17, (SELECT @i:=0) a ) AS t1, (SELECT @j:=@j+1 AS rowId, `id`, `categories` AS c2, `total` FROM extable18, (SELECT @j:=0) a ) AS t2 WHERE t1.rowId = t2.rowId;
  2. Hi guys it's been forever I haven't touch code and I ended up with this situation. I have no problem to display the page with IE and FF. I have a div that contain embedded posts from a facebook page that should not exceed 500px by 500px and keep the left of the page. On the right there is an other div a little bit smaller that should float right but for some reason the facebook div seems to clear right only with chrome. I've been trying to wrap it, force my other div, and find a hack but no success. Since every attempt failed I went back to my original code. Your help is appreciated, thx! the address of the page is http://www.matpatnik.com/White-Spiders css: /****************** #desc Style ******************/#desc{ float: right; width:450px; max-width:450px; display:block;}#desc>.innerBox>.contentBox{ height: 484px;} html: <div class="outerBox fb-page" data-href="https://www.facebook.com/WhiteSpiders" data-width="500" data-height="500" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="true" data-show-posts="true"> <div class="fb-xfbml-parse-ignore"> <blockquote cite="https://www.facebook.com/WhiteSpiders"> <a href="https://www.facebook.com/WhiteSpiders">WhiteSpiders</a> </blockquote> </div></div><div id="desc" class="outerBox"><div class="innerBox"><div class="contentBox">
  3. I probably sent a wrong parameter somewhere ^^
  4. Here you can do an if statement to find the current path and if it's longer then their root directory leave it allow them to go up else leave it the way it is.if (strlen(/farm/$userID/) == $currentPath){ $up = $currentPath;} else { $up = substr($path, 0, (strrpos(dirname($path."/."),"/")));} I don't know if it work but you get the idea.
  5. Matpatnik

    Mkdir

    I'm glad it help
  6. Matpatnik

    Mkdir

    I see, have you tried with $_SERVER['DOCUMENT_ROOT']? <?php$target_path = $_SERVER['DOCUMENT_ROOT'] ."/farm/$userID/";$NewFolder = ($_POST["FileName"]);mkdir("$target_path" & "/" & "$NewFolder" ,0755);?> maybe that's why it doing it's thing in the same directory
  7. Matpatnik

    Mkdir

    try this: <?php $target_path = "/farm/$userID/"; $NewFolder = $_POST["FileName"]; mkdir($target_path . $NewFolder ,0755); ?>
  8. The code below works good alone so fare but I need to call it more then once.Copy and paste can't be the solution, I hope hehe!a soon as I wrap this snippets to create a function out of it it give me this error: I tried to wrap only the foreach() as a function, same errorWhere ever I wrap it it give me the error.can someone give me a hand on this plz, Thank you.$fontSize = 15;$ox = 10;$y = 40;$text = $row['description'];// Set the content-typeheader('Content-type: image/png');// Create the image$im = imagecreatetruecolor(750, 300);// Create some colors$beige = imagecolorallocate($im, 255, 206, 122);$dark_red = imagecolorallocate($im, 193, 0, 0);$grey = imagecolorallocate($im, 128, 128, 128);$black = imagecolorallocate($im, 0, 0, 0);imagefill($im, 0, 0, $beige);$text = text_to_array($text);foreach ($text as &$value){ $x = $ox; foreach ($value as &$val) { $mod = 0; if (substr($val, 0, 3) == '[B]') { $val = substr($val, 3); $mod = 1; } else if (substr($val, 0, 3) == '[I]') { $val = substr($val, 3); $mod = 2; } else if (substr($val, 0, 4) == '[BI]') { $val = substr($val, 4); $mod = 3; } // Bounding box $bbox = imagettfbbox($fontSize, 0, 'Fonts/'. $fonts['bkant'][$mod], $val); imagettftext($im, $fontSize, 0, $x, $y, $black, 'Fonts/'. $fonts['bkant'][$mod], $val); $x += $bbox[2] + 10; } $y += $bbox[1] + ($bbox[1] - $bbox[5]) + 5;}unset($val);unset($value);// Using imagepng() results in clearer text compared with imagejpeg()imagepng($im);imagedestroy($im);
  9. we probably all got his pm,Fortunatly I couldn't access the private message I don't know if they toke off this option totaly or it's just for me?
  10. Yes the switch (0) was a typing errorWe have no problem with FF and Opera.The countdown doesn't work on my 3 computers and my friends computer too with IE. It show the starting number but that's all and give me an error Line: 68, Char: 5, Error: Object required, Code: 0... function myConstructor(blocknum) { hid = ('hide' + (blocknum)); unhid = ('click' + (blocknum)); if (t == 0) { document.getElementById("the_countdown").innerHTML = t--; document.getElementById(hid).style.display = "block"; document.getElementById(unhid).style.display = "none"; } else if (t < 0) { t = 10; document.getElementById("the_countdown").innerHTML = "GO!"; myCalculOperation(); document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } else { document.getElementById("the_countdown").innerHTML = t--; document.getElementById(hid).style.display = "none"; /* <--- It's this line */ document.getElementById(unhid).style.display = "block"; } }
  11. ok it work with Firefox but not with IE of course. I guess when I've look on IE it was still on cache and I still didn't figured out the click problem with the auto answer.I did some minor change: <script type="text/javascript"> function showMoreAnything(blocknum, isOpen) { /* --Merci a http://www.scriptygoddess.com-- */ hid = ('hide' + (blocknum)); unhid = ('click' + (blocknum)); if(document.getElementById) { if(document.getElementById(hid).style.display) { if(isOpen != 0) { document.getElementById(hid).style.display = "block"; document.getElementById(unhid).style.display = "none"; }else{ document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } }else{ location.href = isOpen;return true; } }else{ location.href = isOpen;return true; } } function myCalculOperation() {num2 = Math.round(Math.random() * 10); do { num1 = Math.round(Math.random() * 10); }while (num1 < 0) switch (0) { case 1: document.getElementById("the_calcul").innerHTML = num1 +" + "+ num2 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 + num2); break; case 2: document.getElementById("the_calcul").innerHTML = num1 +" - "+ num2 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 - num2); break; case 3: document.getElementById("the_calcul").innerHTML = num1 +" x "+ num2 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 * num2); break; case 4: document.getElementById("the_calcul").innerHTML = (num1 * num2) +" ÷ "+ num1 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ num2; break; } } var t=10; var int=self.setInterval("myConstructor(101)",1000); function myConstructor(blocknum) { hid = ('hide' + (blocknum)); unhid = ('click' + (blocknum)); if (t == 0) { document.getElementById("the_countdown").innerHTML = t--; document.getElementById(hid).style.display = "block"; document.getElementById(unhid).style.display = "none"; } else if (t < 0) { t = 10; document.getElementById("the_countdown").innerHTML = "GO!"; myCalculOperation(); document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } else { document.getElementById("the_countdown").innerHTML = t--; document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } } </script> </head> <body> <div align="center"> <div id="the_calcul" class="calcul"></div> <div id="click101"> <a href="#jsenabled=no" class="uLigne" onclick="showMoreAnything(101,'#?jsenabled=no');t=0;return false;">Voir la réponse</a> </div> <div id="the_countdown" class="calcul_countdown"></div> </div>
  12. will it only be for mobile device? if so I suggest that you expend to stationary device too :)more accessibility, more people.edited: It doesn't show everything under 3" wide (wrap)
  13. Matpatnik

    My web site

    since you are using .png images for your top menu I suggest that you do a better fade in fade out effect on mouse over.good start :thumb_up:
  14. I know that you are still on your beta testing but the design style is not appealing there is a lot of work to do on this part.My 2 cents worth
  15. I think you can also change or add an extension to the file like myfile.exe.addandremove when the user need it take off everything after the last dot.But if their is any virus it might save your server the but the user that download it but it can be an add on to that other poster said.
  16. Thank you :)I've been able to do this.Now my problem is that at the start up the user need to click on the link to activate the auto answer.Any hint on this will be great <!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" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="Matpatnik.css" type="text/css"> <title>Matpatnik Addition</title> <script type="text/javascript"> function showMoreAnything(blocknum, isOpen) { /* --Merci a http://www.scriptygoddess.com-- */ hid = ('hide' + (blocknum)); unhid = ('click' + (blocknum)); if(document.getElementById) { if(document.getElementById(hid).style.display) { if(isOpen != 0) { document.getElementById(hid).style.display = "block"; document.getElementById(unhid).style.display = "none"; }else{ document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } }else{ location.href = isOpen;return true; } }else{ location.href = isOpen; return true; } } function myCalculOperation(maxNumber, minNumber, operation) { num2 = Math.round(Math.random() * maxNumber); do { num1 = Math.round(Math.random() * maxNumber);} while (num1 < minNumber) switch (operation) { case 1: document.getElementById("the_calcul").innerHTML = num1 +" + "+ num2 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 + num2); break; case 2: document.getElementById("the_calcul").innerHTML = num1 +" - "+ num2 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 - num2); break; case 3: document.getElementById("the_calcul").innerHTML = num1 +" x "+ num2 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 * num2); break; case 4: document.getElementById("the_calcul").innerHTML = (num1 * num2) +" ÷ "+ num1 +"</div><div id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ num2; break; } } var t=5; var int=self.setInterval("myConstructor()",1000); function myConstructor() { if (t == 0) { document.getElementById("the_countdown").innerHTML = t--; document.getElementById(hid).style.display = "block"; document.getElementById(unhid).style.display = "none"; } else if (t < 0) { t = 5; document.getElementById("the_countdown").innerHTML = "GO"; myCalculOperation(100,25,1); document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } else { document.getElementById("the_countdown").innerHTML = t--; document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } } </script> </head> <body> <div id="the_calcul" class="calcul"></div> <div id="click101"> <a href="#jsenabled=no" class="uLigne" onclick="showMoreAnything(101,'#?jsenabled=no');t=0;return false;">Voir la réponse</a> </div> <div id="the_countdown" class="calcul_countdown"></div> </body></html> I don't understand enough javascript yet but I think it have to do with the showMoreAnything() function.I will try to reverse the function to see what it will do.
  17. I don't know much about JavaScript but can't you look at the value of the last field?
  18. Hi guys, this is what I got so fare as code and it work good.I would like to do a countdown that after a preset time it show the answer of the calculation and call myCalculOperation() function again and again without refreshing the whole page (only the division).Thank you to guide me <!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" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="Matpatnik.css" type="text/css"> <title>Matpatnik Addition</title> <script type="text/javascript">/* --Merci a http://www.scriptygoddess.com-- */ function showMoreAnything(blocknum, isOpen) { hid = ('hide' + (blocknum)); unhid = ('click' + (blocknum)); if(document.getElementById) { if(document.getElementById(hid).style.display) { if(isOpen != 0) {document.getElementById(hid).style.display = "block"; document.getElementById(unhid).style.display = "none"; }else{ document.getElementById(hid).style.display = "none"; document.getElementById(unhid).style.display = "block"; } }else{ location.href = isOpen;return true; } }else{ location.href = isOpen;return true; } } function myCalculOperation(maxNumber, minNumber, operation) { num2 = Math.round(Math.random() * maxNumber); do { num1 = Math.round(Math.random() * maxNumber); }while (num1 < minNumber) switch (operation) { case 1: return num1 +" + "+ num2 +"</td><td id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 + num2); break; case 2: return num1 +" - "+ num2 +"</td><td id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 - num2); break; case 3: return num1 +" x "+ num2 +"</td><td id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 * num2); break; case 4: return (num1 * num2) +" ÷ "+ num1 +"</td><td id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ num2; break; default: return num1 +" + "+ num2 +"</td><td id=\"hide101\" style=\"display:none;\" align=\"left\">= "+ (num1 + num2); break; } } </script> </head> <body> <div align="center"> <div><script type="text/javascript">document.write(myCalculOperation(100,25,1));</script></div> <div id="click101"> <a href="#jsenabled=no" class="uLigne" onclick="showMoreAnything(101,'#?jsenabled=no');return false;">Voir la réponse</a> </div> </div> </body></html>
  19. Matpatnik

    Class problem

    I forgot about the $ Thank you
  20. session_start(); should be at the most top of you code aren't you suppose to tell where to insert the VALUES? some thing like \\ enter the invoice into the db $connection = mysql_connect("server", "user", "password") or die(mysql_error()); $db = mysql_select_db(database,$connection)or die(mysql_error()); $sql = "INSERT INTO mkp_invoices (username, user_id, full_date, total, flag) VALUES ('', '$userid', '$timestamp', '$total', '1')"; $result = mysql_query($sql,$connection) or die(mysql_error());
  21. Matpatnik

    Class problem

    Hi guys, I have this error when using this function generateNumber() it tell me Fatal error: Cannot access empty property.can someone enlighten me plz <?phpclass generateLotto { public $stringNumber; public $maxNumber; public $repeatNumber; // doesn't work function __constructor($maxNum=49, $repeat=5) { $this->maxNumber = $maxNum; $this->repeatNumber = $repeat; $this->stringNumber = ''; } // if __constructor is not set function generateLotto($maxNum=49, $repeat=5) { $this->maxNumber = $maxNum; $this->repeatNumber = $repeat; $this->stringNumber = ''; echo $this->maxNumber .' - '. $this->repeatNumber; // this work fine } function getRandomNumber() { // chose a number between 1 and $maxNum $this->stringNumber = mt_rand(1, $this->maxNumber); // this work fine } function generateNumber() { echo '-'. $this->$repeatNumber .'-'; // problem is here: Fatal error: Cannot access empty property for ($i=0; $i<$this->$repeatNumber; $i++) { $this->getRandomNumber(); if (in_array($this->stringNumber, $lotto)) { continue; } $lotto[$i] = $this->stringNumber; echo $lotto[$i]; } echo $lotto; $this->stringNumber = implode('-', $lotto); } function showNumber() { // this work fine //$this->getRandomNumber(); return $this->stringNumber; }}$LOTTOnumber = new generateLotto(50,3);$LOTTOnumber->generateNumber();echo ' -> '. $LOTTOnumber->showNumber();die();?>
  22. thx for the correction heheI toke of the javascript and nothing have changed except it is validated now
  23. i'm sorry I thought it was oblivious I thought about creating 15 class, 1 for each specific cell style
  24. Matpatnik

    php load dll

    So I can create my own .DLL and use it with php! that's nice how does it work? I mean how do you call it
×
×
  • Create New...