Sub Menu
Links Menu
Online Users

In total there are 310 users online :: 4 registered, 0 hidden and 306 guests

Most users ever online was 1091 on Wed Aug 16, 2023 5:27 pm

Registered users: Bing [Bot], Google [Bot], Helter, Majestic-12 [Bot] based on users active over the past 60 minutes

[MOD/FIX] Global Headers (Left Column) on all pages BETA

This forum contains member submitted mods and hacks for IntegraMOD/IM Portal versions

*please read the "Read Me" post*

Moderator: Integra Moderator

[MOD/FIX] Global Headers (Left Column) on all pages BETA

PostAuthor: Jason Sanborn » Mon May 22, 2006 5:57 pm

This is a modification that is more of a fix. I have tested this on my site, and haven't found any issues with it so far. Of course, I've previously made that mistake with this code. As a result as of the current date, I am only calling this a BETA release. If anyone uses this and finds any problems, please let me know.

On some pages that are called by the message_die() function call, the IntegraMod headers (left column) does not display. This will allow the headers to be displayed on all pages.

OPEN: includes/functions.php

FIND:
Code: Select all
//+MOD] = array(         'msg_code'   => $msg_code,         'msg_text'   => $msg_text,         'msg_title'  => $msg_title,         'err_line'   => $err_line,         'err_file'   => $err_file,         'sql'         => $sql     );//-MOD: Fix message_die for multiple errors MOD

AFTER, ADD:
Code: Select all
//--- Fix Global Headers ---     $sql_store = $sql;       if ( !defined('HEADER_INC') )     {         if ( !defined('IN_ADMIN') )         {             include($phpbb_root_path . 'includes/page_header.'.$phpEx);         }         else         {             include($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);         }     }//--- ---

FIND]     $sql_store = $sql;[/code]
REPLACE WITH:
Code: Select all
//--- Fix Global Headers ---//   $sql_store = $sql;//--- ---

FIND]         //         // Load the Page Header         //         if ( !defined('IN_ADMIN') && !defined('HEADER_INC') )         {             include($phpbb_root_path . 'includes/page_header.'.$phpEx);         }         else         {             include($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);         }[/code]
REPLACE WITH:
Code: Select all
//--- Fix Global Headers ---/*         //         // Load the Page Header         //         if ( !defined('IN_ADMIN') && !defined('HEADER_INC') )         {             include($phpbb_root_path . 'includes/page_header.'.$phpEx);         }         else         {             include($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);         }*///--- ---
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

Re: [MOD/FIX] Global Headers (Left Column) on all pages BETA

PostAuthor: Tom_S » Tue May 23, 2006 12:29 am

Just checking and I am sure you know but there are two instances of:

Code: Select all
    $sql_store = $sql;


I only updated the first one after the last "Find"

Also after I updated to this fix I got this error]General Error
KMA Off-Road Forum Index ÂÂÂ » General Error
General Error

Could not query recent topics information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 9

SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username FROM phpbb_topics AS t, phpbb_posts AS p, phpbb_users AS u WHERE t.forum_id NOT IN ('start') AND t.topic_status <> 2 AND p.post_id = t.topic_last_post_id AND p.poster_id = u.user_id AND t.topic_time <= 1148376710 ORDER BY p.post_time DESC LIMIT

Line : 114
File : blocks_imp_recent_topics.php[/quote]
Last edited by Tom_S on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
<img>

Tom_S
Integra Supporter
Integra Supporter
 
Posts: 62
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 7:23 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Tue May 23, 2006 7:48 am

I rechecked the file, and didn't see a second instance (except that which was added by the modification itself).

Here's the entire message_die() function to compare against, to make sure everything is correct.

