Jump to content

Lance skin some errors. help


ercio

Recommended Posts

I just started using Lance skin www.virtualvarig.com and get some errors

1 - pilot tab not showing any pilots. I added 1 hub , 2 airports 1 aircraft ad one route.

2 - cant register anyone , because no HUB or location can be choose.

PILOTLIST
<?php
if(!$pilot_list) {
echo 'There are no pilots!';
return;
}
?>
<style>
.borders{
margin-left: 100px;
	margin-right:100px;
}
</style>
<div class="borders">
<h3><?php echo $title?></h3>
<table class="table">
<thead>
<tr>
<th>Pilot ID</th>
<th>Name</th>
<th>Rank</th>
<th>Flights</th>
<th>Hours</th>
</tr>
</thead>
<tbody>
<?php
foreach($pilot_list as $pilot)
{
/*
To include a custom field, use the following example:

<td>
<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
</td>

For instance, if you added a field called "IVAO Callsign":

echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');
*/

// To skip a retired pilot, uncomment the next line:
//if($pilot->retired == 1) { continue; }
?>
<tr>
<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>
</td>
<td>
<img src="<?php echo Countries::getCountryImage($pilot->location);?>"
alt="<?php echo Countries::getCountryName($pilot->location);?>" />

<?php echo $pilot->firstname.' '.$pilot->lastname?>
</td>
<td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>
<td><?php echo $pilot->totalflights?></td>
<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>
<?php
}
?>
</tbody>
</table>
</div>

pilot-list

REGISTER FORM

[indent=1]<style>
.bg{
	background-color: #ffffff;
	margin-left: 200px;
	margin-right: 200px;
	border-bottom-color: aqua;
}
a{
color:#212121;
}
</style>
<div class="bg">
<h3>Registration</h3>
<p>Welcome to the registration form for <?php echo SITE_NAME; ?>. After you register, you will be notified by a staff member about your membership.</p>
<form method="post" action="<?php echo url('/registration');?>">
<dl>
<dt>First Name: *</dt>
<dd><input type="text" name="firstname" value="<?php echo Vars::POST('firstname');?>" />
<?php
if($firstname_error == true)
echo '<p class="error">Please enter your first name</p>';
?>
</dd>

<dt>Last Name: *</dt>
<dd><input type="text" name="lastname" value="<?php echo Vars::POST('lastname');?>" />
<?php
if($lastname_error == true)
echo '<p class="error">Please enter your last name</p>';
?>
</dd>

<dt>Email Address: *</dt>
<dd><input type="text" name="email" value="<?php echo Vars::POST('email');?>" />
<?php
if($email_error == true)
echo '<p class="error">Please enter your email address</p>';
?>
</dd>

<dt>Select Airline: *</dt>
<dd>
<select name="code" id="code">
<?php
foreach($airline_list as $airline) {
echo '<option value="'.$airline->code.'">'.$airline->code.' - '.$airline->name.'</option>';
}
?>
</select>
</dd>

<dt>Hub: *</dt>
<dd>
<select name="hub" id="hub">
<?php
foreach($hub_list as $hub) {
echo '<option value="'.$hub->icao.'">'.$hub->icao.' - ' . $hub->name .'</option>';
}
?>
</select>
</dd>

<dt>Location: *</dt>
<dd><select name="location">
<?php
foreach($country_list as $countryCode=>$countryName) {
if(Vars::POST('location') == $countryCode) {
$sel = 'selected="selected"';
} else {
$sel = '';
}

echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>';
}
?>
</select>
<?php
if($location_error == true) {
			echo '<p class="error">Please enter your location</p>';
}
?>
</dd>

<dt>Password: *</dt>
<dd><input id="password" type="password" name="password1" value="" /></dd>

<dt>Enter your password again: *</dt>
<dd><input type="password" name="password2" value="" />
<?php
if($password_error != '')
echo '<p class="error">'.$password_error.'</p>';
?>
</dd>

<?php

//Put this in a seperate template. Shows the Custom Fields for registration
Template::Show('registration_customfields.tpl');

?>

<dt>reCaptcha</dt>
<dd>
		<?php if(isset($captcha_error)){echo '<p class="error">'.$captcha_error.'</p>';} ?>
		<div class="g-recaptcha" data-sitekey="<?php echo $sitekey;?>"></div>
		<script type="text/javascript" src="[url="https://www.google.com/recaptcha/api.js?hl=<?php"]https://www.google.c...api.js?hl=<?php[/url] echo $lang;?>">
		</script>
</dd>

