2014-06-08, 07:58 PM
How can I fetch and then separate forum names from category names.
Here is my pretty basic code:
Why some results don't have correct URL to the forum?
Here is my pretty basic code:
<?php
define("IN_MYBB",1);
include("global.php");
$query = $db->simple_select("forums", "*");
while($posts = $db->fetch_array($query))
{
//echo $posts['name']."<br />";
//echo $posts['fid']."<br />";
$postforumlink = "<a href=\"{$mybb->settings['bburl']}/".get_forum_link($posts['fid'])."\">".$posts['name']."</a>";
if($posts['type'] == 'c')
{
$category .= "<div>{$postforumlink}</div>";
}
if($posts['type'] !== 'c')
{
$forum .= "<div>{$postforumlink}</div>";
}
}
?>
<html>
<head>
</head>
<body>
<?php
echo $category;
?>
<br/>
<br/>
<br/>
<br/>
<?php
echo $forum;
?>
</body>
</html>
Why some results don't have correct URL to the forum?