Jump to content

How to insert Lang fields-entries into a custom simple html page.


ody

Recommended Posts

Hello,

 

we try to insert into a simple custom made page (php or html) preconfigured lang fields

as like {$LANG.orderchooseapackage}

page is saved into default WHMCS teplate

we had try to add into the head section our common css files or ... but ...

 

Thank you, Ody.

Link to comment
Share on other sites

if this is going to be a WHMCS page, I would have thought the easiest way would be to split the page into a PHP file and it's template - so PHP creates the page and the template inserts the content... similar to the thread below...

 

https://forum.whmcs.com/showthread.php?127834-Terms-of-service-page&p=511398#post511398

 

by default, a PHP/HTML page wouldn't know the language files even exist (or probably WHMCS for that matter), so it wouldn't understand what you're referring to with {$LANG.orderchooseapackage}.

Link to comment
Share on other sites

Thank you Brian for your reply,

 

we want to create a popup offer page with no navbar or WHMCS default style css .....

we had try also tpl solution but it wasn't work,

the theme is how to call the lang entries, but not all the rest of WHMCS.

Link to comment
Share on other sites

the theme is how to call the lang entries, but not all the rest of WHMCS.

the trick will be working out the language in the client area... for example, if your site only uses English, you could easily do this in the PHP file (no template)...

 

<?php
define ('WHMCS', true);
include 'lang/english.php';
include 'lang/overrides/english.php';
echo $_LANG['orderchooseapackage'];

now to avoid PHP errors, you should probably wrap the includes with a IF file_exists line to check the language files exists before calling it.

 

it gets slightly trickier if this has to be multilingual (which I assume it does - otherwise why use the language files lol)... :)

 

one way around that, if the page calling the popup is a WHMCS file, would be to pass the current language in the URL to popup.php - e.g

 

http://www.domain.com/whmcs/popup.php?lang={$language}

and then in popup.php, you take that value from the URL and use it in the links to the language files...

 

<?php
define ('WHMCS', true);
$language = $_GET['lang'];
include 'lang/'.$language.'.php';
include 'lang/overrides/'.$language.'.php';
echo $_LANG['orderchooseapackage'];

you will need to add some input validation to that code, e.g check a language is being passed in the URL and if not (or invalid), use a default language value (English); check the language files exist before calling them etc.

 

off the top of my head, that's the simplest way I can think to do this. :idea:

Link to comment
Share on other sites

Nada..

 

we can't call lang fields, we can insert default buttons or other common WHMCS styles boxes or .... but no any lang fields,

I don't know if it's easiest to insert those lang fields in an html page.

Edited by ody
Link to comment
Share on other sites

This is an exaple page in html, which opens with a mouseover

at the end we want to add a roow with an order default lang field $ button

(we can do it with a simple link but with no any tranlsation)

 

<a class="btn btn-success btn-lg btn-checkout" href="/cart.php?gid=1" class="label label-warning"><span style="color: #000080;"><i class="fa fa-lock"></i> Symantec </span>{$LANG.orderchooseapackage}</a>

 

<table align="center" border="1" cellspacing="0" class="table_compare_1" width="100%">

<tbody>

<tr>

<th><span style="color:#000080;"><strong><img alt="" src="/img/symantec.png" style="float: left; height: 48px; width: 150px;" /></strong></span></th>

<td style="text-align: center;"><span style="color:#000080;"><strong>Secure Site</strong></span></td>

<td style="text-align: center;"><span style="color:#000080;"><strong>Secure Site Pro</strong></span></td>

<td style="text-align: center;"><span style="color:#000080;"><strong>Secure Site with EV</strong></span></td>

<td class="featured">

<p style="text-align: center;"><span style="color:#000080;"><strong>Secure Site Pro<br />

with EV</strong></span><span style="color:#000080;"><strong> (recommended)</strong></span></p>

</td>

</tr>

<tr>

<th>Validation Type</th>

<td style="text-align: center;">Organization Validation</td>

<td style="text-align: center;">Organization Validation</td>

