Help with HTML code please

Discussion in 'HTML & Website Design' started by indyonline, Nov 5, 2008.

  1. #1
    Hello. I was wondering if I could get some help with this.
    I have a site that is created with smarty PHP. I want to add a really small article to the site but I only want it to show up on one certain page that is not the index page. In the control panel of the script there is an area that I enter the html code for my ads and I can add the ad there in html.
    Is there a code I could use, thats html, that would only display the ad on a particular page?

    what i have:
    Looking for a new game to play? Try<a href="randomsitedotcom">site</a>
    Code (markup):
    I want it to show up on this page only
    "/profile/lisshrtt4.html"

    so is there a HTML code that would make this only show up on this page?
     
    indyonline, Nov 5, 2008 IP
  2. blktallos

    blktallos Active Member

    Messages:
    314
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Contact me:

    aim-sskatbld1
    yahoo -

    Ill tell you how to do it.
     
    blktallos, Nov 5, 2008 IP
    indyonline likes this.
  3. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    #3
    Yea all you have to do is open the html page with a editor and then add the code in where you want it to go.
     
    ryandanielt, Nov 5, 2008 IP
  4. indyonline

    indyonline Prominent Member

    Messages:
    4,626
    Likes Received:
    248
    Best Answers:
    2
    Trophy Points:
    335
    #4
    I cant do that cause it built with a smarty template script
    there is a layout.tpl file that includes everything then I create a new file "test.tpl" and add the ad there then attch it to the layout.tpl page but it shows on every page
     
    indyonline, Nov 5, 2008 IP
  5. kp_mastermind

    kp_mastermind Active Member

    Messages:
    885
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    58
    #5
    lemme try...still u in problem?
     
    kp_mastermind, Nov 7, 2008 IP
  6. indyonline

    indyonline Prominent Member

    Messages:
    4,626
    Likes Received:
    248
    Best Answers:
    2
    Trophy Points:
    335
    #6
    Ya, I still cant get it, but I dont think there is an HTML code that would tell the site to only display the ad if its a certain page.
     
    indyonline, Nov 7, 2008 IP
  7. kp_mastermind

    kp_mastermind Active Member

    Messages:
    885
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    58
    #7
    there is a code:D but in php
     
    kp_mastermind, Nov 7, 2008 IP
  8. indyonline

    indyonline Prominent Member

    Messages:
    4,626
    Likes Received:
    248
    Best Answers:
    2
    Trophy Points:
    335
    #8
    I have tried many {if} codes that people have told me in this forum and in smarty forums and they dontseem to work.

    What I need is something like

    {if "/profile/lisshrtt4.html"} include_file "lp31.tpl"{/if}

    or something like that. I have no clue when it comes to php and smarty.
     
    indyonline, Nov 7, 2008 IP
  9. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You'll need to set the smarty variable in the php code and then just use it in the layout file.

    E.g
    
    $somevariable = false;
    
    if (correct page)
    {
        $somevariable = true;
    }
    
    smarty->assign('isSomePage' = $somevariable);
    
    Code (markup):
    Then in the .tpl file..

    
    {if $isSomePage}
    show something..
    {/if}
    
    Code (markup):
     
    garrettheel, Nov 8, 2008 IP
  10. indyonline

    indyonline Prominent Member

    Messages:
    4,626
    Likes Received:
    248
    Best Answers:
    2
    Trophy Points:
    335
    #10
    How would the code be if the destination page for the ad was
    /profile/lisshrtt4.html
    Code (markup):
    and the file to be inserted was
    lp31.tpl
    Code (markup):
     
    indyonline, Nov 8, 2008 IP
  11. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    well, for correct page, you'd have to get the URI of the page first and then use explode() and strpos() to get rid of the stuff you don't want

    I don't have time to do it all for you, but to get the URI you use this:
    
    $uri = $_SERVER['REQUEST_URI'];
    
    Code (markup):
    Then go to php.com and check those two functions I just told you about - explode() and strpos() to get rid of the stuff you don't need.

    After that, just use a smarty include statement where I put "show something" before
     
    garrettheel, Nov 8, 2008 IP