Latest Posts on site home page

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
pbcd2000
Registered User
Posts: 7
Joined: Mon Mar 24, 2008 8:33 pm

Re: Latest Posts on site home page

Post by pbcd2000 »

It does actually seem to work, the posts appear on the index page of the website, whether I am logged in, or out. I clearly don't know if there is some sort of cookie on my machine that may be assisting. Any 'unregistered' users appear to be seeing the same.

Paul
Vinyard_X43q
Registered User
Posts: 19
Joined: Wed Jun 06, 2007 8:14 am

Re: Latest Posts on site home page

Post by Vinyard_X43q »

I missed your first post on the last page. What you removed was correct and will work just fine. I don't know if you have already removed it but you can also remove the following code as you will not be needing it.

Code: Select all

    // Get forums that current user has read rights to.
    $forums = array_unique(array_keys($auth->acl_getf('f_read', true))); 
pbcd2000
Registered User
Posts: 7
Joined: Mon Mar 24, 2008 8:33 pm

Re: Latest Posts on site home page

Post by pbcd2000 »

Thanks for that, I seem to be having another problem now however due to where I have placed the code in my site, under Nestcape/Mozilla I get errors relating to the session

[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /public_html/index.php:6)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /public_html/index.php:6)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /public_html/index.php:6)

I am not sure how to resolve this yet as I am a little outside my comfort zone in this php file, any suggestions would be appreciated. Under IE these errors don't appear all the time, only every now and again, so maybe it's a cache issue, not sure.

Paul
Vinyard_X43q
Registered User
Posts: 19
Joined: Wed Jun 06, 2007 8:14 am

Re: Latest Posts on site home page

Post by Vinyard_X43q »

Remove any excess white space on line 6 of your index.php file.
pbcd2000
Registered User
Posts: 7
Joined: Mon Mar 24, 2008 8:33 pm

Re: Latest Posts on site home page

Post by pbcd2000 »

I removed the white space but it made no difference. I decided to remove all mention of sessions and the like as they were being setup by other bits of my site and I had to change a line as without the session the newposts file could not get the correct path to my forum. It all seems to work now in the different browsers I have tried. If logged in the posts are displayed, if not logged in the click on a post asks the user to login so its looking good now. Thanks for the help.

The code changes are below for completeness;

All session items are commented out;

Code: Select all

// Start session management
    //$user->session_begin();
    //$auth->acl($user->data);
    //$user->setup();
The extra path detail is added, so the line changes from;

Code: Select all

line $url = generate_board_url() . "viewtopic.{$phpEx}?f={$row['forum_id']}&t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}";
To my particular case with the extra subdirectory added;

Code: Select all

$url = generate_board_url() . "/fedforum/viewtopic.{$phpEx}?f={$row['forum_id']}&t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}"; //added fedforum to url
Thanks again.

Paul
st00ne
Registered User
Posts: 5
Joined: Sun Mar 30, 2008 12:17 pm

Re: Latest Posts on site home page

Post by st00ne »

i too have the same(almost) errors:
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /home/a4088914/public_html/index3.php:2)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /home/a4088914/public_html/index3.php:2)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /home/a4088914/public_html/index3.php:2)

but under that it shows all the post and icons...
i am no good at php but i found out that if i go to my forum, and come back the errors are gone, so i deleted my cookies and errors were back. so cookies could play some part,
i try lots of thing but noting worked, and i lost like 3 days with this.. so help plzzzzzzzzzzzz
oh, and here you can see it
http://www.zu-extreme.890m.com/index3.php
pbcd2000
Registered User
Posts: 7
Joined: Mon Mar 24, 2008 8:33 pm

Re: Latest Posts on site home page

Post by pbcd2000 »

You are having exactly the same problems that I was having, try commenting out all the session likes like I did in my last post, it certainly seems to have done the trick for me so it may work for you.

Paul
st00ne
Registered User
Posts: 5
Joined: Sun Mar 30, 2008 12:17 pm

