Hi guys,
first of all I wanna thank you for this awesome Template! I tested many Templates and from my point of view you are the best for publishers!
I’m in contact to the guys of CREO – the developers of the famous plugin Easy Social Share Buttons for WordPress (Link: https://codecanyon.net/item/easy-social-share-buttons-for-wordpress/6394476?_ga=1.3113783.606252969.1489390028). Now we need your help to get an excellence solution.
Here the correspondence:
Me:
Hi Guys,
is there a possibility to let only logged-in users print with the print button? That would be perfect!
So the function has to be:
Logged-In User: Click on “Print”-Button = anything works as usual with printfriendly-function.
Not logged-In User: Click on “Print”-Button = redirect to an LogIn-URL.
________
Got this answer from appscreo (AUTHOR) on my envato comment:
Hello,
Technically this can be made but you will need to apply a tiny piece of code. Contact our support team and they will provide instructions how to do it http://support.creoworx.com
________
I would be so thankful for your help.
Cheers
Alex
CREO:
Hello Alex,
The change is not hard and here is how you need to make it. Please open file easy-social-share-buttons3/lib/core/essb-button-helper.php and search for that code:
case 'print' :
$url = "#";
$api_command = "essb_print('" . $salt . "'); return false;";
break;
modify that code to looks like this
case 'print' :
if (is_user_logged_in()) {
$url = "#";
$api_command = "essb_print('" . $salt . "'); return false;";
}
else {
$url = 'http://login.url/page';
$api_command = "return true;";
}
break;
Me:
Hi Support,
thanks for your fast answer. I tested your code and I was wondering why it doesn’t work. In my settings the function print friendly is on. So I took your code and applied it to the print friendly part. Now it works.
Is my code correct from your point of view?
case "print_friendly" :
if (is_user_logged_in()) {
$url = sprintf ( 'http://www.printfriendly.com/print/?url=%1$s', $share ['url'] );
}
else {
$url = 'http://domain.de';
$api_command = "return true;";
}
break;
One last question to get an excellence solution:
On my site there is an very nice function with a Login overlay.
You can see it when you click “Anmelden/Beitreten” in the top-menu (on black background) on my test environment:
http://wordpress.p391127.webspaceconfig.de/
Can you help me to put this click-function in the creoworx-code? So to get the nice overlay instead of switching the site with $url = ‘http://domain.de’ – when the unser in not logged in?
I would be so happy.
Cheers
Alex
CREO:
Hello Alex,
Code is correct – I forgot that you may use printfriendly as service.
The $api_command variable is set to provide a bridge to javascript function call. You need to ask theme author or plugin author that generates that form for possible function call that can initiate the overlay. Once you get the function call I will modify the code to call it.
Rayan
So I would be so thankful if you can help us.
Thanks
Alex
Hello,
Sorry but we have not tested the mentioned plugin so we have no way of knowing if it will work properly or not with our theme. We only tested these plugins: https://www.screencast.com/t/qvTNio2OP Anything beyond that list is used on the user’s own risk and is not covered by the theme support. Sorry but we will not be able to help with the plugin implementation you require. As I can see the plugin author already provided the implementation method needed. If you cannot add the code as suggested we recommend hiring a developer/freelancer to help out as customization such as this is not covered by the thee support.
Thank you for your understanding.
Hi Bogdan,
thanks for your fast answer.
I totally understand that you can’t give support for all plugins.
In our case we just need a tiny php code snippet from you that gives us the possibility to call the nice looking login-overlay (PopUp) in the Newspaper-template. It’s there, we just have to know how to call it via php.
Honestly, I’m really a big fan of the Newspaper-Template and we need min two more licenses for the next projects.
Please take a step towards me. We really need this tiny code.
Thanks
Alex
Hello,
The plugin author seems to need the function call for the theme login. Unfortunately this is added with javascript so there is no php function. You can find the login modal code here: https://www.screencast.com/t/aUBkM6AUj0 The code for the login modal is found in this file: https://www.screencast.com/t/21gm5DcV
Maybe this topic will also help as it provides a solution in adding a social login to the login modal:
https://forum.tagdiv.com/topic/want-social-login-short-code-on-login-page/
https://forum.tagdiv.com/topic/social-login-pushes-signup-button-out-of-view/
I hope this helps.
Thank you!
Hello Bogdan,
many thanks for your help.
I got this message from the Plugin guys:
______________________
Hello Alex,
I review the code (we have license of theme). The code is made in way that does not allow to assign it on the button (or at least without modifying in deep plugin code.
I suggest for now to leave it as it is (the code inside javascript does not have function call that can be used to initiate the login dialog on click – it is assigned to specific classes only).
Rayan
______________________
Ok, it seems to be hard to have this solution.
Now I’m creating a page with a button to login. (to make it easy for our fans and readers to register/login)
I’d like to use your Button Shortcode: [button color=”” size=”” type=”” target=”” link=””][/button]
Can you help me to call the Login Overlay (login popup) with this Button Shortcode?
You are my last chance.
Hopefully
Alex
Hi,
The easiest way to set the theme login in the page structure would be like the solution provided in this topic
– https://forum.tagdiv.com/topic/login-modal/
This way you can place the element where you would like in the page, and login from there while also having the option to add an extra class – https://www.screencast.com/t/A8GMvL9Ap to this element to further style it, or use the design options – https://www.screencast.com/t/Webnalj6F – https://www.screencast.com/t/V3NKg78v to make it look like a button.
Thanks