Forums Logo
 
Reply to this topicStart new topic
> Global UL/DL/Ratio under navbar..
Farjad
post Jun 30 2006, 01:42 AM
Post #1


Member
**

Group: Members
Posts: 28
Joined: 23-June 06
Member No.: 333



Tested & Working

(Wrong Title.. Navbar = Member Bar)

Open up class_display.php (sources/classes/class_display.php)

Find:
CODE
        $this->ipsclass->skin['_wrapper'] = str_replace( "<% BOARD HEADER %>"   , $this_header                        , $this->ipsclass->skin['_wrapper']);


Add After:
CODE
/*----Shows UL/DL/Ratio by Farjad----*/
        $this->ipsclass->skin['_wrapper'] = str_replace( "<% RATIO %>"          , $this->member_ratio()               , $this->ipsclass->skin['_wrapper']);
/*----Shows UL/DL/Ratio by Farjad----*/


Find:
CODE
    /*-------------------------------------------------------------------------*/
    // Show Syndication Links
    /*-------------------------------------------------------------------------*/


Add Above:
CODE
    /*-------------------------------------------------------------------------*/
    // Shows UL/DL/Ratio of a Member by Farjad
    /*-------------------------------------------------------------------------*/

    function member_ratio()
    {
        if($this->ipsclass->member['id'] > 0)
        {
            $this->ipsclass->DB->query("SELECT * FROM users WHERE uid = '".addslashes($this->ipsclass->member['id'])."' LIMIT 1");
            $this->ipsclass->DB->simple_exec();
            
            while ( $r = $this->ipsclass->DB->fetch_row() )
            {
                $downloaded = $this->ipsclass->size_format( $r['downloaded'] );
                $uploaded = $this->ipsclass->size_format( $r['uploaded'] );
                $ratio = $this->ipsclass->ratio($r['uploaded'], $r['downloaded']);
            }
            
            return $this->ipsclass->compiled_templates['skin_global']->global_header_ratio( $ratio, $uploaded, $downloaded );
        }
    }


Make a Template in All Global HTML..

New Template Bit Name: global_header_ratio
New Template Bit Incoming Data Variables: $ratio="",$uploaded="",$downloaded=""
Template Data:
CODE
<div align="right">
<b>UL: </b>{$uploaded} <b>DL: </b>{$downloaded} <b>Ratio: </b>{$ratio}
</div>


Finally,

Edit Edit Board Header & Footer Wrapper

Find:
CODE
<% MEMBER BAR %>


Add After:
CODE
<% RATIO %>


Enjoy, and do give credit where ever you take wink.gif

P.S. If you guys want a torrent page.. request biggrin.gif... lol

This post has been edited by Farjad: Jun 30 2006, 01:48 AM
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
toolmanwill
post Jun 30 2006, 12:25 PM
Post #2


Advanced Member
***

Group: Beta Tester
Posts: 63
Joined: 20-April 06
Member No.: 5



Thanx, nice MOD! Keeps em coming!!
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
Jaggi
post Jun 30 2006, 01:54 PM
Post #3


Administrator
***

Group: Project Developer
Posts: 350
Joined: 31-March 06
Member No.: 1



nice work Farjad nice to see someone else that knows IPB, Also thanks cus this is already coded and in the next release on IPBTracker (1.1) tongue.gif. Nevermind they can get it early now biggrin.gif. Just few things to give you to think about and few pointers firstly you must do the ratio code before u do the downloaded, uploaded.

CODE

{
                $downloaded = $this->ipsclass->size_format( $r['downloaded'] );
                $uploaded = $this->ipsclass->size_format( $r['uploaded'] );
                $ratio = $this->ipsclass->ratio($r['uploaded'], $r['downloaded']);
}


This doesn't apply to you because you applied new name variables to your code but usually it can effect it. I would have done $r['uploaded'] = $this->ipsclass->size_format( $r['uploaded'] ); etc.

This also allows to when sending data to your skins you only have to send one variable $r="" so you'll call them something similar to {$r['uploaded']} etc. Also i updated a existing query meaning theres no extra query. Your code is fine, percise and well written and i hope you don't take this as critisim just some pointers for future which will benifit you more than anything. Nice work and keep them coming.
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
Farjad
post Jun 30 2006, 10:51 PM
Post #4


Member
**

Group: Members
Posts: 28
Joined: 23-June 06
Member No.: 333



QUOTE(Jaggi @ Jun 30 2006, 11:54 AM) *

