TinyPortal

Development => Support => Topic started by: minormike on October 23, 2020, 09:33:59 AM

Title: Code error in my portal
Post by: minormike on October 23, 2020, 09: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:
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


Title: Re: Code error in my portal
Post by: tino on October 23, 2020, 09: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.
Title: Re: Code error in my portal
Post by: 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
Title: Re: Code error in my portal
Post by: tino on October 23, 2020, 10:41:12 AM
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.
Title: Re: Code error in my portal
Post by: 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
Title: Re: Code error in my portal
Post by: tino on October 23, 2020, 11:43:18 AM
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.