FUDapi - Wiki example [message #162680] |
Thu, 01 July 2010 06:20 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
There is an example in the FUDapi that looks like this:
<?php
include_once 'GLOBALS.php';
include_once 'fudapi.inc.php';
$topics = _fud_msg_multi(1, "SELECT root_msg_id FROM ".$GLOBALS['DBHOST_TBL_PREFIX']."thread WHERE forum_id={ARG} ORDER BY id DESC LIMIT 10");
arsort($topics);
foreach($topics as $topic) {
echo "POSTER: ". $topic->login ."\n";
echo "SUBJECT: ". $topic->subject ."\n";
echo "BODY: ". $topic->body ."\n\n";
}
?>
However, when it returns only 1 result, it will break because of this:
} else {
if (count($result) == 1) {
return array_pop($result);
} else {
return $result;
}
}
}
What is served as an array with 2 or more results, becomes a string, or something - When you print_r it, it doesnt show the usual array keys like key => value, it just lists values.
I get an MYSQL error when mine only could only return 1 result, so I commented out that part, mostly.
Ginnunga Gaming
|
|
|
|
Re: FUDapi - Wiki example [message #162684 is a reply to message #162682] |
Thu, 01 July 2010 07:03 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
I am not a good enough coder to contribute there I think, i'll stick to replying to questions that i can answer to on the forum!
Your lovely software just broke 10 million page views on my site by the way! I love this little forum <3
Ginnunga Gaming
|
|
|
|
Re: FUDapi - Wiki example [message #162689 is a reply to message #162687] |
Thu, 01 July 2010 08:53 |
Ernesto
Messages: 413 Registered: August 2005
Karma: 0
|
Senior Member |
|
|
It's over a period of two years, I only have around 700-800 uniques per week, it all depends on if we are playing a popular game or not, then the random visitors surge quite heavily.
100-200 posts per day, nothing fancy, but it's always nice when people use your work!
We had a severe HDD crash and lost hundred thousand posts or so a few years back, also lost our entire joomla site etc, that is when i decided to tweak FUDforum to do all the job for us.
I upgraded to 2.7.7 by hand, one fix at a time, have done a few since then also, but some of the fixes are so major I just can't be bothered hehe.
I guess it wouldnt take more than a few days to upgrade and then apply all our tweaks, but its so annoying with databases and columns and tables and a billion IF statements in the templates hehe.
Since I created a mobile theme that automatically gets enabled, cellphone visitor usability has increased enormously, but now i have done the whole path_info thing so I have to update that theme again hehe.
Ginnunga Gaming
|
|
|
|
|