Be a Supporter!
Response to: IMages not showing up Posted July 30th, 2006 in Programming

At 7/30/06 09:40 PM, Whabs wrote: Thansks a lot! I tried it and it works! Apparently my version of Firefox didn't have that auto fixer too since it shows up now..

Your welcome. By the way, I'm sure it's not called "auto fixer" but I really don't know what to call it hehe. HTML was created as a language that anyone can use. It works independant of whitespace, formatting errors, mistakes, etc. Browsers are supposed to automatically correct HTML mistakes and whatnot, but I guess IE has a bug, because microsoft forgot to add in a fix if the title isn't ended.

Response to: IMages not showing up Posted July 30th, 2006 in Programming

At 7/30/06 09:20 PM, authorblues wrote:
At 7/30/06 09:14 PM, JeremysFilms wrote: IE
its an ie bug, i take it. try killing that incorrect whitespace.

change: <img src ="under1_copie.png">
to <img src="under1_copie.png">

I tried that already, it solves nothing.

I just tested something and found the problem. The error was that you didn't close the <title> tag. You put <title> twice and forgot to make the second instance of the tag a closing (</title>). If you change this it will work correctly. Apparently, IE doesn't have an auto fixer for this error and takes it that your making everything part of the title.

Response to: IMages not showing up Posted July 30th, 2006 in Programming

At 7/30/06 09:20 PM, Momo_the_Monkey wrote: <img src ="blah.png">

needs to be

<img src="blah.png" />

Only if it's XHTML compliant, which it obviously isn't since there's no doctype or any marks for that. So it's fine.

Response to: IMages not showing up Posted July 30th, 2006 in Programming

At 7/30/06 09:02 PM, Whabs wrote: Uh... :|

I can' t see it on my computer...

Sorry for the waste of time then...

No, you were half correct the first time. It does show up, but it doesn't show up in internet explorer though. I checked the source code and it looked fine.. I really don't know what the problem is.

Response to: Php: Basic Image Host Posted July 30th, 2006 in Programming

At 7/30/06 11:30 AM, -Jordan- wrote:
At 7/30/06 11:29 AM, -cherries- wrote: doodle-flash just go away and never come back to newgrounds.
or just dont bother coming into the programming forum asking for help.
Why don't you?

<?
function sucksAndSteals($user,$defend){
return $user.' is a horrible programmer who steals. Also, don\'t insult '.$defend.' as you are the one who stole and sucks at programming.';
}

echo sucksAndSteals('doodleflash','cherries');
?>

Response to: Simple Sound Question... Posted July 29th, 2006 in Programming

ActionScript related questions belong in the flash forum.

Response to: "Shapes" Posted July 29th, 2006 in Programming

At 7/29/06 04:06 PM, Nino_JoJ wrote: I noticed that, but what is the difference between absolute and relative positions?

When I say relative to the image, I'm saying that 0 would be the top left pixel of the image, with absolute, it would be everything, the entire screen. So with iamge maps, 0 is always the top left pixel, no matter where the image is in relation to the screen.

Response to: "Shapes" Posted July 29th, 2006 in Programming

Oh and by the way, the coordinate order is as follows:
Left, Top, Right, Bottom

Usage:

<map name="mymap">
<area href="URL" shape="rect" coords="left, top, right, bottom">
</map>
<img border="0" src="image.gif" usemap="#mymap" width="100" height="100">

Response to: "Shapes" Posted July 29th, 2006 in Programming

At 7/29/06 03:54 PM, Nino_JoJ wrote:
At 7/29/06 03:35 PM, elbekko wrote: Image maps you mean?
They're actually pretty simple, you just have to define a shape (standard is rectangle), and give the corner coordinates. (and a link ofcourse :P)
I know.
But how do I learn the coordinates?

Do they vary bi screen resolution (like the absoulute positions) ?

Coordinates are based on relative pixel coordinates of the image itself. If you don't want to waste time coding coordinates, you could just use frontpage or dreamweaver. Frontpage and dreamweaver (and other html editors) have an iamge map drawing feature, so you can just draw the image map square, circle, or polygon with the program and it'll code the correct coordinates for you.

Response to: Lead Php Programmer Quits Posted July 28th, 2006 in Programming

Fucking antisemite

