Skip to content

Instantly share code, notes, and snippets.

@linickx
Created August 19, 2011 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linickx/1156971 to your computer and use it in GitHub Desktop.
Save linickx/1156971 to your computer and use it in GitHub Desktop.
PRT - admin options - dbblock
<?php
// Line 36
# How do we connect to phpbb?
if ($lnx_PRT_options['prt_phpbb_dbinsecureon'] != "1") {
# COnnect to phpBB and get a list of forums
$wpdb->select($lnx_PRT_options['prt_phpbb_db']);
# Run The query
$tt_results = $wpdb->get_results("SELECT * FROM $lnx_PRT_options[prt_phpbb_tt] LIMIT 3"); // Topic Table Querey - check connectivity
$ft_results = $wpdb->get_results("SELECT forum_id,forum_name FROM $lnx_PRT_options[prt_phpbb_ft]"); // Forum Table Querey - for exclusions
$pt_results = $wpdb->get_results("SELECT * FROM $lnx_PRT_options[prt_phpbb_pt] LIMIT 3"); // Posts Table Querey - to check recent posts functionaility
# Connect back to wordpress :-)
$wpdb->select(DB_NAME);
} else {
# Make new DB Connection
$phpbbdb = new wpdb($lnx_PRT_options['prt_phpbb_dbinsecureuid'], $lnx_PRT_options['prt_phpbb_dbinsecurepw'], $lnx_PRT_options['prt_phpbb_db'], $prt_phpbb_dbinsecurehos);
# Run The query
$tt_results = $phpbbdb->get_results("SELECT * FROM $lnx_PRT_options[prt_phpbb_tt] LIMIT 3"); // As above
$ft_results = $phpbbdb->get_results("SELECT forum_id,forum_name FROM $lnx_PRT_options[prt_phpbb_ft]");
$pt_results = $phpbbdb->get_results("SELECT * FROM $lnx_PRT_options[prt_phpbb_pt] LIMIT 3");
}
// line 59
# Now print the admin form!
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment