Jump to content


Level 2 Member
  • Content count

  • Joined

  • Last visited

  • Days Won


Kian last won the day on January 17

Kian had the most liked content!

Community Reputation

116 Excellent


About Kian

  • Rank
    Senior Member

Recent Profile Visitors

4,932 profile views
  1. This one should work. <button type="submit" class="btn btn-primary btn-lg">Continue &nbsp;<i class="fa fa-arrow-circle-right"></i></button> If it doesn't then remove the icon. <button type="submit" class="btn btn-primary btn-lg">Continue</button>
  2. Kian

    How to validate user session on custom page ?

    Refer to Creating Pages. You don't need all the variables listed in the example but just the main class and... $ca->requireLogin(); // Forces visitors to login Or... if ($ca->isLoggedIn()) { // You are logged } else { // Not logged, exit }
  3. Daily cron runs at a specific time of day (Setup > Automation Settings > Time of Day) that is usually set to 0:00am. The log you posted comes from Domany Sync Cron which is another thing. Look for Cron Job: Completed in Utilities > Log > Activity Log.
  4. Kian

    Attach documents to clients via API ?

    Workaround 1: Instead of sending an email, attach your file via API in a ticket with OpenTicket or AddTicketReply. Workaround 2: Alternatively provide a download link in your email. They can download the contract on click. If you really want to attach the file then why don't you simply use PHPMailer included in WHMCS? In pseudo-code it would be something like this. <?php // Require the autoloader require 'vendor/phpmailer/phpmailer/PHPMailerAutoload.php'; // Get the necessary data from tblconfiguration $conf = GetWHMCSConfig(array('CompanyName', 'Email', 'MailType', 'SMTPHost', 'SMTPUsername', 'SMTPPassword', 'SMTPort')); // $conf->CompanyName would be your Company Name set in WHMCS. Same goes for Email, MailType etc. Don't forget to Decrypt($conf->SMTPPassword) $mail = new PHPMailer; $mail->Port = $conf->SMTPort; $mail->Username = $conf->SMTPUsername; $mail->Password = Decrypt($conf->SMTPPassword); // ... and all the usual stuff... $mail->Subject = 'Accept this contract'; $mail->MsgHTML('Please sign your name in blood'); // ... attach your file and... $mail->Send(); // Done
  5. Maybe it's due to PHP shot tags. In my hook I forgot to use <?php instead of <?. Update the hook at let us know if it works.
  6. Print both localAPI requests. Open a ticket and view it as administrator from backend then open Options tab and change ticket status. Press Save Changes. You should see the result of print on screen. You can print in this way... $results = localAPI('SendEMail', $EmailData); echo '<pre>'; print_r($results); echo '</pre>'; // and... $results = localAPI('AddTicketReply', $TicketData); echo '<pre>'; print_r($results); echo '</pre>';
  7. On TicketStatusChange this hook sends the email and add a reply to ticket. <? use WHMCS\Database\Capsule; function prefix_TicketStatusChange($vars) { $adminUsername = 'admin'; // Change me accordingly. This Admin user is the one used to automatically add replies to tickets when status is updated. Set false if you want to open the ticket using your own customers $userID = Capsule::table('tbltickets')->where('id', $vars['ticketid'])->first(['userid'])->userid; // Send email notification to customer when ticket status changes $EmailData = array( 'id' => $userID, 'customtype' => 'general', 'customsubject' => 'Stop opening tickets!', 'custommessage' => 'Right now I\'m playing League of Legend therefore I can\'t reply.<br><br>Your ticket status has been changed to <strong>' .$vars['status'] . '</strong>' ); localAPI('SendEmail', $EmailData); // Add reply to ticket when its status changes $TicketData = array( 'ticketid' => $vars['ticketid'], 'message' => 'Stop opening tickets!', 'clientid' => $userID, 'adminusername' => $adminUsername, ); localAPI('AddTicketReply', $TicketData); } add_hook('TicketStatusChange', 1, 'prefix_TicketStatusChange'); Here's the result.
  8. Reinventing the wheel. Create my_clients table to store client details (firstname, lastname, companyname, email, state, country, customfields...) Develop a new page from which you can add, edit, delete clients stored in my_clients and start issuing invoices Create my_refids table to store reference numbers to JOIN customers and invoices Begin by selecting the customer you want to invoice (e.g. #5 - Silvio Berlusconi) Create the invoice interacting directly with database. INSERT INTO tblinvoices a lot of stuff using 0 (zero) as UserID since it cannot be NULL and store lastInsertId() in $invoiceid variable Repeat the same process to populate tblinvoiceitems based on tblinvoiceitems.invoiceid = $invoiceid (let's suppose that $invoiceid is equal to #1250) INSERT INTO my_refids (invoiceid, clientid) VALUES (1250, 5) require '/vendor/phpmailer/phpmailer/PHPMailerAutoload.php' new \PHPMailer SELECT subject, message FROM tblemailtemplates WHERE name = "Invoice Created" LIMIT 1. We need it to rebuild the Invoice Created email of WHMCS (multi-language requires more efforts) All Smarty variables ({$client_name}, {$invoice_num}, {$invoice_link}...) must be replaced with the effective values using additional queries and several str_replace Send it to the email address of #5 Silvio Berlusconi I stop here. There are tens of other steps to consider but it's doable. I know that it seems messy and frustrating but nothing is impossible. You should ask yourself if it's worth it. Probably not 🤮
  9. It should be perfectly fine. As far as I know that field isn't used for billing purposes. I think that it's used to register specific TLDs for sub-accounts. For example .it domains require Tax ID and this new field could be used in place of an additional domain field.
  10. You should provide more details. I tend to say that it's doable. As last resource you could use PHP stream (ob_start, ob_get_content) or auto prepend/append but don't do it, it sucks on so many levels and could break 3rd party modules.
  11. Kian

    WHMCS Advice

    I'm biased, but I always discourage people from using Wordpress or any other CMS as front-end. Maintaining WHMCS up-to-date, fresh and secure is a time consuming activity and it's also expensive. Using an additional software increases the amount of problems, waste your time and money. First off you need to integrate both software so that they look exactly the same. For me this is a complete waste of time. I mean, you are forced to recreate your template in two "languages" and you should also make sure that customers can login from both systems and share sessions. What about being forced to rely on two separate interfaces for the rest of your life? Nah, I pass. I already wasted 8 years babysitting two or more systems. WHMCS has the vast majority of features I use and need and in the end I preferred to add missing pieces.
  12. Kian

    IonCube Encoder optimum settings

    You have to look at your error_log to see what's the problem. If it doesn't work because of «This file was encoded with ionCube... and can't work on this version...» etc. then you're using the wrong encoding. Maybe you encoded your software with ionCube 7.2 but your server runs 5.6. That said you have to option: Use the right encoding Use Bundle encoding like WHMCS does but it sucks because it produces bigger files and scripts run slightly slower
  13. Kian

    how to upgrade client package?

    First off create the Product/Service of your software and configure Module tab to use Licensing module of WHMCS. Then move to Setup > Products/Services > Product Addons and create your three tiers. Make sure to select the main product from Applicable Products tab. Now when your customers order the software they will see something like follows. Now I can't remember if the licensing script already transmits information about Addons assigned to the main Product/Service. Just in case use the LicensingAddonVerify action hook. <?php use WHMCS\Database\Capsule; function prefix_LicensingAddonVerify($vars) { // Retreive the ID of the Addon purchased by customer (if Active) $AddonID = Capsule::table('tblhostingaddons')->where(['hostingid', '=', $vars['serviceid']], ['status', '=', 'Active'])->first(['addonid'])->addonid; // On every check_license() the value of AddonID will be transmitted to licensing script. Use it to lock/unlock features of your software return [ 'AddonID' => $AddonID ]; } add_hook("LicensingAddonVerify", 1, "prefix_LicensingAddonVerify"); When the remote software of your customer requests a license check to your server, it will provide all the usual details (valid IP, directory, domain...) plus the ID of the purchased Addon (if Active). Now you can implement it in your software to do things like add/remove "Powered by" footer, lock/unlock additional features and stuff like that. Obviously this value (the ID of the purchased Addon) needs to be stored locally somewhere on the server of your customers and hashed so that no one can freely cheat you by manually changing values. You could store it directly in the localkey. Please keep in mind that mine is just an example. You can use an unlimited number of options. For example you could check the weather in Rome and if it's raining customers can't use your software software unless they purchase Premium features.
  14. Kian

    Schema rename column

    I suppose that that class is not included in WHMCS. From my experience there are many missing pieces like for example hasTable... that's why I refuse to use Capsule. I can't rely on such a class that lacks of many crucial methods.

Important Information

By using this site, you agree to our Terms of Use & Guidelines