init(); $DB = $registry->DB(); //----------------------------------------- // Do we have a valid ID number? //----------------------------------------- if (!is_numeric(ipsRegistry::$request['tid'])) { // Boink to index $registry->getClass('output')->silentRedirect(IPB_URL, '', TRUE); } //----------------------------------------- // Do we have a valid app? //----------------------------------------- $app = $DB->buildAndFetch( array( 'select' => 'app_id', 'from' => 'conv_apps', 'where' => "name='".CONV_ID."'" ) ); if (!$app['app_id']) { echo 'Invalid Conversion ID'; exit; } //----------------------------------------- // Get our link and boink //----------------------------------------- $row = $DB->buildAndFetch( array( 'select' => 'ipb_id', 'from' => 'conv_link_topics', 'where' => "foreign_id=".intval(ipsRegistry::$request['tid'])." AND type='topics' AND app='".$app['app_id']."'" ) ); if (intval(ipsRegistry::$request['page'])) $registry->getClass('output')->silentRedirect(IPB_URL.'/index.php?showtopic='.$row['ipb_id'].'&page='.intval(ipsRegistry::$request['page']), '', TRUE); else $registry->getClass('output')->silentRedirect(IPB_URL.'/index.php?showtopic='.$row['ipb_id'], '', TRUE);