How to display several “viewers” on one page?
8 posts by 2 authors in: Forums > CMS Builder
Last Post: May 10, 2008 (RSS)
By einslistir - May 8, 2008
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:
<?php
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?
Re: [einslistir] How to display several “viewers” on one page?
By Dave - May 8, 2008
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.
interactivetools.com
Re: [Dave] How to display several “viewers” on one page?
By einslistir - May 8, 2008
Re: [einslistir] How to display several “viewers” on one page?
By Dave - May 8, 2008
Hope that helps!
interactivetools.com
Re: [einslistir] How to display several “viewers” on one page?
By Dave - May 9, 2008
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!
interactivetools.com
Re: [Dave] How to display several “viewers” on one page?
By einslistir - May 9, 2008
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?
Re: [Dave] How to display several “viewers” on one page?
By einslistir - May 9, 2008
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!!!
Re: [einslistir] How to display several “viewers” on one page?
By Dave - May 10, 2008
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!
interactivetools.com