Jump to content
Sign in to follow this  
persis

Hook for adding text to registration date of domain page

Recommended Posts

Hello, I need a hook to change the date (adding some text to date) in registration date column in page:

clientarea.php?action=domains

 

Is there any way?

 

 

Share this post


Link to post
Share on other sites

it should just need to be a ClientAreaPageDomains hook that loops through the $domains array, make your changes to the registration date field adn return the modified array back to the template.

the hook in the thread below could be a good starting point for learning about looping through the domains array nd modifying the values within it.

Share this post


Link to post
Share on other sites

thanks for solution.

 

can I use this function hook? (if yes, could you please give me some examples?)

<?php
add_hook('FormatDateForClientAreaOutput', 1, function($vars) {
    // Perform hook code here...
});

Share this post


Link to post
Share on other sites
16 hours ago, persis said:

can I use this function hook? (if yes, could you please give me some examples?)

not really, but it depends on what you're wanting to do - it's not going to do anything that you couldn't do yourself in the above hook point.

what is it exactly that you want to do to these dates? if it's just adding some text after the date itself, e.g 01/03/2021 *Hello World*, then I would still loop through the array as suggested above and modify the date values - they're just text strings as far as I remember and not carbon dates.

if you know the text is going to be the same for all domains, then you could even edit the template to add your text.

however, what you want to change in these values should determine the best way to do it.... so the more info you can give on that, the better we can advise. 🙂

Share this post


Link to post
Share on other sites

I want to find the best way to create whmcs compatible for RTL languages with Jalali calendar.

Changing the template directly is not a good choice because after every auto update, needs to apply changes again. the hooks is very helpful in this regards or whmcs company add this support included in codes...

the Persian translate is very poor, i try to suggest the correction in ticketing system but they told me the translates must be validate by google translate , for example :

my translation  $_LANG['domainsregister'] = "ثبت";

whmcs translation (wrong) : $_LANG['domainsregister'] = "ثبت نام";

and many untranslated ...

I wrote hooks for this changes + some template edit that is work perfectly see attachment

AND I want to ask WHMCS to include those (RTL and Jalali calendar and Best translation) in future update. and I am hear to help to WHMCS team for this requests.

WHMCS RTL AND JALALI.png

Share this post


Link to post
Share on other sites
21 minutes ago, persis said:

or whmcs company add this support included in codes...

will never happen.... semi-related 7-year feature request with 10 votes..

https://requests.whmcs.com/topic/solar-date

25 minutes ago, persis said:

I wrote hooks for this changes + some template edit that is work perfectly see attachment

the usual way to change them would have been to use Language Overrides - only rarely should you need to use hooks/template edits to change them (at least with LTR languages).

language overrides will not be overwritten during an update.

28 minutes ago, persis said:

AND I want to ask WHMCS to include those (RTL and Jalali calendar and Best translation) in future update.

RTL - https://requests.whmcs.com/topic/rtl-support-for-clientarea-and-admin-themes - 5 Year, 25 votes... don't see it happening any time soon.

Jalali calendar - WHMCS will never do this....  replied to many questions about it over the last 8 years.

have you tried the free hook on GitHub?

https://github.com/EhsanCh/whmcs-jalalidate/

I think that will do most of what you want to do - it's 4 years old, so it might need tweaking to work on any newer pages that involve dates.

Share this post


Link to post
Share on other sites
Posted (edited)
44 minutes ago, brian! said:

will never happen.... semi-related 7-year feature request with 10 votes..

You need more votes? ( if yes, I will tell my friends to vote)

44 minutes ago, brian! said:

language overrides will not be overwritten during an update.

I know this , I am looking for to correct the wrong translates for all whmcs users basely! not only for me!

and with any new update every user must translate the untranslated sentences or correct bad translate on override...

Isn't it better to do the basics? Instead of just thinking about fixing the problem?

44 minutes ago, brian! said:

Jalali calendar - WHMCS will never do this....  replied to many questions about it over the last 8 years.

Why? again , do you need more votes?

 

44 minutes ago, brian! said:

I wrote more better hook than this link.

 

 

I want to solve these problems , instead of fixing them!

Edited by persis

Share this post


Link to post
Share on other sites
12 minutes ago, persis said:

You need more votes? ( if yes, I will tell my friends to vote)

I don't think how ever many votes it got, the feature would be added - but you can try if you want.

13 minutes ago, persis said:

I know this , I am looking for to correct the wrong translates for all whmcs users basely! not only for me!

I get that, but if WHMCS don't want your translations then release them yourself as a language pack.... you can't force WHMCS to accept them.

normally, they would at least let you send them in - even if they later decide not to use them... i'm surprised if they've told you that they don't want them.

15 minutes ago, persis said:

Isn't it better to do the basics? Instead of just thinking about fixing the problem?

yes - but you or I are not in control of these things... if we were, or WHMCS was a reactive company,  then we/they could set about fixing all these bugs... there's been a typo in the admin area for at least 7 years that has gone unnoticed, so don't worry about trying to fix these things.

if you see a bug, you can report it.

16 minutes ago, persis said:

Why? again , do you need more votes?

see above.

16 minutes ago, persis said:

I wrote more better hook than this link.

then what's the problem ? if you can solve them for your own situation, then release the solution either for free on GitHub or charge for it.... it's not as though you can send your code to WHMCS and they will use it themselves (they won't).

if they want to do this, they would have already done it by now.

17 minutes ago, persis said:

I want to solve these problems , instead of fixing them!

I get that - but again you can't force WHMCS to do something just because you want them to (if only!).

Share this post


Link to post
Share on other sites

Many Thanks for your answers dear brian!

Maybe someday I release the solution.

Share this post


Link to post
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.

Sign in to follow this  

  • 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