MyBB Community Forums

Full Version: Adding something bellow "Posts"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
You should put this topic back to General Support because im not making any mods for it(Cuz i can't) i only ask so that i can integrate forum with site completely
did you managed to do what you wanted?
Nope
The direct print should look like this
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
print("$ratio");
so you can do that:
open 'inc\functions_post.php' and find -
if($post['userusername'])
	{ // This post was made by a registered user
right after that add:
$ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
now open the template 'postbit_author_user' and add
Ratio: {$ratio}

if still doesn't work - describe what you did step by step and give url, also please post the content of the template and the php file.
Now it works only that i get
Division by zero in *****
Also, will the sql file for 1.2.2 or 1.2.3 work for 1.2.12?
dikidera Wrote:Now it works only that i get
Division by zero in *****
check your code where it's say the error occured, you need to verify that the divisor isn't zero.

dikidera Wrote:Also, will the sql file for 1.2.2 or 1.2.3 work for 1.2.12?
I didn't get what you meant...
This is were i get the error
$ratio = number_format($torr_arr["uploaded"] / $torr_arr["downloaded"], 3);
My ratio is zero when calculated
P.S
I mean that when installing the torrent tracker it includes a dumped or so mybb sql inside and i wonder is it compatible with 1212
dikidera Wrote:This is were i get the error
$ratio = number_format($torr_arr["uploaded"] / $torr_arr["downloaded"], 3);
My ratio is zero when calculated
you can check that like this:
if ($torr_arr["downloaded"] == 0) {
    //put here the value you want for the ratio if the user haven't download yet, e.g.
    $ratio = '-' ;
} else {
    $ratio = number_format($torr_arr["uploaded"] / $torr_arr["downloaded"], 3);
}
------
dikidera Wrote:P.S
I mean that when installing the torrent tracker it includes a dumped or so mybb sql inside and i wonder is it compatible with 1212
I don't know what you mean.... I don't think I'll know to answer that question, is it related to MyBB?
The sql of 1.2.3 is it compatible with 1.2.12?
Like if i have the forum 1.2.12 and 1.2.3 and dump sql from 1.2.3 to 1.2.12 will it still work(Will 1.2.12 with 1.2.3's sql)?
if your query deal with the tables of MyBB or using the functions of MyBB, so NO, you need to rewrite and test your query.

you may ask more specific question to receive better answer.

did you managed to do the ratio code?

(please always supply feedback and if you succeed or not
we spend our own time to support other, at least we want feedback)
Pages: 1 2 3