-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Zane
-
if you only have 2 classes then something like this would work if($count % 6 == 0) $class = ($class == 'one') ? 'two': 'one'; echo "";
-
[SOLVED] To infinity: And beyond! (A question regarding loops)
Zane replied to Szandor's topic in PHP Coding Help
Something tells me you are just storing all of these "tags" in text format. Maybe such a discovery has already been exposed, nevertheless, this is not the way to go. Store dimensional data in something that can instantly be read as "dimensional"... like an array or XML.. or even (worst case scenario) a database. Looping through text that could very well be formatted text is completely redundant and a waste of time for you and your server's CPU. It's like having a database and not running searches on it. Just picking the desired rows out manually for every page. --Looking above I noticed the tags.txt file--- This is the file I'm talking about. You could easily make this a PHP file that does nothing but create an array of all of these tags. tags.php $tags = array(); $tags['nice'] = "dessert"; $tags['nice'] = "lego"; $tags['thing'] = "{ANIMAL}"; $tags['thing'] = "{PERSON}"; $tags['animal'] = "dog"; $tags['animal'] = "cat"; $tags['person'] = "wizard"; ?> Then you can just include or require this page on your engine page. require('tags.php'); echo "",print_r($tags),""; //show the tags ?> At this point (I'm too lazy to right all the code for it). You would use preg_replace_callback like you were doing to find all of the "tags".. (or elements in {BRACES}..) You can then take each match.. one by one, (using foreach) and send it through another function ... randal. where you'd use strtolower to get the text where you find the corresponding array key. .. e.g $tag[$match]. ($match might be "animal") or it may be "thing" in which case you'd have to run randal again on that particular match. -
Can somone donate me a few bucks? only need like 2-3$..
Zane replied to Gayner's topic in Miscellaneous
Why would anyone give you money? Why should anyone give you anything? This forum is meant for PHP web developing..not for little kids to bum money off of like some kind of "Starving Needs Foundation". Why don't you ask mommy and daddy for a dollar or borrow your bestest friends' parents' credit card and get what money you need. Seeing as how you don't seem to care where your money comes from.... or who. Better yet, you could start stealing change out of random people's cars. Soon enough you would have more than what you're asking for. -
When I push F12 in IE8 I get the developer tool.
-
Typically, from what I've been taught about resume writing in college, it is much better to have ONLY one page. Anything over one page is no longer a resume and is then considered a portfolio. So if you only have a 3 page "portfolio", I'd say you have a lot more work to do. If you really do have a lot of different projects, then I'd create a large portfolio to cover ALL of them. Then I'd pick the best 3 or 4 to put on your actual resume. Not exactly the "best" ones... but .. the best examples of work to show to an employer that you are qualified to do what they are hiring you for.
-
and PHP now: Posting your question in the most popular board isn't going to get your the best and mos accurate answer that you really need. No matter how long you have to wait for a reply, you're thread will be read sooner or later. Whether or not it's responded to is dependent upon your wording of the question. Even if you had posted this in PHP Coding it would have been moved here anyway.. most likely. On a side note: Hannah Montana's popular too.. you could try posting your question in her forums.
-
What do you tables look like? What columns do you have?
-
show the schema of your tables. something like this mysql> explain products; +-----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | type | int(11) | NO | | NULL | | | imgurl | varchar(70) | NO | | NULL | | | dateadded | datetime | NO | | NULL | | +-----------+-------------+------+-----+---------+----------------+ 4 rows in set (0.01 sec)
-
Being alerted for new topics in a section.
Zane replied to phpSensei's topic in PHPFreaks.com Website Feedback
I'm not 100% sure.. not even 75% that it's what it's used for. But have you tried clicking the "Notify" button at the top of the particular board? And then edit in your profile.. in the notifications area.. to email you -
I got one too. It's pretty boring until you experience your first live Wave.. then you're like. "Whoa.. " It's the same thing ICQ had. The live chat thing exept they built upon it... A LOT.
-
[SOLVED] To infinity: And beyond! (A question regarding loops)
Zane replied to Szandor's topic in PHP Coding Help
I'd set randel to be recursive if the end result was.. a bracketed one. a {THING} or {PERSON} or {BRACKETBLOCK}. function randel($anelement) { global $elements; // We need this to be global. $anelement = preg_replace("/\{|\}/","",$anelement); // We strip away the curly brackets. $anelement = implode($anelement); // It needs to be a string, not an array. $anelement2 = count($elements[$anelement], COUNT_RECURSIVE) - 1; // Since array_rand() can't be used on multi-dimensional arrays, we count the number of values in the selected sub-array, ... $anelement2 = rand(0,$anelement2); // ... randomly choose a number ... $theelement = $elements[$anelement][$anelement2]; // ... and then call the sub array. /* This is untested and completely freewritten, but you pretty much do a preg match to test for whatever format your looking for (or not looking for essentially) and set it equal to a recursive reload of the same function. if(preg_match("#\{*\}#", $theelement)) $theelement = randel($theelement); return $theelement; } -
Personally I enjoy the Snipping Tool that comes with Windows 7. The easiest screen capturer I've used. Aside from capturing images of me using the thing. I had to use print screen and mspaint for that. [attachment deleted by admin]
-
I'm using 3.5.5 just wondering, but are you minding the little arrow that appears when you drag the tab?.. [attachment deleted by admin]
-
any way to ignore a value from $result = select * from 'tableName'; ?
Zane replied to schalfin's topic in MySQL Help
SELECT * FROM table WHERE date NOT MAX(date) ORDER BY date DESC might work -
Tab The "Tabs" Tab FTW Of course a lot of that depends on how the developer set up the links too. Most sites don't have all their links set to _blank but instead are set to _self. Where I pulled these statistics? I have no clue.. [attachment deleted by admin]
-
If had to take a shot in the dark at what you were actually doing..(which is what you should have posted in the first place) I would say that you are creating a table off all the files within the current directory EXCEPT for index.php. Am I correct? If that's correct, then all you really need to do is this </pre> <table border="0" cellpadding="0"> foreach($galleryDir as $i=>$file) { if($gallerDir[$i] != "index.php") { // $dirLocation = $galleryDir[$i]; $dirName = str_replace("_"," ",$dirLocation); $newRow = (($i % 3) == 0 && $i != 0)? true : false; if($newRow) echo "\n"; echo "$dirName\n"; } } ?> </table
-
I nearly blow a load every time when it opens a new tab without hitting the scroll wheel.
-
What we're all simply trying to tell you here... in a copy and paste sort of way is: Instead of this $error = "" . $error .""; use this echo "" . $error ."";
-
I don't think you'd need a Class for each one of those but ideally.. yeah you need a class for everything The key is to find a similarity between all of them. If you can't do that then group them first. and then find similarities within those groups. Then you can make a class for each group. For instance Supervisors, Students, Instructors and Managers are all People. From that you have your first group and you can make a People Class. not necessarily called People but you get the idea. Then once you have made such a class you can create the other classes and just extend off of People class Supervisor extends People { blah blah } class Student extends People { blah blah } etc,etc
-
LMAO.. don't you just wanna smack him and say "It's not a girdle spring! It's a a floxy chute!".
-
I can think of just the few that deserve that one ... I'm sure everyone's crystal ball is working too.
-
I have that same? shirt.