Login

Who's Online

Google








Home arrow Programmingarrow Joomla Extensionsarrow “and” between names
Discussion Forum
January 09, 2009, 02:28:45 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: “and” between names  (Read 819 times)
Felipe
Newbie
*
Posts: 6


View Profile Email
« on: August 31, 2007, 03:25:47 AM »

Hi!
I'm using the "et al" mode in joombib, but I want to place the word “and” between the names of the authors (if there are two authors). How can I do this?
Logged
Mark Austin
Administrator
Full Member
*****
Posts: 101



View Profile Email
« Reply #1 on: September 12, 2007, 08:19:36 AM »

jombib.php

line 759

$shortauthnames =$shortauthnames.$author['last'];

replace with:

if($authorcount==1){
   $shortauthnames =$shortauthnames.$author['last'];
}else{
   $shortauthnames =$shortauthnames." and ".$author['last'];
}

try that, I think it should work.  You will have to re-add or update the references though.

Mark
Logged
Felipe
Newbie
*
Posts: 6


View Profile Email
« Reply #2 on: September 12, 2007, 11:22:15 AM »

Thanks, Mark.
actually, I already had solved this problem by a not elegant way: I am using only the manual input, so I modified admin.jombib.php. I inserted, in the functions savetomysql and saveEditBib, after the code:
Code:
if($authorcount>2){
$shortauthnames = $shortauthnames." <i>et al.</i>";
}
this:
Code:
else if($authorcount==2)
{
$partesA = explode("A ",$authnames);
if($partesA[1]) { $shortauthnames = $partesA[0]."A and ".$partesA[1]; }

else { $partesB = explode("B ",$authnames); }
if($partesB[1]) { $shortauthnames = $partesB[0]."B and ".$partesB[1]; }

else { $partesC = explode("C ",$authnames); }
and so on....
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