Page 13 of 24

Re: [BETA] Topic Preview 0.7.0a

Posted: Mon Jul 14, 2008 1:38 am
by pgarvin76
indepndent wrote:Hello I am testing on a local installation and getting this error any help is appreciated thanks

Code: Select all

Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in c:\program files\easyphp1-8\www\phpbb3\includes\session.php on line 1278
You obviously have a syntax error (aka code typo) in session.php on or around line 1278.

Re: [BETA] Topic Preview 0.7.0a

Posted: Wed Jul 16, 2008 6:32 am
by IPB_Refugee
Hi pgarvin76,

when I navigate to Forums [tab] -> Manage Forums: Topic Preview to set the options I get these errors:
[phpBB Debug] PHP Notice: in file /adm/index.php on line 291: Undefined index: topic_preview_enabled
[phpBB Debug] PHP Notice: in file /adm/index.php on line 292: Undefined index: topic_preview_enabled
[phpBB Debug] PHP Notice: in file /adm/index.php on line 291: Undefined index: topic_preview_enabled_ucp
[phpBB Debug] PHP Notice: in file /adm/index.php on line 292: Undefined index: topic_preview_enabled_ucp
[phpBB Debug] PHP Notice: in file /adm/index.php on line 291: Undefined index: topic_preview_enabled_guests
[phpBB Debug] PHP Notice: in file /adm/index.php on line 292: Undefined index: topic_preview_enabled_guests
[phpBB Debug] PHP Notice: in file /adm/index.php on line 342: Undefined index: topic_prev_guest_first_last
[phpBB Debug] PHP Notice: in file /adm/index.php on line 273: Undefined index: topic_preview_char_limit
[phpBB Debug] PHP Notice: in file /adm/index.php on line 150: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 152: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3014)
These errors appear on my board outside the ACP:
[phpBB Debug] PHP Notice: in file /includes/functions_topic_preview.php on line 24: Undefined index: topic_preview_enabled
[phpBB Debug] PHP Notice: in file /viewforum.php on line 380: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
I have not only refreshed the style's cache but also purged the complete cache.

Does your MOD require any database changes? If yes, I couldn't find it.

Regards
Wolfgang

Re: [BETA] Topic Preview 0.7.0a

Posted: Thu Jul 17, 2008 3:58 am
by pgarvin76
IPB_Refugee wrote:Hi pgarvin76,

when I navigate to Forums [tab] -> Manage Forums: Topic Preview to set the options I get these errors:

I have not only refreshed the style's cache but also purged the complete cache.

Does your MOD require any database changes? If yes, I couldn't find it.

Regards
Wolfgang
The MOD does add several lines to the config table but that is taken care of automatically by the acp framework. It seems from your error messages that the config options are not making it into the database. I'm not sure what would cause that. Did this just start happening randomly or did you just install the mod? What phpBB version are you on?

Re: [BETA] Topic Preview 0.7.0a

Posted: Thu Jul 17, 2008 7:25 am
by IPB_Refugee
Hi pgarvin76,

I also think that there are no database changes done as I can't open the Topic Preview page in ACP without the mentioned errors. (Gues that's the place where the database changes should happen.)

I'm running 3.0.2. First I converted my phpBB-2.0.23 board to 3.0.1 and a few days ago I used the automatic updater to bring my board to 3.0.2.
By now my board has about 34 MODs, some related to the ACP: ACP Add User, ACP Notepad, ACP Overwrite Timezone. PHP version is 5.2.4 and MySQL version is 5.0.27.

Regards
Wolfgang

Re: [BETA] Topic Preview 0.7.0a

Posted: Fri Jul 18, 2008 2:21 am
by pgarvin76
OK Wolfgang, I've spent the last few hour pouring over the code and this is the only thing I can come up with. The errors are of type PHP Notice. I'm trying to figure out why you are having this issue and no one else has. I think the key is PHP Notice. In my common.php I have the following lines:

Code: Select all

// Report all errors, except notices
error_reporting(E_ALL ^ E_NOTICE);
Normally phpBB ignores PHP Notices. But you must have it set to display them. There are two ways to fix this.
1) Turn off E_NOTICE errors
2) Load the config values in the DB through phpMyAdmin

If you want to do choice 2 insert the following rows to your config table:

Code: Select all

config_name                           config_value       is_dynamic
topic_preview_enabled                 0                  0
topic_preview_enabled_ucp             0                  0
topic_preview_enabled_guests          0                  0
topic_prev_guest_first_last           0                  0
topic_preview_char_limit              250                0

Re: [BETA] Topic Preview 0.7.0a

Posted: Fri Jul 18, 2008 9:17 am
by IPB_Refugee
Hi pgarvin76,

thank you for helping me! :)
pgarvin76 wrote:In my common.php I have the following lines:

Code: Select all

// Report all errors, except notices
error_reporting(E_ALL ^ E_NOTICE);
I have exactly the same. Maybe it's because I have debug mode enabled in config.php?

Code: Select all

@define('DEBUG', true);
I manually added the fields in phpbb_config and now the ACP part of your MOD works. I have these settings now:

Enable topic preview: yes
Enable topic preview in UCP: yes
Enable topic preview for guests: no
Display which post by default: first
Set the character limit of topic previews: 250

But there's still an error left: When I visit a forum (viewforum.php), I get these errors:

Already fixed: http://www.phpbb.com/community/viewtopi ... 5#p6260595
[phpBB Debug] PHP Notice: in file /viewforum.php on line 380: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
[phpBB Debug] PHP Notice: in file /viewforum.php on line 477: Undefined index:
The lines 374-393 are:

