Topic: $pun_url and pun_link()
How do I use them? I making a mod wich affect the user profile and I see link like: pun_link($pun_url['profile_about'], $id) and I don't really understand it. How do I make my mod working with the url rewrite system?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.3 troubleshooting → $pun_url and pun_link()
How do I use them? I making a mod wich affect the user profile and I see link like: pun_link($pun_url['profile_about'], $id) and I don't really understand it. How do I make my mod working with the url rewrite system?
Use pun_link just like you're shown
pun_link is a function that returns a link. It takes two parameters (although only the first is required). The first is the URL, should should be gotten from $pun_url. The second is the arguments. That can either not be passed (no arguments), be passed something that isn't an array (one argument) or be passed an array (multiple arguments). In this example, you only need one: the user's ID. So, you simply pass the user's ID to the function. If this was a link to a forum or a topic, you would need to pass an array with two elements, the first being the ID and the second being the name (because of SEF friendly URLs).
So if I want to make a new section in the user profile it should look like this?:
$pun_url['profile_gallery'] = 'profile.php?section=gallery&'.$id;
pun_link($pun_url['profile_gallery'], $id);
Btw, where is $pun_url created?
No. Take a look at $pun_url in include/common.php and in the include/url/* files.
PunBB Forums → PunBB 1.3 troubleshooting → $pun_url and pun_link()
Powered by PunBB, supported by Informer Technologies, Inc.