Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2007, 05:16 AM
spaceman33 spaceman33 is offline
 
Join Date: Apr 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Convert phpBB SQL to vBulletin

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.

Existing page on phpBB is still here

Can anyone give me some pointers, suggest anything, tell me where to go (politely)?

Cheers.

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>
Reply With Quote
  #2  
Old 04-30-2007, 03:09 PM
rs-server rs-server is offline
 
Join Date: Sep 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vBulletin provides a system for this.

Documentation on it can be found here Impex
Reply With Quote
  #3  
Old 04-30-2007, 06:04 PM
spaceman33 spaceman33 is offline
 
Join Date: Apr 2007
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I ran that when I installed vBulletin.

All the database entries are there, it's just how would/could I interrogate the SQL?

From what I see in impex it doesn't import php files that I wrote for the old phpBB board. It only imports databases, or am I misunderstanding the purpose of impex?
Reply With Quote
  #4  
Old 05-01-2007, 04:44 AM
Cap'n Steve's Avatar
Cap'n Steve Cap'n Steve is offline
 
Join Date: Feb 2004
Location: Kalamazoo, MI, USA
Posts: 745
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's kind of a lot to get into, I suggest you start in the Articles section of this forum and just rebuild the script from the ground up.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03940 seconds
  • Memory Usage 2,308KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete