WebsiteBaker Support (2.8.x) > Droplets & Snippets

Full URL to actual site

(1/1)

Lonesome Walker:
Due a very lazy user here, i had to use this function:


--- Code: ---<?php

function actual_site() {

    global $database, $wb;

    $page_id = $wb->page_id;

    if (PAGE_ID>0) {

        $query1=$database->query("SELECT value FROM ".TABLE_PREFIX."settings WHERE name=pages_directory");
        $directory=$query1->fetchRow();

        $query2=$database->query("SELECT link FROM ".TABLE_PREFIX."pages WHERE page_id=$page_id");
        $sitelink=$query2->fetchRow();

        $query3=$database->query("SELECT value FROM ".TABLE_PREFIX."settings WHERE name=page_extension");
        $extension=$query3->fetchRow();

    }
    echo WB_URL;
    echo $directory[0];
    echo $sitelink[0];
    echo $extension[0];
}

?>

--- End code ---

Sure, it could be more efficient, but hey, it works and it is for free  :wink:

diodak:
Hello, O dont know for what you need that, I use


--- Code: ---<?php echo WB_URL.$_SERVER[&#39;REQUEST_URI&#39;]; ?>
--- End code ---

to print site addres when printing PDF by html2pdf module.

Lonesome Walker:
Well, sometimes you need it this way (just think about mod_rewrite...)  :roll:

Navigation

[0] Message Index

Go to full version