blogroll off of Links in the menubar is now set as an option to be turned on to allow it to work

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2009-12-20 07:53:59 -08:00
parent 6dca8e0546
commit 1bd10daaa8
4 changed files with 23 additions and 14 deletions

View File

@ -104,6 +104,7 @@ function comicpress_admin() {
$comicpress_options['contact_in_menubar'] = (bool)($_REQUEST['contact_in_menubar'] == 1 ? true : false );
$comicpress_options['disable_dynamic_menubar_links'] = (bool)($_REQUEST['disable_dynamic_menubar_links'] == 1 ? true : false );
$comicpress_options['disable_default_menubar'] = (bool)($_REQUEST['disable_default_menubar'] == 1 ? true : false );
$comicpress_options['enable_blogroll_off_links'] = (bool)($_REQUEST['enable_blogroll_off_links'] == 1 ? true : false );
$tab = 'menubar';
update_option('comicpress_options',$comicpress_options);
}

View File

@ -172,7 +172,9 @@ function comicpress_load_options() {
'buy_print_int_ship' => '9.95',
'enable_comicpress_debug' => true,
'enable_full_post_check' => false
'enable_full_post_check' => false,
'enable_blogroll_off_links' => false
) as $field => $value) {
$comicpress_options[$field] = $value;

View File

@ -62,7 +62,16 @@
<input id="disable_dynamic_menubar_links" name="disable_dynamic_menubar_links" type="checkbox" value="1" <?php checked(true, $comicpress_options['disable_dynamic_menubar_links']); ?> />
</td>
<td>
<?php _e('Allows you to use the links category <i>menubar</i> (you will need to create this category if it does not already exist) to create custom links on the Menubar (mostly used for making graphic images as links). Otherwise, ALL published pages will appear automatically.','comicpress'); ?>
<?php _e('Disable creation of the pages from the wordpress core.','comicpress'); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="enable_blogroll_off_links"><?php _e('Enable the blogroll to appear as a dropdown off the Links page','comicpress'); ?></label></th>
<td>
<input id="enable_blogroll_off_links" name="enable_blogroll_off_links" type="checkbox" value="1" <?php checked(true, $comicpress_options['enable_blogroll_off_links']); ?> />
</td>
<td>
<?php _e('Allows you to show a dropdown of your blogroll off the page created Links. When creating the links page, the name must be a capital-L lowercase inks for it to work.','comicpress'); ?>
</td>
</tr>
</table>

View File

@ -52,27 +52,24 @@ function comicpress_menubar() {
$menulinks = preg_replace('#<li ([^>]*)>#', '<li class="page-item link">', $menulinks);
$menulinks = preg_replace('#<ul ([^>]*)>#', '', $menulinks);
$menulinks = str_replace('</ul>', '', $menulinks);
$bookmarks = wp_list_bookmarks('echo=0&title_li=&categorize=1&title_before=&title_after=&exclude_category='.$linkcatid);
$bookmarks = preg_replace('#<li ([^>]*)>#', '<li class="page-item link">', $bookmarks);
$bookmarks = preg_replace('#<ul ([^>]*)>#', '<ul>', $bookmarks);
if ($comicpress_options['enable_blogroll_off_links']) {
$bookmarks = wp_list_bookmarks('echo=0&title_li=&categorize=1&title_before=&title_after=&exclude_category='.$linkcatid);
$bookmarks = preg_replace('#<li ([^>]*)>#', '<li class="page-item link">', $bookmarks);
$bookmarks = preg_replace('#<ul ([^>]*)>#', '<ul>', $bookmarks);
}
$listpages = '';
if (!$comicpress_options['disable_dynamic_menubar_links']) {
$listpages = wp_list_pages('echo=0&sort_column=menu_order&depth=4&title_li=');
}
if (!empty($bookmarks)) {
if (!empty($bookmarks) && $comicpress_options['enable_blogroll_off_links']) {
$listpages = str_replace('Links</a></li>', 'Links</a>
<ul>
'.$bookmarks.'
</ul>
</li>
', $listpages);
$listpages .= $menulinks;
} else {
$listpages = str_replace('Links</a></li>', 'Links</a>
</li>
', $listpages);
$listpages .= $menulinks;
}
$listpages .= $menulinks;
?>
<ul id="menu">
<li class="page_item page-item-home<?php if (is_home()) { ?> current_page_item<?php } ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>