how to add html in the script.

Discussion in 'PHP' started by newbie191, Aug 10, 2009.

  1. #1
    dear all,
    I am running a glype proxy.
    I want to add a backlinks list on the bottom of this page.

    surfhigh.info

    This is the content of the index.php file

    <?php
    /*******************************************************************
    * Glype Proxy Script
    *
    * Copyright (c) 2008, http://www.glype.com/
    *
    * Permission to use this script is granted free of charge
    * subject to the terms displayed at http://www.glype.com/downloads
    * and in the LICENSE.txt document of the glype package.
    *******************************************************************
    * This file is the webroot index.php and displays the proxy form.
    * Nothing too complicated - decode any errors, render relevant
    * options taking into account forced/defaults.
    ******************************************************************/

    /*****************************************************************
    * Initialise the application
    ******************************************************************/

    // Load global file
    require 'includes/init.php';

    // Send our no-cache headers
    sendNoCache();

    // Start the output buffer
    ob_start('render');

    // Flag valid entry point for hotlink protection
    $_SESSION['no_hotlink'] = true;


    /*****************************************************************
    * Determine the options to display
    ******************************************************************/

    // Start with an empty array
    $toShow = array();

    // Loop through the available options
    foreach ( $CONFIG['options'] as $name => $details ) {

    // Check we're allowed to choose
    if ( ! empty($details['force']) ) {
    continue;
    }

    // Generate the HTML 'checked' where appropriate
    $checked = $options[$name] ? ' checked="checked"' : '';

    // Add to the toShow array
    $toShow[] = array('name' => $name,
    'title' => $details['title'],
    'desc' => $details['desc'],
    'escaped_desc' => str_replace("'", "\'", $details['desc']),
    'checked' => $checked);

    }


    /*****************************************************************
    * Look for any error information in the URL.
    ******************************************************************/

    // Check for error
    if ( isset($_GET['e']) && isset($phrases[$_GET['e']]) ) {

    // Look for additional arguments (to be used as variables in the error message)
    $args = isset($_GET['p']) ? @unserialize(base64_decode($_GET['p'])) : array();

    // If we failed to decode the arguments, reset to a blank array
    if ( ! is_array($args) ) {
    $args = array();
    }

    // Did we find any args to pass?
    if ( $args ) {

    // Add phrase to start of array (to give to call_user_func_array())
    $args = array_merge( (array) $phrases[$_GET['e']], $args);
    $error = call_user_func_array('sprintf',$args);

    } else {

    // Just a simple print
    $error = $phrases[$_GET['e']];

    }

    // Finally add it to the $themeReplace array to get it in there
    $themeReplace['error'] = '<div id="error">' . $error . '</div>';

    // And a link to try again?
    if ( ! empty($_GET['return']) ) {
    $themeReplace['error'] .= '<p style="text-align:right">[<a href="' . $_GET['return'] . '">Reload ' . deproxifyURL($_GET['return']) . '</a>]</p>';
    }

    }

    /*****************************************************************
    * Check PHP version
    ******************************************************************/

    if ( version_compare(PHP_VERSION, 5) < 0 ) {
    $themeReplace['error'] = '<div id="error">You need PHP 5 to run this script. You are currently running ' . PHP_VERSION . '</div>';
    }


    /*****************************************************************
    * Maintenance - check if we want to do anything now
    ******************************************************************/

    if ( $CONFIG['tmp_cleanup_interval'] ) {

    // Do we have a next run time?
    if ( file_exists($file = $CONFIG['tmp_dir'] . 'cron.php') ) {

    // Load the next runtime
    include $file;

    // Compare to current time
    $runCleanup = $nextRun <= $_SERVER['REQUEST_TIME'];

    } else {

    // No runtime stored, assume first request with the cleanup option
    // enabled so run now.
    $runCleanup = true;

    }

    // This might take a while so do it after user has received
    // page and cut connection.
    if ( ! empty($runCleanup) ) {
    header('Connection: Close');
    }

    }


    /*****************************************************************
    * All done, show the page
    ******************************************************************/

    // Throw all template variables into an array to pass to the template
    $vars['toShow'] = $toShow;

    echo loadTemplate('main', $vars);

    // And flush buffer
    ob_end_flush();


    /*****************************************************************
    * Now actually do the maintenance if desired
    ******************************************************************/

    if ( ! empty($runCleanup) ) {

    // Don't stop
    ignore_user_abort(true);

    // Update the time file
    file_put_contents($file, '<?php $nextRun = ' . ( $_SERVER['REQUEST_TIME'] + round(3600 * $CONFIG['tmp_cleanup_interval']) ) . ';');

    // All set, start cleaning! First, empty the cache.
    if ( is_dir($CONFIG['cache_path']) && ( $handle = opendir($CONFIG['cache_path']) ) ) {

    // Read every file in the cache dir
    while ( ( $file = readdir($handle) ) !== false ) {

    // Skip dot files
    if ( $file[0] == '.' ) {
    continue;
    }

    // Delete it
    unlink($CONFIG['cache_path'] . $file);

    }

    // And close handle
    closedir($handle);

    }

    // Next, remove old cookie files
    if ( is_dir($CONFIG['cookies_folder']) && ( $handle = opendir($CONFIG['cookies_folder']) ) ) {

    // Cut off for "active" files (24 hours)
    $cutOff = $_SERVER['REQUEST_TIME']-86400;

    // Read every file in the cache dir
    while ( ( $file = readdir($handle) ) !== false ) {

    // Skip dot files
    if ( $file[0] == '.' ) {
    continue;
    }

    $path = $CONFIG['cookies_folder'] . $file;

    // Check it's not being used
    if ( filemtime($path) > $cutOff ) {
    continue;
    }

    // Delete it
    unlink($path);

    }

    // And close handle
    closedir($handle);

    }

    // And finally, remove logs
    if ( $CONFIG['tmp_cleanup_logs'] && is_dir($CONFIG['logging_destination']) && ( $handle = opendir($CONFIG['logging_destination']) ) ) {

    // Cut off for deletion of old logs
    $cutOff = $_SERVER['REQUEST_TIME'] - ($CONFIG['tmp_cleanup_logs'] * 86400);

    // Read every file in the cache dir
    while ( ( $file = readdir($handle) ) !== false ) {

    // Skip dot files
    if ( $file[0] == '.' ) {
    continue;
    }

    $path = $CONFIG['logging_destination'] . $file;

    // Check it's not being used
    if ( filemtime($path) > $cutOff ) {
    continue;
    }

    // Delete it
    unlink($path);

    }

    // And close handle
    closedir($handle);

    }

    // Finished.

    }

    Here are the contents of config.php file in the themes filder




    <?php
    /*******************************************************************
    * Glype Proxy Script
    *
    * This theme configuration file allows easy customization of the
    * theme without editing the HTML templates.
    *******************************************************************
    * Theme: Simple
    * Author: Glype
    * Website: http://www.glype.com/
    ******************************************************************/

    /*****************************************************************
    * Themes can use "theme replacements". These are HTML tags of the format
    * <!--[tag_name]--> in the template files. To automatically replace
    * these placeholders with other text, use the $themeReplace array.
    * e.g.
    * <!--[tag_name]--> will be replaced with the value of $themeReplace['tag_name']
    ******************************************************************/

    // Website name
    $themeReplace['site_name'] = 'Surf High';

    // Meta description
    $themeReplace['Unblock all websites, Browse everything'] = <<<OUT

    OUT;

    // Meta keywords (separate with comma)
    $themeReplace['Unblock all sites, Censorship sucks, best proxy site, hot proxy, surf high'] = <<<OUT

    OUT;

    // Proxy description text
    $themeReplace['description'] = <<<OUT
    <p>Censorship sucks and we know that, what is the use of internet if you can not brows your favourite websites? Your server admin keeps of blocking your favourite sites?.</p>
    <p>We are here to help. Watch youtube videos meet your friends at face book play your favourite pokar games Just type the adress of your favourite site in the bar below and we will open any site for you,</p>
    OUT;

    // Ad location above the form on the index page
    $themeReplace['index_above_form'] = <<<OUT

    OUT;

    // Ad location below the form on the index page
    $themeReplace['index_below_form'] = <<<OUT

    OUT;

    // Ad location on proxified pages below the url mini-form
    $themeReplace['proxified'] = <<<OUT

    OUT;


    Can you tell me where to add back links so they are shown in the bottom of the index page.
    Please help me I am real confused here.
     
    newbie191, Aug 10, 2009 IP
  2. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    I am guessing like almost all scripts the basic HTML of the page isn't in the main index file. It pulls other files into it and compiles it into one huge script. It annoys me when people just get free proxy scripts and a domain with no knowledge of coding and thinks it will be a success.
     
    Pudge1, Aug 10, 2009 IP
  3. newbie191

    newbie191 Notable Member

    Messages:
    1,961
    Likes Received:
    100
    Best Answers:
    1
    Trophy Points:
    260
    #3
    And I thought it was a help forum:(
    Done It without your help
    SurfHigh.info
     
    Last edited: Aug 10, 2009
    newbie191, Aug 10, 2009 IP