Jump to content
MakeWebGames

Need Help


DAngelo

Recommended Posts

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.

Edited by DAngelo
Link to comment
Share on other sites

are you calling for a users location in an QUERY look at how viewuser uses the attack link to grab info then do the same for example their whereabouts but i cant see this happening as both people would need to be in the same place example both in NY and both in i donn for arguments sake Winter Ruins location....

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Basic example:

 

if ($city == 1)
{
    $link = "<a href='example.php?action=dosomething'>[Link Name Here]</a>";
}

if ($city == 2)
{
    $link = "<a href='example.php?action=dosomethingelse'>[Other Link Name Here]</a>";
}

 

etc., etc.

Again, very basic example, but something like that should do the trick. Then just echo/print $link inside your table.

Link to comment
Share on other sites

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;

Edited by DAngelo
Link to comment
Share on other sites

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

Link to comment
Share on other sites

If your just changing a few of the items I would go with what seker stated, but if your changing a lot of stuff go with what silverstar showed and create a a switch. Going based of what you showed sekers idea is better so you can do something like

if ($ir['location'] == 1) {
$link="<a href='exploreMIA.php'>Explore</a>";
}else if {
Blah blah keep on keepin on with this format

Then just print $link or whatever you wish to call it where you wish to place it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...