Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter serks

    (@serks)

    Ok great.

    Do I need to create the Subscription plans in Paypal? Or is the subscription managed by Woocommerce Subscriptions?

    Thanks

    Thread Starter serks

    (@serks)

    Thank you for your quick response.
    I am referring to the Payment Plugin for Paypal version.

    Thread Starter serks

    (@serks)

    Ok I have found my problem…
    I was using the following code on my site to reorder the custom post type in my admin.

    add_filter("posts_orderby", "reorder_cpt", 10, 2);
    function reorder_cpt($orderby, &$query){
        global $wpdb;
        //figure out whether you want to change the order
        if (get_query_var("post_type") == "custom_post_type") {
             return "$wpdb->posts.post_title ASC";
        }
        return $orderby;
    }

    Turns out it was messing with the entire site and not just the admin listings.

    I can now confirm that changing the order settings in the Results Page Settings of the WPQSF form does indeed work as it should.

    Yasp0, take a look to see if you have any other functions elsewhere in your code that could be messing with the query’s order.

    Thanks

    Thread Starter serks

    (@serks)

    Yes, I can also verify that using the settings in the form settings page does not work.
    Both orderby and ascending/descending settings have no effect.

    I had already tried those settings before I created this topic but I just assumed that these settings were only for the default search template and not for ajax which is why I didn’t mention it earlier.

    Any other ideas?
    Thanks for quick response.

    Thread Starter serks

    (@serks)

    Unfortunately the site is in development and the url is not accessible at this point.

    But I will try to give you some more information and hopefully you can point me in the right direction…

    Basically, I load the page and everything is fine.
    I am loading the form with the following line of code…
    <?php echo do_shortcode('[ULWPQSF id=122 button=0]');?>

    Now I have a few other filters with checkboxes and radio etc….they all work fine.

    I check a box, and the correct posts are displayed.
    I select a radio and all the correct posts are displayed.

    I type a word into the search field (one that I know exists in the list of posts), and the correct posts display for a split second, then disappear.
    If I then just click within the field again and just press enter (without clearing the previous word), this time the correct post is displayed and does not disappear.

    If I then search for a new word, the same thing happens (displayed for split second and then disappears). And just like before, if I just place the cursor back into the search field and press enter a second time (without changing the word), the filter works and the posts are displayed without disappearing.

    I have inspected for errors (using chrome inspect tools) and there are none at all.

    Here is something weird though…
    When I try searching a word the first time, the console displays the following…
    sidebar uwpqsfscript.js?ver=1.0:31
    uwpqsffrom_122 uwpqsfscript.js?ver=1.0:31

    If I then try the second time, one more line is added so the console looks like this…
    sidebar uwpqsfscript.js?ver=1.0:31
    uwpqsffrom_122 uwpqsfscript.js?ver=1.0:31
    sidebar uwpqsfscript.js?ver=1.0:31

    Then if I try a new word, it looks like this…
    sidebar uwpqsfscript.js?ver=1.0:31
    uwpqsffrom_122 uwpqsfscript.js?ver=1.0:31
    (2) sidebar uwpqsfscript.js?ver=1.0:31
    uwpqsffrom_122 uwpqsfscript.js?ver=1.0:31

    So it seems that the line with ‘uwpqsffrom_122’ is causing the problem.

    Also, if I click on ‘uwpqsfscript.js?ver=1.0:31’, the line that the console cursor goes to is…
    var formid = $obj.parent().parent().attr('id'); console.log(formid);

    Just incase you were wondering, I am using Salient theme, but as mentioned, no errors exist upon inspection.

    Any ideas?
    Thanks

    Thread Starter serks

    (@serks)

    Hi TC.K,
    Thank you for quick response and apologies for not looking into it before posting.
    I tried the parameter and it works great except for one thing…

    I have included a search field in my form, so when I type something in the search form and press enter, it does the search, but a second after displaying the results, it all goes away and there is a message that reads ‘There is error here’.

    Then, if I select one of the options, it works again.

    Why could this be happening?

    Thanks

    Thread Starter serks

    (@serks)

    Thank you so much for your response.
    Worked flawlessly!

    Here’s my final code for anyone else wanting to do the same thing…

    add_action('uwpqsf_form_top','add_hidden_id');
    function add_hidden_id($att){
    //get the current post id
    global $post;
    $id = $post->ID;
    echo '<input type="hidden" name="thepostid" value="'.$id.'">';
    }
    
    add_filter('uwpqsf_query_args','injecting_custom_arg','', 4);
    function injecting_custom_arg($args, $id,$getdata){
    //$getdata is like $_GET or $_POST, so you can use it to get the value from instructor.
    
        //On single instructor page
        if($id == '125') {
            if(isset($getdata['thepostid'])) {
                $args['meta_key'] = 'instructor';
                $args['meta_value'] = $getdata['thepostid'];
            }
        }
    
        //On Single Site page
        if($id == '191') {
            if(isset($getdata['thepostid'])) {
                $args['meta_key'] = 'site';
                $args['meta_value'] = $getdata['thepostid'];
            }
        }
    
        return $args;
    }

    Thanks again!

    Thread Starter serks

    (@serks)

    Thanks for the simple suggestion pmcvicker.

    If I need to deploy before Paul rolls out the next release, think I will surely use your method. After the user accepts the achievement, they can always click ‘back’ and go back to the page they were on. Easy fix that avoids the confusion.
    Cheers 🙂

    Thread Starter serks

    (@serks)

    Will do.
    I am going to work on other parts of my site for now and come back to it when the next release of Achievements is out, so I will let you know then.

    Thread Starter serks

    (@serks)

    OK heres my extension file for BP Media…
    Not saying all these actions would be useful but I threw most of them on the list anyway. Bare in mind that I haven’t tested any of the actions except the first one which is just to add media. Also, I don’t know exactly what all of them do.

    <?php
    /**
    * Extension for BP Media
    *
    * This file extends Achievements to support actions from BP Media
    *
    * @package Achievements
    * @subpackage ExtensionBPMedia
    */

    // Exit if accessed directly
    if ( ! defined( ‘ABSPATH’ ) ) exit;

    /**
    * Extends Achievements to support actions from BP Media.
    *
    * @since Achievements (3.0)
    */
    function dpa_init_bpmedia_achievements_extension() {
    achievements()->extensions->bpmedia_achievements = new DPA_BPMedia_Extension;

    // Tell the world that the Invite Anyone extension is ready
    do_action( ‘dpa_init_bpmedia_achievements_extension’ );
    }
    add_action( ‘dpa_ready’, ‘dpa_init_bpmedia_achievements_extension’ );

    /**
    * Extension to add BP Media support to Achievements
    *
    * @since Achievements (3.0)
    */
    class DPA_BPMedia_Extension extends DPA_Extension {
    /**
    * Constructor
    *
    * Sets up extension properties. See class phpdoc for details.
    *
    * @since Achievements (3.0)
    */
    public function __construct() {
    $this->actions = array(

    ‘bp_media_after_add_media’ => __( ‘A user adds media.’, ‘dpa’ ),
    ‘bp_media_after_update_media’ => __( ‘A user updates media.’, ‘dpa’ ),
    ‘bp_media_after_delete_media’ => __( ‘A user deletes media.’, ‘dpa’ ),

    ‘bp_media_after_add_album’ => __( ‘A user adds an album.’, ‘dpa’ ),
    ‘bp_media_album_updated’ => __( ‘A user updates an album.’, ‘dpa’ ),
    ‘bp_media_after_delete_album’ => __( ‘A user deletes an album.’, ‘dpa’ ),
    ‘bp_media_after_edit_album’ => __( ‘A user edits an album.’, ‘dpa’ ),
    ‘bp_media_album_actions’ => __( ‘A user does anything with albums? – NOT SURE’, ‘dpa’ ),

    ‘bp_media_no_activity_entry_meta’ => __( ‘bp_media_no_activity_entry_meta – NOT SURE’, ‘dpa’ ),
    ‘bp_media_add_media_fields’ => __( ‘bp_media_add_media_fields – NOT SURE’, ‘dpa’ ),

    ‘bp_media_after_privacy_install’ => __( ‘A user saves privacy settings?? – NOT SURE’, ‘dpa’ ),

    ‘bp_activity_entry_content’ => __( ‘bp_activity_entry_content – NOT SURE’, ‘dpa’ ),
    ‘bp_media_after_content’ => __( ‘bp_media_after_content – NOT SURE’, ‘dpa’ ),
    ‘bp_activity_entry_meta’ => __( ‘bp_activity_entry_meta – NOT SURE’, ‘dpa’ ),
    ‘bp_activity_entry_comments’ => __( ‘bp_activity_entry_comments – NOT SURE’, ‘dpa’ ),
    ‘bp_after_activity_entry_comments’ => __( ‘bp_after_activity_entry_comments – NOT SURE’, ‘dpa’ ),

    );

    $this->contributors = array(
    array(
    ‘name’ => ‘rtCamp’,
    ‘gravatar_url’ => ‘http://www.gravatar.com/avatar/4993b3f73938e314bb88c5003a343831&#8217;,
    ‘profile_url’ => ‘http://profiles.wordpress.org/rtcamp/&#8217;,
    ),
    );

    $this->description = __( “BuddyPress Media adds Photos, Music, Videos & Albums to your BuddyPress powered social network.”, ‘dpa’ );
    $this->id = ‘buddypress-media’;
    //$this->image_url = trailingslashit( achievements()->includes_url ) . ‘admin/images/invite-anyone.jpg’;
    $this->name = __( ‘BuddyPress Media’, ‘dpa’ );
    //$this->rss_url = ‘http://teleogistic.net/feed/&#8217;;
    //$this->small_image_url = trailingslashit( achievements()->includes_url ) . ‘admin/images/invite-anyone-small.jpg’;
    $this->version = 1;
    $this->wporg_url = ‘http://wordpress.org/plugins/buddypress-media/&#8217;;

    }
    }

    Hope this was helpful
    Thanks 🙂

    Thread Starter serks

    (@serks)

    Oh ok Paul 🙂
    Any ideas on how long before the next version is released?

    Otherwise, is there any quick way this could be avoided as it could be quite annoying for a user who doesn’t click on the ‘View Achievement’ button, clears the pop up and continues to navigate through the site, not knowing that he/she must visit the achievements page to stop the pop up?

    Thanks

    Thread Starter serks

    (@serks)

    Hi Paul,
    Thanks so much for your quick response.

    Using your instructions, I have managed to get an action onto the actions list in the admin. Just to keep things simple for now, I only added one do_action() which is basically when a user adds media. I have set it to ‘2’ for number of times before it unlocks. So far so good.

    Problem…
    I go to frontend and upload 2 items, upon which it successfully unlocks the achievement 🙂 Great, however, after the achievement is unlocked, the ‘unlock’ pop up comes up on every page I visit on the site. So if I go the home page, or any other page, the ‘Achievement Unlocked’ pop up comes up again and again on every page, UNTIL I visit the ‘Achievements’ menu item in my profile navigation. After I visit this ‘Achievements’ page, the pop up stops showing up on every page.
    Hope this makes sense.

    Here is the code for the extension file…you’ll notice I didn’t change everything from the invite only extension ie. contributors, description etc. I just want to get it working first and I assume that stuff isn’t too important for now. I also got rid of the last part (user_id) as I noticed a couple of the other extensions didn’t include it.

    <?php
    /**
     * Extension for BP Media
     *
     * This file extends Achievements to support actions from BP Media
     *
     * @package Achievements
     * @subpackage ExtensionBPMedia
     */
    
    // Exit if accessed directly
    if ( ! defined( 'ABSPATH' ) ) exit;
    
    /**
     * Extends Achievements to support actions from BP Media.
     *
     * @since Achievements (3.0)
     */
    function dpa_init_bpmedia_achievements_extension() {
    	achievements()->extensions->bpmedia_achievements = new DPA_BPMedia_Extension;
    
    	// Tell the world that the BP Media extension is ready
    	do_action( 'dpa_init_bpmedia_achievements_extension' );
    }
    add_action( 'dpa_ready', 'dpa_init_bpmedia_achievements_extension' );
    
    /**
     * Extension to add BP Media support to Achievements
     *
     * @since Achievements (3.0)
     */
    class DPA_BPMedia_Extension extends DPA_Extension {
    	/**
    	 * Constructor
    	 *
    	 * Sets up extension properties. See class phpdoc for details.
    	 *
    	 * @since Achievements (3.0)
    	 */
    	public function __construct() {
    		$this->actions = array(
    			'bp_media_after_add_media' => __( 'A user adds media.', 'dpa' ),
    		//	'sent_email_invite'     => __( 'The user invites someone else to join the site.', 'dpa' ),
    		);
    
    		$this->contributors = array(
    			array(
    				'name'         => 'Boone Gorges',
    				'gravatar_url' => 'http://www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c',
    				'profile_url'  => 'http://profiles.wordpress.org/blackphantom/',
    			),
    			array(
    				'name'         => 'CUNY Academic Commons',
    				'gravatar_url' => 'http://www.gravatar.com/avatar/80c3fc801559bbc7111d5e3f56ac6a4c',
    				'profile_url'  => 'http://profiles.wordpress.org/cuny-academic-commons/',
    			),
    		);
    
    		$this->description     = __( "Makes BuddyPress&rsquo;s invitation features more powerful.", 'dpa' );
    		$this->id              = 'bpmedia_achievements';
    		$this->image_url       = trailingslashit( achievements()->includes_url ) . 'admin/images/invite-anyone.jpg';
    		$this->name            = __( 'BP Media', 'dpa' );
    		$this->rss_url         = 'http://teleogistic.net/feed/';
    		$this->small_image_url = trailingslashit( achievements()->includes_url ) . 'admin/images/invite-anyone-small.jpg';
    		$this->version         = 1;
    		$this->wporg_url       = 'http://wordpress.org/extend/plugins/invite-anyone/';
    
    //		add_filter( 'dpa_handle_event_user_id', array( $this, 'event_user_id' ), 10, 3 );
    	}
    
    	/**
     	 * For the accepted_email_invite action from Invite Anyone, get the user ID from the function
     	 * arguments as the user isn't logged in yet.
    	 *
    	 * @param int $user_id
    	 * @param string $action_name
    	 * @param array $action_func_args The action's arguments from func_get_args().
    	 * @return int|false New user ID or false to skip any further processing
    	 * @since Achievements (3.0)
    	 */
    //	public function event_user_id( $user_id, $action_name, $action_func_args ) {
    //		if ( 'bp_media_after_add_media' != $action_name )
    //			return $user_id;
    //
    //		return (int) $action_func_args[0];
    //	}
    }

    Any assistance would be greatly appreciated.
    Thanks Paul

Viewing 12 replies - 1 through 12 (of 12 total)