Code: Select all

	while ($row = $db->sql_fetchrow($result))

	{

		$rowset[$row['topic_id']] = $row;

		$announcement_list[] = $row['topic_id'];


		// mod: Topic Preview
        $preview_post_ids[] = $row[$topic_preview->first_last];
		// end: Topic Preview


		if ($row['topic_type'] == POST_GLOBAL)

		{

			$global_announce_list[$row['topic_id']] = true;

		}

		else

		{

			$topics_count--;

		}

	}

	$db->sql_freeresult($result);

}
When I then activate topic preview in UCP, these errors vanish and your MOD works! But as soon as I turn off topic preview again, the mentioned errors come back when I visit a forum.

Guests (--> MOD disabled according to my settings in ACP) get the same errors.

I hope we will be able to solve the problem because I really like this MOD! :)

Regards
Wolfgang

EDIT: When I disable the MOD in ACP, I always get the undefined index errors when I visit a forum.

Re: [BETA] Topic Preview 0.7.0a

Posted: Sat Jul 19, 2008 7:26 am
by IPB_Refugee
I was right: When I change

Code: Select all

@define('DEBUG', true);
to

Code: Select all

//@define('DEBUG', true);
in config.php, there are no more error messages. But this can't be the solution because disabling the debug mode doesn't solve the problems in the code, it just hides them.

Regards
Wolfgang

Re: [BETA] Topic Preview 0.7.0a

Posted: Sat Jul 19, 2008 10:13 am
by IPB_Refugee
Okay, here is the fix. In viewforum.php change

Code: Select all

		// mod: Topic Preview
        $preview_post_ids[] = $row[$topic_preview->first_last];
		// end: Topic Preview
to

Code: Select all

		// mod: Topic Preview
		if ($topic_preview->enabled)
        	$preview_post_ids[] = $row[$topic_preview->first_last];
		// end: Topic Preview
and

Code: Select all

		// mod: Topic Preview
		$preview_post_ids[] = $row[$topic_preview->first_last];
		// end: Topic Preview
to

Code: Select all

		// mod: Topic Preview
		if ($topic_preview->enabled)
			$preview_post_ids[] = $row[$topic_preview->first_last];
		// end: Topic Preview
Maybe search.php needs similar changes - haven't looked at it yet. Thanks a lot for your MOD. I love it. :)

Regards
Wolfgang

Re: [BETA] Topic Preview 0.7.0a

Posted: Sat Jul 19, 2008 2:32 pm
by pgarvin76
Yes, search.php would need similar changes. I came up with a different way to solve it. But that will work fine for now. I need to do something about the errors you got in the ACP. Then I'll release an update.

Re: [BETA] Topic Preview 0.7.0a

Posted: Sat Jul 19, 2008 3:48 pm
by IPB_Refugee
Fine. :)

I think there is one more small bug: When I visit the topic preview page in ACP and change the settings, the administration protocol tells {TOPIC PREVIEW LOG CONFIG} Seems like there is a language variable missing.

Regards
Wolfgang

Re: [BETA] Topic Preview 0.7.0a

Posted: Sun Jul 20, 2008 3:02 am
by jtryptophan
Hello, may be b/c I'm still on 3.0...works fine on announcements but only shows 'No new posts" or "New posts" when hovering over regular topics. Results from search show nothing when hovered over. Refreshed a million times, purged, etc. Same issue. Any help?

guess i could make all topics announcements. :lol:

ImageClick for full size - Uploaded with plasq's Skitch

ImageClick for full size - Uploaded with plasq's Skitch

Re: [BETA] Topic Preview 0.7.0a

Posted: Mon Jul 21, 2008 4:12 am
by pgarvin76
jtryptophan wrote:Hello, may be b/c I'm still on 3.0...works fine on announcements but only shows 'No new posts" or "New posts" when hovering over regular topics. Results from search show nothing when hovered over. Refreshed a million times, purged, etc. Same issue. Any help?

guess i could make all topics announcements. :lol:
Your edits in viewforum.php and search.php must be incorrect. The code around where you add

Code: Select all

$preview_post_ids = $row[$topicpreview->firstlast];
changed a lot between 3.0.0 and 3.0.1. Zip up both of the mentioned files and post a link to them and I will take a look at them.

Re: [BETA] Topic Preview 0.7.0a

Posted: Thu Jul 24, 2008 1:01 am
by takufner
I've installed this MOD still in 3.0.1 and it was working like a charm.
My site has 20 forums and, after upgrading to 3.0.2 I can see the topic preview with no errors in all forums but the first one (just the first page doesn't show, the others are ok).

Thanks in advance

Re: [BETA] Topic Preview 0.7.0a

Posted: Thu Jul 24, 2008 6:36 pm
by IPB_Refugee
pgarvin76 wrote:Yes, search.php would need similar changes. I came up with a different way to solve it. But that will work fine for now. I need to do something about the errors you got in the ACP. Then I'll release an update.
Take your time. Unfortunately the changes in search.php do not work when you search for posts (sr=posts). When you search for topics, everything is okay. But when you search for posts, you get this warning:
[phpBB Debug] PHP Notice: in file /search.php on line 546: Undefined variable: topic_preview
[phpBB Debug] PHP Notice: in file /search.php on line 546: Trying to get property of non-object
That's line 546:

Code: Select all

		'S_TOPIC_PREVIEW'		=> $topic_preview->enabled,
Regards
Wolfgang

Re: [BETA] Topic Preview 0.7.0a

Posted: Fri Jul 25, 2008 6:39 am
by autinhyeu
Not work with FF3 :)