Jump to content

Kryptix

Members
  • Posts

    283
  • Joined

  • Last visited

    Never

Everything posted by Kryptix

  1. I want to have a top border on a div but only across 50% of the width. Is this possible?
  2. <div id="background"> <article> <header></header> </article> </div> To style the article you can use: #background>article But how can you style the header? I tried: #background>article header
  3. As title really, I have <a>'s everywhere and I want to style them all EXCEPT for the <a>'s in <nav> How would I leave them alone?
  4. Kryptix

    Levels?

    <nav> <ul> <li><a href="#">Home</a></li> <li><a href="#">Test</a> <ul> <li><a href="#">Test 1</a></li> <li><a href="#">Test 2</a></li> <li><a href="#">Test 3</a></li> </ul> </li> </ul> </nav> How would I style JUST the second level without styling the first?
  5. Hi guys, I have this: <html> <body> <article> <header></header> <footer></footer> </article> <footer></footer> </body> </html> I know you can style JUST the article footer by doing 'article footer' but how can I style JUST the bottom footer, without touching the article footer? Thanks
  6. Er, when you go to page.html/1 on my website it takes the CSS away. Someone found out an XSS exploit as I was taking the page title from the file name, and they done page.html/1/</title><javascript... I noticed on lots of websites you can add / after page names and mess things up. Is there anyway to disable this or a work around using lighttpd?
  7. It works but the thing is, I'm overlapping up to 20 PNG images in one go through a function called add_sprite() like so: function add_sprite($loc) { global $char_image; $spr_add = imagecreatefrompng($loc); imagecopymerge($char_image, $spr_add, 0, 0, 0, 0, 64, 102, 100); imagedestroy($spr_add); } With your way I don't see how I can do it because it's a different set and amount of images each time. All you're doing is putting the non-transparent item at the bottom and then the head on top. The problem is the item isn't properly transparent. Thanks so much for your help so far. Is there anyway to see what the difference is between the two PNG's? As I said the first batch work fine, it's just the items that are causing a problem as they've been generated differently.
  8. Brilliant, that works perfect -- thanks! One more problem, I have 2 types of PNG, one is for the character and the other type of the items they're wearing. It seems that the PNG's have been generated differently and although this PNG appears transparent it just overlaps the existing image. When I load the first set of images into Photoshop they appear to have a black background even though they're transparent when viewing them in Windows and when you open the above image it opens as transparent, so there's clearly something different in how they're generated or saved. Can anyone tell me how to overcome this? Here's the code. It works fine until the last one (armour) and then it's overlapped and just shows the one image: <?php header('Content-type: image/png'); $canvas = imagecreatetruecolor(64, 102); imagecolortransparent($canvas, imagecolorallocate($canvas, 0, 0, 0)); $body = imagecreatefrompng('body.png'); imagecopymerge($canvas, $body, 0, 0, 0, 0, 64, 102, 100); $head = imagecreatefrompng('head.png'); imagecopymerge($canvas, $head, 0, 0, 0, 0, 64, 102, 100); $armour = imagecreatefrompng('armour.png'); imagecolortransparent($armour, imagecolorallocate($armour, 255, 255, 255)); imagecopymerge($canvas, $armour, 0, 0, 0, 0, 64, 102, 100); imagepng($canvas); imagecanvasroy($canvas); imagecanvasroy($src); ?>
  9. I'm not sure what I'm meant to be looking at, I can't find anything on there that would help? The images I'm using are: The above code works fine on my friends Ubuntu install but not on my Windows install. What am I doing wrong?
  10. Add another column (an int) to the table called 'views' Whenever the web page runs the query, just have another query increasing the view count: UPDATE `table` SET `views` = `views` + 1 WHERE `id` = ''
  11. I have 2 PNG images that are the same size and both have transparent backgrounds. The first image is a head which should fit perfectly on the second image (the body). This code works fine on my friends Linux system, but on my system the body just overlaps the head making it white <?php header('Content-type: image/png'); $canvas = imagecreatetruecolor(64, 102); $head = imagecreatefrompng('head.png'); $body = imagecreatefrompng('body'); imagecopy($canvas, $head, 0, 0, 0, 0, 64, 102); imagecopy($canvas, $body, 0, 0, 0, 0, 64, 102); imagecolortransparent($canvas, imagecolorallocate($canvas, 0, 0, 0)); // Remove black background imagepng($canvas); imagedestroy($canvas); ?>
  12. I have created a image using imagepng() and then right-click'd and saved it. I then added it to the database by using phpMyAdmin to upload it directly into a field called 'avatar' which is a BLOB. The code the view the image back is the following: header("Content-type: image/png"); echo mysql_result(mysql_query("SELECT `avatar` FROM `rscd_players` WHERE `username` = 'Kryptix'"), 0); Now when I try and add the imagepng() directly to the database it doesn't work. I've tried multiple things. Here's the code: ob_start(); imagepng($char_image); $pngimagedata = ob_get_contents(); ob_end_clean(); mysql_query("UPDATE `rscd_players` SET `avatar` = " . $pngimagedata . " WHERE `username` = 'Kryptix'"); Here's the full code: http://pastebin.com/jqsKc9Qd This is the query that phpMyAdmin produces: http://pastebin.com/nuypNuwJ This is the query that the above code produces: http://pastebin.com/NPWmi5eb phpMyAdmin is 2.2kB, my code is 4.4kB Any idea? I've been trying all night...
  13. You know how LEFT or RIGHT JOIN will join regardless if there's a match, I want it to join without having to define LEFT or RIGHT if that makes sense... If I'm joining the above, regardless if there's an entry in address OR staff, it joins anyway (displays the result)
  14. Say I have two tables... staff staff_addresses If both tables don't have a match I want to delete the other tables record. DELETE `staff`.*, `staff_address`.* FROM `staff` JOIN `staff_addresses` ON (`staff`.`id` = `staff_addresses`.`staff_id`) WHERE `staff`.`id` IS NULL OR `staff_addresses`.`id` IS NULL; I can use a LEFT or RIGHT join if I know which won't have an entry, but is it possible to do a join anyway regardless if it has a match?
  15. Selecting is really quick (0.006 seconds) but deleting takes 22 seconds... 211689 row(s) deleted. ( Query took 22.6486 sec )
  16. EXPLAIN EXTENDED SELECT * FROM `RSCEmulation Logs`.`game_chat` WHERE `time` < UNIX_TIMESTAMP() - 604800 Returns: Storage engine: MyISAM
  17. DELETE FROM `chat_logs` WHERE `time` < UNIX_TIMESTAMP() - 604800; It takes over 20 seconds as it has like 2 million entries. Is there a quicker way it can be done?
  18. Say I have 3 tables... employees employees_addresses employees_jobs_completed If a linking ID between employees and employees_addresses doesn't exist I want to delete all records from every table even though employees_jobs_completed may have either 0 entries or a thousand entries... Would this work? DELETE employees.*, employees_addresses.*, employees_jobs_completed FROM employees JOIN employees_addresses ON (employees.id = employees_addresses.e_id) LEFT JOIN employees_jobs_completed ON (employees.id = employees_jobs_completed.e_id) WHERE employees.id IS NULL OR employees_addresses.id IS NULL; Note the LEFT JOIN on employees_jobs_completed in case it has no entries or 1-1,000 entries. Is this the correct usage? If not, how would I go about doing it within a query?
  19. Thanks for your help, I'd still like to sleep after every query though. How could I do this?
  20. Kryptix

    Wildcard?

    UPDATE `RSCEmulation`.`rscd_experience` SET `attack_rank` = null, `defense_rank` = null, `strength_rank` = null, `hits_rank` = null, `ranged_rank` = null, `magic_rank` = null, `prayer_rank` = null, `cooking_rank` = null, `woodcut_rank` = null, `fletching_rank` = null, `fishing_rank` = null, `firemaking_rank` = null, `crafting_rank` = null, `smithing_rank` = null, `mining_rank` = null, `herblaw_rank` = null, `agility_rank` = null, `thieving_rank` = null, `runecrafting_rank` = null, `total_xp_rank` = null; Is it possible to do something like... UPDATE `RSCEmulation`.`rscd_experience` SET `%_rank` = null;
×
×
  • 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.