<dt></dt>
<dd><p>By clicking register, you're agreeing to the <li><a href="<?php echo url('/Ruleregs'); ?>">terms and conditions</a></li></p></dd>
<dt></dt>
<dd><input type="submit" name="submit" value="Register!" /></dd>
</dl>
</form>
</div>[/indent]

Edited by servetas
added the part of codes in [code][/code] backets
Link to comment
Share on other sites

Hi George are you from PHPvms or Lance?

I try to register and I still cant.

I deleted this part on the bottom, because I don't want this and still cant register:

<?php

//Put this in a seperate template. Shows the Custom Fields for registration

Template::Show('registration_customfields.tpl');

?><p><dt>reCaptcha</dt>

<dd>

<?php if(isset($captcha_error)){echo '<p class="error">'.$captcha_error.'</p>';} ?>

<div class="g-recaptcha" data-sitekey="<?php echo $sitekey;?>"></div>

<script type="text/javascript" src="[url="

Link to comment
Share on other sites

  • 3 weeks later...
  • Moderators

Hi George are you from PHPvms or Lance?

I try to register and I still cant.

I deleted this part on the bottom, because I don't want this and still cant register:

<?php

//Put this in a seperate template. Shows the Custom Fields for registration

Template::Show('registration_customfields.tpl');

?><p><dt>reCaptcha</dt>

<dd>

<?php if(isset($captcha_error)){echo '<p class="error">'.$captcha_error.'</p>';} ?>

<div class="g-recaptcha" data-sitekey="<?php echo $sitekey;?>"></div>

<script type="text/javascript" src="[url="

You can't just delete the recaptcha code in registration form and expect process to go through. If you don't need the recaptcha, you'll need to modify 'Registration' module too.

Link to comment
Share on other sites

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>

<?php

if(!$pilot_list) {

echo 'There are no pilots!';

return;

}

?>

<style>

.borders{

margin-left: 100px;

margin-right:100px;

}

</style>

<div class="borders">

<h3><?php echo $title?></h3>

<table class="table">

<thead>

<tr>

<th>Pilot ID</th>

<th>Name</th>

<th>Rank</th>

<th>Flights</th>

<th>Hours</th>

</tr>

</thead>

<tbody>

<?php

foreach($pilot_list as $pilot)

{

/*

To include a custom field, use the following example:

<td>

<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>

</td>

For instance, if you added a field called "IVAO Callsign":

echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');

*/

// To skip a retired pilot, uncomment the next line:

//if($pilot->retired == 1) { continue; }

?>

<tr>

<td width="1%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">

<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>

</td>

<td>

<img src="<?php echo Countries::getCountryImage($pilot->location);?>"

alt="<?php echo Countries::getCountryName($pilot->location);?>" />

<?php echo $pilot->firstname.' '.$pilot->lastname?>

</td>

<td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td>

<td><?php echo $pilot->totalflights?></td>

<td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td>

<?php

}

?>

</tbody>

</table>

</div>

My question here

Is

When I leave the pilots.tpl default I get only the hubs that have pilots in them

There are no pilots here is on the margin and about 4 times across the bottom of the page

http://i228.photobuc...zpsurzfhlya.png

when I remove the code in the first 8 lines I get all the hubs, but

an error code pointing to the line that has the <foreach> argument on it

http://i228.photobuc...zps3ezzm4ma.png

How do I get the hub list with.....there are no pilots here....in the hubs that have no pilots in them?

Thanks

Rick

Link to comment
Share on other sites

  • Moderators

Try this:

<table>

<?php
$sql1 = "SELECT * FROM phpvms_pilots";
$pilots = DB::get_results($sql1);
$sql2 = "SELECT * FROM phpvms_airports";
$airps = DB::get_results($sql2);
foreach($airps as $airp)
{

if($airp->hub > 0)
 {
  $h = $airp->icao;
  $p = "SELECT * FROM phpvms_pilots WHERE hub = '$h'";
  $pi = DB::get_results($p);
?>
 <thead>

 <tr><td align="center" colspan="6" ><font size="4"><?php echo $airp->icao;?> (<?php echo $airp->name;?>)</font></td></tr>
 <tr><th style="text-align: center;" bgcolor="#00405e" colspan="6"> </th></tr>
 <tr>
 <td>Pilot ID</td>
 <td>Pilot Location</td>
 <td>Pilot Name</td>
 <td>Pilot Rank</td>
 <td>Pilot Total Flights</td>
 <td>Pilot Total Hours</td>
 </tr>
 </thead>
 <?php
 foreach($pi as $p)
  {
   if(!$pi)
 {
 ?>
  <tr><td colspan="6">No Pilots At This HUB</td></tr>
 <?php
 }
   else
 {
  $rank = "SELECT * FROM phpvms_ranks WHERE rank = '$p->rank'";
  $ran = DB::get_row($rank);
 ?>
  <tr>
   <td><a href="<?php echo url('/profile/view/'.$p->pilotid);?>"><?php echo $p->code.$p->pilotid;?></a></td>
   <td><img src="<?php echo Countries::getCountryImage($p->location);?>" alt="<?php echo Countries::getCountryName($p->location);?>" ></td>
   <td><?php echo $p->firstname.' '.$p->lastname?></td>
   <td><img src="<?php echo $ran->rankimage?>" alt="<?php echo $p->rank;?>" ></td>
   <td><?php echo $p->totalflights;?></td>
   <td align="center"><?php echo Util::AddTime($p->totalhours, $p->transferhours); ?></td>
  </tr>
<?php
 }
  }
 }
}
?>
</table

