Welcome Guest, Not a member yet? Register   Sign In
Language problems
#1

[eluser]margsot[/eluser]
Hi i have a file called theme.php and in this file i have this line

Code:
$LANG['sources_HAVE_AN_ACCOUNT'] = "Have an account?";


Now in file called votes.php uses the code

Code:
if($r) //voting done
{
  echo "". $LANG['sources_HAVE_AN_ACCOUNT']." <a href='../login' target='_blank'  #0087F7; text-decoration: none; font-weight: bold;'>".$LANG['header_LOGIN_title']."</a>";
}
elseif(!$r) //voting failed
{
  $effectiveVote = getEffectiveVotes($id);
  echo $effectiveVote." ".$LANG['sources_POINTS_title'];
}

to perform a vote function for a specific article.

The problem is that when you click on the vote button the text "Have an account?" doesn't appears!!

Why is this happens? Where is the problem?
#2

[eluser]Tim Brownlaw[/eluser]
Well just as an aside your function would look a little better like this... ( or course there are other ways to do this )

Code:
if($r) //voting done
{
  echo $LANG['sources_HAVE_AN_ACCOUNT'];
  echo '<a href="../login" target="_blank">';
  echo $LANG['header_LOGIN_title'].'</a>';
}
else //voting failed
{
  $effectiveVote = getEffectiveVotes($id);
  echo $effectiveVote.' '.$LANG['sources_POINTS_title'];
}

Is $r definitely a Boolean - TRUE/FALSE... Also you could get a bit more creative on naming $r to something more meaningful as you seem to have done on your $LANG indexes! But that's a minor point.

To the meaty bits!

Now I am assuming that your statement...
Quote:The problem is that when you click on the vote button the text “Have an account?” doesn’t appears!!
means that this code is then run.

Now are you Certain that $LANG['sources_HAVE_AN_ACCOUNT'] exists when this code is executed.
And do the other $LANG[] values show up as expected?

If you were to put in a
Code:
var_dump($LANG);
at the end of that code - Do you see that item set and is it spelt the same (CASE is important!)

That's about all I can suggest at the moment.

Cheers




Theme © iAndrew 2016 - Forum software by © MyBB