Code: Select all
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = ''){     global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images;     global $userdata, $user_ip, $session_length;     global $starttime;     global $HTTP_COOKIE_VARS;     //-- mod : profile cp ------------------------------------------------------------------------------//-- add     global $admin_level, $level_prior;//-- fin mod : profile cp --------------------------------------------------------------------------  //-- mod : categories hierarchy --------------------------------------------------------------------//-- add     global $tree;//-- fin mod : categories hierarchy ----------------------------------------------------------------  //-- mod : qbar ------------------------------------------------------------------------------------//-- add     global $qbar_maps;//-- fin mod : qbar --------------------------------------------------------------------------------  //-- mod : sub-template ----------------------------------------------------------------------------//-- add//-- fix     global $sub_template_key_image, $sub_templates;//-- fin mod : sub-template ------------------------------------------------------------------------     global $nav_separator;     //+MOD: Fix message_die for multiple errors MOD     static $msg_history;     if( !isset($msg_history) )     {         $msg_history = array();     }     $msg_history[] = array(         'msg_code'   => $msg_code,         'msg_text'   => $msg_text,         'msg_title'  => $msg_title,         'err_line'   => $err_line,         'err_file'   => $err_file,         'sql'         => $sql     );//-MOD: Fix message_die for multiple errors MOD  //--- Fix Global Headers ---     $sql_store = $sql;       if ( !defined('HEADER_INC') )     {         if ( !defined('IN_ADMIN') )         {             include($phpbb_root_path . 'includes/page_header.'.$phpEx);         }         else         {             include($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);         }     }//--- ---         if(defined('HAS_DIED'))     {//+MOD: Fix message_die for multiple errors MOD           //         // This message is printed at the end of the report.         // Of course, you can change it to suit your own needs. <s><img><s>         //         $custom_error_message = 'Please, contact the %swebmaster%s. Thank you.';         if ( !empty($board_config) && !empty($board_config['board_email']) )         {             $custom_error_message = sprintf($custom_error_message, '<a>', '</a>');         }         else         {             $custom_error_message = sprintf($custom_error_message, '', '');         }         echo "<html>n<body>n<b>Critical Error!</b><br>nmessage_die() was called multiple times.<br> <hr>";         for( $i = 0; $i </b>sql_error();           $debug_text = '';           if ( $sql_error['message'] != '' )         {             $debug_text .= '<br><br>SQL Error : ' . $sql_error['code'] . ' ' . $sql_error['message'];         }           if ( $sql_store != '' )         {             $debug_text .= "<br><br>$sql_store";         }           if ( $err_line != '' && $err_file != '' )         {             $debug_text .= '<br><br>Line : ' . $err_line . '<br>File : ' . basename($err_file);         }     }       if( empty($userdata) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) )     {         $userdata = session_pagestart($user_ip, PAGE_INDEX);         init_userprefs($userdata);     }       //     // If the header hasn't been output then do it     //     if ( !defined('HEADER_INC') && $msg_code != CRITICAL_ERROR )     {         if ( empty($lang) )         {             if ( !empty($board_config['default_lang']) )             {                 include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx);             }             else             {                 include($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);             }//-- mod : language settings -----------------------------------------------------------------------//-- add             include($phpbb_root_path . './includes/lang_extend_mac.' . $phpEx);//-- fin mod : language settings -------------------------------------------------------------------           }               if ( empty($template) || empty($theme) )           {             $theme = setup_style($board_config['default_style']);         }  //--- Fix Global Headers ---/*         //         // Load the Page Header         //         if ( !defined('IN_ADMIN') && !defined('HEADER_INC') )         {             include($phpbb_root_path . 'includes/page_header.'.$phpEx);         }         else         {             include($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);         }*///--- ---     }       switch($msg_code)     {         case GENERAL_MESSAGE:             if ( $msg_title == '' )             {                 $msg_title = $lang['Information'];             }             break;           case CRITICAL_MESSAGE:             if ( $msg_title == '' )             {                 $msg_title = $lang['Critical_Information'];             }             break;           case GENERAL_ERROR:             if ( $msg_text == '' )             {                 $msg_text = $lang['An_error_occured'];             }               if ( $msg_title == '' )             {                 $msg_title = $lang['General_Error'];             }             break;           case CRITICAL_ERROR:             //             // Critical errors mean we cannot rely on _ANY_ DB information being             // available so we're going to dump out a simple echo'd statement             //             include($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);               if ( $msg_text == '' )             {                 $msg_text = $lang['A_critical_error'];             }               if ( $msg_title == '' )             {                 $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';             }             break;     }       //     // Add on DEBUG info if we've enabled debug mode and this is an error. This     // prevents debug info being output for general messages should DEBUG be     // set TRUE by accident (preventing confusion for the end user!)     //     if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) )     {         if ( $debug_text != '' )         {             $msg_text = $msg_text . '<br><br><b><u>DEBUG MODE</u></b>' . $debug_text;         }     }       if ( $msg_code != CRITICAL_ERROR )     {         if ( !empty($lang[$msg_text]) )         {             $msg_text = $lang[$msg_text];         }           if ( !defined('IN_ADMIN') )         {             $template->set_filenames(array(                 'message_body' => 'message_body.tpl')             );         }         else         {             $template->set_filenames(array(                 'message_body' => 'admin/admin_message_body.tpl')             );         }           $template->assign_vars(array(             'MESSAGE_TITLE' => $msg_title,             'MESSAGE_TEXT' => $msg_text)         );//--------------------------------------------------------------------------------// Prillian - Begin Code Addition//         if ( $gen_simple_header )         {             $template->assign_vars(array('U_INDEX' => '', 'L_INDEX' => ''));         }//// Prillian - End Code Addition//--------------------------------------------------------------------------------           $template->pparse('message_body');           if ( !defined('IN_ADMIN') )         {             include($phpbb_root_path . 'includes/page_tail.'.$phpEx);         }         else         {             include($phpbb_root_path . 'admin/page_footer_admin.'.$phpEx);         }     }     else     {         echo "<html>n<body>n" . $msg_title . "n<br><br>n" . $msg_text . "</body>n</html>";     }       exit;}

If you have more information on your error, let me know, so I can try to find where the error is.
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

Re: [MOD/FIX] Global Headers (Left Column) on all pages BETA

PostAuthor: tekguru » Tue May 23, 2006 7:52 am

So if we alter both occurances does it fix the issue?
Last edited by tekguru on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[size=99px]http][/size]
[url=http][img=left]http://www.4winmobile.com/news/MVP_Horizontal_FullColor.png[/img][/url]
User avatar
tekguru
Sr Integra Member
Sr Integra Member
 
