Latest postings on website (Technics)
Hallo everyone,
I would like to put a preview window in the main page? E.g the lase three postings. So the user can see new postigs without visit the forum page.
Thanks a lot
Hakan
by Hakan, Sunday, October 14, 2007, 07:23 (6010 days ago)
Hallo everyone,
I would like to put a preview window in the main page? E.g the lase three postings. So the user can see new postigs without visit the forum page.
Thanks a lot
Hakan
by Alex , Sunday, October 14, 2007, 13:47 (6010 days ago) @ Hakan
Hi,
I would like to put a preview window in the main page? E.g the lase three postings. So the user can see new postigs without visit the forum page.
There are two possibilities: by a direct database request or - more elegant and independent - by using the RSS feed of the forum. This can be realized easily with MagpieRSS. See my example. Here you can download the script.
Alex
by Hakan, Sunday, October 14, 2007, 21:05 (6009 days ago) @ Alex
Thanks a lot Alex, I will try this....
best regards,
Hakan
by Hakan, Cologne/Germany, Monday, October 15, 2007, 15:59 (6009 days ago) @ Hakan
Hello Alex,
ahm...could you give a small instruction?
Thanks,
best regards,
Hakan
by Alex , Monday, October 15, 2007, 18:38 (6009 days ago) @ Hakan
ahm...could you give a small instruction?
It should just run out of the box... what problem do you have?
I added this how-to on the wiki - any corrections or improvements are welcome!
Alex
by Hakan, Monday, October 15, 2007, 19:12 (6009 days ago) @ Alex
Well, I think I have to chance the Index.php acording to my website.
Instead of http://mylittleforum.mylittlehomepage.net/forum/index.php
Is this correct? It it seems it's not enough...
As you can see I have not really knowledge in php...
Best regards,
Hakan
by Alex , Monday, October 15, 2007, 19:27 (6009 days ago) @ Hakan
In your case (Version 1.7) it should work like this:
$rss = fetch_rss('http://www.katzen.ag/forum/rss.php');
Alex
by Hakan, Monday, October 15, 2007, 20:03 (6009 days ago) @ Alex
***IT WORKS***
All right, and now my last issue.
To see the last postings I browse:
http://www.katzen.ag/latest_topics/latest_topics/index.php
So far so good, but how can I generate a small window (like you have ) and put it into the main page: http://www.katzen.ag/
The full screen doesn't make really sense.
You know what I mean? I know just the Iframe tecnology to put in to the main page, but this solution is not really elegant.
However the script works
Best regards,
Hakan
by Alex , Monday, October 15, 2007, 21:28 (6008 days ago) @ Hakan
So far so good, but how can I generate a small window (like you have ) and put it into the main page: http://www.katzen.ag/
The full screen doesn't make really sense.
Well, that's just an HTML/CSS issue. For example: put it into a div and format it with CSS:
<div id="main"> main content... </div> <div id="sidebar"> <?php require('magpierss/rss_fetch.inc'); // etc... ?> </div>
CSS:
#sidebar { float:right; }
If your main page isn't a PHP page you have to include the script by iframe.
Alex
by Hakan, Monday, October 15, 2007, 22:31 (6008 days ago) @ Alex
Thanks a lot.
MLF rules!
Best regards,
Hakan
by Hakan, Sunday, October 28, 2007, 20:21 (5996 days ago) @ Alex
Hi Alex,
I still have a problem. I made everything as we discussed.
But the last postings viewing works not realy.
If somebody make a new post, the script doesn't show it... ahmm... I mean it shows sometimes.
Let me explain:
http://www.katzen.ag/latest_topics/latest_topics/index.php
Currently the script shows:
Latest topics
test
bitte
bitte
Neues Forum
Katzengras
Re: Katzengras
Katzengras
Re: Suche Katzenpension
Suche Katzenpension
Re: Katze übergibt sich häufig nach dem fressen
Re: Kann mir jemand helfen
Re: Kann mir jemand helfen
Re: Kann mir jemand helfen
Kann mir jemand helfen
Re: Hilfe! Katzenunterbringung während Urlaub
So far so good...but for e.g. the last posting "test" isn't really the last posting - I made two postings after "test" but the script doesn't show it.
What is wrong???
Hakan
by Alex , Sunday, October 28, 2007, 23:24 (5995 days ago) @ Hakan
Hi Hakan,
So far so good...but for e.g. the last posting "test" isn't really the last posting - I made two postings after "test" but the script doesn't show it.
What is wrong???
This has probably to do with the caching feature of MagpieRSS. You can set the maximum cache age by defining MAGPIE_CACHE_AGE
(in seconds, deafult is 3600):
require('magpierss/rss_fetch.inc'); define("MAGPIE_CACHE_AGE", 1800); $rss = fetch_rss('[URL OF RSS FEED]');
Alex
by Hakan, Monday, October 29, 2007, 12:06 (5995 days ago) @ Alex
Yes, thats it!
Thanks