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

Recent

Welcome to TinyPortal. Please login or sign up.

February 09, 2025, 08:57:40 AM

Login with username, password and session length
Members
  • Total Members: 3,946
  • Latest: Sparo
Stats
  • Total Posts: 195,471
  • Total Topics: 21,258
  • Online today: 68
  • Online ever: 6,457 (November 30, 2024, 02:40:09 PM)
Users Online
  • Users: 1
  • Guests: 44
  • Total: 45
  • @rjen

TinyPortal PHPBox Parsing Problem

Started by dy, December 12, 2006, 07:38:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dy

Hi, I was wondering whether anyone would be able to help me with a serious aesthetically-based PHP parsing issue on TinyPortal.

Using JPDeni's "Greetings: Birthday, Holiday, Time of Day" block code snippet (Link: http://www.tinyportal.net/index.php?topic=9940), and a phpbox block, I keep on getting weird characters appearing in the box, along with the greetings (see my earlier post: http://www.tinyportal.net/index.php?topic=9940.msg87222#msg87222).

The box, for example displays a greeting (ie. Good Afternoon), along with the user's name...however, it also displays weird characters preceding the greeting, something like this:
QuoteïÃ,»Ã,¿ ïÃ,»Ã,¿ Good Afternoon
dy

With the phpbox having the code:
global $context;
require('UserFunctions.php');
echo '<span style="font-size: 8pt;"> ',greeting(),'<br /><b>'.$context['user']['name'],'</b></span><br />';


After discussing with JPDeni, we have come to the conclusion that the block code snippet has nothing to do with it, so I'm wondering whether any part of the PHP parsing that TinyPortal deals with, has anything to do with it.


>> I have also tried creating a file, trial.php, placing it in the Sources directory with the code in it:
<?php
echo 'Trial. If this prints, then this test is complete.';
?>


>> Then creating a phpbox with the code:
require('Trial.php');

>> This then provides the output:
QuoteïÃ,»Ã,¿Trial. If this prints, then this test is complete.

>> Looking at the page source, this is what is there:
<div class="tborder" style="margin-bottom: 2px;">
<div class="windowbg" style="padding:4px; " id="block24">ïÃ,»Ã,¿Trial. If this prints, then this test is complete.</div>
</div>



So, without fail, both methods still provide weird characters. I'm thinking it could have something to do with the require() function and any other 'defined' php function.
I will greatly appreciate any help anyone can give me! (Sorry about the long post!)

dy

Does anyone at all have any ideas??? (I haven't received a reply in weeks!)

JPDeni

You can try to use include instead of require. Maybe your server would like it better. (It has to be something with your server, since other people aren't having problems while using the same code.)

You could also consider just putting the function in the php box itself. Forget the "require" statement and put the greeting() function at the bottom of your box. If it's a problem with "require" (or "include"), that should take care of it.

Sorry I didn't respond sooner.