Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-30-2007, 07:58 PM   #1
RedShoe
赤い靴 call me 202-456-1111
 
RedShoe's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: The Valley
Posts: 14,831
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


RedShoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:03 PM   #2
peterk
Confirmed User
 
peterk's Avatar
 
Join Date: Aug 2007
Posts: 3,529
Sorry, I cannot help you but here is a bump
__________________
Bogat mama ala cu loturi de trafic
peterk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:08 PM   #3
Aussie Rebel
Blow Me U Geeks
 
Join Date: Aug 2001
Location: Maximum Security
Posts: 5,108
Sorry mate I don't know either, but bump for someone else that might know
Aussie Rebel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:20 PM   #4
Dvae
Confirmed User
 
Dvae's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: US
Posts: 5,326
Quote:
Originally Posted by RedShoe View Post
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"}
Dvae is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:27 PM   #5
RedShoe
赤い靴 call me 202-456-1111
 
RedShoe's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: The Valley
Posts: 14,831
Quote:
Originally Posted by Dvae View Post
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


RedShoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:28 PM   #6
RedShoe
赤い靴 call me 202-456-1111
 
RedShoe's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: The Valley
Posts: 14,831
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


RedShoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:30 PM   #7
AsianDivaGirlsWebDude
Purveyor, Fine Asian Porn
 
AsianDivaGirlsWebDude's Avatar
 
Industry Role:
Join Date: Jul 2004
Location: San Francisco Bay Area
Posts: 38,323
Quote:
Originally Posted by RedShoe View Post
Double quotes? That's the dumbest..



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

Thanks DVAE!!
Best compliment ever...

ADG
AsianDivaGirlsWebDude is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:36 PM   #8
Dvae
Confirmed User
 
Dvae's Avatar
 
Industry Role:
Join Date: Feb 2005
Location: US
Posts: 5,326
Quote:
Originally Posted by RedShoe View Post
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.
Dvae is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:38 PM   #9
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
sounds stupid but ...

oops you got it
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:48 PM   #10
kmanrox
aka K-Man
 
kmanrox's Avatar
 
Industry Role:
Join Date: Oct 2001
Location: The Gutter
Posts: 29,292
what's Smarty? do u have a link for more info?
__________________
Crypto HODLr
Crypto mining
Angel investor
kmanrox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-30-2007, 08:49 PM   #11
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by kmanrox View Post
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
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.