Jump to content
CPC900

Tour Mod Page

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.';}

?>

Share this post


Link to post
Share on other sites

What are you using for a template. This is most likely going to best achieved with floating <div>'s rather than a table.

Share this post


Link to post
Share on other sites

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?!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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>';}

Share this post


Link to post
Share on other sites

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 :(

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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:

tour_edit1.jpg

but want this:

tour_edit2.jpg

Bruce

 

Edited by CPC900

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I'd look at getting Bootstrap incorporated into your site.  It makes things a lot fresher, cleaner and allows you to make repsonsive layouts (ie. that resize dependant on broswer window size)

http://getbootstrap.com/docs/3.3/getting-started/#download

I can't just paste my code here as it will not work for you as mine has bootstrap classes assigned to it.

Share this post


Link to post
Share on other sites

Ok, I will look into that tonight.  I assume, Bootstrap is not TOO hard to install into my site, without causing too much mental anguish ;)

And what did you recommend to install in with: npm, yarn, composer or nuget??

Thanks,

Bruce

 

Edited by CPC900

Share this post


Link to post
Share on other sites

Hello

Shakamonkey88 is there any chance  to you give me the php code for your Tours Page please, mine looks horrible. I would love to do one that look like the picture above. 

I have the Tour Center module and the Ela Skin installed on my VA page

 

Thank You.

 

 

Share this post


Link to post
Share on other sites
On 12/18/2017 at 12:04 AM, shakamonkey88 said:

I have it showing in two colums - is this something you're after?

tE7aeTt.jpg

Do you have the code above for Crazy Creative's Tour Module.  The original is to plain.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×