Jump to content


php navigation redirect (forum emulation)


  • Please log in to reply
5 replies to this topic

#1 _*♣Mike♣_*

_*♣Mike♣_*
  • Guests

Posted 02 September 2007 - 05:07 PM

Ok I am using phpbb. Now the navigation system looks like this:

./viewtopic.php?f=6&p=14


Now for example, IPB uses this format,

index.php?showtopic=36954


If I were to switch forum softwares, how would I create redirects for different topics?

Here is what I mean.

I want

./viewtopic.php?f=6&p=14 to link to google.com
and
./viewtopic.php?f=7&p=15 to link to yahoo.com

I realize I would need to create a file called viewtopic.php. Could someone refer me to the coding I need for it though?

Thank you


#2 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 02 September 2007 - 11:48 PM

I have absolutely no idea what you're aiming at in reference to the forum software, but for redirects, you would simply need to use the header() function.

#3 _*♣Mike♣_*

_*♣Mike♣_*
  • Guests

Posted 03 September 2007 - 12:50 AM

ok how do I make a php navigation.

Like I create a file called viewtopic.php ok. And I program it to have redirects.

viewtopic.php?act=1
viewtopic.php?act=2
viewtopic.php?act=3

1 links to google
2 links to yahoo
3.links to msn


do you get what im saying? the only thing im requesting more in depth is to follow the phpbb structure.

#4 Balor

Balor

    PHP Nerd

  • Members
  • Pip
  • 63 posts
  • Gender:Male
  • Location:Germany->Frankfurt
  • Interests:My beautyful girl, my son and webcoding. I'm also very interested in art but I'm not really good at art... it's sad but true ^^

Posted 03 September 2007 - 01:37 AM

you mean how to read out act=1 etc? it's totally simple... most common thing^^

// Check if act is set in the url query
if(isset($_GET['act'])) {
 // do something like this for example
 switch($_GET['act']) {
 case "1": $link='http://www.google.com'; break;
 case "2": $link='http://www.yahoo.com'; break;
 case "3": $link='http://www.msn.com'; break;
 default: $link='http://www.google.com'; break;
}
} else {
 // do something if there is no act
}

Add this before header... then in header just use meta direct using the $link variable... that's it.

#5 _*♣Mike♣_*

_*♣Mike♣_*
  • Guests

Posted 03 September 2007 - 01:55 AM

thanks for that Balor, I know I've seen it everywhere but how would I use it to redirect phpbb topicssee here is an example topic
http://neogt.com/forum/viewtopic.php?f=5&t=6
how can I make it so that links to google.com for exampleso basically instead of act=1 I want viewtopic.php?f=5&t6

#6 Balor

Balor

    PHP Nerd

  • Members
  • Pip
  • 63 posts
  • Gender:Male
  • Location:Germany->Frankfurt
  • Interests:My beautyful girl, my son and webcoding. I'm also very interested in art but I'm not really good at art... it's sad but true ^^

Posted 03 September 2007 - 02:04 AM

thanks for that Balor, I know I've seen it everywhere but how would I use it to redirect phpbb topicssee here is an example topic

http://neogt.com/forum/viewtopic.php?f=5&t=6
how can I make it so that links to google.com for exampleso basically instead of act=1 I want viewtopic.php?f=5&t6


Same thing just use $_GET['t'] or $_GET['f'] (whatever refers to your link) instead of $_GET['act'].




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users