Is there a way to edit what the tour page looks like on the site?! I mean the layout of the different tours on the page. It seems it is always just one row, then another, then another. Whereas, rows and columns might be nice. Just wondering.
So, I guess where I am stuck is…I have the Tour page where I want to put the tours side by side in two columns, all they way down. So, like 12 tours in 2 columns, 6 rows. I just can’t figure out where/how to put the Div. Here is the current code in progress:
<?php
if(Auth::LoggedIn() == false)
{
echo 'Please login to view this page.';
echo '<br /><br /><br />';
Template::Show('login_form.tpl');
return;
}
?>
<?php
//////////////////////////////////////////////////////////////////////
//simpilotgroup Tour 1.0 module for phpVMS virtual airline system //
//@author David Clark (simpilot) //
//@copyright Copyright (c) 2011, David Clark, All Rights Reserved //
//////////////////////////////////////////////////////////////////////
echo '<center><h6>'.SITE_NAME.' Tours</h6></center>';
if($tours)
{
echo '<table width="40%" border="1px" align="center">';
foreach($tours as $tour)
{
if($tour->active == '0'){continue;}
$flights = unserialize($tour->flights);
echo '<tr>';
echo '<td width="25%">';
echo '<center><h2>'.$tour->title.'</h2></center>';
echo '<b>Status:</b> ';
if($tour->active == '1'){echo '<font color="#00FF00"><b> Active</b></font>';}
if($tour->active == '2'){echo '<font color="#FF0000"><b> Complete</b></font>';}
if($tour->active == '3'){echo '<font color="#FF0000"><b> Upcoming</b></font>';}
echo '<br /><b>Description:</b> '.$tour->description.'<br />';
echo '<b>Participants:</b> '.TourData::participants($tour->id).'<br />';
echo '<br /><a href="'.url('tour/details').'/'.$tour->id.'" text-decoration:underline;"><b>View Details</b></a>';
// echo '</td><td>';
if($tour->image == '')
{echo 'No Image Available';}
else
{echo '<center><img src="'.$tour->image.'" alt="'.$tour->title.'" style="max-width:300px;" /></center>';}
echo '</td>';
echo '<td>';
echo '<b>Flights:</b><br />';
$i = 1;
foreach($flights as $flight)
{
$schedule = SchedulesData::getSchedule($flight);
echo 'Leg: '.$i.' - '.$schedule->code . $schedule->flightnum.' - '.$schedule->depicao.' to '.$schedule->arricao.'<br />';
$i++;
}
echo '</td>';
echo '</tr>';
}
echo '</table>';
}
else
{echo 'No Tours Have Been Created.';}
?>
What are you using for a template. This is most likely going to best achieved with floating <div>'s rather than a table.
Yeah, sorry for taking so long to get back to you. The template, I think, was the original one that I had just modied along the way; but it has been so long, I forgot
But basically, the way it looks right now, with the changes I made above…is a smaller width table which I wanted to split into 2 columns essentially.
The tour module automatically puts it into a table, no?!
Yes, the template is set to structure as a table. The loop is going to have to be modified to count and allow two listings in each row instead of one.
Can I do that?! Or does the module have to be modified?!
Can I do that?! Or does the module have to be modified?!
This will have to be set in the template, the module just gives an array of the data from the database.
Maybe something like this could be used as a base;
$columns = 1;
foreach($lines as $line) {
//check to see if we are on the first column of the row
if($columns == 1){echo '<tr>';}
echo '<td>'.mydata.'</td>';
//check and see if we are on the second column
//if we are - end the row and reset the column count
//if not - add to the column count
if($columns == 2){echo '</tr>'; $columns = 1;}
else
{$columns++;}
}
//check if we have an open row
if($columns == 2){echo '</tr>';}
is it possible to put the add to bid on the listings of the tours (on the tours page) ?
Sorry Dave but the code I put above was right out of the tour_index.tpl file; am I editing that. I am kind of lost on how do this
Sorry, but I am coming back to this because I could never figure it out. I can edit it with “inspect” mode, but I have no idea what file I need to edit. I mean I would have thought the “tour_index.tpl” could be the item to edit, but apparently not.
I am just confused on this one, sorry Any help would be appreciated.
Bruce
2 hours ago, CPC900 said:
Sorry, but I am coming back to this because I could never figure it out. I can edit it with “inspect” mode, but I have no idea what file I need to edit. I mean I would have thought the “tour_index.tpl” could be the item to edit, but apparently not.
I am just confused on this one, sorry Any help would be appreciated.
Bruce
I been editing mine, what are you trying to edit. I will try to help you.
I just want to have the tours appear 2 or 3 across, instead of just one column. Like I said, I can work on it in firefox or chrome with the inspect function to see what it could look like, but have no clue how to edit the tour_index.tpl to make that happen??!
So, default looks like:
but want this:
Bruce
I was unable to get it that way on my test site. Sorry!
Yeah, the code that simpilot had posted above, has me stumped onto how to manipulate it?!?
bruce
Is there no one who can enlighten me on this?!? It’s like I feel it should be easy somehow, but obviously it’s not
Bruce
So, everyone who runs the tour mod, all have it displaying in ONE row?! Nobody has a different look to their tour page?!
And, is there another Tour type module out there for PMPVMS?!
Bruce
I have it showing in two colums - is this something you’re after?
Yes!! That is exactly what I am trying to do.
Bruce
Do you use the bootstrap framework?
Um, no. That was newer, right?!
Bruce