Posts by OriginalEXE

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Hi guys and gals, I’m working on my new theme and I need frontend image upload functionality.

Since I don’t want to bother with creating a custom solution, it would be handier to use the awesome new WP Media Uploader.

But here comes the trouble, it’s undocumented, and I’ll be honest to say that my js skills are not as good as php ones.

So what I’m trying to do is restrict the user to viewing only images that belong to him when he clicks on Media Library in modal window.

Now, I was digging through media-views.js and apparently, there is no such filter, you can pass some query filters like type, but author is not within them.

So, I had to hack the solution and I did it, but since it’s a hack, I would like more to use proper solution.

Here is my solution:

JS part, this is parameter for wp.media:
library  : {
    type: 'image',
    uploadedTo: 987654321
},

and then php part:

add_action( 'parse_query', 'you_no_author_filter' );

function you_no_author_filter( $wp_query_obj ) {

    if ( ! is_user_logged_in() )
        return;

    global $current_user;

    if ( $wp_query_obj->get( 'post_parent' ) == 987654321 ) {

        $wp_query_obj->set('post_parent', 0 );
        $wp_query_obj->set('author', $current_user->ID );

    } 

}

Would appreciate better solutions, thanks.

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Hi, maybe something like this: http://codecanyon.net/item/sticky-widget-areas-reloaded/4240198

It’s not really related to ads, but widgets can hold any content you need.

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Don’t worry BittLoader, they ARE here and they ARE perfectly aware of the thread and the problem. In other threads requiring staff reply they are active on the 4th minute!!! @OriginalEXE: I am afraid it’s not funny and not the best thing to make jokes with at the moment!
Relax, this might be a lesson for everyone to improve their funds management.

You are in the real world, you should not rely only on the next payment, you never know what might happen.

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Ok guys just heard back from Envato, all your money will go to me this month, sorry, more luck next month :evilgrin:

Seems like only PayPal guys are receiving funds on time.

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Here you go, my full class:

http://pastebin.com/guit7qf6

I integrated some methods, code should be pretty obvious.

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

I use this excellent solution: https://github.com/MatthewRuddy/Wordpress-Timthumb-alternative though slightly modified to remove compatibility with WordPress < 3.5

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

Soft reject… the approval is close, i can smell it! :-) Thanks again for your input, hopefully next upload will be the good one!

Great to hear, soft rejection is a good sign :)

Good luck!

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says

They don’t want you to affect 3rd party plugins but the code I linked to only affects your own shortcodes, so it should be accepted with no problems.

1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says


Check this out: https://gist.github.com/bitfade/4555047
That is basically doing the same thing, so why would that pass and the one I am doing not?
There is one big difference, your code affects all shortcodes, but with the code I linked you have the control over what shortcodes get “cleaned”
1565 posts
  • Affiliate Level 2
  • Author Level 5
  • Collector Level 2
  • Featured Author
+2 more
OriginalEXE
says
by
by
by
by
by
by