Firefox PHP

recent messages

Posted by lebaud 
recent messages
December 05, 2009 11:24PM
Hi all,

I have found and integrated a script "recent messages" in my index page site.
But I got the error message :

Quote

Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in C:\wamp\www\for\for\common.php on line 398

Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in C:\wamp\www\for\for\common.php on line 916

Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in C:\wamp\www\for\for\common.php on line 923

Notice: Use of undefined constant phorum_page - assumed 'phorum_page' in C:\wamp\www\for\for\common.php on line 1614

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

Notice: Array to string conversion in C:\wamp\www\for\recent_messages.php on line 63

My Version phorum is 5.2.14

Thanks for your help, Chris.
Re: recent messages
December 05, 2009 11:26PM
What is "a script recent messages"? Show the code or a link to the code.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: recent messages
December 05, 2009 11:27PM
"a script" is not really descriptive. All I can tell is that it's missing a defined('phorum_page', 'somename'); statement. Furthermore, it's handling data that it's not expecting, which might very much indicate a programming error.

If you found this script in some thread on these forums, then please post your follow up question in that same thread.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: recent messages
December 06, 2009 11:17AM
Hi Maurice and Thomas,

script here of Joe Curia

Thanks for your help.
Cordially Chris.

Sorry i'm not speak english very well
Re: recent messages
December 06, 2009 01:53PM
Chris,

Try these changes:

Add line 63:
Language: PHP
  1. foreach(array_keys($message) as $key) {
  2. if (is_array($key)) continue;
  3. $current_loop_content = str_replace("%$key%", $message[$key], $current_loop_content);
  4. }

Add line 109:
Language: PHP
  1. function get_recent_messages($number_of_messages,$show_forum,$view_type) {
  2.  
  3. define('phorum_page','jc_recent_messages');
  4.  
  5. require_once('./common.php');
  6. require_once('./include/format_functions.php');


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: recent messages
December 06, 2009 05:39PM
Hi Joe,

I have added line 63 and 109 but I got just one error

Quote

Notice: Array to string conversion in C:\wamp\www\for\for\recent_messages.php on line 64

thanks for you help.
Re: recent messages
December 06, 2009 06:20PM
Argh, I'm sorry, line 63 should read:
Language: PHP
  1. if (is_array($message[$key])) continue;


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: recent messages
December 06, 2009 06:34PM
Hi Joe,

Great


Thank you very much
Re: recent messages
December 20, 2009 07:23PM
Hi all,

I have found and integrated a script "recent messages" in my index page site.
But I got a new error message :

Quote

Warning: Cannot modify header information - headers already sent by (output started at /homez.60/lapatiss/www/index.php:5) in /homez.60/lapatiss/www/for/include/api/user.php on line 2636

Warning: Cannot modify header information - headers already sent by (output started at /homez.60/lapatiss/www/index.php:5) in /homez.60/lapatiss/www/for/include/api/user.php on line 264

Why ? help me please.
Thanks for your help.
Re: recent messages
December 20, 2009 08:54PM
Most probably, Phorum is trying to set a user cookie at that point, but your page has already sent the header of the page to the browser. Setting cookies can only be done before sending any body data to the browser.

A work around could be to put ob_start() as the very first command in your index.php script. That will hold back the body data until all script code has finished.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login