Results 1 to 5 of 5

Thread: Problem with custom page at indexu (global)

  1. #1
    Join Date
    Jan 2008
    Posts
    141

    Default Problem with custom page at indexu (global)

    Hi,

    I tried creating a new page in indexu to implement a forum script. The page is on following format: http://domain.com/page.php?id=forum

    Then I have placed that forum file under themes/kosmos/ as forum.html.
    Everything fine so far right, the file forum.html looks like this:
    Code:
    <%include file="header.html"
        title="site.com"
        meta_keywords=""
        meta_description=""
    %>
    <div id="container">
        
      <div id="main">
        
       <%$hook_html_custom_page_template_begin%>
        
            <%php%>include "./forum/index.php"; <%/php%>
        
        <%$hook_html_custom_page_template_end%> 
    
      </div>
    </div>
    
    <%include file="footer.html"%>
    It loads and works fine except from one thing...

    Take a look at this function:
    Code:
    $a = 1;
    $b = 2;
    
    function Sum()
    {
       global $a, $b;
       $sum = $a + $b;
       return $sum;
    }
    
    $sum = Sum();
    It's supposed to return 3, however when I access the page via http://domain.com/page.php?id=forum instead of http://domain.com/forum/index.php it returns 0. This happens because the script doesn't take note of the "global". In other words: "global $a" equals 0, when it's supposed to be 1 and "global $b" equals 0 when it's supposed to be 2.

    Anyone know what this could be?

  2. #2
    Join Date
    Aug 2008
    Location
    Paris, France
    Posts
    46

    Lightbulb Possible explanation ?

    When you type : http://domain.com/forum/index.php,
    maybe I'm wrong, but I guess that you go directly to your forum page and do not use any IndexU function. Therefore you get the result you were expecting.

    When you type : http://domain.com/page.php?id=forum,
    you use IndexU page.php + all its includes, so if there are a $a and a $b in IndexU code, there probably will be some code collisions (maybe other kinds of code collisions are possible, I do not know).

    Why not use .htaccess to send any visitor to the 1rst address (as it is able to add 2 numbers ) renamed as http://domain.com/forum/ ? This would solve your issue with a very friendly URL.

  3. #3
    Join Date
    Jan 2008
    Posts
    141

    Default

    Hello,

    First of all, there are no collisions between variable names, I have tried using random variable names like "$hwhadhiaww" and that didn't make any difference.

    Secondly, yes... when they go http://domain.com/forum/ there are no indexu functions...

    Why not use .htaccess to send any visitor to the 1rst address (as it is able to add 2 numbers ) renamed as http://domain.com/forum/ ? This would solve your issue with a very friendly URL.
    The thing is I want to keep my indexu design, and if I just send user directly to the script I lose my template design and I dont' want that.

  4. #4
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Warz...

    What forum script are you using? If you can create custom headers / footers in the forum, you could easily give the same look and feel to the forum as IndexU. With a little html work, it would look seamless and no one would know the difference
    FSGDAG | IndexU Hosting | Owner
    Website | NiceCoder Script Hosting and More! | Web4URL is For Sale!
    Follow Us On Twitter | FaceBook Profile | YouTube Videos

  5. #5
    Join Date
    Jan 2008
    Posts
    141

    Default

    I have created the forum myself (for another script, but decided to transfer it to indexu) and I guess your right... but was just hoping for a better and more integrated solution though, since recreating the templates means making two updates for every change.

Similar Threads

  1. error message at top of page when doing global search
    By leoa in forum INDEXU DELUXE v1.x
    Replies: 4
    Last Post: 07-08-2008, 03:33 AM
  2. Global Search on the WEB NOT working.
    By robbizok in forum v5.x
    Replies: 1
    Last Post: 08-29-2007, 09:47 PM
  3. Custom IndexU theme + Custom Adv. Mod
    By tender_heart in forum Help Wanted/Job Request
    Replies: 0
    Last Post: 08-28-2007, 12:25 AM
  4. Global Adventures Directory
    By ccherlet in forum Sites in Action
    Replies: 2
    Last Post: 01-25-2006, 09:23 PM
  5. Page Title for Custom Contact Page
    By thespursfan in forum v5.x
    Replies: 3
    Last Post: 10-30-2005, 02:12 PM

Posting Permissions

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