Response to: Need a bit of php help... Posted July 27th, 2006 in Programming

At 7/27/06 05:47 PM, doodle_flash wrote: You won't beleive this untill its done, but i'm making a flash portal that works entirely on .dat/.txt files. NO MySQL.

What's the point of that? It'll just end up using up more bandwidth and server load in the end since it would have to always read the entire txt file and then pull sub-data from that and then turn it into variables. It's just a lot of un-needed work. MySQL and other databases use special algorithms and keys to find and select data. In the end, it'll be more work and more trouble to use txt files for everything. ALSO, when the files become full of a lot of data, everything will begin to become slower since it has to read the entire files and it will begin to take longer.

Do you even know MySQL though?.. if not, learn it.

Response to: See Plus / See Plus Plus Posted July 24th, 2006 in Programming

At 7/24/06 02:51 AM, Afro_Ninja wrote: It's C-sharp

Nah, it's 'See Octothorpe'
Proof my my genious: Octothorpe!!!! < click

Response to: rand () and probability Posted July 24th, 2006 in Programming

At 7/24/06 08:45 AM, JeremysFilms wrote: Lots of stuff

SHIT! I didn't notice your response post that it's in C++... even though the syntax is obviously C++ I must've somehow forgotten while posting... that was weird. I don't know any C++, but perhaps my post helps somehow?

Sorry.

Response to: rand () and probability Posted July 24th, 2006 in Programming

rand() will return a random number between 0 and RAND_MAX defined in php.ini unless parameters are given.

With parameters, the two optional arguments would be min and max

rand(3,8); //Generates random integer between 3 and 8 (inclusive)
rand(-7,43); //Generates random integer between -7 and 43 (inclusive)
rand(0,1); //Generates random integer of 0 or 1
-------------------------------------- ---------------------------------------
Currently, you are just giving the value of rand() to the variables, you probably need to declare numbers to go between.

Response to: web sapce or band width? Posted July 24th, 2006 in Programming

At 7/24/06 08:03 AM, Insanical wrote: Surely you can afford atleast $3 a month for a domain?
Hell places even do it for $1.

Godaddy charges $8 yearly though..

Response to: a program.. Posted July 24th, 2006 in Programming

At 7/24/06 04:14 AM, CronoMan wrote: Smells like a keylogger

...Are you kidding me? How the hell could this be like a keylogger. I want to have words outputted when letters are typed, how the FUCK does that relate to a keylogger.

Response to: testing php on my computer Posted July 23rd, 2006 in Programming

http://www.zend.com/products/zend_studio

I love this program.

Response to: Portal Script Posted July 23rd, 2006 in Programming

At 7/23/06 07:36 AM, Rellizate wrote: I'll help you. Contact me:

AIM: Rellizate
MSN: meltdown10@hotmail.co.uk

As usual.

Response to: bb code Posted July 23rd, 2006 in Programming

At 7/23/06 01:28 PM, Loccie wrote: Thx for all the comments and I'm allready pretty far with this but I would like to know how I can make sure people can't post a very long word that messes up my page layout. In other words how do I add a max length to a word or even better move the pieces of the word that don't fit to the next line.

You could use my and gamescools' custom wordwrap2 function:
[thread] | [function]
(Visit Both)

Or if you want to do a lousy job of automatic line breaking, you could use the old predefined wordwrap() function, but I highly recommend wordwrap2 over the original as it doesn't use character counts, but instead it uses the width of each character to add up to a specific number and once that number is reached it will break. This way, it won't ever break too early because you just set it to reach as long as you want it to stay at.

Response to: php help Posted July 23rd, 2006 in Programming

At 7/23/06 12:19 PM, Jcrypt wrote: This may be TOTALLY out there but iv'e hadd code mess up by having constants set like that ( .= ) try to just have a basic assigning symbol. ( = ) 'obviously :P' and good luck again it has made a difference for me post back and let me know i'll look at it closer when i get home sorta ran outta time here :P Good Luck. ~James

What????

Response to: php help Posted July 23rd, 2006 in Programming

At 7/23/06 11:50 AM, CaptinChu wrote: I think you have to do "if else" instead of just else. But I'm not completely sure. *is waiting for a php professional to tell him what actually needs to be done*

1) It's called elseif()
2) If you read the notes in my post pointed out clearly with bold and underlined text, you would know why I'm simply using else's

