WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.9 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Full URL to actual site
  • Print
Pages: [1]   Go Down

Author Topic: Full URL to actual site  (Read 9275 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:
Logged
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.
Logged
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:
Logged
opensource company WebsiteBaker Templates Werbeartikel aller Art WebsiteBaker Hosting

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Full URL to actual site
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2