*

Recent

Author Topic: template  (Read 13282 times)

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #15 on: October 23, 2011, 10:43:25 PM »
Your core.php code worked however u forgot to include $suserid as the userid in the if then statement so i did that and it worked. Also. with the settings.php when i deleted the cache and set it to 0 it now updates the mysql however even still it says its yes even if its no. I dont get that.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: template
« Reply #16 on: October 23, 2011, 10:52:03 PM »
oops sorry I meant to add that in after I found what the var was named lol must have forgot.

Hmmm about that.. try debugging it.. I know it seems stupid, but try echoing out the value of the setting you're talking about.
in the database you're using 1 and 0, correct?

Do you understand the process of doing these?
Code: [Select]
if ( $avatar_on == "0" ) { $avsel = "selected" ; } ;
if ( $gender_on == "0" ) { $gavsel = "selected" ; };

I'll stick around for about another 15 mins to explain if needed, but after that I really gotta get to sleep.. got school in the morning and need to run to the ER after that to make sure I don't have a toxic level of lithium in my body.

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #17 on: October 23, 2011, 11:02:25 PM »
I did debug if you look at my site the debug is under user panel. they do echo correctly also i do understand what those lines of code do it says if its 0 then the variable is set to selected making down at the bottom have no selected yet still when the variable is set to 0 it still says yes.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: template
« Reply #18 on: October 23, 2011, 11:18:03 PM »
hmm okay, just making sure you understood cuz you might be stuck with this problem till tomorrow.
Right now my guess is as good as yours though.

but.. give this a try just for the hell of it.
Code: [Select]
<select type=\'dropdown\' name=\'gender_on\'>
<option value=\'1\''; if($gender_on == "1"){ echo "selected"; } echo '>Yes</option>
<option value=\'0\' '; if($gender_on == "0"){ echo "selected"; } echo '>No</option>
</select>

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #19 on: October 23, 2011, 11:20:47 PM »
wait why would it be echo?

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: template
« Reply #20 on: October 23, 2011, 11:23:24 PM »
same thing as before.. its placing the text 'selected' inside the <option> tag.
Just this way is a little different and should work.. although the other way should too lol.
But this is more upfront and direct.

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #21 on: October 23, 2011, 11:26:14 PM »
still says yes but its set to no.... this makes no sense

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: template
« Reply #22 on: October 23, 2011, 11:33:56 PM »
yupperz I agree.
now I am thinking its a html problem. because the php is all correct.. I mean its echoing the correct value and its a simple if statement..
soo here is another debugging step..

Code: [Select]
<select type=\'dropdown\' name=\'gender_on\'>
<option value=\'1\''; if($gender_on == "1"){ echo "selected"; $yup = 1; } echo '>Yes</option>
<option value=\'0\' '; if($gender_on == "0"){ echo "selected"; $yup = 2; } echo '>No</option>
</select>
echo "<br>$yup<br>";

seems kinda dumb but just double checking things before we rule out PHP.
If that comes back with the correct output you're looking for then your problem is most likely related to html.
I'm off to bed, but give the html a real good look.. any little thing could be effecting it. I like to look at the page source via a web browser just to get all that php crap out the way to view just the plain html.

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #23 on: October 24, 2011, 06:17:24 AM »
well after fixing your echo :) i tried this and $yup was nothing. So it seems its not reading in the settings.php but yet it reads on the template.php

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: template
« Reply #24 on: October 24, 2011, 08:05:25 AM »
Not sure what's going on here - but it looks like something is missing. :(

Maybe this will help with the line of thought.

Code: [Select]
index.php   // Before the default

case 'whatever':
include ('whatever.php');
break;


URL PATH: http://127.0.0.1/arcade/index.php?action=whatever


whatever.php


<?php
{
global $domain$db$templates$directorypath// and whetever else you need
}

include 
"includes/config.php"// If you need to.

BLAH!

//If it's a function

function whatever() {

global $domain$db$templates$directorypath// and whetever else you need

BLAH!

}


?>
« Last Edit: October 24, 2011, 08:11:34 AM by mort »

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #25 on: October 24, 2011, 08:09:02 AM »
thats what i was thinking but there isnt a includes nor a global in settings for any of the others so why would i need it for those 2? This is really bothering me because it all looks correct. If you didnt notice the code is on the first page. Any money its just some simple comma or semi-colon.

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #26 on: October 24, 2011, 08:12:48 AM »
So i have an idea of how to fix this without actually fixing it. Im thinking if i just remove the enable yes/no because thats the only part that doesnt work. Then just put in my if/then that if its equal to '' then dont use it and if its fill then use it. Whaty do you guys think? I know its not as clean? i guess but it would work then.

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: template
« Reply #27 on: October 24, 2011, 08:14:06 AM »
I've updated my post (While you were posting) to include functions, because that's too easy to overlook.

:)

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: template
« Reply #28 on: October 24, 2011, 08:16:19 AM »
Get modern and change all the options "selected" to selected="selected"

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: template
« Reply #29 on: October 24, 2011, 08:18:17 AM »
whoa whoa thats their code dont blame me lol. I also need to go through it and make all the </tr> tags to both <tr></tr>.