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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,022
  • Total Topics: 21,332
  • Online today: 409
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 243
  • Total: 243

So I upgraded to RC1.1 and some block content broke...

Started by MoreBloodWine, May 15, 2011, 06:14:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

lol, that is quite the workaround. I don't know of any way to troubleshoot this... but I'll keep thinking on how I can figure this out for you.

MoreBloodWine

Quote from: IchBinâ,,¢ on May 18, 2011, 03:30:46 PM
lol, that is quite the workaround. I don't know of any way to troubleshoot this... but I'll keep thinking on how I can figure this out for you.
Ya well, it's the only workaround I can think of to get this working. At the very least I should probably get that test site back up the way things originally were to try and figure it out because like I said... when TP wasnt installed all was golden but with TP installed it seemed eveything that hooked SMF broke from my status deals to my stat sig seen here and even my custom recent posts block.

Hell, you saw the video...

Ps; Like I said, I'd be more than happy to FTP you to a test ite etc. I made the account yesterday. Just need to get the test site back up... if I didnt delete it yet.

I even just now realized I didnt edit the links for my status sig that showing the "codehook" install as I've deemed it.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

What's crazy is that I have tested this code in both versions RC1 and RC1.1 and I cannot get it to work in a block. I remember that you had it working in a block previously, and I swear that I had tried it in a block too. But I can't get it to work in either version of TP. I can get it to work fine when just hitting the script directly, but the minute I add it to a block it makes my whole page go blank with no errors on output in the SMF or server log.

MoreBloodWine

Quote from: IchBinâ,,¢ on May 18, 2011, 05:48:03 PM
What's crazy is that I have tested this code in both versions RC1 and RC1.1 and I cannot get it to work in a block. I remember that you had it working in a block previously, and I swear that I had tried it in a block too. But I can't get it to work in either version of TP. I can get it to work fine when just hitting the script directly, but the minute I add it to a block it makes my whole page go blank with no errors on output in the SMF or server log.
Souns like your experiencing something weirder than me because all I got was a broken image. It's def with the SMF hook when TP's installed because if you run it by itself with no SMF hooks and use file_get_contents it works fine like it does when TP's not installed (with the SMF hooks in tact). But like I said, it's not just that that breaks when TP's installed it's also my custom recent posts block and my stat sig which consists of nothing more than the following code... nevermind how it looks now since I had to butcher it a bit to get it to work but just with the SSI hook.

<?php

if (file_exists(dirname(__FILE__) . '/codehook/SSI.php')) {
   require(
dirname(__FILE__) . '/codehook/SSI.php');
}
else
die();

signature();

