Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

1 Follower

About cdeese8

  • Rank
    Senior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. How do I "check" $vars['filename'] or check the url? I've browsed a few topics on the forums and noticed Brian! shared a few snippets.... $filename = APP::getCurrentFileName(); if ($filename=="clientarea" && $_GET['action']=="details"){ or if (APP::getCurrentFileName() == 'clientarea' && $_GET['action'] == 'details'){
  2. I believe it, absolutely. I was not able to "control the positioning" of the above shared snippet. I was hoping to be able to add a hook on a specific page too, maybe inside one of those .tpl files. So it looks like best way to add PHP code is to use a hook. BUT, if using a hook, how do we control the exact page to display the code on? Or even make it so I can re-use the code using one of those smarty shortcodes? Thanks for everything and the help too btw, very nice!
  3. What's the best way to add a snippet of PHP inside a .tpl file? It looks like everybody recommends against using the {php}{/php} bracket for security reason. Should I be creating my .php snippet file in root WHMCS directory and just using include to beam it in? {php} include "my-php-snippet.php"; {/php} I'm looking to "add recent wordpress posts to non wordpress site" and they all involve adding php snippet to include the wp-load.php file. It'd be cool if I can avoid using an <iframe> too. This is the snippet I'd like to add a .tpl page: <?php // Include the wp-load'er include('/public_html/wordpress/wp-load.php'); // Get the last 10 posts // Returns posts as arrays instead of get_posts' objects $recent_posts = wp_get_recent_posts(array( 'numberposts' => 10 )); // Do something with them echo '<ul>'; foreach($recent_posts as $post) { echo '<li><a href="', get_permalink($post['ID']), '">', $post['post_title'], '</a></li>'; } echo '</ul>'; ?> * whmcs 7.4 is installed on root domain, and the wordpress site is installed in a subfolder * https://davidwalsh.name/wordpress-recent-posts * https://www.webmoves.net/blog/web-design-development/display-wordpress-posts-outside-of-wordpress-3081/
  4. A quick and dirty hack is to use CSS - https://www.w3schools.com/css/css_display_visibility.asp Another thought is to use a hook to remove data on specific page * https://developers.whmcs.com/hooks/ * https://duckduckgo.com/?q=site%3Awhmcs.community+hook+remove+data
  5. I reckon you would just want him to have FTP credentials. If you want to invest more time, you could always just backup your entire WHMCS setup, and developer could do everything local (offline) and not even need to mess around with anything live. BUT, maybe the budget doesn't warrant all that extra setup time. My typical flow is to just use Cyberduck to connect to the VPS hosting WHMCS and I right click edit files to make live changes on save. You could always snag a dev license and just setup an entire new instance on a subdomain or something too: https://www.whmcs.com/members/index.php/knowledgebase/78/What-is-a-development-license-How-do-I-get-one.html
  6. How do I pass a customer name field into the checkout form (cart.php?a=view) name field using WHMCS 7.4.* and standard six theme? Do you recommend I just a cookie instead of a GET / POST? https://stackoverflow.com/a/872522 -- this was the post I wanted to use at first: https://stackoverflow.com/a/43268025 and it didn't work, but I believe there is a security issue with adding PHP snippets directly onto custom pages or even wrapping them in the {PHP} tag. I'd prefer to do this as clean as possible and not going into WHMCS Admin Options to rig something. I browsed the "Linking" docs but didn't have any luck with appending "&email=jeff@example.com" to a regular <a> link either. I think it only works for support tickets and does not work on checkout templates like cart.php?a=view ... https://docs.whmcs.com/Linking_to_WHMCS > You can also define a name and email address: Thanks for anything that might come to your mind.
  7. I didn't know that by only adding a custom field into the panel output would require so many extra lines of codes. that's madness! jeeze that sounds intense. rebuilding the service home panel seems more complicated than copy pasting a file into a new folder. The existing panel is already just about perfect. Just have to make do. You know what, with my ignorance, I might just call it quits and end my search here. I'm not ready to burn up an entire supply of lamp oil. Not today, maybe in a week.
  8. Download everything locally to your PC. Next, use a program to "Find in Files" to reverse lookup. Try using keyword like "please contact the site" or "not been published". https://www.ghacks.net/2016/09/16/use-notepad-to-find-text-in-all-files-of-a-folder/
  9. I'm just not having much luck, frig! Thanks in advance for anything you can share with me to help! I'd like to display the value field from table tblcustomfieldsvalues in the Client Area Home Panel Active Products/Services on WHMCS 7.4.1 with stock template. I visit example.com/whmcs/configproducts.php?action=edit&id=40 and put {$cf46} (or even {$customfields.0.value}) in the "Product Name" field so clientarea dashboard home panel will display name and custom field data. If I goto example.com/clientarea.php?action=productdetails&id=999 I see that the data is being display because I put {debug} into the clientareaproductdetails.tpl file. Why am I not able to display custom field id #46 array data in the product name field? I thought I could tweak the hook from a previous post by brian too, but no good. <?php use Illuminate\Database\Capsule\Manager as Capsule; function display_custom_field_46($vars) { $client = Menu::context('client'); $cf46 = Capsule::table('tblcustomfieldsvalues') ->where('value', $client->id) // compare ->where('fieldid', $vars['fieldid']) ->get(); $encodedata = json_encode($cf46); $decodedata = json_decode($encodedata, true); return array("cf46" => $decodedata); } add_hook("ClientAreaPage", 1, "display_custom_field_46"); ?> p.s. - this post too, was not helpful either. i tried copy / paste into hook folder and use custom field #46 but it did not work when I pasted {$customFields[$service.id]} into Product Name field.
  10. Perhaps you are looking to configure cPanel templates. https://forums.cpanel.net/threads/default-new-account-page.44051/ https://stackoverflow.com/questions/5271749/change-default-page-in-cpanel What does the "coming soon landing page" look like? Screenshot please.
  11. That's odd, it definitely works. What happens when you click Test Connection button on the Setup > Products/Services > Servers screen? Brush over these help articles and make sure you did everything correctly. https://docs.whmcs.com/DirectAdmin https://help.whmcs.com/m/getting_started/l/1076211-creating-your-first-directadmin-server
  12. How do I display domain name for each child? It's the {$domains.domain} smarty variable I believe. I think I already had something similar that I was able to build off of.... but no results. *display UPTO 4 domains i don't think i have this working, i tried to test on client with 5 domains, but only 1 child is being loaded. perhaps the scrollbar like from your image is best, and display just 4. sort by domain name include "newduedate " into panel open link in new window I'm getting stuck on the $clientdomain AND .fromMySQLDate part of the hook, still don't know what they mean. Also, I don't think I'm loading the table data newduedate into this hook... <?php # Made with help of Honored Contributor brian! // https://whmcs.community/topic/292268-email-history-homepage-panel/ // https://forums.whmcs.com/showthread.php?127034-home-page-panel-add-array-title-and-target-to-href // https://developers.whmcs.com/hooks/hook-index/ // http://docs.whmcs.com/Working_With_Client_Area_Home_Page_Panels // https://developers.whmcs.com/hooks-reference/client-area-interface/#clientareahomepagepanels use Illuminate\Database\Capsule\Manager as Capsule; use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $client = Menu::context('client'); $clientdomain = Capsule::table('tbldomains')->where('userid', $client->id)->select('id','domain')->orderBy('domain','desc')->limit(4)->get(); if (count($clientdomain)) { $homePagePanels->addChild('Manage Domains', array( 'label' => 'Domains', // panel title name 'icon' => '', 'order' => 0, 'extras' => array( // panel title button 'color' => '', 'btn-link' => 'clientarea.php?action=domaindetails', 'btn-text' => Lang::trans('managedomain'), 'btn-icon' => '', ), )); // foreach ($clientdomain as $key => $child){ // $homePagePanels->getChild('Manage Domains') // ->addChild($child->domains)->setUri('clientarea.php?action=domaindetails&id='.$child->id)->setAttribute('target','_blank'); // } // uncomment above / below to "load domain newduedate" foreach ($clientemails as $key => $child){ $homePagePanels->getChild('Manage Domains') ->addChild($key)->setLabel('<span class="xyz">Domain: '.fromMySQLDate($child->newduedate,true,false).'</span>'.$child->domains)->setUri('clientarea.php?action=domaindetails&id='.$child->id)->setAttribute('target','_self'); } } });
  13. I'm onto you dude! It's like you are holding a fishing pole with some bait and I'm trying to eat that bait. hahahaha Alright, well if you are telling me you already wrote a home panel hook to display domains, than I just gotta dig into your post history replies, find the code and altercate it. Let's see what I can come up with and I'll report back here. I too, will determine what exact I want to output. talk to you soon! 😎
  14. Specifically in the Client Area as a client, not as admin. But you are right! it's like the feature is already available as an admin. but not as a client. <div class="pull-right"> <button type="submit" class="btn btn-primary pull-right" name="postreply" id="btnPostReply" value="true"> <i class="fa fa-reply"></i> {$_ADMINLANG.support.reply} </button> <div class="return-to-ticket-list"> <label class="checkbox-inline"> <input type="checkbox" name="returntolist" value="1"{if $returnToList == true} checked{/if} /> {$_ADMINLANG.support.returnToTicketList} </label> </div> </div> I imagine, the client would log into WHMCS and be able to "reply and close" ticket. Better yet, perhaps "reply close and redirect to clientarea.php". I noticed yesterday after brushing over forums you shared a hook that included a header redirect. That seems magical! May you please help me build a hook that would do this? Or advise on best way to get this desired result?
  15. How do I create a clientarea home panel that displays domains? It would be cool if I could just copy / paste table found on example.com/clientarea.php?action=domains ... OR something more simple that displays UPTO 10 domain name that each have a manage button to redirects user to the example.com/clientarea.php?action=domaindetails&id=999 page. I think it would be cool to save client a couple of clicks, but really just display everything on clientarea home panel. There is already a home panel that shows "Domains Expiring Soon" on clientarea home that redirects to the example.com/cart.php?gid=renewals page. I believe is getting data from cart template file domainrenewals.tpl. I brushed over the docs here https://docs.whmcs.com/Working_With_Client_Area_Home_Page_Panels and I also scoured over a bunch of community topics that involve hooks but nothing I tried last night worked. I only spent 90 minutes but still... dang! Before I went to bed last night, I started playing with hooks and I copy / pasted code scattered all over these forums but I kept getting broken website error like "oops, something isn't right" and deleted everything. https://www.google.com/search?ei=_i8qXtvgKqe-ggfn7Jpo&q=site%3Awhmcs.community+home+panel&oq=site%3Awhmcs.community+home+panel When I log into the database using Adminer, I see the table and data that I desire too. tbldomains > domains tbldomains > newduedate (which I think expire date)
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated