Shorten Subjects in Stats

CerealGuy

  • Posts: 317
Shorten Subjects in Stats
« 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.

Nao

  • Dadman with a boy
  • Posts: 15,927
Re: Shorten Subjects in Stats
« Reply #1, 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.)

Freñiçh

  • Webmaster Linux Mint Forum
  • All i want is a couple days off
  • Posts: 122
Re: Shorten Subjects in Stats
« Reply #2, 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)
Creativity is inventing, experimenting, growing, taking risks, breaking rules, making mistakes, and having fun.
GitHub Dutch Translation Wedge (Under Construction)

CerealGuy

  • Posts: 317
Re: Shorten Subjects in Stats
« Reply #3, 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>'

Freñiçh

  • Webmaster Linux Mint Forum
  • All i want is a couple days off
  • Posts: 122
Re: Shorten Subjects in Stats
« Reply #4, on September 27th, 2014, 04:29 PM »Last edited on September 28th, 2014, 10:04 AM
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


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?>

 Stats.php - 26.1 kB, downloaded 18 times.


Nao

  • Dadman with a boy
  • Posts: 15,927
Re: Shorten Subjects in Stats
« Reply #5, 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.

Re: Shorten Subjects in Stats
« Reply #6, 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.

Nao

  • Dadman with a boy
  • Posts: 15,927


Freñiçh

  • Webmaster Linux Mint Forum
  • All i want is a couple days off
  • Posts: 122

Re: Shorten Subjects in Stats
« Reply #10, 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.

Freñiçh

  • Webmaster Linux Mint Forum
  • All i want is a couple days off
  • Posts: 122
Re: Shorten Subjects in Stats
« Reply #11, 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.

Re: Shorten Subjects in Stats
« Reply #12, 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.

Freñiçh

  • Webmaster Linux Mint Forum
  • All i want is a couple days off
  • Posts: 122
Re: Shorten Subjects in Stats
« Reply #13, on September 28th, 2014, 04:01 PM »Last edited on September 28th, 2014, 04:20 PM
Something weird your Forum History (using forum time offset) didn't start instantly,only when you open it by clicking on . (see screenshot)


And it's also looks very different,graph starts in 2009 ?
This is mine
This is yours

Re: Shorten Subjects in Stats
« Reply #14, 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.