New Module: Publications

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
tallphil
Forum Members
Forum Members
Posts: 20
Joined: Sat Jan 30, 2010 8:01 pm
Location: Cambridge, UK

New Module: Publications

Post by tallphil »

Hi all,

I've released the first beta of my new module Publications today.

It allows FrontEndUsers to create and maintain a list of Publications (designed for scientific publications / references). There are fields for Title, Reference, DOI and a single upload. They can edit and order publications once added.

The module also allows the display of publications, and uses a templating system for control of output. Output can also be restricted to one or many users, or to a FEU group of users.

This is the first release of my first ever module, so I'm sure that there will be loads of bugs and mistakes - all comments / critiques / suggestions welcome!

Phil
Peciura

Re: New Module: Publications

Post by Peciura »

Release has files like '._file_name.ext' also folders '.svn'
Installation is not smoth

Code: Select all

Index: method.install.php
===================================================================
--- method.install.php	(revision 1)
+++ method.install.php	(working copy)
@@ -75,13 +75,13 @@
 			$this->SetTemplate('form_Sample',$template);
 			$this->SetPreference('current_form_template','detail_Sample');
 		}

 		// Set Preferences
-		$this->SetPreference('morelink_text') = $this->Lang('default_morelink_text');
-		$this->SetPreference('allowed_upload_types') = 'pdf, doc, docx, rtf';
-		$this->SetPreference('feu_redirect') = '';
+		$this->SetPreference('morelink_text',$this->Lang('default_morelink_text'));
+		$this->SetPreference('allowed_upload_types','pdf, doc, docx, rtf');
+		$this->SetPreference('feu_redirect','');
 
 		// put mention into the admin log
 		$this->Audit( 0, $this->Lang('friendlyname'), $this->Lang('installed',$this->GetVersion()));

 ?>
Preference 'allowed_upload_types' are handeled as string (is not expolded to array).
while adding file user name is '-user-'
not enough documentations about FEU submit

It is not clear what should be in line 28 on 'function.admin_listtab.php'
$pubs_row = $pubs_result->FetchRow();
if($pubs_row.fields !== 'fields'){
// User has publications, get new $i from size of array
Publicatoins are isted after file upload from back end but 'List' tab is empty.
User avatar
tallphil
Forum Members
Forum Members
Posts: 20
Joined: Sat Jan 30, 2010 8:01 pm
Location: Cambridge, UK

Re: New Module: Publications

Post by tallphil »

Many thanks for your detailed comments Peciura, looking back at the code I think I need to go through and re-write a lot of it. I was very much working things out as I went along, so when I see pages like function.admin_listtab.php (one of the first I wrote) I can see that there are better ways to get the same result.

As for 'allowed_upload_types' - this is exploded to an array in the upload file function, so doesn't need to be handled as an array in the preference. I'm not sure what you mean about setting the file user name? I hope to write more extensive help and documentation in the code - I'll do this with the next release I think.

And I think I need to enable 'view hidden files'!
Peciura

Re: New Module: Publications

Post by Peciura »

when i uploaded '.doc' file i was warned that file is not of type 'pdf, doc, docx, rtf' :D.
There is only one FEU on test site and instead of its name (email ATM) i can choose '-user-' or empty name.
If i choose '-user-' i am asked to 'Please Select a User To Associate with Publications' so i chose empty value.
User avatar
tallphil
Forum Members
Forum Members
Posts: 20
Joined: Sat Jan 30, 2010 8:01 pm
Location: Cambridge, UK

Re: New Module: Publications

Post by tallphil »

Ah, ok - I think that the bug with the filetypes is because of the spaces (I need to use the trim() function I think), and the username problem is a stupid mistake on my part - it's using custom FEU fields which I had set up, oops! This will also cause the 'Lists' tab to be empty...

I've noted these down, I'll fix them when I go through and sort out the code... Thanks for flagging them up!
Last edited by tallphil on Mon Jun 07, 2010 3:36 pm, edited 1 time in total.
User avatar
tallphil
Forum Members
Forum Members
Posts: 20
Joined: Sat Jan 30, 2010 8:01 pm
Location: Cambridge, UK

Re: New Module: Publications

Post by tallphil »

Right, I've gone through and re-written a whole load of code. The module now defaults to using FEUsers usernames, but will use the custom fields firstname and lastname if they're available. I've fixed the upload filetypes bug and I've also removed all direct database interactions for the FEU module, replacing these with FEU API calls. Finally, I've updated the help and language files, repackaged the module and tested it on a blank install of CMSMS. I don't think that there are any unnecessary files included this time! The updated release is again available through the CMSMS Forge.

If anyone finds any problems or has any comments, please let me know! Thanks again for your help Peciura...
Post Reply

Return to “Modules/Add-Ons”