Posted on: 09/02/06 03:55pm
By: DubiousChrisJ
Since the upgrade, hacks stored in lib-custom are not being recognized. I get the following error in blocks referencing custom php:
Error in PHP Block. Function, phpblock_mostPopular, does not exist.
Is there anything I need to do to get it to recognize lib-custom again?
Last question today, I swear
Posted on: 09/02/06 04:03pm
By: Dirk
Is your lib-custom.php still there? Just asking in case you overwrote it with the one that ships with Geeklog ...
bye, Dirk
Last question today, I swear
Posted on: 09/02/06 04:07pm
By: DubiousChrisJ
Yeah, I just downloaded a fresh copy to verify.
Last question today, I swear
Posted on: 09/02/06 04:08pm
By: DubiousChrisJ
I reuploaded my lib-custom, and now it says:
Resource ID #225
But is still not returning the desired data.
Last question today, I swear
Posted on: 09/02/06 04:15pm
By: Dirk
[QUOTE BY= DubiousChrisJ] Resource ID #225[/QUOTE]
That's what you get when you echo out the result of a database query and usually indicates a bug in the script in question.
Since I don't know what's in your lib-custom.php I can't really be any more specific ...
bye, Dirk
Last question today, I swear
Posted on: 09/02/06 04:18pm
By: DubiousChrisJ
This is the script in question:
function phpblock_mostPopular () {
global $_TABLES;
$result = DB_query("SELECT sid,title,hits FROM {$_TABLES["stories"]} WHERE (draft_flag = 0) AND (date <= NOW()) AND (Hits > 0)" . COM_getPermSQL ('AND') . " ORDER BY Hits desc LIMIT 10");
return $result;
Last question today, I swear
Posted on: 09/02/06 04:26pm
By: Dirk
Yep, as I said above. This isn't going to work and never did.
What you get back from that database query is a MySQL resource identifying the results of the query - but not the actual results yet. You need at least a DB_fetchArray($result); to actually request the data. And then do something sensible with the result (which is an array).
I'd say there's quite a bit of code missing from that function ...
bye, Dirk
Last question today, I swear
Posted on: 09/02/06 04:34pm
By: DubiousChrisJ
Hmmm...so maybe, part of the code did get overwritten...it was working before. I will seach the archives here and see if I can find the thread where I worked with the other guy to come up with it. Thanks, Dirk!