id="cloneplaceholder">
'; // show the form for the $vbulletin->GPC['dostyleid'] $stylevars = fetch_stylevars_array(); // $stylevars['group']['stylevarid']['styleid'] = $stylevar (record array from db); echo "
'; if ($vbulletin->debug AND ($vbulletin->GPC['dostyleid'] == -1)) { // show the add stylevardfn button echo ' '; } // table wrapper echo '
' . $vbphrase['color_key'] . '
' . $vbphrase['stylevar_is_unchanged_from_the_default_style'] . '
' . $vbphrase['stylevar_is_inherited_from_a_parent_style'] . '
' . $vbphrase['stylevar_is_customized_in_this_style'] . '
'; // show the editor pane echo ' '; // table wrapper echo ' '; $return_url = 'stylevar.php?' . $vbulletin->session->vars['sessionurl'] . '&dostyleid=' . $vbulletin->GPC['dostyleid']; //echo construct_link_code($vbphrase['rebuild_all_styles'], // 'template.php?' . $vbulletin->session->vars['sessionurl'] . 'do=rebuild&goto=' . urlencode($return_url)); } // ############################################################################# // do revert all StyleVars in a style if ($_POST['do'] == 'dorevertall') { if ($vbulletin->GPC['dostyleid'] != -1 AND $style = $db->query_first("SELECT styleid, parentid, parentlist, title FROM " . TABLE_PREFIX . "style WHERE styleid = " . $vbulletin->GPC['dostyleid'])) { if (!$style['parentlist']) { $style['parentlist'] = '-1'; } $stylevars = $db->query_read(" SELECT DISTINCT s1.stylevarid FROM " . TABLE_PREFIX . "stylevar AS s1 INNER JOIN " . TABLE_PREFIX . "stylevar AS s2 ON (s2.styleid IN ($style[parentlist]) AND s2.styleid <> $style[styleid] AND s2.stylevarid = s1.stylevarid) WHERE s1.styleid = $style[styleid] "); if ($db->num_rows($stylevars) == 0) { print_stop_message('nothing_to_do'); } else { $deletestylevars = array(); while ($stylevar = $db->fetch_array($stylevars)) { $deletestylevars[] = "'" . $stylevar['stylevarid'] . "'"; } $db->free_result($stylevars); if (!empty($deletestylevars)) { $db->query_write("DELETE FROM " . TABLE_PREFIX . "stylevar WHERE styleid = $style[styleid] AND stylevarid IN(" . implode(',', $deletestylevars) . ")"); print_rebuild_style($style['styleid']); } print_cp_redirect("stylevar.php?" . $vbulletin->session->vars['sessionurl'] . "do=modify&dostyleid=$style[styleid]", 1); } } else { print_stop_message('invalid_style_specified'); } } // ##################################