set_filenames( array( 'plugin_admin_content' => dirname(__FILE__).'/admin.tpl' ) ); // Select the existing copyrights $query = sprintf( 'SELECT * FROM %s ;', COPYRIGHTS_ADMIN); $result = pwg_query($query); // Append the copyrights to the Smarty array while ($row = pwg_db_fetch_assoc($result)) { $template->append( 'CRs', array( 'cr_id' => $row['cr_id'], 'name' => $row['name'], 'url' => $row['url'], 'descr' => $row['descr'], 'visible' => $row['visible'] ) ); } // Assign the path for URL forming $template->assign( 'COPYRIGHTS_PATH', COPYRIGHTS_WEB_PATH ); // Assign all the variables we constructed above $template->assign('edit', $edit); $template->assign('CRid', $CRid); $template->assign('CRname', $CRname); $template->assign('CRurl', $CRurl); $template->assign('CRdescr', $CRdescr); $template->assign('CRvisible', $CRvisible); // Get it up and running $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); ?>