Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 10:37:31 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155556 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Code and varibles namespace  (Read 212 times)
noname8

Offline Offline

Posts: 75


« on: October 18, 2011, 03:21:48 PM »


I'm trying to port an old php cart script into the wb, by using code-page and adding the php files into it by includes (version 2.8.1)

Problem is that all the variables in the CODE
isn't seen by the index.php file of the template

and vice versa

I have just one some small part with varying text and link in the header of the page, so that why it is in the template.php file.

Can I somehow make a varibale in the CODE that could be echoed by the template ? (or used some kind of str_replace with the wb buffer variable ?? )
« Last Edit: October 19, 2011, 07:30:26 AM by noname8 » Logged
noname8

Offline Offline

Posts: 75


« Reply #1 on: October 19, 2011, 07:37:06 AM »

I got it working after a loong night. Atleast partly. My template had the varibles used BEFORE the page_content
so nothing could not be seen of course.
But somehow the CODE and template's .php does not share the namespace of variables, even if changed the echo into the footer of the template.

Found out that its possbile to echo some text in to the $global[yourstuffname]
and it is seen by the template !

Other problem was ajax made session gets lost every page refresh, that is because the session need a name also in the ajaxphp. You can echo the name to see what it is and then code it
Code:

        session_name(APP_NAME.'_session_id'); //put the session in the APP_NAME, self made files cannot see the
        // defines of WB without includes... eg session_name('wb34343_session_id')

        @session_start();

 


Logged
noname8

Offline Offline

Posts: 75


« Reply #2 on: October 19, 2011, 11:01:18 PM »

Still would like to know that is there some kind of buffer in website baker core that i can do str_replaces
with my code section or in the template

What i would like to do is modify the page head section from inside the code-section with str_replace
but the tricky is that code section cannot see the head section because the head is located at the template's php file and not in the code section...

 afro+ evil
Logged
Stefek
WebsiteBaker Org e.V.

Offline Offline

Posts: 4884



« Reply #3 on: October 20, 2011, 12:39:33 AM »

You could try output filter dashboard.
It's a module (admin-tool) designed for that purpose.

Regards,
Stefek
Logged

"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
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!