Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    6
    Plugin Contributions
    0

    Default side boxes on non zen cart pages (in same domain)

    i checked out dynamic sideboxes. if you're familiar with it, i'm not using the javascript just calling the php script directly. the php script has to sit in the root folder of the store with on my site is larrysimprovpage.com/store.

    when i call http://www.larrysimprovpage.com/stor...eatured_sb.php i'm directly calling the script i want. you see it puts a product on the page.

    when i call http://www.larrysimprovpage.com/store/test_tony.php it works also. it's requiring the file above. all files are in the same folder as the include which is in the store root folder.

    if i call this: http://larrysimprovpage.com/test/test_tony.php since i'm out of the folder nothing works. i know it's because all the zen car vars and functions are relative to the /store folder i have set up.

    is there anything i can do to call this script outside of the /store folder and get the file that i'm calling to think it's being called from within the /store folder? i tried changin a bunch of the php $_SERVER vars. but that did nothing.

    any ideas? here's the script i'm calling:
    --------------------------------------------------------------------------------
    <?php
    /**
    * single_sidebox.php used to display a Zen Cart sidebox on some external resource
    *
    * @package general
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: single_sidebox.php based on index.php 2942 2006-02-02 04:41:23Z drbyte $
    */
    /**
    * Load common library stuff
    */
    require('includes/application_top_tmdev.php');


    /**
    * PLEASE ENTER THE NAME OF THE SIDEBOX YOU WANT TO CALL HERE:
    */
    $sidebox_name = 'whats_new_tm_dev.php';

    //which sidebox template to use:
    $column_box_default='tpl_box_default_left.php';
    $column_width = BOX_WIDTH_LEFT;



    /**
    * Load required functions and processing to generate the sidebox:
    */
    $language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
    $box_id = zen_get_box_id($sidebox_name);

    require(DIR_WS_MODULES . 'sideboxes/' . $sidebox_name);
    /*
    if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $sidebox_name) ) {
    echo "yes";
    require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $sidebox_name);
    } else {
    echo "no";
    require(DIR_WS_MODULES . 'sideboxes/' . $sidebox_name);
    }
    */

    /**
    * Load general code which runs before page closes
    */
    require(DIR_WS_INCLUDES . 'application_bottom.php');


    ?>

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: side boxes on non zen cart pages (in same domain)

    is there anything i can do to call this script outside of the /store folder and get the file that i'm calling to think it's being called from within the /store folder?
    This is part of the security/sessions thing .... why does it need to think that there is a session created? is it not enough to display the info?
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: side boxes on non zen cart pages (in same domain)

    i'm doing a real bad job at explaining myself i think.

    if i have a script located here. /script.php
    and it requires a script here: /inhere/this.php

    and this.php has this in it-> require('another.php').

    this won't work because rather than getting /inhere/another.php this way it will look for /another.php.
    right????? i mean i've checked this out over and over and those have been my results. when you require a script all the paths are relative to the script being called. sooo i would have to change the require to require('/inhere/another.php') and it would work anywhere.

    i can't do that calling zen-cart cause there's too many other includes that are including, etc. etc. etc. i'm ok with PHP but i'm not ready to mess with zen-card code.

    now since this post, i looked at the databases and i can write my own script to pull down the information i need (should have done that first). BUT I'M still curious, is there a way to trick the browser. i guess you're right that would be a security breach.

    and if i did set_path_includes i'd have to include many zen-cart folders.

    i also posted this on experts-exchange.com and usually when the questions are REALLY dumb nobody answers you! so maybe this is a REALLY dumb question!

    i'm assuming the answer is no. is it?

    thanks for your time.


    i'm sorry if it is.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: side boxes on non zen cart pages (in same domain)

    It would be easier to include the js
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Sep 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: side boxes on non zen cart pages (in same domain)

    you're right about the java script. i forget though why i thought against it. i'm curious as to how java script does it.

    anyway, i'm writing my own php scripts to go into the dbs and pull out products, i figured out the categories structure, which isn't too complicated. once i looked at it all, it was simple.

    in the end i'll be able to pick a folder id and work through it until i get to the products then pull them out and list them.

    thanks for all your help.

 

 

Similar Threads

  1. v151 using side boxes on non-store pages
    By erica62 in forum General Questions
    Replies: 5
    Last Post: 16 Feb 2014, 10:36 PM
  2. v139d Zen Side Boxes in my own HTML pages
    By 1066geoff in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Nov 2012, 02:28 PM
  3. Replies: 1
    Last Post: 18 Jul 2010, 08:35 AM
  4. Replies: 3
    Last Post: 27 Feb 2008, 09:25 PM
  5. Need Zen Cart Objects in non-zen cart web pages
    By udos in forum General Questions
    Replies: 4
    Last Post: 9 Jan 2008, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg