Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in my opinion you should adopt this choice.
- Follow this guide and see what you solve
- https://blog.hubspot.com/blog/tabid/6307/bid/29544/the-ultimate-cheat-sheet-for-creating-social-media-buttons.aspx
- -------------
- as for the coosocial.php and db.php files
- the error is that you have to add this to all functions:
- #file coolsocial.php
- if(!function_exists('check_network')) { // <------------------------------ THIS
- function check_network($network)
- {
- global $db_link, $share_url, $ip, $get_count_minutes; // Version 1.1a - forgot to have $get_count_minutes here
- $last_count = 0; // 1/17/2018 - Version 1.1 - Was $count = "N/A" // Version 1.1a - Changed $count to $last_count
- $get_new_count = false;
- $network_count = 0; // Version 1.1a - Added $network_count = 0
- // Check database for Network counts
- $network = db_escape_string($db_link, substr($network, 0, 255)); // Don't strip_tags from urls
- $query = "SELECT *, TIMESTAMPDIFF(MINUTE, date_updated, NOW()) AS minutes
- FROM social_count WHERE url='$share_url' AND network='$network' LIMIT 1";
- $result = db_query($db_link, $query);
- if (db_num_rows($result)) {
- $row = db_fetch_assoc($result);
- $last_count = $row["count"];
- if ($row['minutes'] > $get_count_minutes || isset($_POST['click'])) // Version 1.1a - Removed "&& $row['minutes'] > 5" at end
- $get_new_count = true;
- } else // No rows for this network, first time getting count
- $get_new_count = true;
- //if (isset($_POST['click']) && ($row['ip'] != $ip || $last_count == 0)) // Version 1.1a - Moved to line 89
- // $count++; // Add 1 to count if user clicked share and not same ip as last share
- if ($get_new_count) {
- if (function_exists("get_" . $network . "_count")) {
- $network_count = call_user_func("get_" . $network . "_count", $share_url); // 12/17/2018 - Version 1.1 was $count =
- if ($network_count > $last_count || !db_num_rows($result)) // Version 1.1a - Only update count in db if it is bigger than last_count
- update_count($share_url, $network, $network_count);
- }
- }
- $count = ($network_count > $last_count) ? $network_count : $last_count; // 12/17/2018 - Version 1.1
- if (isset($_POST['click']) && $last_count == $count) $count++; // Add 1 to share count if a user clicked the share button
- if (is_numeric($count))
- $count = add_letter($count);
- echo $network . "=" . $count; // echo to ajax
- }
- } // <---------------------------- THIS
- ------------------------------------------------------------------
- to all the functions of the two files
- I send to gmail address file icons.zip
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- this alternate solution
- # file function.php (for cdn fonts)
- <?php
- /**
- * Font Awesome CDN Setup Webfont
- *
- * This will load Font Awesome from the Font Awesome Free or Pro CDN.
- */
- if (! function_exists('fa_custom_setup_cdn_webfont') ) {
- function fa_custom_setup_cdn_webfont($cdn_url = '', $integrity = null) {
- $matches = [];
- $match_result = preg_match('|/([^/]+?)\.css$|', $cdn_url, $matches);
- $resource_handle_uniqueness = ($match_result === 1) ? $matches[1] : md5($cdn_url);
- $resource_handle = "font-awesome-cdn-webfont-$resource_handle_uniqueness";
- foreach ( [ 'wp_enqueue_scripts', 'admin_enqueue_scripts', 'login_enqueue_scripts' ] as $action ) {
- add_action(
- $action,
- function () use ( $cdn_url, $resource_handle ) {
- wp_enqueue_style( $resource_handle, $cdn_url, [], null );
- }
- );
- }
- if($integrity) {
- add_filter(
- 'style_loader_tag',
- function( $html, $handle ) use ( $resource_handle, $integrity ) {
- if ( in_array( $handle, [ $resource_handle ], true ) ) {
- return preg_replace(
- '/\/>$/',
- 'integrity="' . $integrity .
- '" crossorigin="anonymous" />',
- $html,
- 1
- );
- } else {
- return $html;
- }
- },
- 10,
- 2
- );
- }
- }
- }
- -----------------------------------------------
- # file index.php (test icons)
- <?php include 'include/header.php'; ?>
- <body class="bg-light">
- <header>
- <div class="container-fluid">
- <div class="container">
- <ul class="list-inline text-primary">
- <li class="list-inline-item"><i class="fas fa-tty"></i> +971582413208</li>
- <li class="list-inline-item" style="float: right;"><i class="fab fa-whatsapp"></i> +971556671673</li>
- </ul>
- </div>
- </div>
- <?php include 'include/navbar.php'; ?>
- </header>
- <div class="container">
- <div class="social">
- <p class="skype">
- <a href="#" title="Skype"><i class="fab fa-skype"></i></a>
- </p>
- <p class="facebook">
- <a href="#" title="Facebook"><i class="fab fa-facebook"></i></a>
- </p>
- <p class="twitter">
- <!--<a href="#" title="Twitter"><i class="fab fa-twitter"></i></a>-->
- <a href="https://twitter.com/chiab_gigi?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @chiab_gigi</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
- </p>
- <p class="instagram">
- <a href="#" title="Instagram"><i class="fab fa-instagram"></i></a>
- </p>
- <p class="youtube">
- <a href="#" title="YouTube"><i class="fab fa-youtube"></i></a>
- </p>
- <p class="linkedin">
- <a href="#" title="Linkedin"><i class="fab fa-linkedin-in"></i></a>
- </p>
- </div>
- </div>
- <?php include 'include/footer.php'; ?>
- </body>
- </html>
- --------------------------------
- # file header.php
- <?php
- include 'functions.php';
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="author" content="Godwin Ogboe">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, maximum-scale=1, shrink-to-fit=no">
- <title><?php echo basename($_SERVER['REQUEST_URI']); ?></title>
- <!-- Latest compiled and minified CSS -->
- <link rel="shortcut icon" href="assets/ico/favicon.ico">
- <link rel="apple-touch-icon" sizes="180x180" href="assets/ico/apple-touch-icon.png">
- <link rel="icon" type="image/png" sizes="32x32" href="assets/ico/favicon-32x32.png">
- <link rel="icon" type="image/png" sizes="16x16" href="assets/ico/favicon-16x16.png">
- <link rel="manifest" href="assets/ico/site.webmanifest">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
- <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.1.1/bootstrap-social.min.css">
- <link rel="stylesheet" href="assets/css/style.css">
- <!--<link rel="stylesheet" href="assets/css/coolsocial.css">-->
- <style>
- .social {
- line-height: 200px;
- height: 200px;
- text-align: center;
- }
- .social p {
- line-height: 1.5;
- display: inline-block;
- vertical-align: middle;
- }
- </style>
- </head>
- -------------------------------
- #file footer.php
- <footer>
- <div class="col-md-12 justify-content-center">
- <p style="font-size: 11px; text-align: center;">Copyright © 2020 - <?php echo date('Y');?> Ifeanyi Chukwu Automobile. All Right Reserved </p>
- </div>
- <div class="social">
- <p class="skype">
- <a href="#" title="Skype"><i class="fab fa-skype"></i></a>
- </p>
- <p class="facebook">
- <a href="#" title="Facebook"><i class="fab fa-facebook"></i></a>
- </p>
- <p class="twitter">
- <!--<a href="#" title="Twitter"><i class="fab fa-twitter"></i></a>-->
- <a href="https://twitter.com/chiab_gigi?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @chiab_gigi</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
- </p>
- <p class="instagram">
- <a href="#" title="Instagram"><i class="fab fa-instagram"></i></a>
- </p>
- <p class="youtube">
- <a href="#" title="YouTube"><i class="fab fa-youtube"></i></a>
- </p>
- <p class="linkedin">
- <a href="#" title="Linkedin"><i class="fab fa-linkedin-in"></i></a>
- </p>
- </div>
- </footer>
- <!-- jQuery library -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
- <!-- Popper JS -->
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
- <!-- Latest compiled JavaScript -->
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
- <!-- Font Awesome JS -->
- <script defer src="https://use.fontawesome.com/releases/v5.0.13/js/solid.js" integrity="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin="anonymous"></script>
- <script defer src="https://use.fontawesome.com/releases/v5.0.13/js/fontawesome.js" integrity="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin="anonymous"></script>
- <script src="https://kit.fontawesome.com/e04e8f81b0.js"></script>
- <script src="//cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>
- <!--<script>
- CKEDITOR.replace( 'descs' );
- </script>-->
- -------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement