EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #03644


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Antwort: inserting irstats on abstract/detail page


Hi Ajunk,
If you're using IRStats2, there's this:
~/artchives/ARCHIVEID/cfg/cfg.d/z_irstats2.pl
$c->{plugins}{"Screen::EPrint::Box::Stats"}{params}{disable} = 1;

If you change that to '0', and then make it appear somewhere (examples below), you should see things!
$c->{plugins}->{"Screen::EPrint::Box::Stats"}->{params}->{disable} = 0; #enable Stats boxes
$c->{plugins}->{"Screen::EPrint::Box::Stats"}->{appears}->{summary_bottom} = 100; # show them at the bottom of the summary page (in position '100' - see the link below for more details)
$c->{plugins}->{"Screen::EPrint::Box::Stats"}->{appears}->{summary_right} = undef; # not in their default location on the right
$c->{plugins}->{"Screen::EPrint::Box::Stats"}->{params}->{render_collapsed} = 1; #by default hide content with

This has a list of where things can 'appear': http://wiki.eprints.org/w/Where_Plugins_Appear - the 'summary_' ones should be useful in this situation

Hope that helps!
Cheers,
John

-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Yuri
Sent: 05 December 2014 08:45
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Antwort: inserting irstats on abstract/detail page

Add this:

    $page->appendChild( $session->make_element( "a", name => "stat" ) );
    my $irstats = $session->make_element( "div", class=>"ep_block_left");
    my $irstatsLastMonthLink = 
"/irstats.cgi?page=last_month&set=eprint_" . $eprint->get_value( 
"eprintid" );
    my $irstatsLastMonthImg = $session->make_element( "img", 
src=>$irstatsLastMonthLink );
    my $irstatsLastYearLink = "/irstats.cgi?page=last_year&set=eprint_" 
. $eprint->get_value( "eprintid" );
    my $irstatsLastYearImg = $session->make_element( "img", 
src=>$irstatsLastYearLink );
    $irstats->appendChild( $session->html_phrase(
              "page:irstats",
              img_last_month => $irstatsLastMonthImg,
              img_last_year => $irstatsLastYearImg ) );
    $page->appendChild( $irstats );

with


     <epp:phrase id="page:irstats"><h2>Download statistics</h2>

in phrases

these are 2 images, generated by irstats cgi, one last month an one last 
year, for the current eprint.

Basically, use $eprint->get_value( "eprintid" ) to get the eprint id, 
for the link, go to /irstats.cgi and play around to find urls and 
parameters.

Plus, this code adds an anchor #stat so you can link or go directly to 
stats (it is handy to have such a link at the begin of the abstract, 
expecially when the eprint abstract is very long).

Il 05/12/2014 05:11, Ajunk Pracetio ha scritto:
> I already open archives/{repo}/cfg/cfg.d/eprint_render.pl 
> <http://eprint_render.pl> and at bottom page, there is a code like this :
>  # IRSTATS CODE STARTS HERE
>                 if 
> ($repository->get_repository->can_call('irstats_abstract_content'))
>                 {
> $page->appendChild($repository->get_repository->call('irstats_abstract_content', 
> $repository, $eprint));
>                 }
>                 # END IRSTATS
>
> But, when I removed the # and run generate, there nothing graph except 
> text "Document Downloads".
> Is it okay if I insert this script at that line :
> <div id="mytable" class="irstats_table"/>
>
> <script type="text/javascript">
> document.observe( "dom:loaded", function() {
>
>          new EPJS_Stats_Table( {
>                  'context': { 'datatype': 'downloads' },
>                  'options': { 'container_id': 'mytable', 'top': 'eprint', 'view': 'Table', 'limit': '5' }
>          } );
>
> });
> </script>
>
> I'm don't know about perl :(
>
> Any help very appreciate.
>
> Thank you
> Best regards
> Agung
>
>
> On Fri, Nov 28, 2014 at 1:41 PM, <martin.braendle@id.uzh.ch 
> <mailto:martin.braendle@id.uzh.ch>> wrote:
>
>     Hi,
>
>     the abstract/detail page is rendered by
>     archives/{repo}/cfg/cfg.d/eprint_render.pl <http://eprint_render.pl>
>
>     http://eprints.github.io/irstats2/api.html describes the functions
>     to obtain statistics data and gives some examples.
>
>     Best regards,
>
>     Martin
>
>     --
>     Dr. Martin Brändle
>     Zentrale Informatik
>     Universität Zürich
>     Winterthurerstr. 190
>     CH-8057 Zürich
>
>     mail: martin.braendle@id.uzh.ch <mailto:martin.braendle@id.uzh.ch>
>     phone: +41 44 63 56705
>     fax: +41 44 63 54505
>     http://www.id.uzh.ch
>
>     Inactive hide details for Ajunk Pracetio ---28/11/2014
>     04:43:23---Hi, I'd like to insert irstats on abstract/detail page.
>     Is thAjunk Pracetio ---28/11/2014 04:43:23---Hi, I'd like to
>     insert irstats on abstract/detail page. Is there any guide hoq
>
>     Von: Ajunk Pracetio <prazetyo@gmail.com <mailto:prazetyo@gmail.com>>
>     An: "eprints-tech@ecs.soton.ac.uk
>     <mailto:eprints-tech@ecs.soton.ac.uk>"
>     <eprints-tech@ecs.soton.ac.uk <mailto:eprints-tech@ecs.soton.ac.uk>>
>     Datum: 28/11/2014 04:43
>     Betreff: [EP-tech]  inserting irstats on abstract/detail page
>     Gesendet von: eprints-tech-bounces@ecs.soton.ac.uk
>     <mailto:eprints-tech-bounces@ecs.soton.ac.uk>
>
>     ------------------------------------------------------------------------
>
>
>
>     Hi,
>
>     I'd like to insert irstats on abstract/detail page. Is there any
>     guide hoq to make it?
>
>     Thank you
>
>     Best Regards,
>     Agung P.W
>
>     -- 
>     Life isn't valuable if you don't have someone to care*** Options:
>     http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>     *** Archive: http://www.eprints.org/tech.php/
>     *** EPrints community wiki: http://wiki.eprints.org/
>     *** EPrints developers Forum: http://forum.eprints.org/
>
>
>     *** Options:
>     http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>     *** Archive: http://www.eprints.org/tech.php/
>     *** EPrints community wiki: http://wiki.eprints.org/
>     *** EPrints developers Forum: http://forum.eprints.org/
>
>
>
>
> -- 
> Life isn't valuable if you don't have someone to care
>
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/