Posts: 329
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 10:29 pm
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Tue May 23, 2006 7:58 am

I only see one occurance in the unmodified file. In the modified file, it occurs twice. The first occurance is added by the modification in the first AFTER, ADD. This should not be changed. The second occurance is the line that should be replaced above.

If you are still having the error, can you post your message_die function, as I had posted in my previous post? (Be sure to disable smilies in the post when you do)
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

Re: [MOD/FIX] Global Headers (Left Column) on all pages BETA

PostAuthor: Tom_S » Tue May 23, 2006 10:43 am

That has got to be the stupidest mistake I have made yet. That is a super huge "DUH!" on my part. That is what I get for working with code after working for 28 hours straight.

I ran back through it and there are errors on the board.

My complete bad. <img>
Last edited by Tom_S on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
<img>

Tom_S
Integra Supporter
Integra Supporter
 
Posts: 62
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 7:23 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Tue May 23, 2006 11:16 am

No problem. I'm glad you found your problem, and hope you got it fixed. <img>
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Tom_S » Tue May 23, 2006 11:30 am

I still must be tired.

That is supposed to say 'No errors" on the board. After I re-coded it all back in there was not an issue at all when I did it right. I was counting the dang one I added as soon as I added it and all of a sudden there were two. If I would have been more attentive I would have watched what I was doing better. <img>
Last edited by Tom_S on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
<img>

Tom_S
Integra Supporter
Integra Supporter
 
Posts: 62
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 7:23 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Tue May 23, 2006 11:41 am

;)
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

Re: [MOD/FIX] Global Headers (Left Column) on all pages BETA

PostAuthor: Tom_S » Tue May 23, 2006 3:21 pm

Well darn. I haven't seen it as I have tried to duplicate what he did with no luck but I got a report from a Jr Admin of that same error:

[code]General Error KMA Off-Road Forum Index ÂÂÂ » General Error General Error  Could not query recent topics information  DEBUG MODE  SQL Error ]

Any ideas?
Last edited by Tom_S on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
<img>

Tom_S
Integra Supporter
Integra Supporter
 
Posts: 62
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 7:23 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Tue May 23, 2006 3:29 pm

That is a vague error message. Can you give me some more details as to what was happening, what page(s) this affects, etc?
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

Re: [MOD/FIX] Global Headers (Left Column) on all pages BETA

PostAuthor: Tom_S » Tue May 23, 2006 3:34 pm

Oops. Sorry.

I created a link in the qbar main menu to bring up unread posts since your last visit with this link:
http://mysite.com/search.php?search_id=newposts&sid=
(url modified)

When he clicked this is when he received the error. I still can not get it to reproduce so I need to call him and see if that was a very delayed post and he received it when I fouled up the first mod or since I updated it correctly.

Messag die for that line is:

Code: Select all
    message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);


EDIT

I had a member just report the same error when uploading a pic to the album which is smartors that came with 1.4.0.

He didn't copy/paste the error but just said it was the same as the one reported.

I dunno...I am digging through it and can't see anything.
Last edited by Tom_S on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
<img>

Tom_S
Integra Supporter
Integra Supporter
 
Posts: 62
Likes: 0 post
Liked in: 0 post
Joined: Wed Apr 26, 2006 7:23 am
Cash on hand: 0.00

PostAuthor: Jason Sanborn » Tue May 23, 2006 4:08 pm

I will look into that and see if I can reproduce and find what might be causing the error.
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Jason Sanborn » Tue May 23, 2006 7:56 pm

I haven't yet been able to pinpoint this error. There are a couple of things we should check.

1) When you receive the error, does the left column still appear (as the Mod suggests)?

2) If you remove the code added by this mod/fix, do you still receive the error?

If both items are true, then the mod is performing as designed, and you should look for the error elsewhere.

Please let me know what you find.
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

PostAuthor: Jason Sanborn » Thu May 25, 2006 6:59 am

Tom, do you have any more information on this? Has anyone else tried this code? It has been running on http://forums.simplicitypoint.com/ since I posted this thread, and I haven't seen any problems yet.
Last edited by Jason Sanborn on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[url=http][img=left]http://images.cbreview.net/banners/cloney2.gif[/img]
Comic Book Review: Comics, Role Playing and More[/url]
User avatar
Jason Sanborn
Sr Integra Member
Sr Integra Member
 
Posts: 436
Likes: 0 post
Liked in: 0 post
Joined: Sat Apr 08, 2006 9:40 am
Cash on hand: 0.00
Location: Marina, CA

Next

Return to Mods/Hacks

Who is online

Registered users: Bing [Bot], Google [Bot], Helter, Majestic-12 [Bot]