Login

Who's Online

We have 1 guest online

Google








Home arrow Programmingarrow Joomla Extensionsarrow Author: Last name displayed first
Discussion Forum
January 09, 2009, 02:48:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Author: Last name displayed first  (Read 760 times)
Peter Cutter
Newbie
*
Posts: 2


View Profile Email
« on: October 18, 2007, 01:47:10 PM »

Hi Mark,

Amazingly useful component--thanks!

I'm currently having a bit of trouble getting the last name of the author to display first in the display table (single line truncated display option). We need to have the last name display first or else it is not visible in this, our prefered display format.

Any ideas?

Thanks,
Pete
Logged
Mark Austin
Administrator
Full Member
*****
Posts: 101



View Profile Email
« Reply #1 on: October 29, 2007, 08:56:51 AM »

That should be possible by tweaking the code a bit.  In jombib.php lines 750 to 760 generate the authors name that is stored in the database.  If you change the order of this bit of code, you will get what you want.  However this change will only work if you re-add or edit your references.

if($sets['fullnames']=="on"){
  $authnames =$authnames.$author['first']." ";
  if($authorcount==1){
    $shortauthnames =$shortauthnames.$author['first']." ";
  }
}   
$authnames =$authnames.$author['last'];
  if($authorcount==1){
  $shortauthnames =$shortauthnames.$author['last'];
}

change to

$authnames =$authnames.$author['last'];
  if($authorcount==1){
  $shortauthnames =$shortauthnames.$author['last'];
}
if($sets['fullnames']=="on"){
  $authnames =$authnames.$author['first']." ";
  if($authorcount==1){
    $shortauthnames =$shortauthnames.$author['first']." ";
  }
}
Logged
Peter Cutter
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: November 18, 2007, 12:04:04 AM »

Hi Mark,

That worked like a charm (although I also added a comma and space after the last names...).--Thanks much!!!

I am probably pushing my luck but was wondering if you could help me accomplish 2 more formatting things:

1) I need the author part of th list view to be a little wider; and
2) I need to replicate another journal style that looks like this:

Rahman, M. M. 1982. A study of tiger population of Nilkamal Sanctuary in the Sundarbans. Bano biggyan patrik 11:36-40.

e.g. no parentheses on the year and no " on the title.

I would be happy to pay you (donation I guess) for helping with these modifications.

Many thanks in advance,
Pete
Logged
joomla-freak
Newbie
*
Posts: 4


View Profile Email
« Reply #3 on: November 19, 2007, 12:23:25 PM »

Dear Pete,
I am not Mark, but I can give an answer to your secondo question:
In the file jombib.html.php
you can change the format how you like to print the title:
title without ":

if (HTML_jombib::keyExistsOrIsNotEmpty('title',$row)){
         if($link=="none"){
            echo ", ".$row['title']."";
         }else{
            echo ", <a href='$link' title='View Reference Details'>".$row['title']."</a>";
         }
      }

May be you can write the title also in italic:

if (HTML_jombib::keyExistsOrIsNotEmpty('title',$row)){
         if($link=="none"){
            echo ", <i>".$row['title']."</i>";
         }else{
            echo ", <a href='$link' title='View Reference Details'><i>".$row['title']."</i></a>";
         }
      }
The year with out ( ):

if (HTML_jombib::keyExistsOrIsNotEmpty('year',$row)){
         echo " ".$row['year']."";
      }

I did a copy from my site and I hope it works also on your site.
greetings
annette

Logged
Ranja
Newbie
*
Posts: 7


View Profile Email
« Reply #4 on: November 22, 2007, 09:05:22 PM »

That should be possible by tweaking the code a bit.  In jombib.php lines 750 to 760 generate the authors name that is stored in the database.  If you change the order of this bit of code, you will get what you want.  However this change will only work if you re-add or edit your references.

if($sets['fullnames']=="on"){
  $authnames =$authnames.$author['first']." ";
  if($authorcount==1){
    $shortauthnames =$shortauthnames.$author['first']." ";
  }
}   
$authnames =$authnames.$author['last'];
  if($authorcount==1){
  $shortauthnames =$shortauthnames.$author['last'];
}

change to

$authnames =$authnames.$author['last'];
  if($authorcount==1){
  $shortauthnames =$shortauthnames.$author['last'];
}
if($sets['fullnames']=="on"){
  $authnames =$authnames.$author['first']." ";
  if($authorcount==1){
    $shortauthnames =$shortauthnames.$author['first']." ";
  }
}

I did this (in jombib.php), and I deleted all my references and re-entered them. And NO change at all. I don't understand why. Do you?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
© 2009 Everything That I Know About