![]() |
help with eval
Can anyone please tell me how to add an eval statement to this so I can put the information into a template? I know it's simple, I just can't see it. :)
Code:
if (($bday[2]>=21 and $bday[1]==3) or ($bday[2]<=19 and $bday[1]==4)) { Code:
<tr><td valign="top"><smallfont><B>Zodiac Sign: </B></smallfont></td><td valign="top"><smallfont>$zodiacsign |
Boofo is this what you're looking for?
PHP Code:
g-force2k2 |
I had:
Quote:
Quote:
|
Boofo so the second code is the template (getinfo_zodiac) that you're trying to integrate into the getinfo templates? regards...
g-force2k2 |
Yes. I want it to pull up the template if there is a zodiac sign and not do anything if there isn't. Here is the revised code that I need to have the template for.
PHP Code:
|
okay Boofo try this code then ::
PHP Code:
|
Nope, that didn't do it. Any other ideas? I know it is just a syntax problem I am missing here. I need to eval the template at the end of the code.
|
umm... just a question Boofo when you tested my code did you replace my variables with yours?
g-force2k2 |
I tried your code first and then my variables and neither one worked. here is what I had before with it all together:
PHP Code:
Quote:
|
well from that code you're showing me you can't use $zodiacsign in the eval because then you changed its original value of what it was to now define the template... maybe that maeks sense? regards
change this: PHP Code:
PHP Code:
hopefully that helps somewhat? g-force2k2 |
LOL I told you I was feeling stupid on this one. Your code works fine. :)
I forgot to change the variable in the getinfo template to $getinfo_zodiac like you had it in the code. I've been tearing myself up over this for almost 3 hours now and it was there slapping me in the face the whole time. It's usually the simple stuff that messes us up, huh? :) Thanks for all for the help. I owe you one, my friend. :) |
lol Boofo don't worry i probably do it waaay more then you ;) damn parse errors for me :p but its all good... i knew that the code should've worked one way or another :) just glad its all good... just another usual day of hacking for us eh? ^^
g-force2k2 |
I need to ask you, for my own curiosity...why couldn't I slip the eval statement in before I had it at zodiacsign="". They do that with the birthday variable and other ones. How come that won't work here? Because of all of the else if statements? I'd like to understand this a little better. :)
|
well its not that you can't do it that way... but with each elseif that you have and you want to define it before then $zodiacsign=""; then you'd have to use the same eval station after each esleif... kinda like this:
PHP Code:
g-force2k2 |
Ahhh, ok, that makes sense now. Instead of defining it twelve times, by waiting until after the zodicasign="", you can basically just save some code and do it once, right? So, then for each else statement you have to do an eval if you want to use a template or do it like we did here. I almost went the route of defining the eval after each else if but I knew there had to be an easier way to do it, I just wasn't sure how. :) I should have known that. Duuhhh!!! Believe it or not, that is the first time I have run into more than one else statement. LOL Again, thank you very much for guiding me through this. I had another piece of code with 12 else statements and I used to same type of thing that you showed me here for it and it worked great!
|
np Boofo always glad to help someone like you :)
g-force2k2 |
Does that mean I'm special? I get to ride the little yellow bus to school? ;)
|
You mean you dont anymore :(
Now I am the only one :dead: |
Move over! After my little fiasco here and the birthday problem (don't even ask, and gforce, that is our little secret :)) it looks like I'm back on the bus. :(
Quote:
|
YAY ^_^
I am sure susy will be drooling all over you once again ;) |
Is suzy back on the bus, too? Gosh, how long has it been since we've seen her? (Can you say NEVER!) ;)
Quote:
|
Yeah I was wondering about that oO
I think Freddie is the bus drivig tomorrow Oo |
I heard Freddie is sitting in the back with us from now on. That's the rumor I started (I mean heard), anyway. :)
Quote:
|
All times are GMT. The time now is 02:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|