'Do' Branch Naming 
Most vBulletin scripts contains 'do' branches. The following naming standards should be followed.
if (empty($_REQUEST['do']))
{
    // set default branch for this script
    $_REQUEST['do'] = 'modify';
}

// #############################################################################

if ($_POST['do'] == 'kill')
{
    // 'kill'
    // run code to remove item in database
}

// #############################################################################

if ($_REQUEST['do'] == 'delete')
{
    // 'delete'
    // display delete confirmation message
}

// #############################################################################

if ($_POST['do'] == 'insert')
{
    // 'insert'
    // run code to insert new item into database
}

// #############################################################################

if ($_REQUEST['do'] == 'add')
{
    // 'add'
    // display form to add new item
}

// #############################################################################

if ($_POST['do'] == 'update')
{
    // 'update'
    // run code to update item in database
}

// #############################################################################

if ($_REQUEST['do'] == 'edit')
{
    // 'edit'
    // display form to edit item
}

// #############################################################################

if ($_REQUEST['do'] == 'modify')
{
    // 'modify'
    // show default branch for this script
}
If possible, keep the branches in the order listed above, with 'modify' (the default action) at the very bottom of the script.

If a script contains branches to edit/add/delete more than a single item type (such as template.php containing script to modify both styles and templates), then you should suffix the kill/delete/insert/add/update/edit branch names with the item type.
if ($_REQUEST['do'] == 'edittemplate')
{
    // show form to edit a template
}

// #############################################################################

if ($_REQUEST['do'] == 'editstyle')
{
    // show form to edit a style
}
If a the functionality of a 'do' branch does not tally with edit, update, add, insert, delete or kill, give it a name that summarised the functionality of the branch.
if ($_REQUEST['do'] == 'rebuildstylecache')
{
    // rebuild style cache
}

// #############################################################################

if ($_REQUEST['do'] == 'updatetemplateparentlists')
{
    // update template parent lists
}
Keep groups of branches applicable to a single item type together in the script.
// if (empty($_REQUEST['do']))

// if ($_REQUEST['do'] == 'rebuildstylecache')
// if ($_POST['do'] == 'killstyle')
// if ($_REQUEST['do'] == 'deletestyle')
// if ($_POST['do'] == 'insertstyle')
// if ($_REQUEST['do'] == 'addstyle')
// if ($_POST['do'] == 'updatestyle')
// if ($_REQUEST['do'] == 'editstyle')

// if ($_REQUEST['do'] == 'updatetemplateparentlists')
// if ($_POST['do'] == 'killtemplate')
// if ($_REQUEST['do'] == 'deletetemplate')
// if ($_POST['do'] == 'inserttemplate')
// if ($_REQUEST['do'] == 'addtemplate')
// if ($_POST['do'] == 'updatetemplate')
// if ($_REQUEST['do'] == 'edittemplate')

// if ($_REQUEST['do'] == 'modify')
Copyright © 2024 MH Sub I, LLC dba vBulletin. All rights reserved. vBulletin® is a registered trademark of MH Sub I, LLC dba vBulletin.