Wedge

Public area => The Pub => Bug reports => Topic started by: CerealGuy on September 26th, 2014, 07:43 PM

Title: Shorten Subjects in Stats
Post by: CerealGuy on September 26th, 2014, 07:43 PM
Shortening subjects in Stats would be good, otherwise it looks crappy with long names.
Something around 35 Letters should be good.
Title: Re: Shorten Subjects in Stats
Post by: Nao on September 27th, 2014, 12:50 PM
Done, but it doesn't look that good to me... (Maybe because I'm browsing with a narrow window, I dunno.)
Title: Re: Shorten Subjects in Stats
Post by: Jurien on September 27th, 2014, 02:47 PM
Quote from Nao
Done, but it doesn't look that good to me
I agree with you,it doesn't look very neat to me.
See the difference between  the Top 10 Topics (by Replies) and Top 10 Topics (by Views)
(http://i.imgur.com/4uYoUs4.png)
Title: Re: Shorten Subjects in Stats
Post by: CerealGuy on September 27th, 2014, 03:25 PM
35 is too long, perhaps 28 is better. But you missed once the wrong variable. You shortened name instead of subject, therefore Top 10 Topics are not affected.
Should be
Code: [Select]
$context['top_topics_views'][] = array(
'id' => $row_topic_views['id_topic'],
'board' => array(
'id' => $row_topic_views['id_board'],
'name' => $row_topic_views['name'],
'href' => '<URL>?board=' . $row_topic_views['id_board'] . '.0',
'link' => '<a href="<URL>?board=' . $row_topic_views['id_board'] . '.0">' . $row_topic_views['name'] . '</a>'
),
'subject' => $row_topic_views['subject'],
'num_views' => $row_topic_views['num_views'],
'href' => '<URL>?topic=' . $row_topic_views['id_topic'] . '.0',
'link' => '<a href="<URL>?topic=' . $row_topic_views['id_topic'] . '.0">' . shorten_subject($row_topic_views['subject'], 28) . '</a>'
Title: Re: Shorten Subjects in Stats
Post by: Jurien on September 27th, 2014, 04:29 PM
Changed stats.php
Code: [Select]
<?php
$context
['top_topics_views'][] = array(
'id' => $row_topic_views['id_topic'],
'board' => array(
'id' => $row_topic_views['id_board'],
'name' => $row_topic_views['name'],
'href' => '<URL>?board=' $row_topic_views['id_board'] . '.0',
'link' => '<a href="<URL>?board=' $row_topic_views['id_board'] . '.0">' $row_topic_views['name'] . '</a>'
),
'subject' => $row_topic_views['subject'],
'num_views' => $row_topic_views['num_views'],
'href' => '<URL>?topic=' $row_topic_views['id_topic'] . '.0',
'link' => '<a href="<URL>?topic=' $row_topic_views['id_topic'] . '.0">' shorten_subject($row_topic_views['subject'], 28) . '</a>'?>
Now it looks much better
(http://i.imgur.com/GnpiOy5.png)

Changed Shortening subjects Top Liked Post into 20 letters
Code: [Select]
<?php
$context
['top_likes'][] = array(
'num_likes' => $row_likes['likes'],
'subject' => $row_likes['subject'],
'member_name' => $row_likes['real_name'],
'id_member' => $row_likes['id_member'],
'href' => '<URL>?topic=' $row_likes['id_topic'] . '.msg' $row_likes['id_msg'] . '#msg' $row_likes['id_msg'],
'link' => '<a href="<URL>?topic=' $row_likes['id_topic'] . '.msg' $row_likes['id_msg'] . '#msg' $row_likes['id_msg'] . '">' shorten_subject($row_likes['subject'], 20?>
Title: Re: Shorten Subjects in Stats
Post by: Nao on September 27th, 2014, 10:46 PM
Sorry I botched part of it... today I've been too busy IRL to spend any time on implementing the feature I've been working on, so I wanted to at least fix a recent but report lol...
Anyway I'll again be too busy until tomorrow night. Then I might be able to fix stuff.
Title: Re: Shorten Subjects in Stats
Post by: BurkeKnight on September 27th, 2014, 10:52 PM
Speaking of stats page, it seems there is a script issue on it, and I can not even get mine to come up, without browsers stopping the script.

So no, I have no idea which script it is.
Title: Re: Shorten Subjects in Stats
Post by: Nao on September 28th, 2014, 12:21 AM
But what browser..?!
Title: Re: Shorten Subjects in Stats
Post by: BurkeKnight on September 28th, 2014, 12:46 AM
Happens on my site, in Firefox, IE 11, and Chrome.

http://www.bkgta.cc.nf/index.php?action=stats
Title: Re: Shorten Subjects in Stats
Post by: Jurien on September 28th, 2014, 09:34 AM
Quote from BurkeKnight on September 28th, 2014, 12:46 AM
Happens on my site, in Firefox, IE 11, and Chrome.

http://www.bkgta.cc.nf/index.php?action=stats
It looks like there's a problem with handling the Ajax request.You could try to reupload stats.php
Title: Re: Shorten Subjects in Stats
Post by: BurkeKnight on September 28th, 2014, 10:56 AM
Quote
A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.

Script: http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js:2
When hit debug, I get some strange code that is such a mess, I would not be able to even be able to start to figure out what is wrong....LOL

Uploading new Stats.php did nothing.
Title: Re: Shorten Subjects in Stats
Post by: Jurien on September 28th, 2014, 11:22 AM
What's your jQuery source location?.............did you perhaps choose another one instead of the default setting.
Quote
This option allows you to choose which server to serve the jQuery script from. If you're trying to save bandwidth, you may want to use one of the CDNs (content delivery network) provided by Google or Microsoft. You may also want to serve it directly from jquery.com's official servers.
Title: Re: Shorten Subjects in Stats
Post by: BurkeKnight on September 28th, 2014, 03:00 PM
I did not change it, so has to be default.

Google CDN

I just tried all, and same on all.
Title: Re: Shorten Subjects in Stats
Post by: Jurien on September 28th, 2014, 04:01 PM
Something weird your Forum History (using forum time offset) didn't start instantly,only when you open it by clicking on . (see screenshot)
(http://i.imgur.com/pEiDF3s.png)

And it's also looks very different,graph starts in 2009 ?
This is mine (http://i.imgur.com/FjEOVcY.png)
This is yours (http://i.imgur.com/Ww7NnDW.png)
Title: Re: Shorten Subjects in Stats
Post by: BurkeKnight on September 28th, 2014, 05:29 PM
The site was an import from SMF 2.0.9 as well as an old site that had been updated when taken out of mothballs.
Title: Re: Shorten Subjects in Stats
Post by: CerealGuy on June 11th, 2015, 11:43 PM
Pulling this one out again, but the fix wasn't the best thing to do.
Better would be to fix this thing via css.
Code: [Select]
dl.stats dt {
  clear: both;
  float: left;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 50%;
  height: 1.2em;
  white-space: nowrap;
}
But this needs an additional class for stats with diagrams. Will create a branch on github.

https://github.com/C3realGuy/wedge/tree/dev_statistics