houfton
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Issue with creating a "2015" pageI have no idea why it should be but, if anyone is interested, changing “year” to “annum” in my script works for both 2014 and 2015.
Forum: Fixing WordPress
In reply to: Issue with creating a "2015" pageDid you find an answer to this?
I have a link which has “year=2015” as a GET parameter. It returns a 404 Page Not Found. The link works fine with “year=2014” but with 2015 it does not even get to the page it is supposed to. This suggests that it is not to do with the script parsing the GET array. 2016 is no better.
Forum: Plugins
In reply to: [PayPal for WooCommerce] Multiple PayPal accountsThat’s an impressively fast, if somewhat disappointing, reply, thank you.
Forum: Fixing WordPress
In reply to: TinyMCE Anchor Button in Editor?I cannot get ‘anchor’ to work either, though other buttons do. I have noticed that some names have changed (sub = subscript, justifyfull = alignjustify etc.) but not ‘anchor’ according to this list TinyMCE 4 buttons / controls.
Forum: Plugins
In reply to: [Plugin: NextGEN Gallery] Not allowed to add subpageI have found a way to solve this using a little hack. In wp-content/plugins/nextgen-gallery/admin/manage-images.php look for “parent_dropdown”.
In my latest version of NextGEN Gallery it is wrapped in a conditional clause:
<?php if (get_post()): ?> <?php parent_dropdown (); ?> <?php endif ?>
Removing or commenting out the “if” and “endif” lines seems to make it work but I am not sure why the conditional is there (it is not in an earlier version of NextGEN Gallery) so there may be issues with my hack?
<?php //if (get_post()): ?> <?php parent_dropdown (); ?> <?php //endif ?>
I have hidden the “Choose gallery” select option and set it to the current user’s own, single gallery by hacking wp-content/plugins/nextgen-gallery/admin/addgallery.php. It would be better to do it without a hack but I don’t know how!
The idea is to serve a hidden field to Contributors with their gallery id drawn from the database as the value:
if (!current_user_can('publish_posts') ) { global $current_user, $wpdb; get_currentuserinfo(); $user_gallery = $wpdb->get_var( $wpdb->prepare( "SELECT gid FROM wp_ngg_gallery WHERE name = %s", $current_user->user_login ) ); ?> <input name="galleryselect" id="galleryselect" type="hidden" value="<?php echo $user_gallery; ?>" />
… then Authors and above get the standard code – a select menu in a table row…
<?php } else { ?> <tr valign="top"> <th scope="row"><?php _e('in to', 'nggallery') ;?></th> <td><select name="galleryselect" id="galleryselect"> <option value="0" ><?php _e('Choose gallery', 'nggallery') ?></option> <?php foreach($this->gallerylist as $gallery) { //special case : we check if a user has this cap, then we override the second cap check if ( !current_user_can( 'NextGEN Upload in all galleries' ) ) if ( !nggAdmin::can_manage_this_gallery($gallery->author) ) continue; $name = ( empty($gallery->title) ) ? $gallery->name : $gallery->title; echo '<option value="' . $gallery->gid . '" >' . $gallery->gid . ' - ' . esc_attr( $name ) . '</option>' . "\n"; } ?> </select> <br /><?php echo $this->maxsize; ?> <br /><?php if ((is_multisite()) && wpmu_enable_function('wpmuQuotaCheck')) display_space_usage(); ?></td> </tr> <?php }
I have done a similar thing to the ‘Scale images to max width…” checkbox in order to reduce the number of choices for my Contributors.
I have removed the “Add new gallery” tab (and two other tabs) using a function which hooks into a filter in wp-content/plugins/nextgen-gallery/admin/addgallery.php.
I put this code in my functions.php file in my theme:
if (!current_user_can('publish_posts') ) { add_filter('ngg_addgallery_tabs', 'test_remove_tabs'); function test_remove_tabs ($tabs) { unset($tabs['addgallery']); unset($tabs['zipupload']); unset($tabs['importfolder']); return $tabs; } }
The
if (!current_user_can('publish_posts') {}
conditional restricts this to users below Author level ie Contributors. To use another level see the WordPress Roles and Capabilities.Forum: Plugins
In reply to: [BuddyPress Album] [Plugin: BuddyPress Album] Enable Light box withSorry again, I have changed the way I did this but did not update this post (I hate it when people do that!).
What I use now is an addition to the wp-content/themes/my-child-theme/members/single/profile/profile-loop.php file in my child theme. I put this just above
<?php do_action( 'bp_profile_field_buttons' ); ?>
:<?php global $bp, $pictures_template; $args['ordersort'] = 'ASC'; $args['per_page'] = 12; bp_album_query_pictures($args); ?> <ul class="picture-gallery"> <?php while ( bp_album_has_pictures() ) : bp_album_the_picture(); ?> <li class="picture-thumb-box"> <a href='<?php bp_album_picture_middle_url() ?>' class='fancybox' rel='slideshow' title=''><img src='<?php bp_album_picture_thumb_url() ?>' /></a><br /> <a href="<?php bp_album_picture_url() ?>" class="picture-title"><?php bp_album_picture_title_truncate(22) ?></a><?php if (bp_is_my_profile() || is_super_admin()) { echo "<br />"; bp_album_picture_edit_link(); } ?> </li> <?php endwhile; ?> </ul>
It is set to show up to 12 images. The image link uses Fancybox. The image title links to the image as a post and there is an image edit link below that as well for logged-in users. All this can be changed obviously. The picture-thumb-box class applied to the list item allows you to change the styling.
Dare I say, it seems to work for me!
For some reason on my system the table does not get renamed with the PHP lower case on upgrade or if I try a direct SQL query like the one above. Even
ALTER TABLE wp_allowPHP_functions RENAME TO wp_allowphp_functions
does not work. There are no errors, just no change!I altered the table name directly (I generally use the Sequel Pro app for Mac rather than phpMyAdmin for messing around with the database).
Strangely the plugin version 3.0.2 does not seem to care whether the table is upper or lower case on my test site at least.
A minor problem with using Boone’s solution to remove the email options from the Group Directory is that there is a message which the plugin adds to the bottom of the Settings > Notifications screen (../members/member/settings/notifications/) saying “To change the email notification settings for your groups, go to [My Groups] and click “Change” for each group.” But the “Change” link has been removed.
I have replaced that function (ass_add_notice_to_notifications_page() in bp-activity-subscription-functions.php) with my own one in my theme with slightly different wording.
Picky? I know! But perhaps worth noting…
It may have been a cache thing because all is well now…
Forum: Plugins
In reply to: [BuddyPress Album] [Plugin: BuddyPress Album] Enable Light box withSorry, there is a mistake here:
do_action( 'spear_bp_album_all_images' );
should be:
do_action( 'xxx_bp_album_all_images' );
Forum: Plugins
In reply to: [BuddyPress Album] [Plugin: BuddyPress Album] Enable Light box withI think I just worked this out. Warning: I am not an expert but it works for me!
I copied the wp-content/plugins/bp-album/includes/templates/album/all-images.php file to album/all-images.php in my child theme. I altered the layout to create a list of images rather than a table but the main thing is to alter the link (line 40?) from
<a href="<?php bp_album_picture_url() ?>" class="media-image"><img src='<?php bp_album_picture_thumb_url() ?>' /></a>
to something like
<a href='<?php bp_album_picture_middle_url() ?>' class='fancybox' rel='slideshow' title=''><img src='<?php bp_album_picture_thumb_url() ?>' /></a>
I then copied the ‘bp_album_screen_all_images()’ function which uses the ‘bp_album_all_images’ function you mention (found in wp-content/plugins/bp-album/includes/bpa.screens.php – line 644?) to the functions.php file in my child theme. I changed all mentions of bp_album_screen_all_images to xxx_bp_album_screen_all_images to avoid declaring the same function twice:
function xxx_bp_album_screen_all_images() { global $bp; bp_album_query_pictures(); bp_album_load_subtemplate( apply_filters( 'xxx_bp_album_screen_all_images', 'album/all-images' ), false ); } add_action('xxx_bp_album_all_images','xxx_bp_album_screen_all_images',3);
To use it I added
do_action( 'spear_bp_album_all_images' );
below the profile fields loop in members/single/profile/profile-loop.php in my child theme. It could be used anywhere I think.I am using Fancybox for WordPress but other lightboxes could work, you just need to use the appropriate class / rel attributes.
Forum: Plugins
In reply to: [MM Forms] [Plugin: MM Forms] Frontend Data setting not savingUpdate: Tom, the developer, has given me a fix for this bug.
In mm-forms.php change a line in the form_display_loopdata function (somewhere around line 2270):
old:
if($select_datas[0]=='')
new:
if($select_datas[0]->formloopdata<>'')
Richard
Forum: Plugins
In reply to: [Plugin: MM Forms] Exported CSV Columns SwappingUpdate: I have found a solution to my CSV export problem. If you specify a delimiter other than a comma, you must use the same delimiter in the list of field names eg for semi-colon “your_name; your_email”.
Kind of obvious maybe but the documentation, such as it is, specifies commas.
Richard