selycha
Forum Replies Created
-
Forum: Plugins
In reply to: [Post Pay Counter] Add more basic payments / Basic payment for a categoryWow,
fast work thanks! 🙂 I’ll give it a try 😉
Bests,
Forum: Plugins
In reply to: [Post Pay Counter] Add more basic payments / Basic payment for a categoryHey :),
that’s great news! I’ll be looking forward to it. If you don’t mind, I would share the temporary workaround to multiple basic payments I made since I needed a solution right away. It can come in handy for someone.
**PLEASE KEEP IN MIND THAT THIS IS A WORKAROUND NOT a permanent solution and don’t forget to delete it and update to the latest version when ready**
I decided to use a custom taxonomy, since the payment categories are usually not the same as the post categories and it could be a headache if you would need to add for example three new categories (pay1, pay2, pay3) which would then be visible to the readers on the frontend.
SOLUTION(dont forget to change the taxonomy ‘type’ and the terms ‘pay1’, ‘pay2’, ‘no_pay’ and keep in mind that these are the “slugs” not the “names” of the terms):
I adjust the basic payment(for correct display in stats), but also the total payment. The different basic payments are calculated based on the one set in the options. So that in my example my basic payment is 4 in the options, but I want 6 for the ‘pay1’ posts so I increase the basic payment by +2. Change this amount as you please.
The ‘no_pay’ posts are posts, which I don’t want to pay for – so I set the amount to 0.
The ‘default’ is for posts for which I want to pay the basic payment set in the plugin options.
1. set a default basic payment in the plugin options
2. (FTP)Go to the plugin directory > post-pay-counter > classes
3. Open the file “ppc_html_functions_class.php” in a text editor
4. Look for the function “data2cash” and go to the line with “$single->ppc_count = $post_countings;”
5. Between this line and the line “$single->ppc_payment = $post_payment[‘ppc_payment’];” add the folowing code:/* Adjust basic payment based on custom taxonomy "type" */ $post_terms = get_the_terms( $single->ID , 'type' ); if ( $post_terms && ! is_wp_error( $post_terms ) ) { foreach($post_terms as $term) { switch ($term->slug) { case 'pay1': $post_payment['ppc_payment']['normal_payment']['basic'] = $post_payment['ppc_payment']['normal_payment']['basic'] + 2; $post_payment['ppc_payment']['normal_payment']['total'] = $post_payment['ppc_payment']['normal_payment']['total'] + 2; break; case 'pay2': $post_payment['ppc_payment']['normal_payment']['basic'] = $post_payment['ppc_payment']['normal_payment']['basic'] + 4; $post_payment['ppc_payment']['normal_payment']['total'] = $post_payment['ppc_payment']['normal_payment']['total'] + 4; break; case 'no_pay': $post_payment['ppc_payment']['normal_payment']['basic'] = 0; $post_payment['ppc_payment']['normal_payment']['total'] = 0; default: break; } } }Hope this helps someone. Enjoy.
Forum: Plugins
In reply to: [Post Pay Counter] Add more basic payments / Basic payment for a categoryThanks,
unfortunately, thats not a solution for me right now :). Can you at least point me to a function, where I can check for the post category and based on that add som ammount to the payment of the post?
Or would it be possible to add a filter, which would go through the authors posts after the PPC has counted the payment and add specific ammounts for posts which are in the categories I am looking for, so that the final payment would be basically the same as if there would be more basic payment ammounts?
– I am new to wordpress core functionality and filters / actions, thats why I’m asking.If we could write a quick filter for this, it could be a temporary solution for many people until later addons would arive.
Thanks again 😉
Forum: Fixing WordPress
In reply to: Automatic image import for wrong / old URLs and URL fixThanks for your answer. It was just an example. My actual problem is, that we had a site on a subdomain, where the images are still being uploaded, but we moved the site to another domain. So the images are still linked to the folder in the subdomain.
I need to install an SSL certificate but I get an error for linking images from a site with a different protocol. That is why I need to fix the images.
Will copying the images in the current folder with the same structure and updating the URLs through a query work?
Thanks
Forum: Fixing WordPress
In reply to: "Open in new tab" opens links in the current and also a new tabThank you MarkRH,
now we have at least some direction to search. I’ll check the plugins and try to discover what exactly is causing this.