I hate when people don't read.

php help Posted July 23rd, 2006 in Programming

Setting:
I have a text area. When you submit the form to PHP, it takes the text and converts each letter into an image by retrieving an image file that corresponds to the letter being dealt with.

Problem:
I tried to make the script take line breaks and just insert a <br> tag. The problem I'm having with this is that it does insert the <br> tag correctly, but it also inserts an image tag before this <br> (literally with the line break):
<img src="
.gif"><br>

The Snippet of Code:
$output .= '';
for($i=0; $i<count($letters); $i++){
$letters[$i] = preg_replace($pattern, $replace, $letters[$i]);
if($letters[$i] == ' '){
$output .= '&nbsp;';
}else{
if($letters[$i] == "\n"){
$output .= '<br>';
}else{
$output .= '<img src="'.$letters[$i].'.gif">';
}
}
}

Notes about Snippet:
- preg_replace() function is being used to replace puntuation characters with other names since I am not using punctuation symbols as file names.

- I'm not using elseif() because I decided to try testing this with just else but (as I predicted) it made no difference so I presume I'll change it back later on.

May I have a Solution?

Response to: bb code Posted July 23rd, 2006 in Programming

At 7/23/06 10:57 AM, JeremysFilms wrote: $replace=array(
'\\1',
'\\1',
'\\1',
'<font color=\"\\1\">\\2</font>'
);

Damn, NG messed up my post, here's the entire post from pastebin:
http://pastebin.ca/97285

Response to: bb code Posted July 23rd, 2006 in Programming

Here's how I make my own "bbcode" and use it.

1) Run htmlentities() on the message being posted to make it safe before it's added to a database.
2) Insert this message that has been altered with htmlentities() into the database.
3) When you are outputting the messages to the page, that's when you want to run something to replace the bbcode with html, this way, if you ever want to alter what a specific tag does, you won't have to go through every post and change the html there, since it'll just have the bbcode in there.

Just use a preg_replace to replace the bbcode with html during output, it's pretty simple:
__________________________________________
________
$pattern=array(
'/\[b\](.*)\[\/b\]/i',
'/\[i\](.*)\[\/i\]/i',
'/\[u\](.*)\[\/u\]/i',
'/\[color=(.*)\](.*)\[\/color\]/i'
);

$replace=array(
'\\1',
'\\1',
'\\1',
'<font color=\"\\1\">\\2</font>'
);

preg_replace($pattern,$replace,$stringToOu
tput);
__________________________________________
________

$stringToOutput would be the string that is being outputted from the database.
Example snippet:

while($row = mysql_fetch_array($result)){
echo preg_replace($pattern,$replace,stripslashe
s($row['message'])).'<br /><br />;
}

Response to: a program.. Posted July 23rd, 2006 in Programming

Um, just so you all know, I'm talking about actually pasting the text of like Apple when a is pressed, so it's on demand as soon as you click a key. So while it runs, if I type in notepad, the different letters make dif words.

Response to: no dif caps in windows??? Posted July 22nd, 2006 in Programming

At 7/22/06 09:13 PM, JeremysFilms wrote: allows me to use different caps but same file.

but same file name*

no dif caps in windows??? Posted July 22nd, 2006 in Programming

I have a file called a.gif I tried to create a file called A.gif (different caps in the file name) but it won't let me because it states that a.gif already exists, how can I have two files of the same name but different caps? I'm sure you can do this on linux since my host allows me to use different caps but same file.

Response to: php question Posted July 22nd, 2006 in Programming

At 7/22/06 08:20 PM, GamesCool wrote: Yeah, I just noticed that. Glad it works now.

Thanks much :D

Response to: php question Posted July 22nd, 2006 in Programming

Works, except that sometimes you used $mychars and sometimes you used $mychrs. But here's the fixed version:

function make_string_array($string)
{
$mychars = array();
$strlen = strlen($string);
for ($i = 0; $i < $strlen; $i++)
{
$mychars[$i] = substr($string, $i, 1);
}
return $mychars;
}

Response to: php question Posted July 22nd, 2006 in Programming

At 7/22/06 07:58 PM, GamesCool wrote: explode?

But you need to use a separator for that, so how could I just take every single character and push it into an array.