<script>Based on https://stackoverflow.com/a/65297467
document.addEventListener('DOMContentLoaded', function(event) {
// create urlParams variable (constant) from URLSearchParams class using current window
const urlParams = new URLSearchParams(window.location.search);
// set UTM medium, source and campaign variables (constants) based on results of URSearchParams
const utm_medium = urlParams.get('utm_medium') || "";
const utm_source = urlParams.get('utm_source') || "";
const utm_campaign = urlParams.get('utm_campaign') || "";
const utm_term = urlParams.get('utm_term') || "";
const utm_content = urlParams.get('utm_content') || "";
const ref_link = urlParams.get('ref') || "";
// get the Outbound button element
links = document.querySelectorAll("a");
links.forEach(function(outboundLink) {
// edit Outbound button element property by appending the URL parameters
var finalLink = "";
if (utm_medium != "")
finalLink += "utm_medium=" + encodeURIComponent(utm_medium);
if (utm_source != "")
{
if (finalLink != "")
finalLink += "&";
finalLink += "utm_source=" + encodeURIComponent(utm_source);
}
if (utm_campaign != "")
{
if (finalLink != "")
finalLink += "&";
finalLink += "utm_campaign" + encodeURIComponent(utm_campaign);
}
if (utm_term != "")
{
if (finalLink != "")
finalLink += "&";
finalLink += "utm_term=" + encodeURIComponent(utm_term);
}
if (ref_link != "")
{
if (finalLink != "")
finalLink += "&";
finalLink += "ref=" + encodeURIComponent(ref_link);
}
if (finalLink != "")
outboundLink.href += "?" + finalLink;
// log final Outbound button link to console
// console.log(outboundLink.href);
});
} );
</script>
Legacy PHP Functions
Just setup a small github repo of some deprecated php function replacements.
I have many websites that I maintain and other old software and always trying to stay on the latest version of PHP. These functions help if you are going from PHP 5 to PHP 7 and PHP 7 to PHP 8
Includes: mysql_* create_function ereg eregi ereg_replace eregi_replace split spliti
Installing Elastic Search 8.0 on CentOS 8 Orcale Linux
A quick guide on setting up Elastic Search
yum install java-1.8.0-openjdk.x86_64
cd /etc/yum.repos.d/
ls
vi elasticsearch.repo
yum install –enablerepo=elasticsearch elasticsearch
systemctl start elasticsearch.service
curl –cacert /etc/elasticsearch/config/certs/http_ca.crt -u elastic hcurl –cacert /etc/elasticsearch/certs/http_ca.crt -u elastic https://localhost:9200
yum install kibana
cd /etc/yum.repos.d/
vi kibana.repo
yum install kibana
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
/bin/systemctl daemon-reload
/bin/systemctl enable kibana.service
sestatus
setsebool httpd_can_network_connect 1 -P
systemctl status firewalld
firewall-cmd –new-zone=elastic-access –permanent
firewall-cmd –zone=elastic-access –add-source=192.68.0.1 –permanent
firewall-cmd –zone=elastic-access –add-port=9200/tcp –permanent
firewall-cmd –zone=elastic-access –add-port=9300/tcp –permanent
firewall-cmd –zone=elastic-access –add-port=5601/tcp –permanent
firewall-cmd –zone=elastic-access –add-port=80/tcp –permanent
firewall-cmd –zone=elastic-access –add-port=443/tcp –permanent
firewall-cmd –reload
/usr/share/kibana/bin/kibana-verification-code
netstat -ntlp
yum -y install nginx httpd-tools
cd /etc/nginx/conf.d
vi es.yoursite.com.conf
nginx -t
service nginx restart