List Viewer not showing up...

7 posts by 2 authors in: Forums > CMS Builder
Last Post: February 28, 2008   (RSS)

By nikkijones - February 18, 2008

Hi.

I've created a list viewer for a schools list using CMS Builder. The list for some reason, is appearing on one page and not on the other, eg:

http://www.interiorcentral.tv/AIP/schoolsmainPage.php - the schools list appears on the left

http://www.interiorcentral.tv/AIP/schoolsPage.php?1._Arrow_Vale_High_School-3 - the school list DOESN'T appear on the left.

I have the code 'include "schoolsList.php";' used on both.

Also, we wanted to have a password protected page for each school. This seemed simple in theory, the host provides password protected pages as part of its package. However, as the page is not a fixed page, is it impossible to password protect each page? The site had the whole are password protected before, however we now want each school password protected and i may have to re-do the whole school area if i cannot find a solution [mad] Any ideas? I've searched the net but just keep getting normal php password scripts, not a script for when a specific page is called.

Any help would be fab as its driving me crazy [crazy]

Cheers,
Nikki [:)]

Re: [nikkijones] List Viewer not showing up...

By Dave - February 18, 2008

>The list for some reason, is appearing on one page and not on the other.

The default for lists is to load the page number from the end of the url. So with the second url it's trying to show your 'page 3' of the results, which doesn't exist.

Try hard coding the page number for the school list to be 1 like this: $options['pageNum'] = '1';

>Also, we wanted to have a password protected page for each school.

I have a few ideas for this. So you want schoolsmainPage.php to be public and schoolsPage.php to be password protected? Or is this for a different section all together? Will each school have it's own password? What should happen if they don't know the password? Would it be better to have a username/password popup or a special url with a password on the end in it?

Let me know and I'll work on some options for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] List Viewer not showing up...

By nikkijones - February 27, 2008

Hi Dave,

Thanks for pointing out that Dave, it sorted out the problem.

Regarding the password protect, yes that's exactly what i want. Nothing too fancy. Schools are allocated a specific password and they need to type that in to get their schools details. If they forget it, they contact the client (as they contact regularly). Not bothered also whether it pops up or not. I was in a rush so i purchased a password protect script, however each school can still get in with the same password. We need each school to have their own unique password. Does this make sense?

Thanks as always for your help

Nikki[:)]

Re: [nikkijones] List Viewer not showing up...

By Dave - February 27, 2008

Would it be possible to just add a field to the school section editor called password? And then maybe have a pulldown with the school names and a field for password.

Then do a list viewer that only shows one record and matches records with that school name and password?

What do you think?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] List Viewer not showing up...

By nikkijones - February 28, 2008

Hi Dave,

I think i know what you're saying. The things is, i've set up the schools list as a viewer so the client can add news schools on and write all about them. This seemed the easiest way to do this - is there not a way to password protect it this way? With a pull down, how would the client be able to populate the list with schools?

Or am i completeley misunderstanding what you've said? [crazy]

Cheers,
Nikki.

Re: [nikkijones] List Viewer not showing up...

By Dave - February 28, 2008

Instead of having the list viewer output an html list of schools, you just have it output a list of schools with <option></option> around each school. Does that make sense?

But I had another idea all together for this. Is it important to have a direct url? Like school.php?OurSchool or can they always just link to the main page? Because if they can link to the mainpage you could just lookup the schools by password alone (making password a required, and unique field in the editor).

If you wanted to try that, create a new list viewer called schoolsPage2.php.

Then add this to the top in the HTML <head></head>.

<?php if (!$_GET['password']) { die("No password specified!"); } ?>

Then on your schoolList.php page add this javascript to the top:

<script type="text/javascript"><!--
function getPasswordAndRedirect() {
var password = prompt('Enter Password', '');

if (password) {
window.location='schoolPage2.php?password=' + password;
}

return false;
}
// --></script>


and replace your school links with this:

<a href="#" onclick="getPasswordAndRedirect();">...</a>

Then when they click on a school they'll get prompted for a password and then redirect to an url such as: schoolsPage2.php?password=magic which will display the school with that password -or- the "no records found" message, which you could replace with "Invalid Password".

What do you think? Would that work for you? Hopefully I didn't make that too complicated. :)
Dave Edis - Senior Developer
interactivetools.com