newtech1 (@newtech1)

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 48 total)
  • In reply to: Subscribe to Forum

    @newtech1

    Participant

    When I inserted the customized code for all my custom fields that are created by the ACF plugin, I forgot to delete the original code that makes the subscription email notification to work. So I had that customized code and the customized code for my custom fields. Thus sending out two emails.

    I removed this code.

    
    if( function_exists( 'bbp_get_topic_post_type' ) ){
    	function newtech1_bbpress_new_topic( $post ) {
    		if( isset( $post->post_type ) && $post->post_type == bbp_get_topic_post_type() ){
    			do_action( 'bbp_new_'.bbp_get_topic_post_type(), $post->ID , $post->post_parent, [] , $post->post_author );
    		}
    	}
    	add_action(  'draft_to_publish' ,  'newtech1_bbpress_new_topic', 10 );
    }
    In reply to: Subscribe to Forum

    @newtech1

    Participant

    I changed the fish caught to a text field since I could not get the radio button to work. I could not get the image to show up in an email so have just accepted that the email receiver has to log in to see the image and the map.

    NEW ISSUE SUDDENLY CAME UP, WAS NOT HAPPENING BEFORE
    Subscribers are receiving two email notifications. One email notification has all the custom fields blank and the second email has all the custom fields filled out. What could be going on?

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    I just got around to testing the above. I copied the code into themes function.php. Under fish caught it still says array instead of the fish species chosen in the dropdown. Also the image still does not show up.

    Any other suggestions? the Fish caught I can change it so that the user has to type in the fish species caught. Just much easier for them to choose the dropdown when entering, especially if on the lake when posting.

    It is important for the image to show up in the email because that draws much more interest than no image showing up.

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Thank you for your ongoing help we are almost there.
    But I am sorry I am not understanding this new information regarding the fish_caught field.
    I understand I would replace
    `$afc_replace = array(
    ‘{catch_date_time}’ => get_field( ‘catch_date_time’, $topic_id),
    ‘{anglers}’ => get_field( ‘anglers’, $topic_id )
    );`

    with this code
    `$afc_replace = array(
    ‘{catch_date_time}’ => get_field( ‘catch_date_time’, $topic_id),
    ‘{anglers}’ => get_field( ‘anglers’, $topic_id )
    ‘{fish_caught}’ => $fish_caught
    );`

    But not understanding where I would put this code

    $fish_caught = get_field('fish_caught');
    
    if( is_array( $fish_caught ) && isset( $fish_caught['label'] ) ){
    	$fish_caught = $fish_caught['label'];
    }else{
    	$fish_caught = '';
    }

    in the midst of this code. I am sure I am getting ( ) { } in the wrong places.

    if( !function_exists('acf_email_bbp_subscription_mail') ){
    	function acf_email_bbp_subscription_mail( $message, $topic_id, $forum_id, $user_id ) {
    		if ( function_exists( 'get_field' ) && $topic_id != 0 ) {
    In reply to: Subscribe to Forum

    @newtech1

    Participant

    To clarify in regard to images. I do not want users to have the ability to access the media folder and thus all my images. Without the image custom field they could go to post a topic, click on ‘Add Media’ and they would be able to access images from my entire media folder.

    So I removed access to the “Add Media” link and created a custom field image so that they have to upload an image from their device. The problem is the image they upload to the topic does not display in the email notification. It just says ‘array’. Any workaround?

    I wish there was a way they could click ‘Add Media’ and they could add media but not access my media folder.

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Error-Image field
    In the email the image will not display. Most likely it is because of how I have the image field being created. I do not want posters to insert images into the website media gallery. So I have created a custom field for images. Here is the script for the image field. Is there a way to make it so images show up in the email notification? I am assuming the only work around is to allow them to access the media library.

    I know there was another way for posting images using custom field but I could never get it to work.

    <?php 
    $image = get_field('image');
    if( !empty( $image ) ): ?>
        <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
    <?php endif; ?>
    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Error-Fish Caught Field

    This field has radio buttons for each type of fish caught. So the poster does not have to type in the species of fish. Instead the choose the appropriate radio buttons.

    The email shows the result for this field as the word ‘array’.

    Is there a way to resolve that without having to change this to a text field where they type in each species of fish?

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    I am happy to report that code works great. The two custom fields show up in the email notification.

    Here are all the custom fields. I should be able to take what you have done and make all them work. Hopefully not break anything.

    <strong>YOU CHOOSE HOW MUCH INFORMATION YOU ENTER</strong><br>
    <strong>Catch Date & Time:</strong> <?php the_field( 'catch_date_time' ) ; ?><br>
    <strong>Anglers:</strong> <?php the_field( 'anglers' ) ; ?><br>
    <strong>Weather:</strong> <?php the_field( 'weather' ) ; ?><br>
    <strong>Fish Caught:</strong> <?php the_field( 'fish_caught' ) ; ?><br>
    <strong>Kept or Released:</strong> <?php the_field( 'kept_or_released' ) ; ?><br>
    <strong>Lake Point Marker:</strong> <?php the_field( 'lake_point_marker' ) ; ?><br>
    <strong>Water_Features:</strong> <?php the_field( 'water_features' ) ; ?><br>
    <strong>Speed:</strong> <?php the_field( 'speed' ) ; ?><br>
    <strong>Fish Depth:</strong> <?php the_field( 'fish_depth' ) ; ?><br>
    <strong>Lake Depth:</strong> <?php the_field( 'lake_depth' ) ; ?><br>
    <strong>Method Used:</strong> <?php the_field( 'method_used' ) ; ?><br>
    <strong>Lure & Color:</strong> <?php the_field( 'lure_color' ) ; ?><br>

    BUT there are two custom fields that are done differently, do not know how I would do them. It is the image field and the location field, but maybe they work the same way.

    <strong>Image:</strong>
    <?php 
    $image = get_field('image');
    if( !empty( $image ) ): ?>
        <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
    <?php endif; ?> <br>
    
    <br>
    <br>
    <strong>Fishing Location: </strong> <?php the_field( 'location' ) ; ?><br>
    <?php 
    $location = get_field('location');
    if( $location ): ?>
        <div class="acf-map" data-zoom="13">
            <div class="marker" data-lat="<?php echo esc_attr($location['lat']); ?>" data-lng="<?php echo esc_attr($location['lng']); ?>"></div>
        </div>
    <?php endif; ?>
    In reply to: Subscribe to Forum

    @newtech1

    Participant

    I have the bbp style pack plugin installed but only using forSubscription Emails and Subscription Management. I have manually edited files for the customized fields to show up under adding new topics and to display results in the front end.

    Here are some customized fields in content-single-topic.php
    YOU CHOOSE HOW MUCH INFORMATION YOU ENTER<br>
    Catch Date & Time: <?php the_field( ‘catch_date_time’ ) ; ?><br>
    Anglers: <?php the_field( ‘anglers’ ) ; ?><br>

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Yes I can create a customized template for the email. Here is what is my current issue:

    In the backend when a user posts a topic there are several custom fields created with the ACF plugin, ie. date, time, water depth, fish caught, etc.

    When the email notification is sent, the information in the content filled shows up in the email, but any custom fields data does not show up in the email.

    So my question is, what file is being used for the email notification. The file where topic content is entered? I may be able to enter the correct coding to display ACF field results in the emmail.

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Whoops. I am wrong. IT IS NOW WORKING! I need to test auto login and some other features since this is a private forum.

    One issue that I do not think can be solved is I am using ACF plugin for Custom fields within topics. The email notification only has the topic text, it does not include any of the custom field results. Assume no one know how to resolve this. ACF plugin support will not help because they know nothing about bbpress.

    The reason I have forum users posting in the backend is because I could never get the ACF plugin to work properly on the frontend.

    Thanks!

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    I put the following code within my theme’s functions.php file. I created a topic under the only forum I have on the site. I published it. Subscribers never received the notification. I checked emails log. It does not show any email being sent out. I am still wondering if the issue can be that if a topic is created within the backend instead of frontend could be causing the problem.

    /**
    *begin edit for subscribe notification to work
    */
    if( function_exists( 'bbp_get_topic_post_type' ) ){
    	function newtech1_bbpress_new_topic( $post ) {
    		if( isset( $post->post_type ) && $post->post_type == bbp_get_topic_post_type() ){
    			do_action( 'bbp_new_'.bbp_get_topic_post_type(), $post->ID , $post->post_parent, [] , $post->post_author );
    		}
    	}
    	add_action(  'draft_to_publish' ,  'newtech1_bbpress_new_topic', 10 );
    }
    /**
    *end edit for subscribe notification to work
    */
    In reply to: Subscribe to Forum

    @newtech1

    Participant

    What do I replace newtech1 with?

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Currently only have a few sunscribeessubscribers since it is not working.

    Not going into spam I know because check and login plug-in shows no emails going out.

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    I should mention I installed the style pack. I have verified users that are subscribed to the forum.
    I went into Subscription Emails and ran ‘Sent Test Topic Email’. The test email was sent out with no problem. I then posted a topic in the forum. No email notification was sent out.

    I am thinking if topics are posted from the backend, or maybe from moderators, that email notifications do not work. Can someone test this? I cannot test it because we do not have topic creation on the front end. (We have customized fields that we could never get to work on the frontend so made topic creation via backend.)

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Finally getting back to this topic.
    I have installed the ‘check and log email’ plugin. It shows all other plugins are sending out emails, but bbpress is not sending out emails to subscribers. What could be the issue.

    The way we use bbpress is that the topics are posted via the backend. All users are posting as moderators. Would there be any reason that would be preventing email notifications from being sent. I do not see any reason that would be the case.

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    What could be causing notifications to not be received, notifications not being sent. I am using GoSMTP and other emails are sent out with no problem. Where is the coding for this feature?

    Does it matter if topic posts are made from the frontend or the backend for the subscribe notification to work? In our forum topics are created only in the backend by moderators.

    In reply to: Subscribe to Forum

    @newtech1

    Participant

    Also, is it feasible to make it so the default for all users is to be subscribed?

    In reply to: remove user Forum Role

    @newtech1

    Participant

    I found this code to remove IP address:

    function vvd_no_view_ip ($author_ip, $r, $args) {
        return __return_empty_string ();
    }
    add_filter ('bbp_get_author_ip','vvd_no_view_ip', 10, 3);

    I was in wrong functions.php file. Did not realize I needed to do these edits in my theme functions.php.

    In reply to: remove user Forum Role

    @newtech1

    Participant

    I found these two different codes that is supposeto what I want (I do not want moderator or keymaster roles shown in forntend), but when I insert either in the bbpress functions.php page nothing happens.

    
    function hide_role ($args) {
    $args['show_role'] = false ;
    Return $args ;
    }
    add_filter ('bbp_before_get_reply_author_link_parse_args', 'hide_role') ;
    function role_show () {
    $displayed_user = bbp_get_reply_author_id() ;
    $role = bbp_get_user_role( $displayed_user);
    if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_moderator') $args['show_role'] = true ;
    else $args['show_role'] = false ;
    return $args ;
    }
    add_filter ('bbp_before_get_reply_author_link_parse_args', 'role_show' );

    I also do not want IP address shown for anyone on the frontend. (Yes even for moderators ND KEYMASTERS)

    @newtech1

    Participant

    Whoops maybe I am misunderstanding what I am seeing or how subscription works, so let me describe what I want.

    We currently have one forum. paid members can post topics in the one forum and there are no replies.
    We want paid members to subscribe to the forum and thus receive email every time someone post a topic to the forum.

    We do not want them to subscribe to an individual topic because there will never be a change to the topic (no replies).
    a
    It appears to be subscribe button for the forum and one for each topic, thus a person can click subscribe for the forum and also subscribe to individual topics. Maybe I am reading into this more than I should.

    Is this how the subscribe works?
    If a person clicks anywhere they see a subscribe button they are either subscribing or unsubscribing to both forums AND topics? Not an either/or?

    @newtech1

    Participant

    Any solution?

    @newtech1

    Participant

    Well thus far it looks like this works:
    Remove this code:

    if ( empty( $r['links'] ) ) {
    			$r['links'] = apply_filters( 'bbp_topic_admin_links', array(
    				'edit'    => bbp_get_topic_edit_link   ( $r ),
    				'merge'   => bbp_get_topic_merge_link  ( $r ),
    				'close'   => bbp_get_topic_close_link  ( $r ),
    				'stick'   => bbp_get_topic_stick_link  ( $r ),
    				'trash'   => bbp_get_topic_trash_link  ( $r ),
    				'spam'    => bbp_get_topic_spam_link   ( $r ),
    				'approve' => bbp_get_topic_approve_link( $r ),
    				'reply'   => bbp_get_topic_reply_link  ( $r )
    			), $r['id'] );
    		}
    
    In reply to: Forum default

    @newtech1

    Participant

    Whoops we must have been posting at the same time. THANK YOU SO MUCH.
    Believe me I had to edit other bbpress files to make ACF plugin work. Again thank you!!!!!

    In reply to: Forum default

    @newtech1

    Participant

    Thank you for the clarification of the analogy. Yes, that certainly makes sense, and I certainly would like to just use the car. BUT no one has been able to help me make ACF plugin to work on the frontend. ACF has me going to bbpress and bbpress has me going to ACF. (The code that is working great on the backend I have not been able to work on the front end. Spent hours upon hours trying to this.

    What I do not understand is why an admin/moderator would ever want a topic to fall under the category of no forum. If nothing else I will figure out a way to just make it so the first option has no words so the poster sees it looks strange, and/or find a way to add additional text below it to tell them to choose the Fishing Report Forum. (I will be giving each new user an instruction pages but I can see many topics going into la la land.

    Thanks for what you do at the kitchen table. I will deal with the train. 🙂

Viewing 25 replies - 1 through 25 (of 48 total)