Re: Latest Posts on site home page

Post by st00ne »

yes i already try that and then i get sql error you can see it here
http://www.zu-extreme.890m.com/index4.php

but i guess we dont have the same code because i didnt find this code
line $url = generate_board_url() . "viewtopic.{$phpEx}?f={$row['forum_id']}&t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}";
and instead of this

Code: Select all

// Start session management
    //$user->session_begin();
    //$auth->acl($user->data);
    //$user->setup();
i have this:

Code: Select all

    // Start session management
    $user->session_begin();
    $auth->acl($user->data);

    // Grab user preferences
    $user->setup();
i know it is the same thing but...

EDIT it:
and when i go to sessions.php and delte this code:

Code: Select all

		header('Set-Cookie: ' . $name_data . '; expires=' . $expire . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false);
everything works perfect.. BUT auto login on my forum isn't working(which is logical ) and that is something that i don't want.
so anyone could have some advices...
Embraer195
Registered User
Posts: 4
Joined: Thu Jan 03, 2008 7:06 pm

Re: Latest Posts on site home page

Post by Embraer195 »

Im also having the same problem with the headers error message.
bollo28
Registered User
Posts: 3
Joined: Fri Apr 04, 2008 6:11 pm

Re: Latest Posts on site home page

Post by bollo28 »

pbcd2000 wrote:Thanks for that, I seem to be having another problem now however due to where I have placed the code in my site, under Nestcape/Mozilla I get errors relating to the session

[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /public_html/index.php:6)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /public_html/index.php:6)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /public_html/index.php:6)

I am not sure how to resolve this yet as I am a little outside my comfort zone in this php file, any suggestions would be appreciated. Under IE these errors don't appear all the time, only every now and again, so maybe it's a cache issue, not sure.

Paul


Ihave almost the same errors. How can i fix this?
bollo28
Registered User
Posts: 3
Joined: Fri Apr 04, 2008 6:11 pm

Re: Latest Posts on site home page

Post by bollo28 »

Have now fixed it :)
KittyMelissa
Registered User
Posts: 4
Joined: Tue Apr 29, 2008 10:47 pm

Re: Latest Posts on site home page

Post by KittyMelissa »

The code works fine for me, but can someone modify it for me so the topics scroll one behind the other from right to left. If anyone can, it'd be much appreciated ^_^ :mrgreen:
slimeysi
Registered User
Posts: 2
Joined: Wed May 07, 2008 2:52 pm

Re: Latest Posts on site home page

Post by slimeysi »

Hey all i look after the tech side of a website and im having a problem with this mod :(

Like a few of you i'm getting an error saying
"[phpBB Debug] PHP Notice: in file /includes/session.php on line 916: Cannot modify header information - headers already sent by (output started at /home/vhosts/sdat-evo-1.coolpage.biz/sdf-home-new.php:62)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 916: Cannot modify header information - headers already sent by (output started at /home/vhosts/sdat-evo-1.coolpage.biz/sdf-home-new.php:62)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 916: Cannot modify header information - headers already sent by (output started at /home/vhosts/sdat-evo-1.coolpage.biz/sdf-home-new.php:62)

All my forums have public access and i cannot figure out what is going wrong.
I am using "php include" to show the script in my main page, could this be causing the problem?

see example here http://www.samedifferencefans.co.uk
slimeysi
Registered User
Posts: 2
Joined: Wed May 07, 2008 2:52 pm

Re: Latest Posts on site home page

Post by slimeysi »

Not to worry i found the problem!

For anyone that might have the same issue i was using a masked forwarding service and it was the mask that was causing the problem.

I have now changed my forwarding to re-dfirect and the problem has magicly dissapeared :D

Si
johnson
Registered User
Posts: 18
Joined: Sun Feb 24, 2008 3:51 am

Re: Latest Posts on site home page

Post by johnson »

How do I set this up? Where do I put in the code so I can view it on the front page of my site?

Return to “[3.0.x] MOD Requests”