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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 388
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 294
  • Total: 294

Need urgent help with a side block

Started by davieb, April 11, 2009, 04:22:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

davieb

I've added a side block today to my site www.enjoyingphotography.co.uk and it is showing an error

Quotefatal error: Function name must be a string in /home/davidbre/public_html/enjoyingphotography/forum/Sources/Load.php(1749) : eval()'d code(52) : eval()'d code on line 3

Only the sidebar shows now. The rest of the site doesn't appear. I also can't get into the admin panel to switch the block off.

I'm running SMF1.1.8 and TP 1.06

davieb

Forgot to mention the block only appears to admins. It doesn't show to anyone else as it's set for admins only while I was testing it.

ZarPrime

davieb,

I just looked at your site and I don't see a problem with it.  Have you solved this yourself?  If so, how did you do it?

ZarPrime

ZarPrime

#3
OK, so, you still can't get into Admin to turn the block off.  What is the code you are using in the block?

ZarPrime

Edit:  David, if it's just that the errant clock is keeping you from getting into Admin, this link should let you get in there ---> http://enjoyingphotography.davidbrennan.co.uk/forum/index.php/index.php?action=admin;noblocks


Renegd98


davieb

Quote from: ZarPrime on April 11, 2009, 04:36:06 PM
OK, so, you still can't get into Admin to turn the block off.  What is the code you are using in the block?

ZarPrime

the code is
global $smcFunc, $scripturl;
isAllowedTo('view_articles');
$dbresult = $smcFunc['db_query']('', "
SELECT a.ID_ARTICLE, a.title, a.views
FROM {db_prefix}articles AS a
ORDER BY RAND()
LIMIT 3
");

while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
echo ' ', sp_embed_image('dot'), ' <a href="' . $scripturl . '?action=articles;sa=view;article=' . $row['ID_ARTICLE'] . '">' . $row['title'] . '</a> (' . $row['views'] . ' views)<br />';
}
$smcFunc['db_free_result']($dbresult);


I was trying to create something to show the latest articles from SMF Articles

davieb

Quote from: ZarPrime on April 11, 2009, 04:36:06 PM
OK, so, you still can't get into Admin to turn the block off.  What is the code you are using in the block?

ZarPrime

Edit:  David, if it's just that the errant clock is keeping you from getting into Admin, this link should let you get in there ---> http://enjoyingphotography.davidbrennan.co.uk/forum/index.php/index.php?action=admin;noblocks

Sorry didn't spot the edit. That lets me in to the admin but as soon as I click Panels and blocks I hit the same problem as the block shows on all pages I think.
All I see is the attached screen

ZarPrime

OK, a coder will have to tell you what's the matter with that actual code.

However, for now, try this link instead.  This should take you straight to the blocks and panels ...
http://enjoyingphotography.davidbrennan.co.uk/forum/index.php/action,tpadmin/sa,blocks.html?noblocks

If that doesn't work, let me know as that is what I would have to do on my site to get to that point.  However, I have SEO turned on so that may not work in your site.  If it doesn't work, LMK and I'll give you another link to try.

ZP

davieb

Hi ZarPrime and thanks. That did the trick. Once I was able to see the panel and blocks page without the blocks showing it was just a case of binning the block. As to what's wrong with the code, no idea but I won't be using it again lol

I think I'll make a note of those 2 urls as well. Very handy in case of any other errors I make

ZarPrime

OK, I'm glad that got you to where you needed to be. :up:

Out of curiosity, what was the code supposed to do?  One thing you might want to keep in mind for future reference is that php prefers that you use all lower case letters, at least I think so, but I don't know if that has anything to do with it.  Like I said, one of our coders more knowledgeable in php would have to tell you.

On those, links, yes they have saved me a time or 2 as well. ;)

ZarPrime

This website is proudly hosted on Crocweb Cloud Website Hosting.