Page 1 of 1

Help with Coding

Posted: Sat Jul 31, 2010 5:48 pm
by Majick
Hello everyone.

I've been browsing the web trying to find some help with coding. I'm starting a DC fan forum, and I would love to add a sort of hatchery to it. I would like to try something where members can enter the 4-digit code of their dragons, and then they would show up in either a specific area of the forum or perhaps within the global header in small, randomly selected groups. If that makes sense. However, I am a complete HTML, PHP, MySQL idiot (I've never touched the stuff) and the coding stuff just drives me batty. I was wondering if anyone knows where I could find a simple format that is free for editing for use, or could maybe walk me through making one of my own. Either one would be great.

Thanks a bunch!

Re: Help with Coding

Posted: Sat Jul 31, 2010 5:54 pm
by superdezign
That was... vague. lol
Firstly, what is DC?

Secondly, if these "dragons" are images that are stored online and these codes can be used to identify the images, then this is certainly possible. As a courtesy, you should copy the images to your website and load them from there rather than from the parent site, but that's your call. If you can provide us with the URL of an image and it's corresponding 4-digit code, or the means by which these dragons are defined, we can help you.

Programming is all about logic. Give us the logic, and we'll help you figure it out.

Re: Help with Coding

Posted: Sat Jul 31, 2010 6:29 pm
by Majick
Oh, sorry, LOL!

DC is the abbreviation of a virtual dragon adoptable site called "Dragon Cave". There, members join and they get a "scroll", on this scroll they store their eggs and hatchlings, which require clicks and views/unique views to hatch and to grow into adults. The hatchery would be for eggs and hatchlings only. As for uploading the pics to my own site, I don't think that would work since each individual dragon is assigned its own unique 4-digit code upon creation. Though, it's entirely possible I'm not understanding you. I am new to this, this is my first time ever trying it ^__^;

I guess ... I hope that makes more sense? :)

Re: Help with Coding

Posted: Sat Jul 31, 2010 6:32 pm
by superdezign
Well, on the main site for this, are these dragons shown as images? Is it Flash-based? Is it Java-based?

Re: Help with Coding

Posted: Sat Jul 31, 2010 6:33 pm
by Majick
They are images. Each type of dragon has it's own little sprite.

Re: Help with Coding

Posted: Sat Jul 31, 2010 6:46 pm
by superdezign
Alright then. Do you see the 4-digit code showing up the URL of either the sprite image or the page that the sprite image resides on?

Re: Help with Coding

Posted: Sat Jul 31, 2010 7:00 pm
by Majick
Yes. Whenever you click on one of the sprites, it looks like this

http://dragcave.net/view/pHcC

the pHcC is what distinguishes that particular dragon from the others. I have a dragon who's 4-digit code is FART (and yes, in all caps just like that).

Re: Help with Coding

Posted: Sat Jul 31, 2010 7:07 pm
by superdezign
Okay, then. In order to figure out their image, you have 2 steps:
  1. Get the HTML data from: http://dragcave.net/view/[b]4-digit-code[/b]
  2. Find the <img> element whose src attribute starts with "/images/"
From what I see, the sprites are the only images in the "images" folder. That's just an assumption on my part, though.

Then you would save the file referenced by that src attribute on your site, and reference their sprite from there. They could have a button that they can click to tell your website to update their sprite. Instead of the button, you could automatically attempt to update it, but this would strain both your server and the main site's server. This could also possibly get your website blacklisted by their server, so I'd recommend against automatic updates.