Deniweb Posted April 28, 2021 Share Posted April 28, 2021 Hello, I followed these directions from katamaze to insert a column with the icon directed to the plesk or cpanel panel on my service list. (look attach image). Unfortunately, a part of the code for how to insert icons and links to panels is missing. See below, I also reported this to katamaze but got no answer. Can you help me solve? Thank you Managing multiple accounts can be frustrating for customers. The following hook makes things easier by allowing you to access any control panel directly from the My Services section. Here is a preview. The hook works with any control panel (cPanel, Plesk, DirectAdmin, Centova Cast, Cloudmin ...) provided that the servers and products / services have been correctly integrated. Before getting the code, keep in mind that the hook requires some changes to a template file. Open templates / {YOUR_TEMPLATE} /clientareaproducts.tpl and add the new Manage column in thead as follows. {$ LANG.orderproduct} {$ LANG.clientareaaddonpricing} {$ LANG.clientareahostingnextduedate} {$ LANG.clientareastatus} {$ LANG.manage} Your thead may be slightly different (e.g. in the first column you may have the SSL certificate checker) so apply the change accordingly. Then move to the tbody and add the cell right inside the {foreach} loop. {if $ kt_autologin [$ service.id]} ****missing code **** {/ if} We recommend replacing the Click to Login text with a $ LANG variable for multi-language support. Now we just have to turn off the sorting for the newly added column. At the top of the file you find the following string. {include file = "$ template / includes / tablelist.tpl" tableName = "ServicesList" noSortColumns = "4" filterColumn = "3"} Focus on noSortColumns = "4". 4 means that the fifth column cannot be sorted (the column count starts from zero). Edit it accordingly. For example, if in your template in the first column you have the SSL certificate checker, you will write noSortColumns = "0, 5". 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 29, 2021 Share Posted April 29, 2021 22 hours ago, Deniweb said: Can you help me solve? use the English version of the blog post... 😎 https://katamaze.com/blog/32/whmcs-action-hooks-example#cpanel-plesk-login-button-in-my-services Quote The hook works with any panel (cPanel, Plesk, DirectAdmin, Centova Cast...) provided that servers and products/services have been integrated correctly. Before you get the code, keep in mind that this action hook requires some changes to a template file. Open templates/{YOUR_TEMPLATE}/clientareaproducts.tpl and add the new Manage column in thead like follows. <thead> <tr> <th>{$LANG.orderproduct}</th> <th>{$LANG.clientareaaddonpricing}</th> <th>{$LANG.clientareahostingnextduedate}</th> <th>{$LANG.clientareastatus}</th> <th>{$LANG.manage}</th> <th class="responsive-edit-button" style="display: none;"></th> </tr> </thead> Your thead could be slightly different (eg. your first column could be the SSL icon check) so change things accordingly. Next move to tbody and add the cell right inside {foreach} loop. <td class="text-center"> {if $kt_autologin[$service.id]} <div class="btn-group btn-group-sm plesk-login" style="width:60px;"> <a href="clientarea.php?action=productdetails&id={$service.id}&autologin=1" target="_blank" class="btn btn-primary btn-xs" alt="Click to Login" title="Click to Login" style="padding: 2px 5px;"><img src="templates/{$template}/img/katamaze_autologin/{$kt_autologin[$service.id]->type}.png" style="height:22px; max-width:39px"> <i class="fa fa-sign-in fa-fw" aria-hidden="true"></i></a> </div> {/if} </td> We suggest you to replace Click to Login with $LANG variable for multi-language support. Now we need to disable sorting for the newly added column. On top of the file you'll find the following statement. {include file="$template/includes/tablelist.tpl" tableName="ServicesList" noSortColumns="4" filterColumn="3"} Focus on noSortColumns="4". 4 means that the 5th column will be not sortable (column count start from zero). Change it accordingly. For example if your template uses the SSL check as 1st column, use noSortColumns="0, 5". 0 Quote Link to comment Share on other sites More sharing options...
Deniweb Posted April 29, 2021 Author Share Posted April 29, 2021 Thank you for your quick answer, Where do I find the button icons for plesk.png and cpanel.png? Thank you. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 30, 2021 Share Posted April 30, 2021 20 hours ago, Deniweb said: Where do I find the button icons for plesk.png and cpanel.png? I assume Kian made them himself - it wouldn't be that difficult to find the logos online.... perhaps PM Kian and ask him for the icons if you don't want to make them yourself. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted April 30, 2021 Share Posted April 30, 2021 I always forgot to include the zip with images. https://github.com/Katamaze/WHMCS-Free-Action-Hooks/files/5320899/katamaze_autologin.zip 2 Quote Link to comment Share on other sites More sharing options...
Deniweb Posted July 13, 2021 Author Share Posted July 13, 2021 Hello, Thanks to your indications, the added buttons worked until a few days ago, then suddenly from the Cpanel buttons (see attachment) I no longer access the relative cpanel but sends me to the whmcs home page. From the Plesk buttons instead I normally access the various Plesk. What happened ? It may have been some update or I have changed something without realizing it. ?? Thank you. 0 Quote Link to comment Share on other sites More sharing options...
Nguyen Tien Minh Posted July 23, 2021 Share Posted July 23, 2021 Why i can't setup it??? It load load and load Please help me! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.