Author Topic: Full URL to actual site  (Read 2601 times)

Offline Lonesome Walker

  • Posts: 274
  • Gender: Male
  • Try...
    • Lonesome Walker
Full URL to actual site
« on: February 09, 2008, 07:15:05 PM »
Due a very lazy user here, i had to use this function:

Code: [Select]
<?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];
}

?>


Sure, it could be more efficient, but hey, it works and it is for free  :wink:
opensource company WebsiteBaker Templates Werbeartikel aller Art WebsiteBaker Hosting

Offline diodak

  • Posts: 85
Re: Full URL to actual site
« Reply #1 on: February 09, 2008, 07:30:21 PM »
Hello, O dont know for what you need that, I use

Code: [Select]
<?php echo WB_URL.$_SERVER[&#39;REQUEST_URI&#39;]; ?>
to print site addres when printing PDF by html2pdf module.
Buchsbaum

Offline Lonesome Walker

  • Posts: 274
  • Gender: Male
  • Try...
    • Lonesome Walker
Re: Full URL to actual site
« Reply #2 on: February 09, 2008, 07:35:56 PM »
Well, sometimes you need it this way (just think about mod_rewrite...)  :roll:
opensource company WebsiteBaker Templates Werbeartikel aller Art WebsiteBaker Hosting