Hi.
I have no idea how to program vBulletin at the moment but am willing to learn.
I created the script below to run on our old phpBB board, but now want to get it to run on vBulletin so that it looks at the 'user title' and then arranges them into the order required but have no idea where to start. Thought it would be a case of just changing where the SQL is pointing, but I'm guessing not.
Can anyone give me some pointers, suggest anything, tell me where to go (politely)?
PHP Code:
<title>Hyperborea Chain of Command</title>
<p align="center" style="position: relative !important">
<a href="http://www.hborea.us/pn2/portal.php">
<img src="http://www.hborea.us/pn2/images/title.gif"></a><br>
<a href="http://www.hborea.us/pn2/portal.php">Go back to Portal</a></p>
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './'; //Change this to point to your phpBB directory
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
echo "<table border='1' width='100%' id='table1'>";
echo " <tr>";
echo " <td align='center'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' color='#00547f' size='2'>";
echo " <b>Position</b></font></td>";
echo " <td align='center' colspan='7'><b>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' color='#00547f' size='2'>";
echo " Rank</font></b></td>";
echo " </tr>";
echo " <tr>";
echo " <td align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'><b>";
echo " Overseer</b> </font></td>";
echo " <td align='center' valign='top' colspan='7'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>General<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/general.gif' width='129' height='61' title='The General is the Overseer of the clan.
His objectives are to keep everything running and to detain the overall clan morale at its best.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '1'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo "</td>";
echo " </tr>";
echo " <tr>";
echo " <td align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'><b>";
echo " Scribe</b></font></td>";
echo " <td align='center' valign='top'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Senior Scribe<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/sscribe.gif' width='129' height='61' title='Senior Scribe is the administrator of
all the clan pages and documents. His objective is to make sure the web-pages and servers are secured and functioning properly.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '3'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " <td align='center' valign='top' colspan='3'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Scribe<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/scribe.gif' width='129' height='61' title='The Scribe of the clan does all the repairs
in any case their is a problem. He also adds new features and pages if approved by the Overseer and Senior Scribe.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '2'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " <td align='center' colspan='3' valign='top'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Junior Scribe<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/jscribe.gif' width='129' height='61' title='The job of the Junior Scribe is to help
and learn everything his fellow Scribe does.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '4'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo "</td>";
echo " </tr>";
echo " <tr>";
echo " <td align='center'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'><b>Squad Paragon</b></font></td>";
echo " <td align='center'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Paladin Commander<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/paladinc.gif' width='129' height='61' title='The Paladin Commander is the muscle
of the clan. He is experienced in both battle and paperwork. His job is to make sure all code of conduct is enforced and all combat operations are running smoothly. He is the paragon warrior and administrator of the clan. Paladin Commander is also the Squad Leader of Hyperborea's elite squad.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '17'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " <td align='center' valign='top'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Senior Paladin<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/spaladin.gif' width='129' height='61' title='Senior Paladin of the clan is the oldest most experienced member of the clan. His job is too teach his fellow members how to act and get things done properly.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '6'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " <td align='center' valign='top' colspan='4'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Paladin<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/paladin.gif' width='129' height='61' title='The Paladin of the clan is the icon of
the most advanced and experienced warrior of Hyperborea. He has great charisma, skill and loyalty towards the clan. '></font></td>";
echo " <td align='center' valign='top'>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>Junior Paladin<br>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/jpaladin.gif' width='129' height='61' title='The Junior Paladin is one the rare few who have made it to Hyperboreas elite squad. His job is to learn and follow the ways of the Paladin.'></font></td>";
echo " </tr>";
echo " <tr>";
echo " <td align='center'><b>Squad Hyperborea</b></td>";
echo " <td align='center' valign='top'>Knight Commander<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/knightc.gif' width='129' height='61' title='The Knight Commander carries out the orders executed by the Paladin Commander. His job is to keep the clan active through training, battles and other clan activities. Knight Commander is Squad Leader of Hyperborea's official combat squad.'></font>";
echo " <td align='center' valign='top' colspan='2'>Senior Knight<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/seniorknight.gif' width='129' height='61' title='The job of the Senior Knight is to teach the customs, conduct and drill of to the less experienced members of the clan.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '9'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " </tr>";
echo " <td align='center' valign='top' colspan='2'>Knight<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/knight.gif' width='129' height='61' title='The Knight is the vision of the perfect warrior. He has good knowledge of battlefield combat and Hyperboreas customs and conduct. '></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '10'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " <td align='center' valign='top' colspan='2'>Junior Knight<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/jknight.gif' width='129' height='61' title='The job of the Junior Knight is to learn the ways of the Knight, and help those who are in need.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '11'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " </tr>";
echo " <tr>";
echo " <td align='center'><b>Squad Neophyte</b></td>";
echo " <td align='center' valign='top'>Senior Initiate<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/sinitiate.gif' width='129' height='61' title='He is the oldest and most educated Initiate of Squad Neophyte. His job is to teach and carry out the orders of those relieved by the Squad Leader.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '12'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " </tr>";
echo " <td align='center' valign='top' colspan='3'>Initiate<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/initiate.gif' width='129' height='61' title='The Initiate has the basic knowledge of battlefield combat, customs and conduct. His job is to carry out the orders of those relieved by the Squad Leader and Fire Team Leader.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '13'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " </tr>";
echo " <td align='center' valign='top' colspan='3'>Junior Initiate<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/jinitiate.gif' width='129' height='61' title='Junior Initiate goes through the molding
stage, where he learns the basics of working together, loyalty, respect and good sportsmanship. '></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '14'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " </tr>";
echo " <tr>";
echo " <td align='center'><b>Delayed Entry Program</b></td>";
echo " <td align='center' valign='top' colspan='7'>DEP Recruit<br>";
echo " <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>";
echo " <img border='0' src='http://www.hborea.us/pn2/images/ranks/dep.gif' width='129' height='61' title='This is you! Your job is to stay in contact, study
and show us that you want to be part of the clan.'></font>";
$sql = "SELECT u.user_id, u.username, u.user_rank FROM phpbb_users AS u WHERE user_rank = '15'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'SQL error', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
echo "<br>";
echo '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['username'] ) . '" class="gensmall">' . $row['username'] . '</a>';
//echo htmlspecialchars($row['username']);
}
echo " </tr>";
echo " </table>";
?>
<center>Coding and design by [Hborea]Spaceman, December 2006</center>
</body>