Unstoppable Domains โ€” Get your daily AI drops report

Need Help Editing PHProxy Code

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

thetzfreak

Established Member
Impact
19
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):

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:

PHP:
$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 :)
 
Last edited:
1
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
What I did:

Find
PHP:
<?php echo $PHProxy->options_list(true, true) ?>

Remove it

Find

PHP:
</form>

Above, add

PHP:
<table style='display: none;'>
<?php echo $PHProxy->options_list(true, true) ?>
</table>

You could then write some JS or something to dynamically show/hide the options...
 
0
•••
Javascript to show/hide the advanced options:

Replace

PHP:
<table style='display: none;'>

With

PHP:
<table style='display: none;' id='advoptions'>

Then where you want the "show/hide options" link

PHP:
<script type='text/javascript'> 
function showAdvancedOptions() { 
    currentstatus = document.getElementById('advoptions').style.display; 
    if ( currentstatus == "none" ) { 
        currentstatus = "block"; 
    } 
    else { 
        currentstatus = "none"; 
    } 
    document.getElementById('advoptions').style.display = currentstatus; 
} 
</script> 

<p>(<a href='#' onclick='showAdvancedOptions();'>Show/Hide Advanced Options</a>
 
0
•••
Appraise.net
Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back