Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
How to display several “viewers” on one page?

 

 


einslistir
User

May 8, 2008, 3:17 PM

Post #1 of 8 (802 views)
Shortcut
How to display several “viewers” on one page? Can't Post

I would like to display several viewers on the frontpage, but I couldn’t manage to do it, because I include header.php and footer.php (like this <?php include ("toppur.php") ?>) for better control with the layout. Then I included a page with only a viewer, but now the links aren’t working properly.

When trying to click on the links below “Vegleiðingar” in the left side of http://televarp.fo.space2u.com/index.php, only one of the pages open. The same page open, even if you click on any of the other five links.

On the frontpage I included the file “vegleidingar.php” which only has this code:


Code
<?php 
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/home/d26454/public_html/lib/viewer_functions.php";

list($filesRecords, $filesDetails) = getRecords(array(
'tableName' => 'files',
'limit' => '10',
));

?>
<?php foreach ($filesRecords as $filesRecord): ?><a href="<?php echo $filesRecord['_link'] ?>" class="menuSidur"><?php echo $filesRecord['title'] ?></a><br><?php endforeach ?>


I thought, I had found the perfect solution for several viewers, by just including the files, but is that maybe the problem. Or should I do something else, if I want to use several viewers on the frontpage?


Dave
Staff / Moderator


May 8, 2008, 3:53 PM

Post #2 of 8 (798 views)
Shortcut
Re: [einslistir] How to display several “viewers” on one page? [In reply to] Can't Post

einslistir,

It sounds like everything is working except the vegleidingarSida.php page, which isn't showing different content even though the links are passing different numbers.

Can you attached vegleidingarSida.php so I can take a look at it?

As far as I can tell your index.php is setup correctly.

Dave Edis - Senior Developer
interactivetools.com


einslistir
User

May 8, 2008, 4:32 PM

Post #3 of 8 (796 views)
Shortcut
Re: [Dave] How to display several “viewers” on one page? [In reply to] Can't Post

Thanks for your help, Dave! The file is attached here...
Attachments: vegleidingarSida.php (2.21 KB)


Dave
Staff / Moderator


May 8, 2008, 4:37 PM

Post #4 of 8 (794 views)
Shortcut
Re: [einslistir] How to display several “viewers” on one page? [In reply to] Can't Post

That is odd. It looks right from this end. Want me to login and take a look? Can you send FTP and CMS login details to dave@interactivetools.com? (don't post login details to the forum). I'll take a look and get it sorted out for you.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


Dave
Staff / Moderator


May 9, 2008, 8:52 AM

Post #5 of 8 (755 views)
Shortcut
Re: [einslistir] How to display several “viewers” on one page? [In reply to] Can't Post

Hi einslistir,

I found the problem!

The vegleidingarSida.php file included topput.php which included vegleidingar.php which had the same list viewer and overwrote the value of $filesRecord.

I updated vegleidingarSida.php and moved the include tag _above_ the other tag and now it works.

You can see here:
http://televarp.fo.space2u.com/vegleidingarSida.php?4

Let me know if you need anything else!

Dave Edis - Senior Developer
interactivetools.com


einslistir
User

May 9, 2008, 1:24 PM

Post #6 of 8 (746 views)
Shortcut
Re: [Dave] How to display several “viewers” on one page? [In reply to] Can't Post

Thanks for your help, Dave! But your solution caused another problem. If you look at the letters and characters, both in the menu and the page, they are not the same as the others on the site. I don’t know how or why, but your change somehow disturbed all the faroese characters (that have something to do with either “vegleidingar.php” or “vegleidingarSida.php”), so they turned out to be something funny...

You can see the (big) difference, when you compare how the links under “Vegleiðingar” look like in http://televarp.fo.space2u.com/index.php and in http://televarp.fo.space2u.com/vegleidingarSida.php?4.

So I still ask the same question: How do I use many “viewers” on one page, without conflict between $filesRecord and stuff like that? What I need, is the possibility to use menus from the different sections on the frontpage and as menus on all pages. I don’t think the include works, so maybe you have some other solution, so I can have dynamic links on all pages?


einslistir
User

May 9, 2008, 4:55 PM

Post #7 of 8 (730 views)
Shortcut
Re: [Dave] How to display several “viewers” on one page? [In reply to] Can't Post

Hi, Dave! Finally, some light at the end of the tunnel. But I’m not sure, it will last, because now I have solved the problem with some JavaScript code, like <body onLoad="clientSideInclude('...');"> and a few other commands. I would rather do it with PHP, but right now JavaScript is the solution for me!

The problem with the funny characters appeared, when <?php include ("toppur.php") ?> was moved to the top of “vegleidingarSida.php”. This was also the problem for me before, and that was why I in first place moved it belove the “LOAD RECORDS” command. I don’t know how or why, but (with yours and my former solution) it messes up the special faroese characters like á, í, ó, ú, ý and ð.

If we now speak about feature requests, I definetely would like to see some solutions on how to include multiple viewers on a kind of a frontpage or similar, because almost every homepages needs to have different menus, like I need with mine. So this is a challenge of great importance!!!


Dave
Staff / Moderator


May 10, 2008, 2:41 PM

Post #8 of 8 (705 views)
Shortcut
Re: [einslistir] How to display several “viewers” on one page? [In reply to] Can't Post

Hi einslistir,

The other thing you can try is just renaming the variables on that page to something that isn't on any other page. For example on vegleidingarSida.php rename $filesRecords to $filesRecords2.

The other issue is probably related to charset. The program defaults to utf-8. If you can, it's good to set your charset to utf-8 with this tag in your page:

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

Give it a try, and if you're still having problems send me another email and I'll get in there and fix it for you.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4