Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do you write this?

  • What is the proper way to write this:

    <?php require( '<?php include('site.html'); ?>/abc.html' ); ?>

Viewing 7 replies - 1 through 7 (of 7 total)

  • chrishajer
    Participant

    @chrishajer

    What exactly are you trying to do? You have two filenames there: are you trying to include a file from a different site or something? You have a filename (abc.html) but have no URL or filesystem path. Please explain what you want to do exactly.

    I’m trying to see if I can create a theme via pixopoint that works for everyone. It requires you to put

    <?php require( 'xxxx/1.html' ); ?>, <?php require( 'xxxx/2.html' ); ?>, <?php require( 'xxxx/3.html' ); ?>, etc. in different locations of the bbPress theme.

    The xxxx changes with every server. Instead of finding and replacing all instances of the codes. I wanted to create another file that you can put in the path and it will fill all the xxxx.

    Does that make sense?


    chrishajer
    Participant

    @chrishajer

    No, it doesn’t make sense to me. Maybe someone else will follow. Or maybe I need more coffee.

    Maybe instead of xxxx, since the xxxx is the piece that changes, you define that in a file that is included by all files already (maybe bb-config.php or something that pixopoint includes) and then use the variable everywhere. Similar to how $bb_table_prefix is done:

    $bb_pixopoint_url = 'www.examplexxxx.com';

    Then use $bb_pixpoint_url in the different locations in the bbPress theme.


    kevinjohngallagher
    Member

    @kevinjohngallagher

    <br />
    <?php<br />
    //Put this in someplace obvious<br />
    // like the config file<br />
    global $path_needed_for_ryans_plugin = "/path/to/stuff/"</p>
    <p>?><br />
    <?php<br />
    global $path_needed_for_ryans_plugin;<br />
    require_once( $path_needed_for_ryans_plugin .'1.html' );<br />
    ?><br />

    Infact you’re probably better off doing in it with a “define” but I’ve not used Ryan’s plugin and didn’t want to presume.

    Long term though, this should be something the plugin handles itself. After all the point of a plugin, especially one that is meant to make it easier to sort out themes without having to edit them, is ot not edit the themes :) It’s still a great first step though.

    @kevinjohngallagher with deep integration all I need to do is edit the bbpress theme but with ryan’s plugin I need to edit both WP and bbP themes. The good thing about his plugin that it reduces the load on bbPress. It’s hard to make things automatic because every theme is made differently without a universal structure, it would be nice though.

    @chrishajer <?php require( .$bb_pixpoint_url. '/1.html' ); ?> is that how you write it?


    chrishajer
    Participant

    @chrishajer

    I think I would do it like this:

    <?php require( "$gerikg_pixopoint_path/chunk1.html" ); ?>

    Then define $gerikg_pixopoint_path = '/homepages/32/d84982904/htdocs/example/wp-content/plugins/pixopoint-theme-integrator/';

    If you define $gerikg_pixopoint_path in bb-config.php, I think you need to do a global $gerikg_pixopoint_path wherever you want to use the variable. There has to be a better way of doing it. [EDIT]


    chrishajer
    Participant

    @chrishajer

    Specifically about this though, and what’s wrong with it:

    <?php require( .$bb_pixpoint_url. '/1.html' );

    1. The . before the $bb_ and after the url means “concatenate” or “put together”. So you are putting together nothing, then the variable, then the 1.html. I don’t think it would work, since there is nothing to add to the beginning of the variable. Would probably give a syntax error

    2. It’s not really a URL it’s a file system path. So, it’s poorly named.

    3. I didn’t try it, but I think it would work otherwise, if you define the variable somewhere first.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar