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,965
  • Latest: boruko
Stats
  • Total Posts: 195,980
  • Total Topics: 21,320
  • Online today: 157
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 113
  • Total: 113

Blank pages !

Started by adnan, October 03, 2006, 02:19:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

adnan

It seem tinyportal use eval function to run php blocks !
Perhaps it doesn't work fine with TP . why does TP Team use eval to run php codes ? They could use "include" function !

Thurnok

Here, try this.  I cleaned up your code a bit, added some error prevention, and removed the problem (the exit statement).  I believe this will work for you, let me know.

$key = ';';
$read = '';
$fp = @fopen('url.txt', 'r');
if ($fp){
$read = fgets($fp, 10240);
fclose($fp);
}
if (!empty($_SERVER['HTTP_REFERER'])){
if (!strpos($_SERVER['HTTP_REFERER'], 'yarantoos') && !strpos($_SERVER['HTTP_REFERER'], 'host-tracker')){
$read = $_SERVER['HTTP_REFERER'] . $key . $read;
$fp = fopen('url.txt', 'w');
$url = strtok($read, $key);
echo '<ol>';
for($i=0; $i<12; $i++){
if (!empty($url)){
echo '<li><a href="' . $url . '">' . substr($url, 7, 20) . '</a></li>';
fwrite($fp, $url . $key);
}
$url = strtok($key);
}
fclose($fp);
echo '</ol>';
}
} else {
$url = strtok($read, $key);
echo '<ol>';
for($i=0; $i<12; $i++){
if (!empty($url)){
echo '<li><a href="' . $url . '">' . substr($url, 7, 20) . '</a></li>';
$url = strtok($key);
}
}
echo '</ol>';
}

bloc

In case of the search friendly url issue, SMF can have it on and it should work as expected when TP is installed..but the specific TP calls do not use it. So reading the forum should be fine, but not for example the Downloads manager.

As for using php in blocks, it can't be "included"..that would signify external files. TP use the db to store the php code for blocks. Remember that blocks and even php articles are NOT meant to be used with full-blown php applications, it can't efficiently do that. Rather it can use all of SMF already loaded data and do some php magic on its own.

If it doesn't work, the script is too complex, or rely on things that SMF/TP already have changed or use.

Thurnok

However, one thing for you to keep in mind adnan, you can make a block that has the following:

include("myphpfile.php");

and have a php file loaded as though it were part of the block... remember to do extensive testing when doing this however...

adnan

Thank you Thurnok !
Your codes is working fine with TP .

This website is proudly hosted on Crocweb Cloud Website Hosting.