<td style="text-align: center;">Extended Validation</td>

<td class="featured" style="text-align: center;">Extended Validation</td>

</tr>

<tr>

<th>Trust Level</th>

<td style="text-align: center;">Deluxe</td>

<td style="text-align: center;">Deluxe</td>

<td style="text-align: center;">Premium</td>

<td class="featured" style="text-align: center;">Premium</td>

</tr>

<tr>

<th>Brand Recognition</th>

<td style="text-align: center;">High</td>

<td style="text-align: center;">High</td>

<td style="text-align: center;">High</td>

<td class="featured" style="text-align: center;">High</td>

</tr>

<tr>

<th>Green Bar <a class="info_1" title="Green Address Bar - Only Extended Validation SSL Certificates trigger the address bar to turn green in high-security browsers, a convenient and visible sign of trust for site visitors.">i</a></th>

<td style="text-align: center;">-</td>

<td style="text-align: center;">-</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>Vulnerability Assessment <a class="info_1" title="Vulnerability assessment helps you quickly identify and take action against the most exploitable weaknesses on your Web site.">i</a></th>

<td style="text-align: center;">-</td>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>Warranty</th>

<td style="text-align: center;">$1,000,000</td>

<td style="text-align: center;">$1,250,000</td>

<td style="text-align: center;">$1,500,000</td>

<td class="featured" style="text-align: center;">$1,500,000</td>

</tr>

<tr>

<th>Subdomains Secured</th>

<td style="text-align: center;">Single</td>

<td style="text-align: center;">Single</td>

<td style="text-align: center;">Single</td>

<td class="featured" style="text-align: center;">Single</td>

</tr>

<tr>

<th>Issuance</th>

<td style="text-align: center;">1-2 days</td>

<td style="text-align: center;">1-2 days</td>

<td style="text-align: center;">5-7 days</td>

<td class="featured" style="text-align: center;">5-7 days</td>

</tr>

<tr>

<th>Validity Options</th>

<td style="text-align: center;">1-3 years</td>

<td style="text-align: center;">1-3 years</td>

<td style="text-align: center;">1-2 years</td>

<td class="featured" style="text-align: center;">1-2 years</td>

</tr>

<tr>

<th>Site Seal</th>

<td style="text-align: center;">Dynamic</td>

<td style="text-align: center;">Dynamic</td>

<td style="text-align: center;">Dynamic</td>

<td class="featured" style="text-align: center;">Dynamic</td>

</tr>

<tr>

<th>Server Gated Cryptography</th>

<td style="text-align: center;">-</td>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">-</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>SSL Encryption</th>

<td style="text-align: center;">up to 256-bit</td>

<td style="text-align: center;">up to 256-bit</td>

<td style="text-align: center;">up to 256-bit</td>

<td class="featured" style="text-align: center;">up to 256-bit</td>

</tr>

<tr>

<th>99% Browser Compatibility</th>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>Browser Security Lock</th>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>Mobile Device Compatibility</th>

<td style="text-align: center;">-</td>

<td style="text-align: center;">-</td>

<td style="text-align: center;">-</td>

<td class="featured" style="text-align: center;">-</td>

</tr>

<tr>

<th>IDN Support</th>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>EV Upgrader</th>

<td style="text-align: center;">-</td>

<td style="text-align: center;">-</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>Installation</th>

<td style="text-align: center;">Quick & Easy</td>

<td style="text-align: center;">Quick & Easy</td>

<td style="text-align: center;">Quick & Easy</td>

<td class="featured" style="text-align: center;">Quick & Easy</td>

</tr>

<tr>

<th>Free Customer Support</th>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>Auto renewal reminders & early renewal benefits</th>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td style="text-align: center;">Yes</td>

<td class="featured" style="text-align: center;">Yes</td>

</tr>

<tr>

<th>Revocation and Replacement</th>

<td style="text-align: center;">Free</td>

<td style="text-align: center;">Free</td>

<td style="text-align: center;">Free</td>

<td class="featured" style="text-align: center;">Free</td>

</tr>

<tr>

