diff --git a/app/Config/Email.php b/app/Config/Email.php index e59f0bd..309b55a 100644 --- a/app/Config/Email.php +++ b/app/Config/Email.php @@ -13,7 +13,7 @@ class Email extends BaseConfig /** * The "user agent" */ - public string $userAgent = 'SmartyURL/Dev'; + public string $userAgent = 'SmartyURL'; /** * The mail sending protocol: mail, sendmail, smtp diff --git a/app/Controllers/Url.php b/app/Controllers/Url.php index cee764c..10f6100 100644 --- a/app/Controllers/Url.php +++ b/app/Controllers/Url.php @@ -269,7 +269,7 @@ public function listData() if (auth()->user()->can('admin.manageotherurls', 'super.admin')) { // he is manager so i must let him know the url owner $url_owner_id = smarty_get_user_username($result->url_user_id); - $url_owner = "
" . lang('Url.UrlOwner') . ": {$url_owner_id}
"; + $url_owner = "
" . lang('Url.UrlOwner') . ": {$url_owner_id}
"; } else { $url_owner = ''; } @@ -289,7 +289,7 @@ public function listData() ", 'url_title_col' => " {$urlTitle} - url_targeturl . "' href='{$result->url_targeturl}' class='link-dark edit-link'> + url_targeturl) . "' href='{$result->url_targeturl}' class='link-dark edit-link'> ", 'url_hits_col' => "" . $result->url_hitscounter . '', 'url_id' => $result->url_id, diff --git a/app/Helpers/smarty_helper.php b/app/Helpers/smarty_helper.php index 381caa5..66b58be 100644 --- a/app/Helpers/smarty_helper.php +++ b/app/Helpers/smarty_helper.php @@ -214,3 +214,24 @@ function smarty_svg_error($text) '; } } + +if (! function_exists('create_nice_url_for_show')) { + /** + * Create a nice URL to show on screen and not for real use on visits + * + * @return mixed|string + */ + function create_nice_url_for_show($original_url, $max_length = 50) + { + // Check if the original URL is longer than the specified maximum length + if (mb_strlen($original_url, 'UTF-8') > $max_length) { + // Trim the URL to the maximum length and add "..." at the end + $nice_url = mb_substr($original_url, 0, $max_length - 3, 'UTF-8') . '...'; + } else { + // If the URL is within the maximum length, use the original URL + $nice_url = $original_url; + } + + return $nice_url; + } +} diff --git a/app/Views/basic/url/urlinfo.php b/app/Views/basic/url/urlinfo.php index 5d885a1..0b0db76 100644 --- a/app/Views/basic/url/urlinfo.php +++ b/app/Views/basic/url/urlinfo.php @@ -114,11 +114,13 @@ class='bi bi-pencil edit-link-btn'>
- : + : +
' - href='' class='link-dark edit-link'>' + href='' class='link-primary edit-link'> +
@@ -231,9 +233,9 @@ class='bi bi-pencil edit-link-btn'> ' + title='' href='' - class='link-dark edit-link'> @@ -301,7 +303,7 @@ class="btn btn-sm btn-outline-dark"> target='_blank' title='' href='urlhit_finaltarget; ?>' - class='link-dark edit-link'> diff --git a/env b/env index 1ef64c3..8421ac0 100644 --- a/env +++ b/env @@ -86,7 +86,7 @@ smartyurl.urltags_shared_between_users = true email.string $protocol = 'mail'; #choose the default sender mail -email.fromEmail = noreplay@example.com +email.fromEmail = 'noreplay@example.com' #choose the default sender name email.fromName = 'SmartyURL'