if ($vbulletin->debug) { print_select_row($vbphrase['product'], 'product', $products, $templateinfo['product']); } else { // use the default as we dictate in inserttemplate, if they dont have debug mode on they can't add templates to -1 anyway construct_hidden_code('product', 'vbulletin'); } } if ($vbulletin->GPC['dostyleid'] > 0) { $history = $db->query_first("\n\t\t\tSELECT title\n\t\t\tFROM " . TABLE_PREFIX . "templatehistory\n\t\t\tWHERE title = '" . $db->escape_string($vbulletin->GPC['title']) . "'\n\t\t\t\tAND styleid = " . $vbulletin->GPC['dostyleid']); } else { $history = null; } construct_hidden_code('expandset', $vbulletin->GPC['expandset']); construct_hidden_code('searchset', $vbulletin->GPC['expandset']); construct_hidden_code('searchstring', $vbulletin->GPC['searchstring']); print_style_chooser_row('dostyleid', $vbulletin->GPC['dostyleid'], $vbphrase['master_style'], $vbphrase['style'], iif($vbulletin->debug == 1, 1, 0)); print_input_row($vbphrase['title'] . ($history ? '<dfn>' . construct_link_code($vbphrase['view_history'], 'template.php?do=history&dostyleid=' . $vbulletin->GPC['dostyleid'] . '&title=' . urlencode($vbulletin->GPC['title']), 1) . '</dfn>' : ''), 'title', $vbulletin->GPC['title']); print_textarea_row($vbphrase['template'] . ' <br /><br /> <span class="smallfont">' . iif($vbulletin->GPC['title'], construct_link_code($vbphrase['show_default'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=view&title=" . $vbulletin->GPC['title'], 1) . '<br /><br />', '') . '<!--' . $vbphrase['wrap_text'] . '<input type="checkbox" unselectable="on" onclick="set_wordwrap(\'ta_template\', this.checked);" accesskey="w" checked="checked" />--> </span>', 'template', $templateinfo['template_un'], 22, '75" style="width:100%', true, true, 'ltr', 'code'); print_template_javascript(); print_label_row($vbphrase['save_in_template_history'], '<label for="savehistory"><input type="checkbox" name="savehistory" id="savehistory" value="1" tabindex="1" />' . $vbphrase['yes'] . '</label><br /><span class="smallfont">' . $vbphrase['comment'] . '</span> <input type="text" name="histcomment" value="" tabindex="1" class="bginput" size="50" />'); print_submit_row($vbphrase['save'], '_default_', 2, '', "<input type=\"submit\" class=\"button\" tabindex=\"1\" name=\"return\" value=\"{$vbphrase['save_and_reload']}\" accesskey=\"e\" />"); ?> <script type="text/javascript"> <!-- var initial_crc32 = crc32(YAHOO.util.Dom.get(textarea_id).value); var confirmUnload = true; YAHOO.util.Event.addListener('cpform', 'submit', function(e) { confirmUnload = false; }); YAHOO.util.Event.addListener(window, 'beforeunload', function(e) {
/** * Prints out the save options for the style generator */ function import_generated_style() { global $vbphrase, $stylecache; cache_styles(); echo " <script type=\"text/javascript\"> <!-- function js_confirm_upload(tform, filefield) { if (filefield.value == \"\") { return confirm(\"".construct_phrase($vbphrase['you_did_not_specify_a_file_to_upload'], " + tform.serverfile.value + ")."\"); } return true; } function js_fetch_style_title() { styleid = document.forms.downloadform.dostyleid.options[document.forms.downloadform.dostyleid.selectedIndex].value; document.forms.downloadform.title.value = style[styleid]; } var style = new Array(); style['-1'] = \"" . $vbphrase['master_style'] . "\""; foreach($stylecache AS $styleid => $style) { echo "\n\tstyle['$styleid'] = \"" . addslashes_js($style['title'], '"') . "\";"; $styleoptions["$styleid"] = construct_depth_mark($style['depth'], '--', iif($vbulletin->debug, '--', '')) . ' ' . $style['title']; } echo " // --> </script>"; echo '<div id="styleform">'; echo '<form id="form">'; construct_hidden_code('adid', $vbulletin->GPC['adid']); echo '<input id="form-data" type="hidden" name="data">'; echo '<div class="styledetails"><div id="title-generated-style" class="help title-generated-style">'; print_input_row($vbphrase['title_generated_style'], 'name', null, null, null, null, null, null, 'form-name'); echo '</div><div id="parent-id" class="help parent-id">'; print_style_chooser_row('parentid', -1, $vbphrase['no_parent_style'], $vbphrase['parent_style'], 1); echo '</div></div><div class="styleoptions"><div id="display-order" class="help display-order">'; print_input_row($vbphrase['display_order'], 'displayorder', 1, null, null, null, null, null, 'form-displayorder'); echo '</div><div id="allow-user-selection" class="help allow-user-selection">'; print_yes_no_row($vbphrase['allow_user_selection'], 'userselect', 1, null, null, null, null, null, 'form-userselect'); echo '</div></div></form></div>'; }
// use the default as we dictate in inserttemplate, if they dont have debug mode on they can't add templates to -1 anyway construct_hidden_code('product', 'vbulletin'); } } //if ($vbulletin->GPC['dostyleid'] > 0) //{ $history = vB_Api::instanceInternal('template')->history($vbulletin->GPC['title'], $vbulletin->GPC['dostyleid']); //} //else //{ // $history = null; //} construct_hidden_code('expandset', $vbulletin->GPC['expandset']); construct_hidden_code('searchset', $vbulletin->GPC['expandset']); construct_hidden_code('searchstring', $vbulletin->GPC['searchstring']); print_style_chooser_row('dostyleid', $vbulletin->GPC['dostyleid'], $vbphrase['master_style'], $vbphrase['style'], iif($vb5_config['Misc']['debug'] == 1, 1, 0)); print_input_row($vbphrase['title'] . ($history ? '<dfn>' . construct_link_code($vbphrase['view_history_gstyle'], 'template.php?do=history&dostyleid=' . $vbulletin->GPC['dostyleid'] . '&title=' . urlencode($vbulletin->GPC['title']), 1) . '</dfn>' : ''), 'title', $vbulletin->GPC['title']); print_checkbox_row($vbphrase['textonly'] . '<dfn>' . $vbphrase['textonly_desc'] . '</dfn>', 'textonly', false); print_textarea_row($vbphrase['template'] . ' <br /><br /> <span class="smallfont">' . iif($vbulletin->GPC['title'], construct_link_code($vbphrase['show_default'], "template.php?" . vB::getCurrentSession()->get('sessionurl') . "do=view&title=" . $vbulletin->GPC['title'], 1) . '<br /><br />', '') . '<!--' . $vbphrase['wrap_text'] . '<input type="checkbox" unselectable="on" onclick="set_wordwrap(\'ta_template\', this.checked);" accesskey="w" checked="checked" />--> </span>', 'template', $templateinfo['template_un'], 22, '5000" style="width:99%', true, false, 'ltr', 'code'); print_template_javascript($vbulletin->textarea_id); print_label_row($vbphrase['search_in_template'], ' <input type="text" class="bginput searchstring" name="string" accesskey="t" value="" size="20" /> <input type="button" class="button findbutton" style="font-weight:normal" value=" ' . $vbphrase['find'] . ' " accesskey="f" />'); print_label_row($vbphrase['save_in_template_history'], '<label for="savehistory"><input type="checkbox" name="savehistory" id="savehistory" value="1" tabindex="1" />' . $vbphrase['yes'] . '</label><br /><span class="smallfont">' . $vbphrase['comment_gstyle'] . '</span> <input type="text" name="histcomment" value="" tabindex="1" class="bginput" size="50" />'); print_submit_row($vbphrase['save'], '_default_', 2, '', "<input type=\"submit\" class=\"button js-reload-to-position\" tabindex=\"1\" name=\"return\" value=\"{$vbphrase['save_and_reload']}\" accesskey=\"e\" />"); } // ############################################################################# // simple update query for an existing template
$sort_fields = array('title' => $vbphrase['thread_title'], 'lastpost' => $vbphrase['last_post_time'], 'dateline' => $vbphrase['thread_start_time'], 'replycount' => $vbphrase['number_of_replies'], 'views' => $vbphrase['number_of_views'], 'postusername' => $vbphrase['thread_starter'], 'voteavg' => $vbphrase['thread_rating']); print_select_row($vbphrase['default_sort_field'], 'forum[defaultsortfield]', $sort_fields, $forum['defaultsortfield']); print_select_row($vbphrase['default_sort_order'], 'forum[defaultsortorder]', array('asc' => $vbphrase['ascending'], 'desc' => $vbphrase['descending']), $forum['defaultsortorder']); print_select_row($vbphrase['show_private_forum'], 'forum[showprivate]', array($vbphrase['use_default'], $vbphrase['no'], $vbphrase['yes_hide_post_counts'], $vbphrase['yes_display_post_counts']), $forum['showprivate']); print_table_header($vbphrase['moderation_options']); print_input_row($vbphrase['emails_to_notify_when_post'], 'forum[newpostemail]', $forum['newpostemail']); print_input_row($vbphrase['emails_to_notify_when_thread'], 'forum[newthreademail]', $forum['newthreademail']); print_yes_no_row($vbphrase['moderate_posts'] . ' <dfn>(' . $vbphrase['require_moderator_validation_before_new_posts_are_displayed'] . ')</dfn>', 'forum[options][moderatenewpost]', $forum['moderatenewpost']); print_yes_no_row($vbphrase['moderate_threads'] . ' <dfn>(' . $vbphrase['require_moderator_validation_before_new_threads_are_displayed'] . ')</dfn>', 'forum[options][moderatenewthread]', $forum['moderatenewthread']); print_yes_no_row($vbphrase['moderate_attachments'] . ' <dfn>(' . $vbphrase['require_moderator_validation_before_new_attachments_are_displayed'] . ')</dfn>', 'forum[options][moderateattach]', $forum['moderateattach']); print_table_header($vbphrase['style_options']); if ($forum['styleid'] == 0) { $forum['styleid'] = -1; // to get the "use default style" option selected } print_style_chooser_row('forum[styleid]', $forum['styleid'], $vbphrase['use_default_style'], $vbphrase['custom_forum_style'], 1); print_yes_no_row($vbphrase['override_style_choice'], 'forum[options][styleoverride]', $forum['styleoverride']); print_input_row($vbphrase['prefix_for_forum_status_images'], 'forum[imageprefix]', $forum['imageprefix']); print_table_header($vbphrase['access_options']); print_input_row($vbphrase['forum_password'], 'forum[password]', $forum['password']); if ($_REQUEST['do'] == 'edit') { print_yes_no_row($vbphrase['apply_password_to_children'], 'applypwdtochild', 0); } print_yes_no_row($vbphrase['can_have_password'], 'forum[options][canhavepassword]', $forum['canhavepassword']); print_table_header($vbphrase['posting_options']); print_yes_no_row($vbphrase['act_as_forum'], 'forum[options][cancontainthreads]', $forum['cancontainthreads']); print_yes_no_row($vbphrase['forum_is_active'], 'forum[options][active]', $forum['active']); print_yes_no_row($vbphrase['forum_open'], 'forum[options][allowposting]', $forum['allowposting']); print_yes_no_row($vbphrase['index_new_posts'], 'forum[options][indexposts]', $forum['indexposts']); print_table_header($vbphrase['enable_disable_features']); print_yes_no_row($vbphrase['allow_html'], 'forum[options][allowhtml]', $forum['allowhtml']);
//print_input_row($vbphrase['forum_link'], 'forum[link]', $forum['link']); print_input_row("{$vbphrase['display_order']}<dfn>{$vbphrase['zero_equals_no_display']}</dfn>", 'channel[displayorder]', $channel['displayorder']); //print_input_row($vbphrase['default_view_age'], 'forum[daysprune]', $forum['daysprune']); if ($vbulletin->GPC['nodeid'] != -1) { if (!isset($channel['guid']) or $channel['guid'] != vB_Channel::MAIN_CHANNEL and !in_array($channel['nodeid'], vB_Api::instance('content_channel')->fetchTopLevelChannelIds())) { print_channel_chooser($vbphrase['parent_forum'], 'channel[parentid]', $channel['parentid'], false, false, false, null, true); } } else { construct_hidden_code('parentid', 0); } print_table_header($vbphrase['style_options']); if ($channel['styleid'] == 0) { $channel['styleid'] = -1; // to get the "use default style" option selected } print_style_chooser_row('channel[styleid]', $channel['styleid'], $vbphrase['use_default_style_gforum'], $vbphrase['custom_forum_style'], 1); print_yes_no_row($vbphrase['override_style_choice'], 'channel[options][styleoverride]', $channel['options']['styleoverride']); /* print_input_row($vbphrase['prefix_for_forum_status_images'], 'forum[imageprefix]', $forum['imageprefix']); print_table_header($vbphrase['access_options']); print_input_row($vbphrase['forum_password'], 'forum[password]', $forum['password']); if ($_REQUEST['do'] == 'edit') { print_yes_no_row($vbphrase['apply_password_to_children'], 'applypwdtochild', 0); } print_yes_no_row($vbphrase['can_have_password'], 'forum[options][canhavepassword]', $forum['canhavepassword']); */ print_table_header($vbphrase['posting_options']); print_yes_no_row($vbphrase['act_as_forum'], 'channel[options][cancontainthreads]', $channel['category'] ? 0 : 1);
// use the default as we dictate in inserttemplate, if they dont have debug mode on they can't add templates to -1 anyway construct_hidden_code('product', 'vbulletin'); } } //if ($vbulletin->GPC['dostyleid'] > 0) //{ $history = $db->query_first("\n\t\t\tSELECT title\n\t\t\tFROM " . TABLE_PREFIX . "templatehistory\n\t\t\tWHERE title = '" . $db->escape_string($vbulletin->GPC['title']) . "'\n\t\t\t\tAND styleid = " . $vbulletin->GPC['dostyleid']); //} //else //{ // $history = null; //} construct_hidden_code('expandset', $vbulletin->GPC['expandset']); construct_hidden_code('searchset', $vbulletin->GPC['expandset']); construct_hidden_code('searchstring', $vbulletin->GPC['searchstring']); print_style_chooser_row('dostyleid', $vbulletin->GPC['dostyleid'], $vbphrase['master_style'], $vbphrase['style'], $vbulletin->debug ? 1 : 0); print_input_row($vbphrase['title'] . ($history ? '<dfn>' . construct_link_code($vbphrase['view_history'], 'template.php?do=history&dostyleid=' . $vbulletin->GPC['dostyleid'] . '&title=' . urlencode($vbulletin->GPC['title']), 1) . '</dfn>' : ''), 'title', $vbulletin->GPC['title']); print_textarea_row($vbphrase['template'] . ' <br /><br /> <span class="smallfont">' . iif($vbulletin->GPC['title'], construct_link_code($vbphrase['show_default'], "template.php?" . $vbulletin->session->vars['sessionurl'] . "do=view&styleid={$masterstyleid}&title=" . $vbulletin->GPC['title'], 1) . '<br /><br />', '') . '<!--' . $vbphrase['wrap_text'] . '<input type="checkbox" unselectable="on" onclick="set_wordwrap(\'ta_template\', this.checked);" accesskey="w" checked="checked" />--> </span>', 'template', $templateinfo['template_un'], 22, '5000" style="width:99%', true, true, 'ltr', 'code'); print_template_javascript(); print_label_row($vbphrase['save_in_template_history'], '<label for="savehistory"><input type="checkbox" name="savehistory" id="savehistory" value="1" tabindex="1" />' . $vbphrase['yes'] . '</label><br /><span class="smallfont">' . $vbphrase['comment'] . '</span> <input type="text" name="histcomment" value="" tabindex="1" class="bginput" size="50" />'); print_submit_row($vbphrase['save'], '_default_', 2, '', "<input type=\"submit\" class=\"button\" tabindex=\"1\" name=\"return\" value=\"{$vbphrase['save_and_reload']}\" accesskey=\"e\" />"); ?> <script type="text/javascript"> <!-- var initial_crc32 = crc32(YAHOO.util.Dom.get(textarea_id).value); var confirmUnload = true; YAHOO.util.Event.addListener('cpform', 'submit', function(e) { confirmUnload = false; }); YAHOO.util.Event.addListener(window, 'beforeunload', function(e) {