I think I'm going to do just that, but keep it basic at first. Create my new bitfield permissions (Who can create elections, who can vote in elections, who can see election results) and then just use the forum front-end for the administration of things at first. That way I can just have plain PHP files out there that only tie in to VB when checking for permissions. Seems like a decent way to get started....
And yes - I will definitely need to check out other products for inspiration. I think I can figure things out.
Thanks for your help.
--------------- Added [DATE]1299097555[/DATE] at [TIME]1299097555[/TIME] ---------------
Soooo I need help again. I created my product, set up my bitfields, and set up my permissions. But I absolutely cannot figure out how to check those permissions in my script. I see that I'm obviously not accessing the correct values, but I don't know where else to check. I am trying to see if the currently logged in user has permission to vote or not. This is just real basic while I'm trying to acclimate myself to the system. Can you help me / point me in the right direction?
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'voting_booth');
define('CSRF_PROTECTION', true);
// change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array('tsgvotingbooth',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = construct_navbits(array('' => 'Voting Booth'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Voting Booth';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
if(!$vbulletin->bf_ugp['tsgvb_permissions']['canvote']) {
print_no_permission();
}
$templater = vB_Template::create('tsgvotingbooth');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());
?>