Jump to content

D.Slatk

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by D.Slatk

  1. hehe, That's okay. My next step is probably going to have to be to store several areas (smaller map chunks of the big map) in a database and somehow assign attributes to organize how they should be arranged on the big map as a whole. I think I am going to use an area id for the primary key, two numbers for the area location (x and y), then the map string for that area. I'd need to write a function that requests a portion of the map depending on for numbers (x1, y1, x2, y2) and those four numbers being two "global" coordinates. An area's global coordinates are determined by the area location. That is the best idea I can think of in order to reduce stress. See I could just make one HUGE map, but since when people request, they only request (normally) a 21x21 chunk of it, that creates a lot of stress on the server. They'd be requesting a huge data entry and only using just a small portion of it. With my idea in the first paragraph, they'll only be request up to four max areas at a time which is stitched together to show them the portion they're supposed to see. This is all just theorizing. No idea how I'll get it done but all you need is an ambition. If anybody has any other ideas that would work better, prove to be less stress on the server, or make the output'ed source code smaller again please share! hehe.
  2. That is a very good idea, thanks! One thing before I try it though, I looked for documentation on php.net so I could find more information out about it but couldn't find any... Do you have a link to it there? edit Nevermind, foud some, it was way down though: http://us2.php.net/manual/en/language.types.string.php Going to go try it now. edit Yay, works. All I had to do was take out the code that converted the string into an array, and then replace each instance if $area1[$i] with $area1{$1}. Any more ideas on how to make this run faster / make the code more clean would be greatly appreciated! http://test.talonz.com/enginetest.php <- Ignore the trees, was testing something.
  3. Okay I managed to get something done. Sorry for not being very clear. I'm trying to have a big "map" of letters that are used to output a table. Each letter represents something in the table, whether it's a cell with a certain color or a </tr><tr> to start a new row. One problem I was having was when I was trying to explode that string so I could each each letter into its own array. I couldn't just explode with '' (explode things that have nothing between them), which I was trying to do to accomplish that. So I looked at php.net and after a bit of looking found a function called chunk_split()! So I used that to place a colon after every letter, then used substr() to take off the last colon, and then exploded it by the colon so each letter was in it's own key as I wanted. Here is the working code: >echo '<html><head><title>Test</title><style type="text/css"><!-- body,table {font-size:11px;} --></style></head><body>'; // Store the map into the variable... $area1 = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxLxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxLLxxxLLLxxxxxxxxxxx xxxxxxxLLxxLxxxxxxLLxxxxxxxxxxxx xxxxxxLLLxxxxLLxxxxxxLLLLLxxxxxx xxxxxxxxxxxxxxxxxxLLLLLLLLLLxxxx xxxLLLLLLLLLLLLLLLLLLLLLLLLLLxxx xxLLLLLLLLLLLLLLLLLLLLLLLLLLLLxx xxLLLLLLLLLLLLLLLLLLLLLLLLLLLLxx xxxLLLLLLLLLLLLLLLLLLLLLLLLLLLxx xxxxLLLLLLLLLLLLLLLLLLLLLLLLLLxx xxxLLLLLLLLLLLLLLLLLLLLLLLLLLLxx xxLLLLLLLLLLLLLLLLLLLLLLLLLLLLxx xLLLLLLLLLLLLLLLLLLLLLLLLLLLLLxx xLLLLLLLLLLLLLLLLLLLLLLLLLLLLLxx xLLLLLLLLLLLLLLLLLLLLLLLLLLLLxxx xLLLLLLLLLLLxxxxxxxLxLLLLLxxxxxx xLLLLLLLLLxxxxxxxxxxxxxxxxxxxxxx xLLLLLLLxxxxxxxxxxxxxxxxxxxxxxxx xLLLLLLLxxxxxxxxxxxxxxxxxxxxxxxx xLLLLLLLLLxxxxxxxxxxxxxxxxxxxxxx xxLLLLLLLLLLLLLLLLLLLLxxxxxxxxxx xxxLLLLLLLLLLLLLLLLLLLLxxxxxxxxx xxxxLLLLLLLLLLLLLLLLLLLLxxxxxxxx xxxxxLLLLLLLLLLLLLLLLLLLLxxxxxxx xxxxxxLLLLLLLLLLLLLLLLLLLxxxxxxx xxxxxxxLLLLLLLLLLLLLLLLLxxxxxxxx xxLLxxxxxxxxxxxxxxLLLxxxxxxxxxxx xxxxxxxLLLxxxLxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // Separate the letters with a colon... $area1 = chunk_split($area1, 1, ':'); $area1 = substr ($area1, 0, (strlen($area1)-1)); // Put each tile into a key of the array... $area1 = explode (':', $area1); // Generate the table and it's tiles depending on the contents of each key... echo '<table border="0" cellpadding="0" cellspacing="0" align="center"><tr>'; for ($i = 0; isset($area1[$i]); $i++) { switch ($area1[$i]) { case 'x': echo '<td width="16" height="16" bgcolor="#89CBF3"> </td>'; break; case 'L': echo '<td width="16" height="16" bgcolor="#19CF00"> </td>'; break; case "\n": echo '</tr><tr>'; break; default: echo '<td width="16" height="16" bgcolor="#FFFFFF"> </td>'; } } echo '</tr></table>'; echo '</body></html>'; You can see it in action at http://test.talonz.com/enginetest.php However I am still looking for ways to make the script more clean. Thanks for telling me about the serialize() function, that way it'd be easy to store this into a mysql record. Okay, and the big forest thing. I want to be able to have a very large map. In order to reduce speeds of requests to the table I'd have several maps, with each record having some way of identifying where it is in relationship to the other maps. Then the big goal is I want to be able to recall say a 10x10 area for starters anywhere on that big map (all of the records put together forms the big map)... It's confusing I think but right now I just want to make sure I can get those records stored and recalled in a nice clean way.
  4. I have started using arrays but it's quite inconvenient. x.x Here is what I have so far: >// Store the map into the variable... $area1 = 'x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xB x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x'; // Get it all on one one line... $area1 = explode ("\n", $area1); $area1 = implode ('', $area1); // Explode the string to store the rows into an array... $area1 = explode ('B', $area1); // Explode again to store each character into a nested array... for ($i = 0; $i < 30; $i++) { $area1[$i] = explode (' ', $area1[$i]); } From there I could recall any one of the x's by using $area[row][column]. I have run into another problem. I need it to be $area[column][row], heh... Sorry about all the questions, I only know the basics of php. Also a couple other minor things... I'm not sure or not if there's a function to put a variable all on one line or not...
  5. Okay, been a while since I've posted. Anyways, lately I have been thinking about something I have been wanting to do but have got stuck on this part. My idea involves a grid. In the grid, each little cell contains something, maybe in image, who knows. This grid of course would have to be displayed to the web browser in one of different forms but that doesn't really matter here. Now here comes the hard part. I want to be able to store the grid in a single variable. Something that could look like this: >xxxxxxxxTxB xxxTxxxxxxB xxxxxxTxxxB xxTxxxxxxxB xxxxxxxxTxB xxxxxxxxTxB xxxTxxxxxxB xxxxxxTxxxB xxTxxxxxxxB xxxxxxxxTx That's a 10x10 grid. I need to find a way to have php scan that variable, and do something depending on the certain letter it sees. Say for every "x" it sees, it needs to make a green cell and for every "T" it sees, it needs to make a brown tile. And for every "B" it sees, it starts a new row. Is there any function that I can use in order to scan it and perform an action depending on what letter it encounters? There might be a really simple way to do this I haven't been able to find, or I'll need to define my own function to do it. >.<
  6. Well for an example you could do this: ><font face="verdana,arial,helvetica">Text</font> If the user has verdana on their system, it'll use that. If not, it'll use arial. If not arial...etc. If you are going to set the font with style sheets, then it's best to place something such as sans-serif at the end in order to make sure you're getting something nearly all computers use. Nothing happens if you don't, it's just recommended. If you are going to use the font style just a few times but not throughout the whole page, you could do something such as this: >.style1 { font-family:Verdana,Arial,Helvetica,sans-serif; } and then where you want to use that certain font on the page just do ><font class="style1">Text</font> This might've been more than you were looking to find out though, but I hope it helps.
  7. Actually, now I changed it all to css and am not appearing to have the problem anymore! Yay...
  8. Perhaps that is it. I am trying to convert the layout to CSS with divides right now (wish me luck) to see if that is the problem. Too much of a paint validating a form of the layout I'm not going to use. However, I'll change the doctype. *tries* edit: Don't worry about it... I'll get it later. -.- That might be it, but I don't know why firefox would only make it shift sometimes. Still working on css version.
  9. http://www.talonz.com/ Go there and keep refreshing while on firefox. For whatever reason this doesn't happen in internet explorer. If you notice, the content in the navigation menu and the content in the main area will shift about every 5 refreshes. I really don't know why this is happening and I would like to find out if this is only me or everybody else. Does anybody have any ideas? Remember it's only happening in firefox, and not internet explorer for whatever reason...
  10. I believe it remains private until your domain renewal comes rolling around... I also remember something about all domains HAVE to be unprivate by February, but I could be wrong on the month of that or just entirely. So unless I'm mistaken, it goes public when your domain renews or February, whichever one comes first.
  11. Also a radio show was aired about it too, by godaddy.com. o.o http://www.bobparsons.com/ (godaddy.com's founder's website) :\ I am thankful I don't have a .us domain name... I don't want phone calls from any of my online acquaintences. One of the large services offering "private registration" is domains by proxy ( http://www.domainsbyproxy.com/LegalAgreement.aspx ). If you look up a domain name that's been passed through that service you'll see their information in place of where yours would be. A whois domain lookup shows details such as your home address, telephone numbers, emails, etc.
  12. D.Slatk

    Color Wheel

    Thank you, that is a really nice web page with many useful features. Only thing I wish it could do would be to show harmonies too (where colors are opposite on color wheel, next to eachother, etc). For that though I use this: http://www.colorschemer.com/online.html
  13. Darn...I was hoping that there was a set way in order to do it (rather than having it expire in the great future). Thanks anyways.
  14. Okay, I've got most of the cookies down, the only thing I am left wondering at is how to set an infinite expiration date. Is it possible, or not? If not I think I could use an if statement to rest the cookie's current time back to whenever, or add onto the cookies current time. But I really hope that isn't necessary... What I'm trying to do is let viewers set the skin of a site (the site isn't up yet anyways so I'm on no rush). I have it in PHP, and it sets a cookie called colorTheme, and its value determines which CSS file the browser is going to use. But I need to know how to make it so it'll never expire uintil they delete it or until they click the default color scheme.
  15. I recommend a prgram called "PHP Designer" for creating and editing php. It's not just PHP though, it can do HTML, CSS, PHP, Perl, and XML as well. Nice syntax highlighting as well, not too large either. ^^ http://www.mpsoftware.dk/phpdesigner.php
  16. Heh...PNG files work in internet explorer. It has worked for quite a while actually, the old computers at my school, which have a very old version of IE all support my png sites. However, the alpha transparency does not work for IE unless in one of the newer versions they added it. However, full transparified (!) pixels in the image should work. For people who don't know, alpha transparency is where you can have pixels semi-transparent. Like a red pixel have 25% transparency. I'm probably a little bit off though. But I know they work in IE...
  17. For what it's worth, you can't edit a post in a locked topic...
  18. Not true, iframes between HTML and XHTML are identical. See: http://www.w3schools.com/tags/tag_iframe.asp Also, check here for a complete list of tags: http://www.w3schools.com/xhtml/xhtml_reference.asp And to get your pages from HTML to XHTML use a utility caled HTMLTidy http://tidy.sourceforge.net/ <{POST_SNAPBACK}> Oops sorry, got my info from the wrong source then. I am not one to use iframes though, but I knew about the doctype for frames.
  19. XHTML transitional doesn't allow frames of any sort, whether they noprmal or iframes. Use the frame form of XHTML: ><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> Make sure to read all the doctypes at: http://www.w3schools.com/xhtml/default.asp edit: see jim posted the link...make sure to read it though, because it mentioned the frameset doctype and stuff...
  20. You've got something funky going on with the css for the iframe, in the second page. Steve I think she's talking about the navbars on the iframe itself instead of the actual page on the second one. I set up two a test page (two, counting the iframe) seeing if it was the actual CSS code that wasn't working, or something interfering with the code, outside of the code itself. http://test.talonz.com/test1.html The main page is from your first link. The iframe is from the iframe in your second link. Both seem to work correctly so I'm assuming it must be something else in the page effecting the code.
  21. I just want to add one thing to the layout part, I don't think he mentioned it but this is an option. It lets you change the titles set for the pages very easily. For example lets say you have this on your fruits and vegetables page of a healthy eating site: ><?php $pageTitle = 'Healthy Eating: Fruits and Vegetables'; include (file.inc); ?> Content <?php include (footer.inc); ?> And in the header.inc you will then have this code: ><html><head><title><?php echo $pageTitle; ?></title</head><body <table...> etc This make it so you can change the title of the page on your web site. In this case, your title would come out as the variable you defined in the first block of code I showed you. You can change it for each page and so then each page will come out differently. One more thing (again, I don't know if this has been mentioned, heh). Use single quotes if all you have are text and characters that you're going to use. That way the server processes it just a little little little bit faster. If you use double quotes, the server will have to parse it while checking for variables and the like. For example: ><?php $singleQuotes = 'testing the single quotes'; echo '$singleQuotes and does it work?<br />'; echo "$singleQuotes and does it work?<br />"; echo 'Another way of ' . $singleQuotes . '<br /><br />'; $singleQuotes2 = "$singleQuotes with storing it in a variable"; echo $singleQuotes2; ?> You would get: Tell me if that those made any sense at all
  22. Yay! Thank you! I really like putting those kinds of buttons on my site (the 15x80 ones) and was looking for one here but could find it. Nice job. Though maybe you want to put it on give with 4/8 colors since it's so small and doesn't use many blending colors...
  23. The one I learned from is http://www.w3schools.com/ You can click Learn CSS on the left.
  24. Yeah, I don't really udnerstand either, but I'll try to help. If your problem is when the shadow starts to tile itself after the cell it's in is stretched, you can control tiling with css. You can assign the cell containing the background a css class. First, remove the background="..." attribute from the <td> tag. Then, add a class, using a name that you can identify the cell easily with. For example, <td class="rightDropshadow">. Now go to your CSS, and use something along the following lines: .rightDropshadow { background-image: url(UrlToBackground.jpg); background-repeat: repeat-y; background-position: top left; } For the repeat you have the following options: repeat repeat-x repeat-y no-repeat Repeat-x repeats it once on the x axis (horizontally). Repeat-y will repeat it on the y axis (vertically). Repeat will just tile it throughout the whole thing. No-repeat will use the image just once and not repeat it at all. For the position, it determines where the first instance of the background is placed in the available space to use as the background: top left top center top right center left center center center right bottom left bottom center bottom right Hope this helps some... css is really ncie to use for controlling backgrounds.
  25. First off I'd like to show you a nice little tutorial, same thing as what Mr. Lucas said but it has pictures. Just remember though always adjust your file types. Some tips to remember. 1. If you have many blendings of colors, such as a photograph, you'll want to use the jpg format. ALWAYS keep the quality under 40 percent, around 20 percent if not too much of the quality is lost. The downside with jpg is that it can't go transparent. Plus is that it's much smaller than gif in many situations. Good example of an image I made suitable for jpg compression: http://files.talonz.com/idb/Icy-Landscape.jpg 2. If you have an image with many parts of it filled with the same color, your best bet is the .gif format. This is because gif treats the fill differently than jpg. It treats it as a fill of color, while is smaller, while jpg treats it as if it's a blend and wastes the memory space on the filler color. Also use gif if you want transparencies of course. Good example of a good gif: http://www.totalchoicehosting.com/forums/s...ges/1/logo4.gif You can see the halo of blue on it. Look at the top of this forum and you won't recognize that there are sharp edges on the text - that's courtesy of the halo. You can also see the simple fills, and few colors used. 3. Make sure to set your mattes if you plan to be the only one using them. What the matte does is it creates a halo on portions of the gif that arn't completely filled with a color. This halo will basically create a "ring" around the gif, in most cases, but the gif will blend much more smoothly into your site. If you want other people to use the image, it's best not to since you don't know what backgrounds they will be using. It looks like you're using ImageReady to create that page for you? If so, there's not much I can do for you about that except to suggest you learn html. http://www.w3schools.com/ and look at the nav on the left, click HTML. For what it's worth, generally most of the files on the internet are GIF or JPG's. You'll occasionally find PNG's, which are nice because they compress better and have alpha transparency, but those arn't too common yet since some of the older browsers don't support PNG's features, or just the image itself. (for example, IE can't see a PNG image's alpha transparency. with alpha transparency you don't need a halo.)
×
×
  • Create New...