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

Home: Products: CMS Builder:
Problem with time stamp or something like that

 

 


einslistir
User

May 22, 2008, 3:54 AM

Post #1 of 9 (449 views)
Shortcut
Problem with time stamp or something like that Can't Post

I am still working on the same homepage, where I now have copied old news, so some of the stuff from the old page will show up in the new one.

To keep the dates, I did create news with older dates, but now they do not show up on the frontpage (http://televarp.fo.space2u.com/index.php), but only on the news listing page (http://televarp.fo.space2u.com/tidindi.php).

How can I change this, so the news will show up on the frontpage as well? Of course, an almost empty frontpage isn’t much worth...

Hopefully, someone can help me out quickly, because the new homepage will be out on the final domainname later today or at last tomorrow!

Dave, you have my ftp-codes, so you maybe could see what is going wrong?


(This post was edited by einslistir on May 22, 2008, 3:56 AM)


Dave
Staff / Moderator


May 22, 2008, 9:09 AM

Post #2 of 9 (436 views)
Shortcut
Re: [einslistir] Problem with time stamp or something like that [In reply to] Can't Post

Hi einslistir,

If it's working on your tidindi.php page you can always copy the code from there. The problem is your index.php page is setup to only show anything if the record has a image uploaded. See this code:


Code
<?php foreach ($newsRecords as $newsRecord): ?> 
<?php foreach ($newsRecord['uploads'] as $upload): ?>
... record content is displayed here...


So foreach record, it displays the html for each upload, but if there is no upload then nothing will be displayed. I copied some code from lower down the page like this:


Code
<?php foreach ($newsRecords as $newsRecord): ?> 

<!-- copied code -->
<table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="380" class="yvirskrift"><a href="<?php echo $newsRecord['_link'] ?>"><?php echo $newsRecord['title'] ?></a></td>
<td width="100"><div align="right"><?php echo date("d.m.Y", strtotime($newsRecord['date'])) ?></div></td>
</tr>
</table>
<!-- /copied code -->

<?php foreach ($newsRecord['uploads'] as $upload): ?>
...


And now it displays something for each record as you can see here: http://televarp.fo.space2u.com/index.php

Just remember that the html inside the "foreach record" tags gets display once for each record, and the html instead for "foreach uploads" tags gets displayed once for each upload. But if there is no uploads nothing will be displayed.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


einslistir
User

May 22, 2008, 2:46 PM

Post #3 of 9 (423 views)
Shortcut
Re: [Dave] Problem with time stamp or something like that [In reply to] Can't Post

What I was looking for, was not the same as in tidindi.php, but I just mentioned that page, because it use the same data - and it actually works...

What I want, is the frontpage to act in the same way, if there is an image, as it does when there is no image. Which means, that I want the title, day and summary to show up always. And if there is an image, I want that to show up too.

Now there is no summary, if there isn’t an image, and that confuses me, because I have tried to move the "foreach" command to different places, but still I can’t get the summary to show up without an image, because right now none of the news story has an image.

The same problem seems to be, when you click on one of the news links on the frontpage!

Also the new code destroy my layout, but I guess that is not the biggest issue...

Another thing is, that I would like to have the first 5 or 10 records (stories with title, date, summary and an image, when there is one) on the frontpage, as they are now. Then I also would like to have some of the next records (maybe 5 or 10) with only a title link. How can I seperate the records in that way?


(This post was edited by einslistir on May 22, 2008, 3:11 PM)


Dave
Staff / Moderator


May 22, 2008, 5:18 PM

Post #4 of 9 (415 views)
Shortcut
Re: [einslistir] Problem with time stamp or something like that [In reply to] Can't Post

Hi einslistir,

So is the first issue solved? It seems like http://televarp.fo.space2u.com/index.php is looking better?

You can tell a viewer to skip the first X records with offset, like this:


Code
list($newsRecords, $newsDetails) = getRecords(array( 
'tableName' => 'news',
'offset' => '10',
'limit' => '10',
));


So if you have another viewer below you could try that.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


einslistir
User

May 23, 2008, 2:03 AM

Post #5 of 9 (408 views)
Shortcut
Re: [Dave] Problem with time stamp or something like that [In reply to] Can't Post

Hi, Dave! The first issue isn’t solved. If you click on the news links on the frontpage, the same image problem is on the page with the full news.

Today this site will be out on the final domain, so I try to do something to make some of the dynamic stuff static. But that is not a solution, just a way to avoid the worst problems with the image issue right now.


Dave
Staff / Moderator


May 23, 2008, 12:16 PM

Post #6 of 9 (372 views)
Shortcut
Re: [einslistir] Problem with time stamp or something like that [In reply to] Can't Post

Hi einslistir,

It's easier for me if we can tackle one problem at a time.

Tell you what, you create a mockup (or post me a link to the old one if it's still around) for the frontpage, explain how it's suppose to work to me, and I'll create the code for you as an example so you can see how to make it work.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


einslistir
User

May 23, 2008, 1:14 PM

Post #7 of 9 (363 views)
Shortcut
Re: [Dave] Problem with time stamp or something like that [In reply to] Can't Post

Hi, Dave!

First of all: I’m happy to say, that the site is out now, on the adress http://www.tv.fo and also http://www.televarp.fo. It’s not totally dynamic, because I had to do some static pages, so the site could be ready, but I will finish it step-by-step.

What it is all about, when we speak about the situation with images (especially on the frontpage, but also in the news stories itself), is as follows:

1. I want to have the possibility to use images with news stories. On the frontpage they can appear as thumbnails (smaller), and with the news story they can be images (larger).

2. The stories should appear on the frontpage with title (that links to news story), date and a summary - and if there is an image, it should be there as well. If there is no image, the title, date and summary should still be there.

3. The same should be, when you go to one of the stories on the frontpage. Then everything should be there in the same way: Title, date, summary and also content - and an image, if there is any. If there is no image, all the other things should be there, only without an image.

The problem was, that when I did some news stories with no image, they didn’t show up at all. As I understand, it was because of the “foreach” statements, so that might be the problem.

Right now the images is the biggest issue here, and to solve it temporarily (so I could get the site out now, as my customer wished), I had to choose an image for the newest news stories, just to have them to appear on the frontpage.

And to assure, that it was possible for visitors to read the news stories, after they pushed the news links on the frontpage, I had to totally remove the image function in the news stories, because otherwise they wouldn’t appear at all.

The piont is, that I would like to have the possibility to use images, if there are any for the stories. But if there aren’t any images, it should not do anything with the rest of the story. Said with other words: I would have the possibility to present the stories in the same way, if there is an image or not.

Hopefully I made myself clear now. My english isn’t that good, so you have to excuse me for that. But I guess, that now you see and understand my problem…?


Dave
Staff / Moderator


May 24, 2008, 3:32 PM

Post #8 of 9 (351 views)
Shortcut
Re: [einslistir] Problem with time stamp or something like that [In reply to] Can't Post

Hi einslistir,

Thanks for the details! The key is to only have the image "foreach" code around the image code itself, and not anything else.

I think I have it setup the way you want now. Have a look at this page and the code and let me know if it's what you wanted: http://televarp.fo.space2u.com/index2.php

Hope that helps! :)

Dave Edis - Senior Developer
interactivetools.com


einslistir
User

May 26, 2008, 5:07 PM

Post #9 of 9 (315 views)
Shortcut
Re: [Dave] Problem with time stamp or something like that [In reply to] Can't Post

Hi, Dave!

That solved the problem! Thank you very much!!!

Now the site is out, but I still have to manage some more pages, and than I can say, it is finished and totally ready for my customer to edit and administrate.

Thanks a lot!

With best regards

Hilmar Jan Hansen

(Einslistir is the name of my company)

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
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