function 
signature(){

$data = file_get_contents('index.php');
if (
preg_match('/$forum_version = [\'"]SMF\s*([^\']*)[\'"]/is', $data, $m)
  || 
preg_match('/Software Version:\s*SMF\s*([0-9\.]*(?:\s?RC[0-9]*)?)/is', $data, $m)
) {  
  
// $m[1] now holds the version number  
} else {  
  
// parse error  
}

if (
file_exists(dirname(__FILE__) . '/Sources/TPSubs.php')) {
$tpsrc = file_get_contents('./Sources/TPSubs.php');
if (
preg_match('/^\s*$string = [\'"]<a.*TinyPortal\s*([0-9]+\.[0-9]+(?:\s*RC\s*[0-9])?)/im', $tpsrc, $n)
 || 
preg_match('/^\*\s*TP version: ([0-9]+\.[0-9]+(?:\s*RC\s*[0-9]*)?)/im', $tpsrc, $n)
) {
 
// $n[1] now holds the version number
} else {
 
// parse error
}
}

global 
$smcFunc, $context, $settings, $modSettings, $boardurl;

   
$request = $smcFunc['db_query']('', '
      SELECT count(session)         
      FROM {db_prefix}log_online
      '
,
      array()
   );
   
list (
$context['num_users_online']) = $smcFunc['db_fetch_row']($request);   
$smcFunc['db_free_result']($request);

$forum_name = $context['forum_name'];
$forum_url = $boardurl;
$now = forum_time();
$timel = date("F jS Y g:ia T", $now);
$total_members = $context['common_stats']['total_members'];
$online_members = $context['num_users_online']; 
$total_topics = $context['common_stats']['total_topics'];
$total_posts = $context['common_stats']['total_posts'];
$last_member = $context['common_stats']['latest_member']['name'];
$forum_version = $m[1];
if (
file_exists(dirname(__FILE__) . '/Sources/TPSubs.php')) {
$tpversion = $n[1];
}

$image = "http://www.eojmarket.com/signature_info.png"; // or where you want
$im = imagecreatefrompng($image);
if (!
$im)
 {
   
$im = imagecreatetruecolor(385, 110); // x-coordinate,  y-coordinate
   //default is black but if you want another background color uncheck
   //imagefill($im, 0, 0, 255, 0, 0); // red etc
 
} 
 
$green = ImageColorAllocate ($im, 23, 124, 17);
$lightblue = ImageColorAllocate ($im, 0, 204, 153);
$lightgreen = ImageColorAllocate ($im, 153, 255, 51); 
$red = ImageColorAllocate ($im, 255, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
 
ImageString($im, 3, 6, 1, "Statistics of EoJ Market Place", $lightblue); 
ImageString($im, 3, 104, 15, "http://www.eojmarket.com", $lightblue);
ImageString($im, 3, 104, 31, "Time: $timel", $lightgreen);
ImageString($im, 3, 104, 46, "Total Members: $total_members", $white);
ImageString($im, 3, 104, 61, "Online Members: $online_members", $white);
ImageString($im, 3, 242, 46, "Total Topics: $total_topics", $white);
ImageString($im, 3, 242, 61, "Total Posts: $total_posts", $white);
ImageString($im, 3, 104, 76, "Latest Member: $last_member", $lightgreen);

if (
file_exists(dirname(__FILE__) . '/Sources/TPSubs.php')) {
ImageString($im, 3, 104, 91, "Versions: Forum ($forum_version) - TP ($tpversion)", $red);
}else{
ImageString($im, 3, 104, 91, "Forum Version: $forum_version", $red);
}

$php = PHP_VERSION; 
header("Content-Type: image/png");
if (@
version_compare(PHP_VERSION, '5.1.0', ">="))
  {
  
// if PHP v5.1 ++
  
Imagepng($im,null,9,null);  
  }
else {
    
Imagepng($im,null,9,null);
  }    
ImageDestroy ($im); 
}
?>


Ps; It wasnt just block issues, even when I called it directly in the browser... mysite.com/file.php I got the same broken image look that I did in a block for the PSN / xBox things.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

I haven't had any problems hitting the script directly....

Would you mind posting your custom recent posts blocks so I can test that?

MoreBloodWine

Quote from: IchBinâ,,¢ on May 18, 2011, 06:40:42 PM
I haven't had any problems hitting the script directly....

Would you mind posting your custom recent posts blocks so I can test that?
Just updating for arguments sake but sent to you at SMF due the connection issues here I mentioned.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

Ok looking at your PSN status code, I am wondering why you chose to use the create image functions? Seems like a lot of work, when all you are doing is outputting an image that you have already created. While troubleshooting your code I noticed that the image functions you are using is what is causing the problem with me. So chopped your code up a bit and changed it to not need those functions by simply echo'ing out the image. That should be a work around at least.

    global $sourcedir;

    if (file_exists('SSI.php') && !defined('SMF'))
        require_once('SSI.php');
    elseif (!defined('SMF'))
         die('This script wasn\'t able to connect to SMF...');

    if (($temp = cache_get_data('psn_status', 300)) == null)
    {
        require_once($sourcedir . '/Subs-Package.php');
        $request = @fetch_web_data('http://en.playstation.com/psn/');

        if ($request !== false && preg_match('~<img src="/static/furn/icons/psn_status/psnstatus_red.gif"/>~smi', $request, $matches))
            $temp = 'psn-down.png';
        else if ($request !== false && preg_match('~<img src="/static/furn/icons/psn_status/psnstatus_green.gif"/>~smi', $request, $matches))
            $temp = 'psn-up.png';
        else
            die('Unable to connect to the PlayStation Network...');

        cache_put_data('psn_status', $temp, 300);
    }

    echo '<img src="' . $temp .'" alt="" />';




I can't figure out the recent topics block yet. The thing that pisses me off is that there is absolutely no errors being output. Nothing in the server log and nothing in the SMF log. Makes it a @#$!@% to troubleshoot.

MoreBloodWine

Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

I noticed something in your unread topics code. There is no javascript api to define your javascript functions unless you change it to use prototype. Once I changed that setting in blockcode.php your recent blocks post started working for me.

MoreBloodWine

Quote from: IchBinâ,,¢ on May 19, 2011, 10:38:55 PM
I noticed something in your unread topics code. There is no javascript api to define your javascript functions unless you change it to use prototype. Once I changed that setting in blockcode.php your recent blocks post started working for me.
I already use the prototype.js for lightbox, thats why theres a setting to use or not use it in the block code.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

This website is proudly hosted on Crocweb Cloud Website Hosting.