Jump to content

hcdarkmage

Members
  • Posts

    326
  • Joined

  • Last visited

Everything posted by hcdarkmage

  1. No, I do not want those values to be random. Those are the Dealer ID numbers that are assigned through the database. Those are permanent. $Top[] = BuyNow(85, 'dealersite.com'); $Top[] = BuyNow(841, 'dealersite.com'); $Top[] = BuyNow(877, 'dealersite.com'); $Top[] = BuyNow(778, 'dealersite.com'); $Top[] = BuyNow(1505, 'dealersite.com'); $Top[] = BuyNow(57, 'dealersite.com'); $Top[] = BuyNow(209, 'dealersite.com'); $Top[] = BuyNow(1260, 'dealersite.com'); $Top[] = BuyNow(1532, 'dealersite.com'); $Bottom[] = BuyNow(189, 'dealersite.com'); $Bottom[] = BuyNow(690, 'dealersite.com'); $Bottom[] = BuyNow(467, 'dealersite.com'); $Bottom[] = BuyNow(1388, 'dealersite.com'); $Bottom[] = BuyNow(1161, 'dealersite.com'); These numbers are referenced here: function BuyNow($id, $site){ global $db; if(($Info = $db->get_row('SELECT * FROM dealers WHERE DealerID = '.$id.'')) != '' ){ $dealer = $Info->DealerName; $web = $Info->Website; } It tells the file to go into the database, take the dealer ID # and the associated properties that I request from it, add the landing page that I want to go to when clicked and assign those to $Top and $Bottom. As you can see $Top and $Bottom are not given an array value (hence the []), but when the code is activated, they are assigned a value (0 - 9 for $Top and 0 - 5 for $Bottom) automatically and called into the corresponding slot that is elected on the form page ([var.$Top.1.dealer] etc.). Given that as it is, I would like to randomly pick from $Top and $Bottom a different dealer to fit into those corresponding slots in the form (the values $Top[0], $Top[1] etc, be random). Clear as mud? The associative arrays that I am pulling need to be assigned a random number for insertion into the form page. At least to the best of my knowledge, that is how this is supposed to work. Given that I am not entirely sure how to make the request clearer, any questions can be posted here.
  2. I think I may have complicated the problem more than needed and retract the statement about changing at certain times. I am trying to figure out how to randomize the $Top and $Bottom data, so that I get a different 1, 2, 3 etc. <?php function BuyNow($id, $site){ global $db; if(($Info = $db->get_row('SELECT * FROM dealers WHERE DealerID = '.$id.'')) != '' ){ $dealer = $Info->DealerName; $web = $Info->Website; } $bnDealer['dealer'] = $dealer; $bnDealer['web'] = $web; $bnDealer['site'] = $site; return $bnDealer; } function ObjToArr($Object){ foreach($Object as $Key => $Value) $Array[$Key] = $Value; return $Array; } $Tpl = new clsTinyButStrong ; $Top[] = BuyNow(85, 'dealersite.com'); $Top[] = BuyNow(841, 'dealersite.com'); $Top[] = BuyNow(877, 'dealersite.com'); $Top[] = BuyNow(778, 'dealersite.com'); $Top[] = BuyNow(1505, 'dealersite.com'); $Top[] = BuyNow(57, 'dealersite.com'); $Top[] = BuyNow(209, 'dealersite.com'); $Top[] = BuyNow(1260, 'dealersite.com'); $Top[] = BuyNow(1532, 'dealersite.com'); $Bottom[] = BuyNow(189, 'dealersite.com'); $Bottom[] = BuyNow(690, 'dealersite.com'); $Bottom[] = BuyNow(467, 'dealersite.com'); $Bottom[] = BuyNow(1388, 'dealersite.com'); $Bottom[] = BuyNow(1161, 'dealersite.com'); ?> As you can see in the code the first $Top argument is automatically assigned the value 0 and same goes for the first $Bottom variable. Being as they are separate variables ($Top and $Bottom), my question was how could I put in the shuffle command and get random dealers plugged into the other page? Any ideas? Or would a random command make it easier?
  3. It is funny that this kind of topic can be raised. I am a graphic designer (by title) and a web programmer (in training). I was thrown into the job because I take direction well and know something about computers. I learn fast with books and find it silly that my company is too damn cheap to hire professionals. The people that run the company I work for are old fashioned and do not know what they are talking about when it comes to design and functionality. EVERYTHING is done by committee. The designers have no freedom with their projects and are forced to make changes that don't seem logical. Yes I like web designing, as long as it doesn't involve a bunch of incompetent people telling you that you don't know what your doing and their design is two stick people holding a stick drawing of the product. Reminds me of that Simpsons episode where Principle Skinner gets mad at the artist over the murial for the school . . . it's kinda like that here.
  4. Thanks roopurt. I am a little familiar with the shuffle command (I have used it once or twice). I am just curious about if you could put a timer on it so that it shuffles the array(s) every . . . say . . . 2 hours? Will the output be the same if I put the time limit on it for multiple pages, or will it shuffle it every time I return to the page? Also, would I put the shuffle command after the $Top variable array and after the $Bottom variable array, or do I mix the two together in one big argument. I've used shuffle on a single array, not two together. Any comment and help are appreciated.
  5. Fixed my little problem: <?php function BuyNow($id, $site){ global $db; if(($Info = $db->get_row('SELECT * FROM dealers WHERE DealerID = '.$id.'')) != '' ){ $dealer = $Info->DealerName; $web = $Info->Website; } $bnDealer['dealer'] = $dealer; $bnDealer['web'] = $web; $bnDealer['site'] = $site; return $bnDealer; } function ObjToArr($Object){ foreach($Object as $Key => $Value) $Array[$Key] = $Value; return $Array; } $Tpl = new clsTinyButStrong ; $Top[] = BuyNow(85, 'dealersite.com'); $Top[] = BuyNow(841, 'dealersite.com'); $Top[] = BuyNow(877, 'dealersite.com'); $Top[] = BuyNow(778, 'dealersite.com'); $Top[] = BuyNow(1505, 'dealersite.com'); $Top[] = BuyNow(57, 'dealersite.com'); $Top[] = BuyNow(209, 'dealersite.com'); $Top[] = BuyNow(1260, 'dealersite.com'); $Top[] = BuyNow(1532, 'dealersite.com'); $Bottom[] = BuyNow(189, 'dealersite.com'); $Bottom[] = BuyNow(690, 'dealersite.com'); $Bottom[] = BuyNow(467, 'dealersite.com'); $Bottom[] = BuyNow(1388, 'dealersite.com'); $Bottom[] = BuyNow(1161, 'dealersite.com'); //echo "<pre>" . print_r(get_defined_vars(), true) . "</pre>"; ?> I basically got rid of the $rank variable, so I don't have to bother with the if...else statement. Thank you all for helping, though I am sure this is not the end for this code. I have a new problem. Now I have to randomize the output of $Top and $Bottom. Any suggestions? ???
  6. Well this problem has been solved (sort of). Just need to show the code: <?php function BuyNow($id, $site, $rank){ global $db; if(($Info = $db->get_row('SELECT * FROM dealers WHERE DealerID = '.$id.'')) != '' ){ $dealer = $Info->DealerName; $web = $Info->Website; } $bnDealer['dealer'] = $dealer; $bnDealer['web'] = $web; $bnDealer['site'] = $site; $bnDealer['rank'] = $rank; return $bnDealer; } function ObjToArr($Object){ foreach($Object as $Key => $Value) $Array[$Key] = $Value; return $Array; } $Tpl = new clsTinyButStrong ; $New[] = BuyNow(85, 'dealerweb.com', 1); $New[] = BuyNow(841, 'dealerweb.com', 1); $New[] = BuyNow(877, 'dealerweb.com', 1); $New[] = BuyNow(778, 'dealerweb.com', 1); $New[] = BuyNow(1505, 'dealerweb.com', 1); $New[] = BuyNow(57, 'dealerweb.com', 1); $New[] = BuyNow(209, 'dealerweb.com', 1); $New[] = BuyNow(1260, 'dealerweb.com', 1); $New[] = BuyNow(1532, 'dealerweb.com', 1); $New[] = BuyNow(189, 'dealerweb.com', 0); $New[] = BuyNow(690, 'dealerweb.com', 0); $New[] = BuyNow(467, 'dealerweb.com', 0); $New[] = BuyNow(1388, 'dealerweb.com', 0); $New[] = BuyNow(1161, 'dealerweb.com', 0); if($rank = 1){ $Top = $New; $Bottom = $New; }elseif($rank = 0){ $Bottom = $New; } //echo "<pre>" . print_r(get_defined_vars(), true) . "</pre>"; ?> And state that this works, only to a point. For some reason my if . . . else statement is not performing the way it should. Then again, I am not the one that "Fixed" this code. I was playing around with different ways to get my variables to work. Our company "Guru" took the code I had and worked it into what you see. As for plugging it in: <td width="206" align="center" bgcolor="#1F70B9" class="title2"><b>BUY NOW!</b></td> <td width="3" class="title"></td> <td width="11"><img border="0" src="img/boxtitleright.jpg" width="4" height="25" /></td> <td rowspan="3" background="img/boxpieceright.jpg" width="10"></td> </tr> <tr> <td rowspan="2" colspan="2"><img border="0" src="img/dot.gif" width="14" height="5" /></td> <td class="contentname" align="center"><table width="100%" border="0" cellspacing="5" cellpadding="15"> <tr> <td width="90%"><table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr> <td><span class="style13">[var.Top.0.dealer]</span></a></td> </tr> <tr> <td><a href="http://www.[var.Top.0.site]" onclick="window.location = '[var.Top.0.site]';" style="display: block; cursor: pointer; text-decoration: none;">[var.Top.0.web]</a></td> </tr> </table> <hr /> <table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr> <td><span class="style13">[var.Top.1.dealer]</span></a></td> </tr> <tr> <td><a href="http://www.[var.Top.1.site]" onclick="window.location = '[var.Top.1.site]';" style="display: block; cursor: pointer; text-decoration: none;">[var.Top.1.web]</a></td> </tr> </table> <hr /> <table width="100%" border="0" cellpadding="2" cellspacing="2"> <tr> <td><span class="style13">[var.Top.2.dealer]</span></a></td> </tr> <tr> <td><a href="http://www.[var.Top.2.site]" onclick="window.location = '[var.Top.2.site]';" style="display: block; cursor: pointer; text-decoration: none;">[var.Top.2.web]</a></td> </tr> </table> <hr /> He changed the [Top_1.dealer] tags to say [var.Top.1.dealer] and so on through out the code. The only problem is that I cannot get the PHP file to separate the $Top and $Bottom variables. At least it plugs in properly! Any suggestions on how to proceed from here? ??? ???
  7. I find that game fairly nice, once you get the hang of what you are supposed to do. Very well structured.
  8. Here we go. I started to restructure the code so that I may define the variables inside the PHP file in itself. Then I ran into some problems. Using the echo statement mentioned earlier, I was able to change the code accordingly, break into the database and use it to my advantage. Unfortunately, I got lost somewhere. The variables are now being defined, but I can't split the ranks so that they fill two different variables, $Top and $Bottom. <?php function BuyNow($id, $site, $rank){ global $db; if(($Info = $db->get_row('SELECT * FROM dealers WHERE DealerID = '.$id.'')) != '' ){ $dealer = $Info->DealerName; $web = $Info->Website; } $bnDealer['dealer'] = $dealer; $bnDealer['web'] = $web; $bnDealer['site'] = $site; $bnDealer['rank'] = $rank; return $bnDealer; } function ObjToArr($Object){ foreach($Object as $Key => $Value) $Array[$Key] = $Value; return $Array; } $Tpl = new clsTinyButStrong ; $New[] = BuyNow(85, ''.$web.'/osc/', 1); $New[] = BuyNow(841, ''.$web.'', 1); $New[] = BuyNow(877, ''.$web.'/wilson.asp', 1); $New[] = BuyNow(778, ''.$web.'', 1); $New[] = BuyNow(1505, ''.$web.'', 1); $New[] = BuyNow(57, ''.$web.'/cellular-antennas/wilson-antennas', 1); $New[] = BuyNow(209, ''.$web.'/wilson_amplifier.html', 1); $New[] = BuyNow(1260, ''.$web.'', 1); $New[] = BuyNow(1532, ''.$web.'', 1); $New[] = BuyNow(189, ''.$web.'/wilcelananad.html', 0); $New[] = BuyNow(690, ''.$web.'', 0); $New[] = BuyNow(467, ''.$web.'', 0); $New[] = BuyNow(1388, ''.$web.'', 0); $New[] = BuyNow(1161, ''.$web.'', 0); if($rank = 1){ $Top = $New; $Tpl->MergeBlock('Top', $Top) ; }elseif($rank = 0){ $Bottom = $New; $Tpl->MergeBlock('Bottom', $Bottom) ; } ?> I am also trying to place the variable $web into the $site variable so I may add extensions (for landing pages). Can anyone help me figure out where I went wrong in this code? The interface into the template doesn't work yet, but I am still working on that problem. Baby steps, if you will, baby steps.
  9. Well . . . the blue is a little bright. You should keep your text headers all the same color. You should use the same hue of blue that you used on the home page ('Welcome Knights' text) whenever you want to use the blue text. I like the Icon at the end of the article. You could probably do without the 'Inspiration' section. The reason I say this is because I have never seen a site that states what caused the story to be published. They may put a blurb in the first couple of lines at the beginning, but never devote a section to it. If anything, state your sources (newspaper articles, quotes, etc.) in that area. Hope these tips help! Also, do you have a wider picture of the school? The one on the home page is giving me a headache. I can't tell if that is supposed to be the front or what. take a look at the second-to-last page here: http://wilsonelectronics.com/Files/InstallInstructions/811210.swf. The picture of the building is in such a way that you could recognize the building if you happened to pass it. A wider picture will also help with the white space.
  10. Ya know . . . it's very funny. I work in a place that build cell phone accessories and I couldn't get a single person to tell me if there is an internal function to do that. Talk about ironic!
  11. Try going to http://treo.com. They may have the answer there.
  12. Nothing now. when I checked earlier on the 'Team' page, the text was running into the picture. You have a mighty fine site there. Hopefully they get you that new header. PS Could you post the link on the next post so that people won't have to go to the first post to click it. It is hard to reply when you have to chase down the link. Doing Good!
  13. That seems to work fairly well. It seems that the background in the information portion of you site is a little darker. Did you change it? It makes the links inside the paragraphs hard to read. The next step will be the header and then applying what you have learned to the rest of the pages!
  14. The buttons look a lot better. One thing, do you know how to make them glow instead of grow? When you move over them, they grow and it distorts the buttons. I think a little mouse over glow would look a little better for the site. That's just my opinion, though.
  15. I went boat fishing in Missouri when I was about 13. It was fun being on the lake, using minnows as bait. that is the first time I ever used one fish to catch another. Where I'm from, we can only use worms or 'Power Bait'. One of these days, I'm gonna have to teach my two sons how to fish. My oldest likes the idea, but isn't old enough to listen to his father!
  16. Have you looked through the users manual? If its anything like the Treo 650, you go to the programs, select 'Card Info' and in the drop-down menu is 'Format Card'. Hope that helps.
  17. Do you have a bigger (wider) picture of the school? Is this the front, or a courtyard? You may want to see about getting a picture that shows the whole outside of the school. Sure the students know what it looks like, but outsiders don't. You are probably using a photo given to you from the school, but if you can change it, you should. It should even out on the ends (too much white space on the sides). Try to get a picture that evens out with your paragraphs. Is the main page link supposed to be specific to the student body? To me it seems to state "Home", even though I am already on the home page. And your class years are still funky.
  18. That is looking a lot better. One last thing on the main page though, The text is now crowding the left border. You may want to have the same spacing on the left as you do on the right (the spacing between the text and the picture). That will make it Excellent!
  19. Hey hey! It's starting to look better. Keep working on it.
  20. Let me show you what I am talking about. The attached Pictures have red marks on them marked 1 and 2. 1 - This is the header I was speaking about. As you can see, it isn't exactly on your site. 2 - This text should be centered with the picture. It would give it a better flow. Try it and see. [attachment deleted by admin]
  21. Yours has a better flow to it. One thing though is on the old site it says welcome and tells a little soething about who you are looking at in the picture. A little loudly, though. you may want to implement something of the like, but not so big. Your paragraph text could be centered more with the picture. The run over (their run under) makes it seem a little tacky. Yes . . . use the head lines from the old site (a little smaller, of course) and keep your paragraph text centered with the picture. It will look better IMHO. Try it and see. If it doesn't, I am sure someone will correct me.
  22. Thank you for pointing out what is going on in my code. I will go through the manual you suggested (I'm sure I have it here somewhere), again, and see if I can get things cleared up. I will post here if there are more problem that arise and will post the working code for those that may need something similar in the future.
  23. One word: Decent! I give it 3 1/2 stars (out of 5). I would give it more, but the text in the nav bar (especially the Race Reports & News) seems to crowd the buttons. My suggestion (though probably not needed) is to name it Reports & News, since it is mainly a race oriented site, is it not?
  24. Oooh ooh . . . I have seen this before. It is in the echo $name . " peter"; that he is trying to give the $name variable a value. I saw this in one of the tutorials, but I can't quite remember which one.
  25. Thanks. With that help, I found out that the problem is with my class. Apparently I am not defining the variables correctly. In this code: <?php // Create a class class BuyNow{ var $dealer; var $web; var $site; var $rank; } // Create the Function function BuyNow($dealer, $web, $site, $rank){ // Define the variables $dealer, $web, $site and $rank $New[] = BuyNow('dealer1', 'web1', 'http://www.site1.com', '1'); $New[] = BuyNow('dealer2', 'web2', 'http://www.site2.com', '1'); $New[] = BuyNow('dealer3', 'web3', 'http://www.site3.com', '1'); $New[] = BuyNow('dealer4', 'web4', 'http://www.site4.com', '1'); $New[] = BuyNow('dealer5', 'web5', 'http://www.site5.com', '1'); $New[] = BuyNow('dealer6', 'web6', 'http://www.site6.com', '1'); $New[] = BuyNow('dealer7', 'web7', 'http://www.site7.com', '1'); $New[] = BuyNow('dealer8', 'web8', 'http://www.site8.com', '1'); $New[] = BuyNow('dealer9', 'web9', 'http://www.site9.com', '1'); $New[] = BuyNow('dealer10', 'web10', 'http://www.site10.com', '0'); $New[] = BuyNow('dealer11', 'web11', 'http://www.site11.com', '0'); $New[] = BuyNow('dealer12', 'web12', 'http://www.site12.com', '0'); $New[] = BuyNow('dealer13', 'web13', 'http://www.site13.com', '0'); $New[] = BuyNow('dealer14', 'web14', 'http://www.site14.com', '0'); } // Separation of dealers if($rank = 1){ $Top[] = $New; }else{ $Bottom[] = $New; } // Define Plug in Variables $Top['dealer'] = $dealer; $Top['web'] = $web; $Top['site'] = $site; return $Top; $Bottom['dealer'] = $dealer; $Bottom['web'] = $web; $Bottom['site'] = $site; return $Bottom; $Tpl = new clsTinyButStrong ; // Make Blocks 'Top' and 'Bottom' $Tpl->MergeBlock('Top', $Top); $Tpl->MergeBlock('Bottom', $Bottom); $Tpl->Show(); ?> is my problem. This is what I need to focus on. Apparently the other files are working okay. Any suggestions on what looks wrong? I can implement the plug-ins later.
×
×
  • 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.