Jump to content
MakeWebGames

DAngelo

Members
  • Posts

    11
  • Joined

  • Last visited

DAngelo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I agree there is probably a much better way to do it but seeing as I am new to php and that works. I used it. However, I am open to suggestions if more experience coders like yourself would give me some insight as to how it could be better done instead of just saying redo it.
  2. I got it working. Thanks!
  3. any ideas as to what the problem is? I know there has to be a more experienced coder out there than me lol
  4. I am working on a rodeo mod. For some reason this is not working right. I can not see the problem. 1 of two things is happening. Either it is not passing the id to function join or function join is not working properly. Db's are not getting updated. I have tried a couple different ways as you will see the commented code. Any help would be greatly appreciated!   <?php require "globals.php"; /* switch($_REQUEST['action']) { case 'join': join(); break; default: rodeo_index(); break; } function rodeo_index() {*/ global $ir, $db, $userid; if($ir['jail']>0 || $ir['hospital']>0) { die("<center>You can not move around right now.</center>"); } if(!$_GET['join']) { print "<center>Welcome to the Rodeo. There are a few different events that you can join. You can only join one event per week! The events will run at 8pm game time every Saturday night. The events will pay out tour points for 1, 2, 3 places each week for each event. At the end of the month there will be a championship event where the top 3 tour point holders will compete for the Championship and a substantial prize. </center><br><br>"; print "<center>Would you like to join an event?</center> <center><table BORDER=2 CELLPADDING=2 CELLSPACING=2> <tr><td> <a href='rodeo.php?action=join&id=1'>Join Saddle Bronc Event.</a> </td> <td> <a href='rodeo.php?action=join&id=2'>Join Bare Back Event</a> </td></tr> <tr><td> <a href='rodeo.php?action=join&id=3'>Join Steer Wrestling Event</a> </td> <td> <a href='rodeo.php?action=join&id=4'>Join Bull Riding Event</a> </td> </tr> </table></center>"; //show joined users /*$view=$db->query("SELECT username FROM saddle_bronc"); $view1=$db->query("SELECT username FROM bare_back"); $view2=$db->query("SELECT username FROM steer_wrestling"); $view3=$db->query("SELECT username FROM bull_riding"); print "<center><h3>Registered Contestants</h3></center><br><br>"; print "<center><table width =75%><tr><td><b>Saddle Bronc</b></td><td><b>Bare Back</b></td><td><b>Steer Wrestling</b></td><td><b>Bull Riding</b></td></tr>"; while ($display = $db->fetch_row($view)) { print "<tr><td>".$display['username']."</td>"; while($display1 = $db->fetch_row($view1)) { print "<td>".$display1['username']."</td>"; while($display2 = $db->fetch_row($view2)) { print "<td>".$display2['username']."</td>"; while($display3 = $db->fetch_row($view3)) { print "<td>".$display3['username']."</td></tr></table></center>"; } } } } }*/ } //update DB's after join if(!function_exists('join')) { function join() { global $ir, $db, $userid; $id=abs((int) $_GET['id']); If ($ir['rodeo'] > 0) { Die ("You have already entered an event this week!"); } else { Switch($id) { case '1' : $db->query("INSERT INTO saddle_bronc VALUES ('', $userid, ".$ir['username'].", 0)"); $db->query("UPDATE users SET rodeo = 1 WHERE userid = $userid"); Break; case '2' : $db->query("INSERT INTO bare_back VALUES ('', $userid, ".$ir['username'].", 0)"); $db->query("UPDATE users SET rodeo = 1 WHERE userid = $userid"); break; case '3' : $db->query("INSERT INTO steer_wrestling VALUES ('', $userid, ".$ir['username'].", 0)"); $db->query("UPDATE users SET rodeo = 1 WHERE userid = $userid"); break; case '4' : $db->query("INSERT INTO bull_riding VALUES ('', $userid, ".$ir['username'].", 0)"); $db->query("UPDATE users SET rodeo = 1 WHERE userid = $userid"); break; } } } } $h->endpage(); exit; ?>
  5. Could I get the sale details please
  6. Thank to everyone for the help! I did use that and it worked fine.
  7. Yes each page is different with the exception of a few standard things that needs to be on each page. It allows me to control the rewards for users based on level and location as well as provide unique features in each city. At least that is my goal! lol
  8. This is kinda what I was thinking but this just gives a different explore page for each city instead of changing the link. Although this may be useful for adding mods to specific cities and not all of them.   switch ({$ir['location']}): case '51': "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='exploreCHI.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; break; case '52': "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='exploreDAL.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; break; case '53': "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='exploreBOS.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; break; case '54': "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='exploreDET.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; break; case '55': "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='exploreMIA.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; break; case '56': "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='exploreLA.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; break; case '57': "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='exploreLV.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; break; default: "<tr> <td colspan='10' style='background:url(images/side_28.png) no-repeat;' width='204' height='30'><table border='0' cellpadding='0' cellspacing='0'><tr><td width='45px'> </td><td><a href='explore.php'>$area->areaname</a></td></tr></table></td> <td><img src='images/spacer.gif' width='1' height='30' border='0' alt='' /></td> </tr>"; endswitch;
  9. Its only concerns the one user clicking the link. I am setting up a mod that users have to complete certain tasks in order to unlock the next city. So when they click the link it needs to display the tasks for the city they are in. I suppose it would be easier to just put all the tasks on one page and call it but then the page would be cluttered and confusing for the user.
  10. They need to view a specific page when clicking on the link based on their location. Say they are in NY and they click the link they need to view a page for NY but if they are in Chicago they need to view a page for Chicago. There will be 7 different pages total.   Edit. I tried using a switch but cant seem to get it to work since the link in question is inside a table on the explore page.
  11. I have a link that is in a table. I would like to change the destination of that link based on the users location. Is this possible? And could you give a brief example of how it could be done? Thanks!
×
×
  • Create New...