2005-08-26, 08:57 AM
2005-08-26, 09:45 AM
switch($action)
{
case "news":
echo "news";
break;
case "Mozilla":
echo "firefox";
break;
default:
echo "index";
break;
}
then use a url like http://www.site.com/index.php?action=news or whatever you want.
{
case "news":
echo "news";
break;
case "Mozilla":
echo "firefox";
break;
default:
echo "index";
break;
}
then use a url like http://www.site.com/index.php?action=news or whatever you want.
2005-08-26, 10:11 AM
Thanks k776 I'll work with it now.
Edit:
What query loops through the table and display all the users?
Well I have played around with it and now have a better grasp of the switch statement.
http://harmor.zeeblo.com/mybb/page.php
Edit:
What query loops through the table and display all the users?
Well I have played around with it and now have a better grasp of the switch statement.
http://harmor.zeeblo.com/mybb/page.php
2005-08-26, 09:02 PM
well, you could use this
$query = $db->query("SELECT uid,username,email,hidemail FROM ".TABLE_PREFIX."users");
while($user = $db->fetch_array($query))
{
echo "<a href=\"member.php?action=profile&uid=".$user['uid']."\">".$user['username']."</a>";
if($user['hideemail'] != "yes")
{
echo " (<a href=\"mailto:".$user['email']."\">".$user['email']."</a>)";
}
else
{
echo "";
}
}
That will loop through all members and link to their profile and show their email if they havev't requested it to be hidden. If you want me to intergrate you switch script, feel free to post it here and I'll take a look, optimize and and re post it 2005-08-27, 08:08 AM
You need
Notice the dot after the $profile.
http://harmor.zeeblo.com/mybb/page.php?action=usernames
Notice the dot after the $profile.
$query = $db->query("SELECT uid,username,email,hideemail FROM ".TABLE_PREFIX."users");
while($user = $db->fetch_array($query))
{
$profile .= "<a href=\"member.php?action=profile&uid=".$user['uid']."\">".$user['username']."</a><br />";
/*if($user['hideemail'] != "yes")
{
$mailto = " (<a href=\"mailto:".$user['email']."\">".$user['email']."</a>)";
}
else
{
$mailto = "";
} */
}
eval("\$user_page = \"".$templates->get("user_page")."\";");
outputpage($user_page);
http://harmor.zeeblo.com/mybb/page.php?action=usernames
2005-08-27, 08:39 AM
You could use something more advanced like this
$query = $db->query("SELECT uid,username,email,hideemail,postnum FROM ".TABLE_PREFIX."users");
while($user = $db->fetch_array($query))
{
if($user['hideemail'] != "yes")
{
$mailto = " <a href=\"mailto:".$user['email']."\">".$user['email']."</a> |";
}
else
{
$mailto = "";
}
$profile .= "<a href=\"member.php?action=profile&uid=".$user['uid']."\">".$user['username']."</a>(Posts: ".$user['postnmum']." |$mailto <a href=\"private.php?action=send&uid=".$user['uid']."\">PM User</a>)<br />";
}
eval("\$user_page = \"".$templates->get("user_page")."\";");
outputpage($user_page);
2005-08-27, 08:58 AM
thanks k776.
I've been looking at this mod (i thinnk it's for links)
Well I've been trying to duplicate the code for the admin panel.
I should be done with that soon. Then my custom page mod will be released.
I hope no one beats me to it.
I've been looking at this mod (i thinnk it's for links)
Well I've been trying to duplicate the code for the admin panel.
I should be done with that soon. Then my custom page mod will be released.
I hope no one beats me to it.