Jump to content

Volter9

Members
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Volter9

  1. Hello guys! I created simple HTML5 Canvas Game Engine and want to share with my creation. There's a link to the project (on github): https://github.com/Volter9/RacoonJS And demo: http://volter9.github.io/RacoonJS/demos/Asteroids/index.html Thank you for attention. P.S.: I hope I not violating any rules. P.S.S.: To admins/moderators: did I choosed right section to post in?
  2. May be you could add in list "Game Engine", for example for Canvas 2d.
  3. Me too, I'm prefer TextWrangler + Courier font.
  4. Volter9

    Word Filler

    Kids, don't use text-align:justify; to make string in whole width
  5. Volter9

    Word Filler

    Dude, it's easy. But I think, wisely be if you would use tables. Here's code: <? // PHP Code function ($before,$after) { $name = $before; $price = $after; $totalLength = 200; // Total length of string $dotsLength = $totalLength - strlen($name) - strlen($price); // Amount of dots $dots = str_repeat(".",$dotsLength); $result = $name.$dots.$price; return $result; } ?>
  6. Do you have here humor or offtopic section?

  7. +1 Jessica, never store code in data bases, and never (sometimes yes, but only at home!) don't use eval()s in code! But it was only a option, just option. It's one way of storing code, but bad way
  8. Hello guys! I'm newbie too (Not in PHP, at forum )! hell_yeah, what language are you speak? (I'm isn't native speaker too )
  9. Volter9

    Layout

    Ok, I fix it... Enjoy
  10. If you want just to insert the same piece of code, there's a different solutions: Includes from another file *.php (recommended, most easiest) Selection from Data Base: MySQL or others (most hardest way) Storage Classes. Note: OOP required (you're creating class and storing inside of class piece of code)
  11. Exactly) I just like shortcuts for some words like jQuery.
  12. Volter9

    Layout

    Ok, how many rows in products table... Simpler question: what did you get in $productCount variable? P.S.: OK, but if you promise that you will change password. OK?
  13. You can sort them array in for/while loop: $someArray = array(); $newArray = array() for ($i = 0; $i < count($someArray)-1; $i++) { $index = abs($i - count($someArray)); $newArray[$index] =$someArray[$i]; } It's also called reserved array.
  14. Volter9

    Layout

    How many rows you have in data base?
  15. There's in CSS3 you can find transformations for elements but the problem is that you can't to control them. There's advice: better use ready JQ or JQ UI plugins/JS solutions.
  16. Guy's where I can find last replies window?

  17. Volter9

    Layout

    Ok, I get it: <?php // Run a select query to get my letest 6 items // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $dynamicList=""; $sql=mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 10"); $productCount=mysql_num_rows($sql); // count the output amount if($productCount>0) { echo '<table>'; while($row=mysql_fetch_array($sql)) { if(($productCount%5) == 0) { $dynamicList .= '<tr>'; } $id=$row["id"]; $product_name=$row["product_name"]; $price=$row["price"]; $date_added=strftime("%b %d, %Y",strtotime($row["date_added"])); $dynamicList.='<td width="142" valign="top" align="center"><a href="product.php?id='.$id.'"><img style="border:#666 1px solid;" src="inventory_images/'.$id.'.jpg" alt="'.$product_name.'" width="77" height="102" border="1" /></a><p>'.$product_name.'</td>'; if(($productCount%5)==4) { $dynamicList .= '</tr>'; } } echo '</table>'; } else { $dynamicList = "We have no products listed in our store yet"; } mysql_close(); ?>
  18. Volter9

    Layout

    I cannot help without link to your site, if it's localhost I'll try to format code, try now: <?php // Run a select query to get my letest 6 items // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $dynamicList=""; $sql=mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 10"); $productCount=mysql_num_rows($sql); // count the output amount if($productCount>0) { echo '<table>'; while($row=mysql_fetch_array($sql)) { if(($productCount%5)==0) { echo '<tr>'; } $id=$row["id"]; $product_name=$row["product_name"]; $price=$row["price"]; $date_added=strftime("%b %d, %Y",strtotime($row["date_added"])); $dynamicList.='<td width="142" valign="top" align="center"><a href="product.php?id='.$id.'"><img style="border:#666 1px solid;" src="inventory_images/'.$id.'.jpg" alt="'.$product_name.'" width="77" height="102" border="1" /></a><p>'.$product_name.'</td>'; if(($productCount%5)==0) { echo '</tr>'; } } echo '</table>'; } else { $dynamicList = "We have no products listed in our store yet"; } mysql_close(); ?>
  19. Volter9

    Layout

    Then: <?php // Run a select query to get my letest 6 items // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $dynamicList = ""; $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 10"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { echo '<table>'; while($row = mysql_fetch_array($sql)){ if (($productCount % 5) == 0) echo '<tr>'; } $id = $row["id"]; $product_name = $row["product_name"]; $price = $row["price"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $dynamicList .= '<td width="142" valign="top" align="center"><a href="product.php?id=' . $id . '"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="77" height="102" border="1" /></a><p>' . $product_name . '</td>'; if (($productCount % 5) == 0) echo '</tr>'; } } echo '</table>'; } else { $dynamicList = "We have no products listed in our store yet"; } mysql_close(); ?> if it's still going outside the table then change "... % 5" to "... % 4"
  20. link7722, you can also use htmlspecialchars()
  21. Volter9

    Layout

    Your code become from initial to: <?php // Run a select query to get my letest 6 items // Connect to the MySQL database include "storescripts/connect_to_mysql.php"; $dynamicList = ""; $sql = mysql_query("SELECT * FROM products ORDER BY date_added DESC LIMIT 10"); $productCount = mysql_num_rows($sql); // count the output amount if ($productCount > 0) { echo '<table><tr>'; while($row = mysql_fetch_array($sql)){ $id = $row["id"]; $product_name = $row["product_name"]; $price = $row["price"]; $date_added = strftime("%b %d, %Y", strtotime($row["date_added"])); $dynamicList .= '<td width="142" valign="top" align="center"><a href="product.php?id=' . $id . '"><img style="border:#666 1px solid;" src="inventory_images/' . $id . '.jpg" alt="' . $product_name . '" width="77" height="102" border="1" /></a><p>' . $product_name . '</td>'; } echo '</tr></table>'; } else { $dynamicList = "We have no products listed in our store yet"; } mysql_close(); ?> Now you should to check it
  22. Hello AyKay47, I'm new one on forum, but I have big experience with PHP, HTML and CSS.
  23. To parent you're setting this properties: #parent { margin: 0 auto; /* Auto working only in W3C browsers, no IE, sorry */ } To fix it in IE, you should to wrap parent div with <table align="center">
  24. It's should to be right: preg_match('/href="\/blog\/([a-z0-9A-Z]*)"/',$data,$matches);
×
×
  • 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.