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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:33:28 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 174
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 162
  • Total: 162

Code error in my portal

Started by minormike, October 23, 2020, 09:33:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

minormike

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:
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



tino

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.

minormike

Sorry, forgot to say! This is the GalleryPic one, but I've got the same error with three or four that I tried

tino

Quote from: minormike on October 23, 2020, 10: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

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.

minormike

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

tino

Quote from: minormike on October 23, 2020, 11: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

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.