All pastes #1276618 Raw Edit

what did I do this time?

public text v1 · immutable
#1276618 ·published 2008-12-05 05:10 UTC
rendered paste body
[00:20:18] <hampsterblade> what did I do this time?
[00:21:10] <azure> Trying to prove that you know PHP when all that you really do is use generated/pre-made scripts.
[00:21:28] <hampsterblade> but I wrote that script
[00:21:38] <hampsterblade> I wrote every script on my site
[00:21:48] <azure> prove it.
[00:21:51] <hampsterblade> except for the IEPNGfix of course
[00:21:54] <azure> yeah
[00:21:54] <hampsterblade> I can't
[00:22:01] <hampsterblade> I can't
[00:22:08] <azure> well, if you can't prove it, then I won't lift the ban.
[00:22:18] <hampsterblade> Nothing on my site can be proved
[00:22:20] <azure> as simple as that.
[00:22:27] <hampsterblade> its all generic if statements
[00:22:32] <azure> How about this:
[00:23:12] <hampsterblade> the only thing I didn't right is the curpagename thing
[00:23:18] <hampsterblade> I have no clue what substr does
[00:23:28] <azure> sit down and actually write a short PHP program.  Make it take a varible that contains text like "The swift fox jumped over the lazy dog" and then replace "The" with "Ye Olde".
[00:23:34] <azure> Then come back, and show me.
[00:23:40] <azure> No googling.
[00:23:41] <hampsterblade> Thats easy
[00:23:45] <azure> BUT
[00:23:54] <hampsterblade> I can't use arrays?
[00:24:00] <azure> It has to be done with regexp.
[00:24:09] <hampsterblade> I hate regular expressions
[00:24:12] <hampsterblade> They confuse me
[00:25:14] <azure> It's easy once you get the hang of it. However still it would be handy to have a cheatsheet around.
[00:25:25] <hampsterblade> like php.net
[00:26:55] <azure> Maybe... but still it would be better just to use a website that shows you the different regexp commands, instead of using a program that just generates everything for you.
[00:27:13] <hampsterblade> i don't
[00:27:21] <hampsterblade> I use notepad++
[00:27:35] <hampsterblade> for the strpos i used the example
[00:27:51] <hampsterblade> strpos($haystack, $needle)
[00:28:01] <hampsterblade> Which gave me a pretty good idea of the santax
[00:28:48] <hampsterblade> also taking note that the first letter of the string is lost i wrote
[00:28:49] <hampsterblade> elseif (strpos($ua, 'pera') == true)                     $browser = 'Opera';
[00:29:25] <azure> interesting
[00:29:47] <hampsterblade> I will soon go down in that and add versions
[00:29:48] <hampsterblade> like
[00:29:56] <hampsterblade> elseif (strpos($ua, 'pera/9.62') == true)                     $browser = 'Opera';
[00:30:19] <hampsterblade> Takes a long time to sort through browser strings
[00:30:35] <hampsterblade> Cause i have to echo $ua in every browser to see the string
[00:30:47] <hampsterblade> then find a factor that identifies it
[00:31:51] <azure> mm.
[00:32:56] <hampsterblade> why does this concept confuse me so much
[00:33:01] <hampsterblade> Its like not even php
[00:33:53] <azure> hmm...
[00:34:19] <azure> Well, for starters, please explain to me why you feel the need to have a different version of your website for every browser.
[00:34:37] <hampsterblade> Not every browser
[00:34:47] <hampsterblade> Just browsers older then IE 5.5
[00:34:52] <azure> I see.  
[00:35:01] <hampsterblade> detecting the browser helps with that
[00:35:25] <hampsterblade> also Ie 5.5 and IE 6 have to load IEPNGfix and ignore opacity filters
[00:35:48] <hampsterblade> '.toggleopacity img{           filter:progid:DXImageTransform.Microsoft.Alpha(opacity=75);           -moz-opacity: 0.75;           opacity: 0.75;      }
[00:36:12] <hampsterblade> that is compatible with IE7 firefox and opera
[00:36:16] <hampsterblade> not tested in safari yet
[00:36:24] <hampsterblade> I still have to install safari to test it
[00:36:48] <azure> yeah.
[00:37:01] <hampsterblade> you made this hard
[00:37:12] <hampsterblade> normally for something like what you said I would do something like this
[00:37:53] <azure> hm?
[00:38:30] <azure> anyway, back to the original question.
[00:38:56] <azure> The concept that you speak of would be of finding the user's browser and version?
[00:39:08] <hampsterblade> yes
[00:39:13] <hampsterblade> Thats exactly what it does
[00:39:38] <hampsterblade> Then it takes action based on that browser
[00:39:48] <azure> yeah.
[00:39:50] <hampsterblade> If their browser doesn't support png it will load gif
[00:40:07] <hampsterblade> If it doesn't support transparency it gets rid of the transparency class
[00:40:14] <azure> yeah, that is a pretty silent way of doing it.
[00:40:23] <hampsterblade> Yeah
[00:40:32] <hampsterblade> Of course it will also have something like this
[00:40:54] <azure> Do you actually use alpha-blended PNGs in the design?
[00:41:06] <hampsterblade> <?php if ($browser == 'old') echo 'Your browser is out of date!'; ?>
[00:41:10] <hampsterblade> Yes I did
[00:41:19] <hampsterblade> http://hampsterblade.ath.cx
[00:41:40] <hampsterblade> the shadow under the top right hand corner form
[00:41:41] <hampsterblade> the logo
[00:41:57] <azure> There is a much easier way to do this.
[00:41:57] <hampsterblade> and somewere else LOL
[00:42:24] <azure> unless you plan on having a nice background behind it all
[00:42:26] <hampsterblade> enlighten me
[00:43:02] <hampsterblade> also
[00:43:13] <hampsterblade> Did my script detect your browser correctly
[00:43:23] <azure> Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4
[00:43:23] <azure> firefox 3 
[00:43:25] <azure> yeah
[00:43:31] <hampsterblade> good
[00:43:34] <azure> mm
[00:43:50] <hampsterblade> elseif (strpos($ua, 'Firefox/3') == true)                     $browser = 'firefox 3';\
[00:44:12] <azure> can you link me to a gif version and a png version of the state of texas image?
[00:44:21] <hampsterblade> I don't have a gif version
[00:44:38] <hampsterblade> sry
[00:44:52] <azure> ok
[00:44:52] <azure> so
[00:44:56] <hampsterblade> also currently lacking photoshop
[00:45:33] <hampsterblade> basically the concept is to test the page in each browser
[00:45:36] <azure> Do you plan on having a pretty background that will take advantage of alpha-blending?
[00:45:39] <azure> yeah
[00:45:45] <hampsterblade> Yes
[00:45:52] <hampsterblade> I'm giving the site a metal look
[00:45:57] <azure> I see.
[00:45:58] <hampsterblade> similar to the header bar you see
[00:46:13] <hampsterblade> The code for that is really simple
[00:46:15] <azure> yeah
[00:46:28] <hampsterblade> #headerbackground {           background-image: url(../images/hdr.png);           background-repeat: repeat-x;           position: absolute;           left: 3%;           height: 30px;           top: 0;           width: 94%;           padding: 0;           border: 0px;           z-index:1;      }
[00:46:34] <hampsterblade> #header {           position: absolute;           right: 5%;           top: 2;           height: 30px;           width: 300px;           padding: 0;           border: 0px;           color: black;           z-index:2;      }
[00:47:05] <hampsterblade> some of that in there was me playing around testing thins
[00:47:10] <azure> yeah
[00:47:28] <hampsterblade> But there is the warning I told you aboout
[00:47:55] <hampsterblade> also in the next section it will have a link to IE7 and Firefox 3 opera 9.62
[00:48:06] <hampsterblade> Opera is actually pretty nice
[00:48:08] <hampsterblade> I like it
[00:48:13] <azure> mm
[00:48:24] <hampsterblade> I downloaded it for testing purposes
[00:48:28] <hampsterblade> But I may end up using it
[00:49:16] <hampsterblade> That shadow under the header is the true definition of alpha transparency though
[00:49:16] <azure> But I have a tip: if you are planning on having the state of texas picture on that blue gradient masthead and nothing else, it would be better just to have that as the background and save it as a 24-bit PNG without antialiasing.
[00:49:42] <hampsterblade> that background is a repeat x
[00:49:49] <hampsterblade> 2px wide
[00:49:52] <azure> yeah
[00:50:08] <hampsterblade> and what your saying would make the image huge
[00:50:12] <hampsterblade> and would require stretching
[00:50:20] <azure> actually, no
[00:50:31] <azure> You get to keep the background as it is
[00:50:34] <hampsterblade> oh
[00:50:41] <hampsterblade> just put the background behind texas
[00:50:47] <hampsterblade> I might think about it in a later design
[00:50:59] <hampsterblade> Thats not the final picture by the wa
[00:51:09] <azure> yeah
[00:51:09] <hampsterblade> The only thing final in this right now is the top right corner
[00:51:20] <hampsterblade> and the header bar
[00:51:27] <azure> mm
[00:51:35] <hampsterblade> I think the metal look will suit the site much better then the 1990s gradient
[00:51:43] <hampsterblade> Just hope BPA thinks the same
[00:51:48] <azure> mm
[00:52:05] <hampsterblade> You ever do any of the BPA stuff in high school?
[00:52:11] <azure> BPA?
[00:52:22] <hampsterblade> Business professionals of America
[00:52:24] <hampsterblade> I guess not
[00:52:29] <azure> I'm Canadian :p
[00:52:34] <hampsterblade> Oh LOL
[00:52:46] <hampsterblade> Basically I'm on a team with 3 other members
[00:52:57] <hampsterblade> the goal is to come up with the best website design
[00:53:16] <azure> mhmm.
[00:53:19] <hampsterblade> This kid in my class is like php is useless for you cause the school server doesn't support apache
[00:53:41] <azure> Probably IIS, right?
[00:53:43] <azure> :p
[00:53:45] <hampsterblade> And I said "I'll host it myself and give the teacher a <meta refresh=0>
[00:53:48] <hampsterblade> Yeah IIS
[00:53:55] <hampsterblade> how did you know that?
[00:54:05] <azure> Eh, most schools are like that.
[00:54:16] <hampsterblade> why does everyone love asp so much
[00:54:25] <hampsterblade> Its made by microsoft so it is de suckage
[00:54:34] <azure> It is D:
[00:54:38] <hampsterblade> its not as powerful or as compatible as php
[00:54:42] <hampsterblade> it costs more
[00:54:49] <hampsterblade> its harder on servers
[00:54:50] <azure> I don't know why either, it's just a corporation thing.
[00:54:57] <hampsterblade> There are no advantages
[00:55:04] <hampsterblade> They just say apache is opensource
[00:55:09] <hampsterblade> Therefore it sucks
[00:55:33] <hampsterblade> We should take advantage of our microsoft servers with microsoft products
[00:55:46] <hampsterblade> And fork up thousands of dollars in the process...
[00:55:50] <azure> mm...
[00:56:14] <hampsterblade> Our school payed 3,000 dollars to have our school website designed
[00:56:16] <azure> I have to learn java this semester and asp next year D:
[00:56:22] <hampsterblade> And its horible
[00:56:23] <azure> What.
[00:56:28] <azure> linkage. D:
[00:56:35] <hampsterblade> http://greeneccc.com/greeneccc/site/default.asp
[00:57:01] <hampsterblade> Absolutely no navigation scheme at all
[00:57:08] <hampsterblade> There are links all over the place
[00:58:19] <azure> ugh
[00:58:40] <hampsterblade> horible I know
[00:58:54] <azure> what... the... heck is going on with the doctype...
[00:59:06] <hampsterblade> hmm?
[00:59:18] <azure> there's like, a chunk of it missing
[00:59:18] <hampsterblade> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "  >
[00:59:21] <azure> yeah
[00:59:45] <hampsterblade> This was designed by a professional web designer
[00:59:59] <hampsterblade> The link to the standards compliance is completely missing
[01:00:00] <azure> web DESIGNER
[01:00:02] <azure> AHA
[01:00:36] <hampsterblade> I can tell half of this is copy pasted
[01:00:37] <azure> If you ask a web designer to make a website, this is the kind of silly stuff that you should expect
[01:00:45] <azure> yeah
[01:00:58] <azure> This is why I am taking both web development and design
[01:01:06] <azure> so then I can be a competent developer
[01:01:08] <azure> AND designer
[01:01:10] <azure> :D
[01:01:14] <hampsterblade> <STYLE type=text/css>
[01:01:17] <hampsterblade> WTF!
[01:01:24] <hampsterblade> style tags?!
[01:01:27] <hampsterblade> no css!
[01:01:29] <hampsterblade> DIAF!
[01:02:13] <azure> </swchannelsectionmenu>
[01:02:18] <hampsterblade> LOL
[01:02:26] <azure> THAT IS NOT EVEN VALID HTML FOR GOD'S SAKES
[01:02:54] <hampsterblade> <SWSITESHORTCUTS>
[01:03:13] <azure> http://www.schoolwires.com/5420_9255142824/site/default.asp
[01:03:20] <azure> THERE THEY ARE
[01:03:24] <azure> >:U
[01:03:38] <azure> And it looks like their own website is running their own software as well
[01:03:46] <azure> It's TERRIBLE.
[01:03:46] <hampsterblade> lol
[01:03:56] <hampsterblade> safe crappy navigation scheme too