LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-16-2008, 02:22 PM   #1
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,104

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
need help with fixing php script


here is a script that is part of a mod for phpbb2
http://hoppernet.newsit.es/fixme.zip
it is broken somehow i think or pehaps just not php5 compliant causing the phpbb admin panel to break when it attempts to load
if someone can fix and post a fixed copy or tell me how to fix it (by posting a, find 'section of code' replace with 'new code' type of deal)
any help would be appreciated
edit: the full version of the mod is here
http://hoppernet.newsit.es/pafiledb_mod_2.0.1.zip
 
Old 01-17-2008, 11:05 PM   #2
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
show the error and show the code .. I am not downloading some random zip file that you point out (no offense)
 
Old 01-18-2008, 02:13 PM   #3
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,104

Original Poster
Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
kk sorry
the file is the pafiledb mod for phpBB2
after a little research (the most recent information is still about 4 years old so there might be a fix for it somewhere but understandably alot of links given are broken)
the problem is apparantly one of the functions in the file admin_pa_ug_auth.php
Code:
//function admin_display_cat_auth( $cat_parent = 0, $depth = 0 )

{
	global $pafiledb, $phpbb_root_path, $pafiledb_template, $phpEx;
	global $cat_auth_fields, $optionlist_mod, $optionlist_acl_adv;
	$pre = str_repeat( '        ', $depth );
	if ( isset( $pafiledb->subcat_rowset[$cat_parent] ) )
	{
		foreach( $pafiledb->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data )
		{
			$pafiledb_template->assign_block_vars( 'cat_row', array( 'CAT_NAME' => $cat_data['cat_name'],
					'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true,
					'PRE' => $pre,

					'U_CAT' => append_sid( "admin_pa_catauth.$phpEx?cat_id=$sub_cat_id" ),

					'S_MOD_SELECT' => $optionlist_mod[$sub_cat_id] ) 
				);

			for( $j = 0; $j < count( $cat_auth_fields ); $j++ )
			{
				$pafiledb_template->assign_block_vars( 'cat_row.aclvalues', array( 'S_ACL_SELECT' => $optionlist_acl_adv[$sub_cat_id][$j] ) 
					);
			}
			admin_display_cat_auth( $sub_cat_id, $depth + 1 );
		}
		return;
	}
	return;
}
is a double declaration of
Code:
function admin_display_cat_auth( $cat_parent = 0, $depth = 0 )
{
	global $pafiledb, $phpbb_root_path, $pafiledb_template, $phpEx;
	global $cat_auth_fields, $cat_auth_const, $cat_auth_levels, $lang;
	$pre = str_repeat( '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $depth );
	if ( isset( $pafiledb->subcat_rowset[$cat_parent] ) )
	{
		foreach( $pafiledb->subcat_rowset[$cat_parent] as $sub_cat_id => $cat_data )
		{
			$pafiledb_template->assign_block_vars( 'cat_row', array( 'CATEGORY_NAME' => $cat_data['cat_name'],
					'IS_HIGHER_CAT' => ( $cat_data['cat_allow_file'] ) ? false : true,
					'PRE' => $pre,
					'U_CAT' => append_sid( "admin_pa_catauth.$phpEx?cat_parent=$sub_cat_id" ) ) 
				);

			for( $j = 0; $j < count( $cat_auth_fields ); $j++ )
			{
				$custom_auth[$j] = '&nbsp;<select name="' . $cat_auth_fields[$j] . '[' . $sub_cat_id . ']' . '">';

				for( $k = 0; $k < count( $cat_auth_levels ); $k++ )
				{
					$selected = ( $cat_data[$cat_auth_fields[$j]] == $cat_auth_const[$k] ) ? ' selected="selected"' : '';
					$custom_auth[$j] .= '<option value="' . $cat_auth_const[$k] . '"' . $selected . '>' . $lang['Category_' . $cat_auth_levels[$k]] . '</option>';
				}
				$custom_auth[$j] .= '</select>&nbsp;';

				$pafiledb_template->assign_block_vars( 'cat_row.cat_auth_data', array( 'S_AUTH_LEVELS_SELECT' => $custom_auth[$j] ) 
					);
			}
			admin_display_cat_auth( $sub_cat_id, $depth + 1 );
		}
		return;
	}
	return;
}
but they arent the same code
commenting out the function allows MOST of the program to work
the question i think is how to get the function to work without making too much change to the code.
there is no error message
the left pane of the admin cp simply fails to load
like this
http://hoppernet.newsit.es/broken.html

Last edited by frieza; 01-18-2008 at 02:21 PM.
 
Old 01-27-2008, 06:15 PM   #4
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,104

Original Poster
Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
nvm i fixed it
here's how
Code:
[open]
admin/admin_pa_catauth.php
[find]
function admin_display_cat_auth
[replace x3]
function admin_pa_display_cat_auth
[open]
admin/admin_pa_ug_auth.php
[find]
function admin_display_cat_auth
[replace x3]
function admin_ug_display_cat_auth
[save and close files]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help fixing and optimizing AWK script hedpe Programming 5 08-29-2006 08:30 AM
LXer: Title: PHP/MySQL Classifieds Script AddAsset1.php Script Insertion LXer Syndicated Linux News 0 07-02-2006 06:21 PM
Help fixing/reconfiguring PHP on Apache PolishSausageof Linux - Software 1 04-28-2005 09:54 AM
Fixing a prebuilt PHP configured improperly number9 Linux - Software 0 05-18-2004 08:33 AM
can somebody help me in fixing the script jdara1 Linux - General 2 10-23-2003 12:18 PM


All times are GMT -5. The time now is 02:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration