<?php
$q = "SELECT * FROM social_domains WHERE catdom_id='$domain_id' AND `status`='1';";
$r = @mysql_query($q);
if($r && mysql_num_rows($r) == 1) {
    $optres['css'][] = $path . "amodules/social-media-actions/css/social-media-actions.css";
    $optres['js'][] = $path . "amodules/social-media-actions/js/social-media-actions.js";

    $optres['css'][] = $path . "assets/css/bootstrap-dialog.min.css";
    $optres['js'][] = $path . "assets/js/bootstrap-dialog.min.js";

    // Get the actual URL
    $salesview_url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $path_info = parse_url($salesview_url);
    if(isset($path_info['query'])) {
        $remove_qs = false;
        if(strpos($path_info['query'], 'remove_cache') !== false) $remove_qs = true;
        if(strpos($path_info['query'], 'yp_renew') !== false) $remove_qs = true;
        if($remove_qs) {
            $salesview_url = rtrim(str_replace('?' . $path_info['query'], '', $salesview_url), '/');
        }
    }


    $salesview_base_url = $protocol . $_SERVER['HTTP_HOST'] . "/$ultra_addonname";
    $salesview_uri = ltrim(str_replace($salesview_base_url, "", $salesview_url), '/');
    $online_url = $protocol. $ultra_domainname . "/$salesview_uri";




    ?>
    <div id="social-media" class="social-media">
        <button id="facebook-post" data-url="<?=$online_url;?>" class="btn btn-info btn-sm"><i class="fa fa-facebook-f"></i></button>
    </div>
    <?php
}