Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 09:59:36 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155487 Posts in 21709 Topics by 7737 Members
Latest Member: deenangle
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: add constant -> PAGE_LINK  (Read 1729 times)
Uthred
Guest
« on: April 01, 2009, 06:10:16 AM »

Hi,

it would be great if someone can add the define for a PAGE_LINK constant in class.frontend.php for future WB versions.
Code:
define('PAGE_LINK', $this->page['link']);

thanks
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #1 on: November 29, 2009, 11:24:35 PM »

This is a good idea.

Could anybody tell me, how to get the URL of the current page easily?

I am using SM2/CRUMB in order to get it, but I think there should be a more easy way to get it?

Any hints welcome.

Regards,
Stefek

Code: (SM2/CRUMB)
<?php
//create VARiable for current page url
    
ob_start();
    
show_menu2(0,SM2_CURR,SM2_CURRSM2_CRUMB'[url]'''''''''falsefalse) ;       
    
$PAGE_LINK ob_get_contents();          
    
ob_end_clean();  
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
DarkViper
Development Team
*****
Offline Offline

Posts: 1252


« Reply #2 on: November 30, 2009, 01:21:36 AM »

Code:
$current_page_link = WB_URL . $GLOBALS['wb']->page['link'] . PAGE_EXTENSION;
that's all....

( wb->page  is an array witch holds the complete record of the current page from table `xxx_pages` )
« Last Edit: November 30, 2009, 01:24:56 AM by DarkViper » Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
BerndJM

Offline Offline

Posts: 1764



« Reply #3 on: November 30, 2009, 03:25:50 AM »

Ok,

here I see it again:
there are a lot of functions/globals/arrays that are not (good) documented.

Anybody out there, that would do a documentation for this part which belongs to the "Dvelopers Guide" of the Help-Project ?!?!?

Regards Bernd
Logged

In theory, there is no difference between theory and practice. But, in practice, there is.
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #4 on: November 30, 2009, 04:36:45 AM »

Thanks to DarkViper I defined a Constant in the index.php of my template like this:


define
("PAGE_LINK"WB_URL PAGES_DIRECTORY $GLOBALS['wb']->page['link'] . PAGE_EXTENSION);


... and works.

Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
DarkViper
Development Team
*****
Offline Offline

Posts: 1252


« Reply #5 on: November 30, 2009, 12:47:17 PM »

Unfortunately the core of WB2.8.x should be backward compatible to PHP4.x.x.
So it's not possible to make classes and objects save for public use yet.
From the moment when we stop suporting PHP4.x.x., we can start to create save, well documented interfaces. But it needs time..time..time

Werner
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!