phpBBHacks.com, the place for phpBB users

Bookmark and Share

Hack Conflicts

Hack Conflicts

Postby Thoul » November 27th 2004, 7:57 pm

A countless number of hacks have been created for phpBB, so it is to be expected that some of them might want to modify the same code. When you install more than one hack that wants to change a certain line of code, you can encounter what is known as a "Hack Conflict." Hack Conflicts usually result in unexpected effects or error messages. This tutorial is a guide to some known conflicts and methods of fixing them.

If you know of another conflict that you believe should be added to this list, send me (or another Support Team member) a private message and it will be considered for addition.
User avatar
Thoul
Admin/Webmaster
 
Posts: 18551
Joined: July 30th 2002, 11:30 am
Location: USA

View Topic Username Conflicts

Postby Thoul » November 27th 2004, 8:04 pm

View Topic Username Conflicts

Known Symptoms:
A user's username, such as MyUsername, is displayed in one of these appearances:
MyUsername');">MyUsername

MyUsername[/b], ')">MyUsername


Causes:
Lots of hacks add colors or other effects to poster usernames inside topics. Some other hacks use the displayed username in JavaScript and the coloration of the username damages the JavaScript code.

Known Conflicting Hacks:


Possible Fix #1:
The first fix is to remove some Advanced Quick Reply code from viewtopic_body.tpl. This may disable certain features of Advanced Quick Reply.
Code: Select all
##
##----------[ OPEN ]-------------------------------------
##

templates/subSilver/viewtopic_body.tpl

##
##----------[ FIND ]-------------------------------------
##

<a href="javascript:emoticon('[b]{postrow.POSTER_NAME}[/b], ')">{postrow.POSTER_NAME}</a>

##
##----------[ REPLACE WITH ]-----------------------------
##

{postrow.POSTER_NAME}


Possible Fix #2:
If the Advanced Quick Reply fix is not a solution, this alteration will remove username colors provided by Color Groups.
Code: Select all
##
##----------[ OPEN ]-------------------------------------
##

viewtopic.php

##
##----------[ FIND ]-------------------------------------
##

'POSTER_NAME' => ($poster_name = color_group_colorize_name($poster_id, true)) ? $poster_name : $poster,

##
##----------[ REPLACE WITH ]-----------------------------
##

'POSTER_NAME' => $poster,



Possible Fix #3:
When using Super Quick Reply with the Shop hack installed, these changes should fix the error.
Code: Select all
##
##----------[ OPEN ]-------------------------------------
##

viewtopic.php

##
##----------[ FIND ]-------------------------------------
##

//
// Quick Reply
//
if ( $show_qr_form )
{
     $poster = '<a href="javascript:pn(\''.$poster.'\');">'.$poster.'</a>';
}

##
##----------[ REPLACE WITH ]-----------------------------
##

//
// Quick Reply
//
if ( $show_qr_form )
{
     $poster = '<a href="javascript:pn(\''.$postrow[$i]['username'].'\');">'.$poster.'</a>';
}
Last edited by Thoul on November 28th 2004, 5:14 pm, edited 1 time in total.
User avatar
Thoul
Admin/Webmaster
 
Posts: 18551
Joined: July 30th 2002, 11:30 am
Location: USA

Junior Admin and Various Hacks

Postby Thoul » November 27th 2004, 8:06 pm

Junior Admin and Various Hacks

Known Symptoms:
An error message similar to the following appears when a Junior Admin attempts to use the Cash hack's administration features:
General Error
Error retrieving cash data

DEBUG MODE

SQL Error : 1146 Table 'xxxxxx.cash' doesn't exist

SELECT * FROM cash ORDER BY cash_order ASC

Line : 999
File : includes/functions_cash.php


Causes:
The Junior Admin hack accesses certain files inside a function, meaning all required variables must exist within the local scope of the function. The Cash hack expects the $table_prefix variable to be in the current (in this case, local) scope. This variable only exists in the global scope, however.

Known Conflicting Hacks:
  • Junior Admin + Cash [See Thread]
  • Junior Admin + Any other hack using $table_prefix


Possible Fix #1:
Add $table_prefix into the local scope of the Junior Admin function by using the following change.
Code: Select all
##
##----------[ OPEN ]-------------------------------------
##
includes/functions_jr_admin.php


##
##----------[ FIND ]-------------------------------------
##
	global $db, $phpbb_root_path, $lang, $phpEx, $board_config, $userdata;


##
##----------[ AFTER, ADD ]-------------------------------
##
	global $table_prefix;
User avatar
Thoul
Admin/Webmaster
 
Posts: 18551
Joined: July 30th 2002, 11:30 am
Location: USA


Return to phpBB 2: Troubleshooting

Who is online

Users browsing this forum: No registered users and 0 guests