Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

November 30, 2020, 08:14:51 PM

Login with username, password and session length
Members
  • Total Members: 3798
  • Latest: Anmer
Stats
  • Total Posts: 191470
  • Total Topics: 20917
  • Online Today: 87
  • Online Ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 51
Total: 51

Author Topic: Code error in my portal  (Read 516 times)

0 Members and 2 Guests are viewing this topic.

Offline minormike

  • Jr. Member
  • **
  • Posts: 5
Code error in my portal
« on: October 23, 2020, 02:33:59 AM »
I have an issue whereby my portal runs perfectly and displays all the predefined blocks and any new blocks I create that have BBC or HTML content, but when I try to add any new PHP blocks with the code from the Block Snippets forum here they all generate the following error:
Code: [Select]
Fatal error: Uncaught Error: Call to undefined function tp_query() in /homepages/14/d73677637/htdocs/forum/Sources/Load.php(2233) : eval()'d code(611) : eval()'d code:173 Stack trace: #0 /homepages/14/d73677637/htdocs/forum/Sources/Load.php(2233) : eval()'d code(611): eval() #1 /homepages/14/d73677637/htdocs/forum/Sources/Load.php(2233) : eval()'d code(147): TPortal_phpbox('20') #2 /homepages/14/d73677637/htdocs/forum/Sources/TPortal.php(2100): TPblock(Array, true, 'left') #3 /homepages/14/d73677637/htdocs/forum/Sources/Load.php(2233) : eval()'d code(86): TPortal_panel('left') #4 /homepages/14/d73677637/htdocs/forum/Sources/Load.php(1945): template_tp_above() #5 /homepages/14/d73677637/htdocs/forum/Sources/Subs.php(3405): loadSubTemplate('tp_above', true) #6 /homepages/14/d73677637/htdocs/forum/Sources/Subs.php(2849): template_header() #7 /homepages/14/d73677637/htdocs/forum/Sources/Errors.php(333): obExit(NULL, true, false, true) #8 /homepages/14/d73677637/htdocs/forum/Sources/Errors.php(161): setup_fatal_error_context(' in /homepages/14/d73677637/htdocs/forum/Sources/Load.php(2233) : eval()'d code(611) : eval()'d code on line 173
They also throw up a formatting problem somewhere, because the error borks the column formatting as per this pic. Can you give me any pointers?
Cheers guys



Offline tino

  • Developer
  • *
  • Posts: 2132
Re: Code error in my portal
« Reply #1 on: October 23, 2020, 02:54:37 AM »
Which code snippet are you using? A lot of them are outdated now and really should be removed as they use older functions. tp_query being one of those functions.

Offline minormike

  • Jr. Member
  • **
  • Posts: 5
Re: Code error in my portal
« Reply #2 on: October 23, 2020, 03:22:47 AM »
Sorry, forgot to say! This is the GalleryPic one, but I've got the same error with three or four that I tried

Offline tino

  • Developer
  • *
  • Posts: 2132
Re: Code error in my portal
« Reply #3 on: October 23, 2020, 03:41:12 AM »
Sorry, forgot to say! This is the GalleryPic one, but I've got the same error with three or four that I tried

Can you copy the links to them? Just so I know I’ve got the correct one.

If any of them contain tp_query they won’t work without modification.

Offline minormike

  • Jr. Member
  • **
  • Posts: 5
Re: Code error in my portal
« Reply #4 on: October 23, 2020, 04:08:09 AM »
https://www.tinyportal.net/index.php?topic=34205.0 is the first one I tried and that did the same thing, then I tried the gallery one above. I've tried a couple of others too

Offline tino

  • Developer
  • *
  • Posts: 2132
Re: Code error in my portal
« Reply #5 on: October 23, 2020, 04:43:18 AM »
https://www.tinyportal.net/index.php?topic=34205.0 is the first one I tried and that did the same thing, then I tried the gallery one above. I've tried a couple of others too

Did you try the last block of code which I had posted in that topic? It’s the second to last post.

You’re also using SMF 2.0 so should use that block and not the SMF 1.1 block.