<th>Free Refund</th>

<td style="text-align: center;">20 days</td>

<td style="text-align: center;">20 days</td>

<td style="text-align: center;">20 days</td>

<td class="featured" style="text-align: center;">20 days</td>

</tr>

</tbody>

</table>

Edited by ody
Link to comment
Share on other sites

ok, if we ignore the mouseover part as I don't know how you're doing it (css/jquery/3rdparty) and let's just assume we have a normal link on the WHMCS homepage...

 

<a href="popup.php?lang={$language}" target="_blank">Click here for popup</a>

and then in popup.php we have your monster table...

 

<?php
define ('WHMCS', true);
$language = $_GET['lang'];
include 'lang/'.$language.'.php';
include 'lang/overrides/'.$language.'.php';
?>
<link href="/whmcs/templates/six/css/all.min.css" rel="stylesheet">
<table align="center" border="1" cellspacing="0" class="table_compare_1" width="100%">
<tbody>
<tr>
<th><span style="color:#000080;"><strong><img alt="" src="/img/symantec.png" style="float: left; height: 48px; width: 150px;" /></strong></span></th>
<td style="text-align: center;"><span style="color:#000080;"><strong>Secure Site</strong></span></td>
<td style="text-align: center;"><span style="color:#000080;"><strong>Secure Site Pro</strong></span></td>
<td style="text-align: center;"><span style="color:#000080;"><strong>Secure Site with EV</strong></span></td>
<td class="featured">
<p style="text-align: center;"><span style="color:#000080;"><strong>Secure Site Pro<br />
with EV</strong></span><span style="color:#000080;"><strong> (recommended)</strong></span></p>
</td>
</tr>
<tr>
<th>Validation Type</th>
<td style="text-align: center;">Organization Validation</td>
<td style="text-align: center;">Organization Validation</td>
<td style="text-align: center;">Extended Validation</td>
<td class="featured" style="text-align: center;">Extended Validation</td>
</tr>
<tr>
<th>Trust Level</th>
<td style="text-align: center;">Deluxe</td>
<td style="text-align: center;">Deluxe</td>
<td style="text-align: center;">Premium</td>
<td class="featured" style="text-align: center;">Premium</td>
</tr>
<tr>
<th>Brand Recognition</th>
<td style="text-align: center;">High</td>
<td style="text-align: center;">High</td>
<td style="text-align: center;">High</td>
<td class="featured" style="text-align: center;">High</td>
</tr>
<tr>
<th>Green Bar <a class="info_1" title="Green Address Bar - Only Extended Validation SSL Certificates trigger the address bar to turn green in high-security browsers, a convenient and visible sign of trust for site visitors.">i</a></th>
<td style="text-align: center;">-</td>
<td style="text-align: center;">-</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>Vulnerability Assessment <a class="info_1" title="Vulnerability assessment helps you quickly identify and take action against the most exploitable weaknesses on your Web site.">i</a></th>
<td style="text-align: center;">-</td>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>Warranty</th>
<td style="text-align: center;">$1,000,000</td>
<td style="text-align: center;">$1,250,000</td>
<td style="text-align: center;">$1,500,000</td>
<td class="featured" style="text-align: center;">$1,500,000</td>
</tr>
<tr>
<th>Subdomains Secured</th>
<td style="text-align: center;">Single</td>
<td style="text-align: center;">Single</td>
<td style="text-align: center;">Single</td>
<td class="featured" style="text-align: center;">Single</td>
</tr>
<tr>
<th>Issuance</th>
<td style="text-align: center;">1-2 days</td>
<td style="text-align: center;">1-2 days</td>
<td style="text-align: center;">5-7 days</td>
<td class="featured" style="text-align: center;">5-7 days</td>
</tr>
<tr>
<th>Validity Options</th>
<td style="text-align: center;">1-3 years</td>
<td style="text-align: center;">1-3 years</td>
<td style="text-align: center;">1-2 years</td>
<td class="featured" style="text-align: center;">1-2 years</td>
</tr>
<tr>
<th>Site Seal</th>
<td style="text-align: center;">Dynamic</td>
<td style="text-align: center;">Dynamic</td>
<td style="text-align: center;">Dynamic</td>
<td class="featured" style="text-align: center;">Dynamic</td>
</tr>
<tr>
<th>Server Gated Cryptography</th>
<td style="text-align: center;">-</td>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">-</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>SSL Encryption</th>
<td style="text-align: center;">up to 256-bit</td>
<td style="text-align: center;">up to 256-bit</td>
<td style="text-align: center;">up to 256-bit</td>
<td class="featured" style="text-align: center;">up to 256-bit</td>
</tr>
<tr>
<th>99% Browser Compatibility</th>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>Browser Security Lock</th>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>Mobile Device Compatibility</th>
<td style="text-align: center;">-</td>
<td style="text-align: center;">-</td>
<td style="text-align: center;">-</td>
<td class="featured" style="text-align: center;">-</td>
</tr>
<tr>
<th>IDN Support</th>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>EV Upgrader</th>
<td style="text-align: center;">-</td>
<td style="text-align: center;">-</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>Installation</th>
<td style="text-align: center;">Quick & Easy</td>
<td style="text-align: center;">Quick & Easy</td>
<td style="text-align: center;">Quick & Easy</td>
<td class="featured" style="text-align: center;">Quick & Easy</td>
</tr>
<tr>
<th>Free Customer Support</th>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>Auto renewal reminders & early renewal benefits</th>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td style="text-align: center;">Yes</td>
<td class="featured" style="text-align: center;">Yes</td>
</tr>
<tr>
<th>Revocation and Replacement</th>
<td style="text-align: center;">Free</td>
<td style="text-align: center;">Free</td>
<td style="text-align: center;">Free</td>
<td class="featured" style="text-align: center;">Free</td>
</tr>
<tr>
<th>Free Refund</th>
<td style="text-align: center;">20 days</td>
<td style="text-align: center;">20 days</td>
<td style="text-align: center;">20 days</td>
<td class="featured" style="text-align: center;">20 days</td>
</tr>
<th><? echo $_LANG['orderchooseapackage'];?></th>
<td style="text-align: center;"><a class="btn btn-success btn-lg btn-checkout" href="/cart.php?gid=1" class="label label-warning"><span style="color: #000080;"><i class="fa fa-lock"></i> <? echo $_LANG['ordernowbutton'];?></a></td>
<td style="text-align: center;"><a class="btn btn-success btn-lg btn-checkout" href="/cart.php?gid=2" class="label label-warning"><span style="color: #000080;"><i class="fa fa-lock"></i> <? echo $_LANG['ordernowbutton'];?></a></td>
<td style="text-align: center;"><a class="btn btn-success btn-lg btn-checkout" href="/cart.php?gid=3" class="label label-warning"><span style="color: #000080;"><i class="fa fa-lock"></i> <? echo $_LANG['ordernowbutton'];?></a></td>
<td class="featured" style="text-align: center;"><a class="btn btn-success btn-lg btn-checkout" href="/cart.php?gid=4" class="label label-warning"><span style="color: #000080;"><i class="fa fa-lock"></i> <? echo $_LANG['ordernowbutton'];?></a></td>
</tr>
</tbody>
</table>

if the homepage language is set to English, i'm seeing this in popup.php

 

eZpAB4h.png

 

and if set to Spanish...

 

SIrrpmW.png

 

now you might need to play with the css to get the buttons right and then add in your mouseover method, but the php file can definitely access the language strings - you just need to jump into PHP to display them. :idea:

Link to comment
Share on other sites

Well,

Houston we have a problem,

 

it's not your code or our ex-test-code or pages,

we can't add any lang fields into all of our WHMCS installation,

not even in announcements, or knowledge pages,

or into whmcms custom pages or ....

we check our .httacces or firewall but all seems OK,

Edited by ody
Link to comment
Share on other sites

We find out where is the problem,

all styles opening but we got error and

it's into our server setup,

AH01071: Got error 'PHP message: PHP Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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