Link to comment
Share on other sites

It printed this to many times to count pretty much a whole page

Warning: Invalid argument supplied for foreach() in /hermes/bosoraweb047/b82/ipg.xxxx/Catch22/phpvms/lib/skins/lance/pilots_list.php on line 32 Warning: Invalid argument supplied for foreach() in /hermes/bosoraweb047/b82/ipg.xxxxxxxxxxxxx/Catch22/phpvms/lib/skins/lance/pilots_list.php on line 32 Warning: Invalid argument supplied for foreach() in /hermes/bosoraweb047/b82/ipg.xxxxxxxxxxxx/Catch22/phpvms/lib/skins/lance/pilots_list.php on line 32 Warning: Invalid argument supplied for foreach() in /hermes/bosoraweb047/b82/ipg.xxxxxxxxxxxx/Catch22/phpvms/lib/skins/lance/pilots_list.php on line 32 Warning: Invalid argument supplied for foreach() in /hermes/bosoraweb047/b82/ipg.xxxxxxxxxxxx/Catch22/phpvms/lib/skins/lance/pilots_list.php on line 32 Warning: Invalid argument supplied for foreach() in /hermes/bosoraweb047/b82/ipg.xxxxxxxxxxxxx/Catch22/phpvms/lib/skins/lance/pilots_list.php on line 32 Warning: Invalid argument supplied for foreach()

then it printed the hubs to many times to count

pretty much about 5 or 6 pages and inserted pilots into hubs randomly as well as the hubs they are supposed t be in

I replaced the code on the page with the code you put up

line 32 is line 32

I took this line out of the php file and it did about the same thing just sort of opposite

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>

Link to comment
Share on other sites

your file you posted didn't work either, so I copied the default one from the core templates folder to the lance skin folder and.....BAM!.....works like a champ so there must have been something corrupt in the original file now I can get to work customizing

I tried your code again with the same results.....do you have a custom module or style sheet, or css style that I don't have

Thanks

Rick

Link to comment
Share on other sites

  • Moderators

your file you posted didn't work either, so I copied the default one from the core templates folder to the lance skin folder and.....BAM!.....works like a champ so there must have been something corrupt in the original file now I can get to work customizing

I tried your code again with the same results.....do you have a custom module or style sheet, or css style that I don't have

Thanks

Rick

I do have a custom CSS but that shouldn't be a problem since it can be modified.

Link to comment
Share on other sites

This is what I get when I use your code

http://i228.photobucket.com/albums/ee182/captthud/WPR/web1_zpsn5zweebb.jpg

This is with the default php file I added a little code o get the lines in

This is basically what I'm tying to get but with a little larger text and the columns lined up

http://i228.photobucket.com/albums/ee182/captthud/WPR/web2_zps2lqpmxmo.jpg

Rick

Link to comment
Share on other sites

  • 3 months later...
  • 10 months later...

Do a quick search in your css for all the #ffffff or #FFFFFF or #fff or #FFF

I know that is not the exact answer you are looking for but will have to do until someone comes along who knows this skin that can tell you. When I can't find something I wild cared it and 99% of the time, I find it.

Scratch that. I just checked and they (Lance) actually embedded css in the layout.php file. I put a fix for this issue on the other post I linked to one or two posts down from this one.

Edited by TAV1702
Link to comment
Share on other sites

nice skin but my links are written in "white" on white background.

i dont find in css to change. can someone help me please?

My other post is accurate on what top search for, but if you can give me some screenshots I'll take a look. I just got requested to install this template for another person, so While I am at it, I might as well take a look and help others out.

So get me some screenshots and I'll give you a hand, EXCEPT, we are going to discuss it in your other post in the skinning thread http://forum.phpvms.net/topic/22701-free-phpvms-template-lance/#entry127194

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...