nice work Farjad nice to see someone else that knows IPB, Also thanks cus this is already coded and in the next release on IPBTracker (1.1) tongue.gif. Nevermind they can get it early now biggrin.gif. Just few things to give you to think about and few pointers firstly you must do the ratio code before u do the downloaded, uploaded.

CODE

{
                $downloaded = $this->ipsclass->size_format( $r['downloaded'] );
                $uploaded = $this->ipsclass->size_format( $r['uploaded'] );
                $ratio = $this->ipsclass->ratio($r['uploaded'], $r['downloaded']);
}


This doesn't apply to you because you applied new name variables to your code but usually it can effect it. I would have done $r['uploaded'] = $this->ipsclass->size_format( $r['uploaded'] ); etc.

This also allows to when sending data to your skins you only have to send one variable $r="" so you'll call them something similar to {$r['uploaded']} etc. Also i updated a existing query meaning theres no extra query. Your code is fine, percise and well written and i hope you don't take this as critisim just some pointers for future which will benifit you more than anything. Nice work and keep them coming.


Nah, I wont take as criticism.. as I don't actually know IPB much... nor PHP much... but I am just trying my best smile.gif

BTW.. how would you send the $r="" to the skin as in mines its
CODE
            return $this->ipsclass->compiled_templates['skin_global']->global_header_ratio( $ratio, $uploaded, $downloaded );


so would it be somewhat like this
CODE
            return $this->ipsclass->compiled_templates['skin_global']->global_header_ratio( $r );



This post has been edited by Farjad: Jun 30 2006, 11:50 PM
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
Jaggi
post Jul 1 2006, 01:04 AM
Post #5


Administrator
***

Group: Project Developer
Posts: 350
Joined: 31-March 06
Member No.: 1



yes exactly like that.
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
Saxfusion
post Jul 11 2006, 04:29 PM
Post #6


Member
**

Group: Members
Posts: 15
Joined: 11-July 06
Member No.: 388



First of all thanks for your work and this nice mod.

We are running the IPBTracker 1.01 with the Global Ratio Mod.

Now the question: How can we integrate the ratio-display into the member/nav-bar?

Playing around with the class_display.php or the member_bar or global_header_ratio html-template bit haven't brought us to a working solution. By swaping code between the member_bar and the global_header_ratio template and changing the input variables for the templates either did make the ratio display work and the "X new messages" disappear of vice versa.

Also we tried changing the member_ratio() function in class_display.php by altering the "return"-line to
CODE
return .... member_bar(variables);

Didn't had any effect so to say. My guess is that this has something to do with the way the member_bar is created.

Any ideas how to solve that mystery?

Would appreciate any help since i have only started recently to work me into the whole IPB stuff.

The attachment shows how it currently looks like and the arrow indicates where we would like to have it.


cheers


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
Farjad
post Jul 11 2006, 06:12 PM
Post #7


Member
**

Group: Members
Posts: 28
Joined: 23-June 06
Member No.: 333



well thats a feature in IPBTracker 1.1 , but if you really want it then you have to edit class_display.php and add the codes in the member bar stuff theres a different function for that.
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
Jaggi
post Jul 11 2006, 06:42 PM
Post #8


Administrator
***

Group: Project Developer
Posts: 350
Joined: 31-March 06
Member No.: 1



Yes its intergrated into IPBTracker 1.1. Due anyday now... honest tongue.gif.
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
Saxfusion
post Jul 12 2006, 03:15 AM
Post #9


Member
**

Group: Members
Posts: 15
Joined: 11-July 06
Member No.: 388



Thanks for the confirmation. Already kinda thought that editing the member_bar area in class_display.php would be the solution. :thumbs_up:

Maybe we wait a few more days then if it already is part of IPBTracker 1.1.

Thanks to both of you for your time and quick replies.


cheers
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post
nightwisher
post Sep 22 2006, 11:40 AM
Post #10


Advanced Member
***

Group: Beta Tester
Posts: 66
Joined: 25-April 06
From: Bosnia
Member No.: 17



Thats class display but if you use some another graphical skins like is vista you need more attention to found where to put code and some skins are mass up !
for tracker its better original skins or with out some code changes like this mine have !

Friendly
Nightwisher

This post has been edited by nightwisher: Sep 22 2006, 11:42 AM
User is offlineProfile CardPM
Report PostGo to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
1 Members: OPPZeroCool

 

Lo-Fi Version 0.1012 sec    0.09    11 queries    GZIP Enabled
Time is now: 9th October 2006 - 11:40 PM