zekinha
Forum Replies Created
-
Forum: Plugins
In reply to: [3DPrint Lite] Email quotes not workingThank you!
Forum: Plugins
In reply to: [Admin Custom Login] Captcha not showingHi, apologies on the delay getting back to you.
What happen is, if I activate the captcha on the backend (which works for the admin page https://www.site.com/admin), it works as it should.
However, when the user tries to login (without admin previleges) on the front end, the site gives an error saying that the captcha was not solved. the problem is, there is no captcha showing to the user to solve.
Does it make sense? Sorry it’s a bit confusing to explain.Forum: Plugins
In reply to: [3DPrint Lite] Email quotes not workingApologies on the delay. I just sent you and email with the details. Thanks.
Forum: Plugins
In reply to: [3DPrint Lite] Email quotes not workingBy the way, as Admin I receive the price enquiry sent by the plugin on the front page. So this also proves the emails are working (?).
Forum: Plugins
In reply to: [3DPrint Lite] Email quotes not workingHi, I just tried that plugin and the email is working fine.
I have the plugin in two different sites (for testing purposes), and in one of them, when I hit the “Email Quotes” button the request disappears from the “Price Requests” tab. On the other site it remains there… weird..
When I press the “Email Quotes” button, there is no message of error or success, the page only refreshes. Should I have a message giving feedback of the action?
Any other idea to get this working? I know this worked weeks ago, and the only thing I made was to update the plugins and the WordPress itself.
Thanks
Hi @georgian Cocora
Thank you for your help and apologies for the very long delay getting back to you. Some stuff happen in my life that I don’t want to publicly share here.
Going back to the problem…
I put this script in my functions.php file inside my theme folder.
function pmsc_enqueue_ads_script() { if (is_user_logged_in() && function_exists('pms_get_member_subscriptions')) { $user_id = get_current_user_id(); if ($user_id != 0) { $subscription = pms_get_member_subscriptions(array('user_id' => $user_id)); if (!empty($subscription) && (!empty($subscription[0]->expiration_date) && time() <= strtotime($subscription[0]->expiration_date))) return; else wp_enqueue_script('adsense-js', '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'); } } wp_enqueue_script('adsense-js', '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'); } add_action( 'wp_enqueue_scripts', 'pmsc_enqueue_ads_script' );
From my very little coding knowledge, this is what I think its happening:
If the user is logged in and the funcion member subscriptions exists, then get the user ID. If the user ID is not 0, check their subscription. If the subscription does not exist (empty) then cancel (return), else load the advertising from Google Adsense.Is this correct?
Then, I created a test adsense code that will place an ad or a pink color so I know it’s working.
That piece of Adsense code I tried to put in a page description, let’s call it “Software”.
Note: the “Display for” option is selected for “Logged in users”, “No ads” plan that I created.
So when I go to the Software page:
Scenario 1: Loading the Software page without bein logged in, does NOT show an ad, just shows the custom message for logged-out users. (should show ad)
Scenario 2: Loading the Software page with a simple user logged in, does NOT show an ad, just shows the custom message for logged-in non-members users. (should show ad)
Scenario 3: Loading the Software page with a user with a “noAds” membership, does SHOW an ad. (should NOT show ad to users with membership)
Any sugestion on what am I doing wrong? Should I put the ad script in other place?
Thanks in advanced.
Hi Georgian, I was trying to make this work but I am a bit confused…
So, the Adsense code I have is this:
<script type="text/javascript">// <![CDATA[ google_ad_client = "ca-pub-7012782425415437"; /* MyAdsName */ google_ad_slot = "4420796155"; google_ad_width = 468; google_ad_height = 60; // ]]></script><script src="https://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">// <![CDATA[ // ]]></script>
So, only one <script> tag as you said.
Now, my question is, where do I put my Adsense code and where do I put the code you provided?
Do I put the code on the textarea (when we edit a page or post) or on the “custom messages” area? Or somewhere else?
Thank you.
ZekinhaHi, Thank you very much for your reply.
I am currently away from my computer, but as soon as I can I will try it and let you know how this went.Regards.
Hi @georgian Cocora,
Thanks for your reply.
I just used a plugin to try to make the ad work (but it didn’t).
Let’s forget about the plugin for the ads. I will try again to explain better to make myself clear.
I have a Google Adsense account, and I wanted to show ads only to NON members, and hide it to members.
The ad code that Google provides is something like this:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Homepage Leaderboard --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-1234567890123456" data-ad-slot="1234567890"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
Source: https://support.google.com/adsense/answer/181950?hl=en
How can I make this with your members plugin? Is it possible?
Regards,