1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Problem with css in phpbb3

Discussion in 'phpBB' started by Matt18, Feb 1, 2010.

  1. #1
    Hi

    I am trying to set up a forum for my site sayeconomy.com

    Here is the link: http://www.sayeconomy.com/forum/

    ALl is going nice and default template is working. But as I try to set a different template (nothing fancy, free one) it works on index page but does not work on subpages (you can try it on the given link)

    I am using a premoded forum with url rewrite

    Please help me out I don't know what i'm doing wrong :S
    SEMrush
     
    Matt18, Feb 1, 2010 IP
    SEMrush
  2. Skinny Vinny

    Skinny Vinny Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to add a base href tag to your overall_header.html, and then purge the cache from the acp.

    Your css url is relative, so the browser is looking in folders that don't exist for your css files.


    Open your includes/functions.php file.
    Find at, or around line 4066 (as of 3.0.6)

    	$template->assign_vars(array(
    Code (markup):
    afterwards, add this:
    		'BASE_HREF'						=> (eregi('adm/',$_SERVER['REQUEST_URI'])) ? "<base href='http://www.sayeconomy.com/forum' />\n" : NULL,
    Code (markup):
    Then, inside the head tags of overall_header.html, simply add {BASE_HREF}

    Purge that cache and it should correct this.
    Let me know if you have any problems with this. Just scribbled it together, but didn't test it. Pretty common issue.
     
    Skinny Vinny, Feb 2, 2010 IP
  3. Matt18

    Matt18 Guest

    Messages:
    591
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi, thank you for your help.

    I did as you've said and went to styles, cleared the catch and nothing happened.

    I went to header and just added one letter before the link to see if there is a cache problem and the letter did appear, but that path did not. What could I do wrong :S?


    EDIT: Here is what I did now:

    I changed all {$phpbb_root_path} in functions with http://www.sayeconomy.com/forum/ and design works! THANK YOU!

    BUT there is a problem when I click New Topic or any other function inside one section. He goes to this link: http://www.sayeconomy.com/forum/economy-forum-f4/posting.php?mode=post&f=4

    and gives 404

    I assume it would have to go to: http://www.sayeconomy.com/forum/posting.php?mode=post&f=4

    How could I fix that? Thank you very much one more time!
     
    Last edited: Feb 2, 2010
    Matt18, Feb 2, 2010 IP
  4. Skinny Vinny

    Skinny Vinny Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It's still the same issue. A relative link.
    The base href tag in your header is the common fix for this.
    Install as I suggested, though I believe I may have faulted here. Try:

    		'BASE_HREF'						=> (eregi('adm/',$_SERVER['REQUEST_URI'])) ? "<base href='http://www.sayeconomy.com/forum/' />\n" : NULL,
    Code (markup):
    Note addition of a trailing slash on the base href tag.

    A quick test, just put this right into the overall_header:
    <base href='http://www.sayeconomy.com/forum/' />

    If it clears it up, the trailing slash was the issue. My bad lol.
    Then go back and do it as I originally said with that trailing slash. Otherwise, your css will disappear when in the acp.





    Am I the only one that finds it incredibly amusing that the 'phpbb-seo' mod links back to itself with an image?
     
    Skinny Vinny, Feb 2, 2010 IP
  5. Matt18

    Matt18 Guest

    Messages:
    591
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Cool thanks. it works now if I put this in the header: <base href='http://www.sayeconomy.com/forum/' />

    But otherwise it doesn't...

    I have added this into functions.php

    		'BASE_HREF'			=> (eregi('adm/',$_SERVER['REQUEST_URI'])) ? "<base href='http://www.sayeconomy.com/forum/' />\n" : NULL,
    
    Code (markup):
    Any idea what's wrong (i don't know php well enough :( )
     
    Matt18, Feb 2, 2010 IP
  6. Skinny Vinny

    Skinny Vinny Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    See, this is why I shouldn't stay up late.
    It's my fault: the method to fix this is correct, I just typo-ed the added line for functions.php.

    I set your true/false backwards.
    This should be the correct version:

    		'BASE_HREF'			=> (!eregi('adm/',$_SERVER['REQUEST_URI'])) ? "<base href='http://www.sayeconomy.com/forum/' />\n" : NULL,
    Code (markup):
     
    Skinny Vinny, Feb 2, 2010 IP
  7. Matt18

    Matt18 Guest

    Messages:
    591
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Still doesn't work without <base href='http://www.sayeconomy.com/forum/' /> in the header

    I cleared the cache and everything, changed it with what you've written but still doesn't work

    any more idea? Thank you very much for your help!
     
    Matt18, Feb 4, 2010 IP
  8. Matt18

    Matt18 Guest

    Messages:
    591
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Everything is working!

    Your method works m8, it was my mistake

    THANK YOU SOOO SOO MUCH for your help!

    Kind regards
     
    Matt18, Feb 6, 2010 IP