TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,972
  • Latest: Lineo
Stats
  • Total Posts: 196,105
  • Total Topics: 21,345
  • Online today: 1,072
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 207
  • Total: 208
  • lurkalot

Can someone help me with some PHP please

Started by nokonium, October 02, 2006, 10:23:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nokonium

I have go lots of the same error on one of my boards,

8: Undefined index: start
File: /#########/sgr/Sources/Subs.php
Line: 3345


It started when I updated it to RC3 & TP 0.95. I think that it is being caused by a print page script, but only because the php print file and SSI.php both use the variable $start. If I were to rename the variable in phprint.php would that solve the problem?

TIA

<?php

/*PHPrint - This file is phprint.php
Make any Page Printer Friendly! Version 2.1 - With error handling
Copyright by MikeNew.Net, Notice must stay intact
Any improvements to this script are welcome: www.mikenew.net/contact.asp
************
Legal: MikeNew.Net is not responsible for any damages caused
by use of this script. (Highly unlikely. Hasn't yet.)
This script will make your pages printer friendly.
Optionally, it will strip images as well. (Instructions for that below)*/

//Do you want to strip images from the printable output?
// If no, change to "no". Otherwise, images are stripped by default.
$stripImages = "no";

//what's the base domain name of your site, without trailing slash?
// Just the domain itself, so we can fix any relative image and link problems.
$baseURL="http://nokonium.co.uk/sgr";

// That's it! No need to go below here. Upload it and test by going to yoursite.com/page.php
// (The page containing the two tags and a link to this script)
// -----------------------------------------------------

$startingpoint = "<!-- startprint -->";
$endingpoint = "<!-- stopprint -->";
// let's turn off any ugly errors for a sec so we can use our own if necessary...
error_reporting(0);
// $read = fopen($HTTP_REFERER, "rb") ... this line may work better if you're using NT, or even FreeBSD
$read = fopen($HTTP_REFERER, "r") or die("<br /><font face=\"Verdana\">Sorry! There is no access to this file directly. You must follow a link. <br /><br />Please click your browser's back button. </font><br><br><a href=\"http://webbuildinginfo.com/\"><img src=\"http://webbuildinginfo.com/i.gif\" alt=\"Website building info\" border=\"0\"></a>");
// let's turn errors back on so we can debug if necessary
error_reporting(1);

$value = "";
while(!
feof($read)){
$value .= fread($read, 1000); // reduce number to save server load
}
fclose($read);
$start= strpos($value, "$startingpoint");
$finish= strpos($value, "$endingpoint");
$length= $finish-$start;
$value=substr($value, $start, $length);

function
i_denude($variable) {
return(
eregi_replace("<img src=[^>]*>", "", $variable));
}
function
i_denudef($variable) {
return(
eregi_replace("<font[^>]*>", "", $variable));
}

$PHPrint = ("$value");
if (
$stripImages == "yes") {
$PHPrint = i_denude("$PHPrint");
}

$PHPrint = i_denudef("$PHPrint");
$PHPrint = str_replace( "</font>", "", $PHPrint );
$PHPrint = stripslashes("$PHPrint");

echo
"<base href=\"$baseURL\">";

echo
$PHPrint;

flush ();
?>

G6Cad


Nokonium

Ah! on page 2, strange though, I'm only getting it on the one board.

G6Cad

I had it to, but it seems like it's gone now after the upgrades of the themes i use :)

Nokonium

My theme is one I did myself, it is based on the default theme with my custom header and css changes. When I ran 'search in files' no theme or TP files were found that contained 'start', just index.php, SSI.php and phprint.php  :-\

This website is proudly hosted on Crocweb Cloud Website Hosting.