Web Hosting Talk







View Full Version : Need Help Editing PHProxy Code


MeAmRussian
01-08-2006, 09:32 PM
You can get the whole code here:

http://prdownloads.sourceforge.net/poxy/poxy-0.4.zip?download

It only has 2 php files, 1 javascript file, and 1 css style.

You can see an example of what it can look like here: http://proxyprince.com/

As you can see, there are a lot of checkbox option, such as Strip Website title, Show images, etc. I really don't need any of these options. They can be found in the file PHProxy.class.php.

These options take a lot of room, and I really don't want them. Can someone help me take them out? Whever I try to do it, the functionality of the whole script is lost. Here is the code where I think the checkbox is (you can find it towards the end in PHProxy.class.php):

function options_list($tabulate = false, $comments_on = false)
{
$output = '';
$comments = array();
$comments['include_form'] = array('Include Form' , 'Includes a mini URL-form on every HTML page');
$comments['remove_scripts'] = array('Remove Scripts' , 'Remove client-side scripting (i.e. Javascript)');
$comments['accept_cookies'] = array('Accept Cookies' , 'Accept HTTP cookies');
$comments['show_images'] = array('Show Images' , 'Show images');
$comments['show_referer'] = array('Show Referer' , 'Show referring website in HTTP headers');
$comments['strip_meta'] = array('Strip Meta' , 'Strip meta HTML tags');
$comments['strip_title'] = array('Strip Title' , 'Strip Website title');
$comments['rotate13'] = array('Rotate13' , 'Use rotate13 encoding on the URL');
$comments['base64_encode'] = array('Base64' , 'Use base64 encoding on the URL');
$comments['session_cookies'] = array('Session Cookies', 'Store cookies for this session only');

foreach ($this->flags as $flag_code => $flag_status)
{
$interface = array($comments[$flag_code][0], ' <input type="checkbox" name="ops[]"' . ($flag_status ? ' checked="checked"' : '') . ' /> ');

if (!$tabulate)
{
$interface = array_reverse($interface);
}

$output .= ($tabulate ? '<tr><td class="option">' : '')
. $interface[0]
. ($tabulate ? '</td><td class="option">' : '')
. $interface[1]
. ($comments_on ? $comments[$flag_code][1] : '')
. ($tabulate ? '</td></tr>' : '');
}

return $output;
}All those comments are the text for the checkboxes and the following line contains the checkbox:

$interface = array($comments[$flag_code][0], ' <input type="checkbox" name="ops[]"' . ($flag_status ? ' checked="checked"' : '') . ' /> ');I just can't seem to take out the checkboxes without making the script not work. This seems like a lot of examining to do, but it really isn't that much. I'd appreciate any help on this to get rid of the checkboxes.

Thanks a lot :)

ZiDev
01-08-2006, 10:44 PM
Remove the $comments['something'] = lines at the beginning to remove specific checkboxes. You'll probably need to keep at least one so that you aren't using array operations on non-existant array elements.

-- HW

MeAmRussian
01-08-2006, 11:19 PM
Remove the $comments['something'] = lines at the beginning to remove specific checkboxes. You'll probably need to keep at least one so that you aren't using array operations on non-existant array elements.

-- HW
Hehe, thanks for trying to help, I appreciate it. However, like I mentioned before, deleting those lines deletes the text only. So, when I deleted all but one of those comment lines, there was a bunch of checkboxes side by side with no text, all except one which did have text next to it :)

Any other help?

Thanks.

Dismounted
01-09-2006, 12:03 PM
edit the html of the main page to remove the checkboxes