anyone here know how to...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RedShoe
    赤い靴 call me 202-456-1111
    • Feb 2001
    • 14831

    #1

    anyone here know how to...

    I have a simple Smarty site going. So far so good, but I can't get it to do one thing. The index.php is set up to display: a header, a main, and a footer set of templates.

    That part works but inside the main.tpl, I use the fetch function to call in a gallery like page.

    That gallery page is created from a database using a different program. (if I knew how to do it with Smarty I would)

    However, I'm using the fetch function and trying to call in a page, the actual function looks like this:

    {fetch file='http://www.domain.com/directory/videos.html'}

    Now the problem is, I need for "directory" be dynamic. It needs to use a smarty function so that I can replace that directory depending on the main page they are on. I've tried making it look like all of the following ways, and none of them work.

    {fetch file='http://www.domain.com/$directory/videos.html'}
    {fetch file='http://www.domain.com/\$directory/videos.html'}
    {fetch file='http://www.domain.com/\'$directory/videos.html'}
    {fetch file='http://www.domain.com/{$directory}/videos.html'}
    {fetch file='http://www.domain.com/'$directory'/videos.html'}

    if I hardcode the directory into the fetch function it works with no problem, but then that would mean I'd need a different template for each page, and the whole point of going with Smarty is to eliminate all those pages.

    Anyone know how to call a smarty instance into a fetch function? (or know of an alternative)

    SPECIALTY COSTUMES • PROPS • FX
    Superheroes • Monsters • Robots
    PM for details


    For any manufacturing needs. Adult or otherwise.

    aka BonsHigh on Insta
    Bonsai weed plants


  • peterk
    Confirmed User
    • Aug 2007
    • 3529

    #2
    Sorry, I cannot help you but here is a bump
    Bogat mama ala cu loturi de trafic

    Comment

    • Aussie Rebel
      Blow Me U Geeks
      • Aug 2001
      • 5108

      #3
      Sorry mate I don't know either, but bump for someone else that might know

      Comment

      • Dvae
        Confirmed User
        • Feb 2005
        • 5326

        #4
        Originally posted by RedShoe
        I have a simple Smarty site going. So far so good, but I can't get it to do one thing. The index.php is set up to display: a header, a main, and a footer set of templates.

        That part works but inside the main.tpl, I use the fetch function to call in a gallery like page.

        That gallery page is created from a database using a different program. (if I knew how to do it with Smarty I would)

        However, I'm using the fetch function and trying to call in a page, the actual function looks like this:

        {fetch file='http://www.domain.com/directory/videos.html'}

        Now the problem is, I need for "directory" be dynamic. It needs to use a smarty function so that I can replace that directory depending on the main page they are on. I've tried making it look like all of the following ways, and none of them work.

        {fetch file='http://www.domain.com/$directory/videos.html'}
        {fetch file='http://www.domain.com/\$directory/videos.html'}
        {fetch file='http://www.domain.com/\'$directory/videos.html'}
        {fetch file='http://www.domain.com/{$directory}/videos.html'}
        {fetch file='http://www.domain.com/'$directory'/videos.html'}

        if I hardcode the directory into the fetch function it works with no problem, but then that would mean I'd need a different template for each page, and the whole point of going with Smarty is to eliminate all those pages.

        Anyone know how to call a smarty instance into a fetch function? (or know of an alternative)
        I'll take a stab at it, just a wild guess
        Use double quotes.
        {fetch file="http://www.domain.com/$directory/videos.html"}
        .
        .

        Arguing with a troll is a lot like wrestling in the mud with a pig, after a couple of hours you realize the pig likes it.

        Comment

        • RedShoe
          赤い靴 call me 202-456-1111
          • Feb 2001
          • 14831

          #5
          Originally posted by Dvae
          I'll take a stab at it, just a wild guess
          Use double quotes.
          {fetch file="http://www.domain.com/$directory/videos.html"}
          Double quotes? That's the dumbest..



          HOLY SHIT!!!! THAT WORKED!!!!

          Thanks DVAE!!

          SPECIALTY COSTUMES • PROPS • FX
          Superheroes • Monsters • Robots
          PM for details


          For any manufacturing needs. Adult or otherwise.

          aka BonsHigh on Insta
          Bonsai weed plants


          Comment

          • RedShoe
            赤い靴 call me 202-456-1111
            • Feb 2001
            • 14831

            #6
            admins, you may close this thread now.

            SPECIALTY COSTUMES • PROPS • FX
            Superheroes • Monsters • Robots
            PM for details


            For any manufacturing needs. Adult or otherwise.

            aka BonsHigh on Insta
            Bonsai weed plants


            Comment

            • AsianDivaGirlsWebDude
              Purveyor, Fine Asian Porn
              • Jul 2004
              • 38323

              #7
              Originally posted by RedShoe
              Double quotes? That's the dumbest..



              HOLY SHIT!!!! THAT WORKED!!!!

              Thanks DVAE!!
              Best compliment ever...

              ADG
              Asian Diva Girls - Exclusive Photos and Videos



              Asian Diva Girls Affiliate Program (50% ccBill Revshare)

              Comment

              • Dvae
                Confirmed User
                • Feb 2005
                • 5326

                #8
                Originally posted by RedShoe
                Double quotes? That's the dumbest..



                HOLY SHIT!!!! THAT WORKED!!!!

                Thanks DVAE!!
                Its known as variable interpolation

                Single quotes are literal, meaning it will display exactly what you put in it.- No interpolation

                Whereas double quotes do.
                .
                .

                Arguing with a troll is a lot like wrestling in the mud with a pig, after a couple of hours you realize the pig likes it.

                Comment

                • 2012
                  So Fucking What
                  • Jul 2006
                  • 17189

                  #9
                  sounds stupid but ...

                  oops you got it
                  best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

                  Comment

                  • kmanrox
                    aka K-Man
                    • Oct 2001
                    • 29295

                    #10
                    what's Smarty? do u have a link for more info?
                    Crypto HODLr
                    Crypto mining
                    Angel investor

                    Comment

                    • 2012
                      So Fucking What
                      • Jul 2006
                      • 17189

                      #11
                      Originally posted by kmanrox
                      what's Smarty? do u have a link for more info?
                      It has a little learning curve but the more I use it the more I'm loving it.
                      http://smarty.php.net/download.php
                      best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

                      Comment

                      Working...