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,004
  • Total Topics: 21,330
  • Online today: 219
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 114
  • Total: 114

Undefined index: Global_character_set error

Started by Skhilled, July 18, 2010, 06:27:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Skhilled

After installing 5.2, I am getting the following 2 errors twice each when viewing the frontpage:

http://www.skhilled.com/docs/index.php?
8: Undefined index: global_character_set
File: /home/skhilled/public_html/docs/Sources/TPortal.php
Line: 1277

http://www.skhilled.com/docs/index.php?
8: Undefined index: global_character_set
File: /home/skhilled/public_html/docs/Sources/TPortal.php
Line: 1276


Guests are also generating these errors.

IchBin


Skhilled


IchBin

Open Sources/TPortal.php and goto line 1269. It should be right before this code:
while($row = tpdb_fetch_assoc($request))
            {
                // expand the vislaoptions
                $row['visual_options'] = explode(",", $row['options']);



Add this line before that code:
$context['character_set'] = empty($modSettings['global_character_set']) ? (empty($txt['lang_character_set']) ? 'ISO-8859-1' : $txt['lang_character_set']) : $modSettings['global_character_set'];


Then find this code just below that:
                $row['body'] = html_entity_decode($row['body'],ENT_QUOTES, $modSettings['global_character_set']);
                $row['intro'] = html_entity_decode($row['intro'],ENT_QUOTES, $modSettings['global_character_set']);


Replace with this:
                $row['body'] = html_entity_decode($row['body'],ENT_QUOTES, $context['character_set']);
                $row['intro'] = html_entity_decode($row['intro'],ENT_QUOTES, $context['character_set']);


I think that should fix it. This problem exists in the single page option as well. Bloc will need to add a fix for it. I'm not sure if this would be the proper way to fix it, but I think it does. :)

Skhilled


Ken.

Thanks for the code IchBin.  O0
This same error has been showing up in the log for the FamilyForum... applying the code edits seemly makes no difference as the errors still happen, for guests and members as well.

QuoteGuest
http://www.ourfamilyforum.org/FamilyForum/index.php?
8: Undefined index: global_character_set
File: /home/kenkayjm/public_html/FamilyForum/Sources/TPortal.php
Line: 1325

Jake
8: Undefined index: global_character_set
File: /home/kenkayjm/public_html/FamilyForum/Sources/TPortal.php
Line: 1326
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

IchBin

What are your frontpage settings Ken? I mentioned this will happen with another setup because I didn't fix them all. I just wanted to test it for Skhilleds setup.

Ken.

" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

IchBin

#8
If you added the below line from my previous post, please remove it as I've put it in a better place now. On about line 1172 after the global line of the doTPFrontpage() function add this line:
$context['character_set'] = empty($modSettings['global_character_set']) ? (empty($txt['lang_character_set']) ? 'ISO-8859-1' : $txt['lang_character_set']) : $modSettings['global_character_set'];

On about line 1323 replace these lines:
                $row['body'] = html_entity_decode($row['body'],ENT_QUOTES, $modSettings['global_character_set']);
                $row['intro'] = html_entity_decode($row['intro'],ENT_QUOTES, $modSettings['global_character_set']);


With this:
                $row['body'] = html_entity_decode($row['body'],ENT_QUOTES, $context['character_set']);
                $row['intro'] = html_entity_decode($row['intro'],ENT_QUOTES, $context['character_set']);


Hopefully that will fix it. I really don't understand why global_character_set would be undefined, so I'm just taking a line out of SMF's code that seems to work for a few things. :) Let me know if that does the trick, if so maybe I'll add it to the repository.

Ken.

Thanks Brad.

Those changes kill the forum and throw this error page:
Quote
Parse error: syntax error, unexpected T_VARIABLE in /home/kenkayjm/public_html/FamilyForum/Sources/TPortal.php on line 1173

BTW... The 'replace' code was found on line 1323.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

This website is proudly hosted on Crocweb Cloud Website Hosting.