Pages: [1]
AndyK
 
BAM!ID: 20538
Joined: 2007-03-06
Posts: 21
Credits: 92,600
World-rank: 708,187

2007-06-28 12:43:53
last modified: 2007-06-28 12:45:37

Willy, could you make two additions?

1st When I look into the stats table I would like to see the row where my account is to be highlighted.
2nd When I click on a link to a designated position by URL#target I would like that row to be highlighted as well.
3rd When hovering over a row with the mouse would great to see that row to be highlighted.

For the CSS part it is not difficult to realize, but as I don't know the php sourcecode I cannot propose a ready state solution.


boincstats.css:
after
Code:
.color1 { background-color: #DEE3E7; }
.color2 { background-color: #EFEFEF; }

insert
Code:
tr.user {
background-color:#f88; /* mark row of user account in light red */
}

tr.target {
background-color:#8f8; /* mark target row in light green */
}

tr:hover {
background-color:#ff8; /* mark row you hover over with pointer in light yellow */
}

of course enter the color codes you desire.
If the last one is not desired for the whole BS site but only for the stat tables you could make it "tr.stats:hover".

For the boinc_user_stats.php in where you give the designated rows (tr tag) the attribute class="xxx" where xxx is the class for the appropriate case.

[BOINCstats] Willy
 
Forum moderator - Administrator - Developer - Tester - Translator
BAM!ID: 1
Joined: 2006-01-09
Posts: 9456
Credits: 353,172,950
World-rank: 4,967

2007-07-01 11:22:08
last modified: 2007-07-01 11:23:15

Is this what you had in mind?

There are some issues with this. CSS alone won't work, as IE doesn't support all needed features. I had to use JS to make it multi-browser compatible.

Futhermore I need to check all links within BS and remote links need to be changed to show the highlighted row. The problem us that the anchor (the value after #) is not available to PHP, so a new value needed to be added to the url.

(Lee; shoot me down)
Please do not PM, IM or email me for support (they will go unread/ignored). Use the forum for support.
AndyK
 
BAM!ID: 20538
Joined: 2007-03-06
Posts: 21
Credits: 92,600
World-rank: 708,187

2007-07-01 15:30:59
last modified: 2007-07-01 15:32:37

Err... of course can you access the #xx of the url:
Code:
<?php
$target = strstr($_SERVER['REQUEST_URI'], "#" );
?>



And btw: you could even use CSS:
Code:
a:target {
background-color: #8888ff;
}


But anyway: Yes it's what I have in mind.

AndyK
[BOINCstats] Willy
 
Forum moderator - Administrator - Developer - Tester - Translator
BAM!ID: 1
Joined: 2006-01-09
Posts: 9456
Credits: 353,172,950
World-rank: 4,967

2007-07-01 15:39:17

Err... of course can you access the #xx of the url:
Code:
<?php
$target = strstr($_SERVER['REQUEST_URI'], "#" );
?>

AndyK


I hate to disappoint you, but you are wrong. Of course I tried what you propose, and when that didn't work I tried a number of different $_SERVER vars. Then I searched the net where I found lots of people with the same problem. (Just one of the many threads about this problem)

The anchor is not send to the server by the browsers. It's only used client-side. JS can read it, but PHP (or any other server-side script) can't read it.
Please do not PM, IM or email me for support (they will go unread/ignored). Use the forum for support.
[BOINCstats] Willy
 
Forum moderator - Administrator - Developer - Tester - Translator
BAM!ID: 1
Joined: 2006-01-09
Posts: 9456
Credits: 353,172,950
World-rank: 4,967

2007-07-01 16:50:54

I also decided against doing this in PHP as it would interfere with the caching mechanism. Worst case a single page would get 101 cached copies, a page for every single row highlighted, and a page without a highlighted row.
Please do not PM, IM or email me for support (they will go unread/ignored). Use the forum for support.
[BOINCstats] Willy
 
Forum moderator - Administrator - Developer - Tester - Translator
BAM!ID: 1
Joined: 2006-01-09
Posts: 9456
Credits: 353,172,950
World-rank: 4,967

2007-07-01 17:24:05

Implemented it in BOINC user stats first. When there are no problems I'll implement it in all stats.

Thanks for this excellent idea.
Please do not PM, IM or email me for support (they will go unread/ignored). Use the forum for support.
AndyK
 
BAM!ID: 20538
Joined: 2007-03-06
Posts: 21
Credits: 92,600
World-rank: 708,187

2007-07-01 18:10:31
last modified: 2007-07-01 18:10:49

Err... of course can you access the #xx of the url:
Code:
<?php
$target = strstr($_SERVER['REQUEST_URI'], "#" );
?>

AndyK


I hate to disappoint you, but you are wrong.
...

The anchor is not send to the server by the browsers. It's only used client-side. JS can read it, but PHP (or any other server-side script) can't read it.


I hate to admit it, but you are right.

Thanks for the implementation. How did you do it now?
Only with JS, or with the CSS command "a:target" ?

AndyK
[BOINCstats] Willy
 
Forum moderator - Administrator - Developer - Tester - Translator
BAM!ID: 1
Joined: 2006-01-09
Posts: 9456
Credits: 353,172,950
World-rank: 4,967

2007-07-01 18:32:27

JS for changing the colors (or actually the class), colors (classes) defined in CSS. Works with all (at least the ones I tested) browsers.
Please do not PM, IM or email me for support (they will go unread/ignored). Use the forum for support.
TeeVeeEss
  Donator
Tester - Translator - BOINCstats SOFA member
BAM!ID: 2648
Joined: 2006-06-27
Posts: 811
Credits: 12,640,897,633
World-rank: 342

2007-07-03 20:49:58

Very nice improvement for readability, thanks guys!
Pages: [1]

Index :: Comments and suggestions :: * highlight rows in stats table
Reason: