- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 54 guest(s) and 1 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Working on a new block [ ]
Author
Message
msimonds
Premium
Joined: Jul 11, 2003
Posts: 240
Location: Dallas, Texas
Posted:
Wed Aug 06, 2003 10:04 am
I am working on a new block for my front page and it works fine so far. It is to go to the individual team forum pages! My question is: Is there way to call this from the database table to auto populate the teams instead of typing in each line:
Quote:
$content .= "<OPTION VALUE=\"modules.php?name=Forums&file=viewforum&f=229\">Bears";
like the following that I got out of the phpbb user menu:
Quote:
$result = sql_query("SELECT username FROM ".$prefix."_users order by user_id DESC limit 0,1", $dbi);
list($lastuser) = sql_fetch_row($result, $dbi);
maybe like this:
Quote:
$result = sql_query("SELECT forum_id FROM ".$prefix."_bbforums order by forum_id DESC limit 0,1", $dbi);
list($forum_id) = sql_fetch_row($result, $dbi);
Quote:
<?php
if (eregi("block-test.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content .= "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n";
$content .= "<TR><FORM METHOD=GET ACTION=\"modules.php\">\n";
$content .= "<TD> <SELECT NAME=\"name\" CLASS=\"boxcontent\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">\n";
$content .= "<OPTION VALUE=\"\">Team Forums";
$content .= "<OPTION VALUE=\"modules.php?name=Forums&file=viewforum&f=229\">Bears";
$content .= "<OPTION VALUE=\"modules.php?name=Forums&file=viewforum&f=230\">Lions";
$content .= "<OPTION VALUE=\"modules.php?name=Forums&file=viewforum&f=231\">Packers";
$content .= "<OPTION VALUE=\"modules.php?name=Forums&file=viewforum&f=232\">Vikings";
$content .= "<OPTION VALUE=\"modules.php?name=Forums&file=viewforum&f=242\">49ers";
$content .= "</SELECT></TD></TR></FORM></TABLE>";
$content .= "</option>";
$content .= "</select><noscript><input type=\"Submit\" value=\"GO\" onsubmit=\"gotosite(document.forms[0].url.options[document.forms[0].url.selectedIndex].value);return false\"></noscript>
";
$content .= "</p>";
?>
Can anyone help me!!
Thanks
Mike
msimonds
Premium
Joined: Jul 11, 2003
Posts: 240
Location: Dallas, Texas
Posted:
Wed Aug 06, 2003 11:41 am
this is what i have so far and I knew that I would get errors:
<?php
if (eregi("block-test1.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
$result = sql_query("SELECT forum_id FROM ".$prefix."_bbforums order by forum_id DESC");
Quote:
$content .= "<table border=0 cellpadding=0 cellspacing=0>\n";
$content .= "<tr><form method=\"get\" action=\"modules.php\">";
$content .= "<td> <select name=\"name\" CLASS=\"boxcontent\" onChange=\"top.location.href=this.options[this.selectedIndex].value\">\n";
$content .= "<option value=\"\">Team Forums";
while($row = mysql_fetch_array($result)){
$content .= "<option value=\"modules.php?name=Forums&file=viewforum&f={$row['forum_id']}\">{$row['name']}</option>";
}
$content .= "</select></td></tr></form></table>";
$content .= "</select><noscript><input type=\"Submit\" value=\"GO\" onsubmit=\"gotosite(document.forms[0].url.options[document.forms[0].url.selectedIndex].value);return false\"></noscript>
";
$content .= "</p>";
?>
here is the error and I know that I am missing some type of $result2 (example) to include the fourm_name from the nuke_bbforums table. Can anyone help me out
Mike
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum