Welcome to Geeklog, Anonymous Tuesday, August 18 2026 @ 05:16 pm EDT
Geeklog Forums
Last question today, I swear...
Status: offline
DubiousChrisJ
Forum User
Regular Poster
Registered: 05/10/05
Posts: 114
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?
Luhme summa dat GL.
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?
Luhme summa dat GL.
19
25
Quote
Status: offline
DubiousChrisJ
Forum User
Regular Poster
Registered: 05/10/05
Posts: 114
Yeah, I just downloaded a fresh copy to verify.
Luhme summa dat GL.
Luhme summa dat GL.
24
21
Quote
Status: offline
DubiousChrisJ
Forum User
Regular Poster
Registered: 05/10/05
Posts: 114
I reuploaded my lib-custom, and now it says:
Resource ID #225
But is still not returning the desired data.
Luhme summa dat GL.
Resource ID #225
But is still not returning the desired data.
Luhme summa dat GL.
27
22
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by DubiousChrisJ: Resource ID #225
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
18
22
Quote
Status: offline
DubiousChrisJ
Forum User
Regular Poster
Registered: 05/10/05
Posts: 114
This is the script in question:
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;
Luhme summa dat GL.
Text Formatted Code
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;
Luhme summa dat GL.
21
19
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
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
21
25
Quote
Status: offline
DubiousChrisJ
Forum User
Regular Poster
Registered: 05/10/05
Posts: 114
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!
Luhme summa dat GL.
Luhme summa dat GL.
16
24
Quote
All times are EDT. The time is now 05:16 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content