How to add Topic for...

99 views
Skip to first unread message

Mohd Izwan

unread,
Feb 11, 2014, 4:28:40 AM2/11/14
to subjec...@googlegroups.com
Dear all,,,
In staff listing, there is a 

Subject Liaison for . . .
[list of subject that related to the staff]

Is there any chances to add other guide such as
Topic Liaison for . . .
[list of topic that the staff contribute]

regards

Andrew Darby

unread,
Feb 11, 2014, 9:53:09 AM2/11/14
to subjec...@googlegroups.com
Hi Mohd,

I'm sure there are more elegant ways to do this, but try using the attached code chunk in subjects/staff_details.php.  You'll need to overwrite the code starting at

// If it's a ref librarian, show their subjects
$subject_listing = ""; // init in case they don't have subs

and ending at the correct curly brace.  Note that at the top of the new code there is an array:

$guide_types = array("Subject","Topic");

Putting both Subject and Topic in there will output them in that order.

I've only tested this very quickly on a local development copy but it seems to work; let me know if it doesn't for you.

Andrew


--
You received this message because you are subscribed to the Google Groups "SubjectsPlus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to subjectsplus...@googlegroups.com.
To post to this group, send email to subjec...@googlegroups.com.
Visit this group at http://groups.google.com/group/subjectsplus.
For more options, visit https://groups.google.com/groups/opt_out.

show_liaison.txt

Mohd Izwan

unread,
Feb 12, 2014, 10:48:24 PM2/12/14
to subjec...@googlegroups.com
SUCCESS...
Thanks AGD...

Mohd Izwan

unread,
Jul 23, 2014, 2:32:59 AM7/23/14
to subjec...@googlegroups.com
Dear AGD, i think this code not work in the new version 3.0
could you help...

Little, James Clarence IV

unread,
Jul 23, 2014, 7:32:00 AM7/23/14
to subjec...@googlegroups.com

​Do you get an error message or does the content just not appear on the page?


-- Jamie 



From: subjec...@googlegroups.com <subjec...@googlegroups.com> on behalf of Mohd Izwan <kiz...@gmail.com>
Sent: Wednesday, July 23, 2014 2:32 AM
To: subjec...@googlegroups.com
Subject: Re: [SubjectsPlus] How to add Topic for...
 
Dear AGD, i think this code not work in the new version 3.0
could you help...

--
You received this message because you are subscribed to the Google Groups "SubjectsPlus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to subjectsplus...@googlegroups.com.
To post to this group, send email to subjec...@googlegroups.com.
Visit this group at http://groups.google.com/group/subjectsplus.
For more options, visit https://groups.google.com/d/optout.

Mohd Izwan

unread,
Mar 1, 2015, 7:15:48 PM3/1/15
to subjec...@googlegroups.com
I have this error

Notice: Undefined offset: 8 in ..\libguide\subjects\staff_details.php on line 95

Mohd Izwan

unread,
Apr 30, 2015, 9:20:05 PM4/30/15
to subjec...@googlegroups.com
Dear Jamie, would you help with the code...
i think need some mode for it to work with sp3

Little, Jamie

unread,
May 1, 2015, 12:17:58 PM5/1/15
to subjec...@googlegroups.com

Could you give some information about the error? Is the page not displaying correctly? 


Thanks,
Jamie

Sent: Thursday, April 30, 2015 9:20 PM

To: subjec...@googlegroups.com
Subject: Re: [SubjectsPlus] How to add Topic for...
--

Mohd Izwan

unread,
May 3, 2015, 11:58:16 PM5/3/15
to subjec...@googlegroups.com

On Saturday, 2 May 2015 00:17:58 UTC+8, James Little wrote:

Could you give some information about the error? Is the page not displaying correctly? 


Thanks,
Jamie

From: subjec...@googlegroups.com <subjec...@googlegroups.com> on behalf of Mohd Izwan <kiz...@gmail.com>
Sent: Thursday, April 30, 2015 9:20 PM
To: subjec...@googlegroups.com
Subject: Re: [SubjectsPlus] How to add Topic for...
 
Dear Jamie, would you help with the code...
i think need some mode for it to work with sp3


On Monday, 2 March 2015 08:15:48 UTC+8, Mohd Izwan wrote:
I have this error

Notice: Undefined offset: 8 in ..\libguide\subjects\staff_details.php on line 95

On Wednesday, 23 July 2014 19:32:00 UTC+8, James Little wrote:

​Do you get an error message or does the content just not appear on the page?


-- Jamie 

--
You received this message because you are subscribed to the Google Groups "SubjectsPlus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to subjectsplus...@googlegroups.com.
To post to this group, send email to subje...@googlegroups.com.

Andrew Darby

unread,
May 4, 2015, 12:07:10 PM5/4/15
to subjec...@googlegroups.com
Hi Mohd,

Those are actually "notices" rather than errors, and while the underlying code should be altered so they don't exist, what you can do right now is turn off the error display on your production server.  Go to the top of the config file and comment out the top couple of lines, e.g.,

//ini_set('display_errors',1);
//error_reporting(E_ALL);

If they are already commented out, you might want to change the error handling settings in php.ini, because either way it's not a good idea to display errors on a production server.

Andrew


To post to this group, send email to subjec...@googlegroups.com.

Mohd Izwan

unread,
May 5, 2015, 12:44:04 PM5/5/15
to subjec...@googlegroups.com
I already done those
1. comment out those 2 in config.php
2. uncommnet that error thing in php.ini

But that Notice: Array to string conversion in ..\subjects\staff_details.php on line 78 still appear

Any idea where should i look at..

Mohd Izwan

unread,
May 5, 2015, 8:06:06 PM5/5/15
to subjec...@googlegroups.com
Oh sorry guys....

That Notice error is gone, i comment wrong part...

However back to the title regarding How to show all guide instead only show Subject Liaison for ...

Regards

Izwan Salim

unread,
Sep 19, 2022, 8:44:51 AM9/19/22
to SubjectsPlus
Dear all, the latest SP, how to add several subject type

I have Research, Topic, Subject and Library.

I would like it to show 

Subject Liaison for . . .
1
2
3

Topic Liaison for . . .
1
2
3

Regards

Andrew Darby

unread,
Sep 22, 2022, 3:51:23 PM9/22/22
to subjec...@googlegroups.com
Hi,

Sorry for the slow reply.  If you wanted to do this, you would need to modify this file:


You could modify the query at line 106, something like (off the top of my head; I don't have a development environment available right now):

SELECT s.subject_id, subject, shortform, s.type
FROM staff_subject ss, subject s
WHERE ss.subject_id = s.subject_id
AND ss.staff_id = :staff_id
AND active = '1'
ORDER BY subject

and then modify the section from lines 126 to 146 so that you loop through your subject types (i.e., s.type), and display only the ones you are interested in (Subject, Topic).

If you aren't comfortable trying this out, we can look at this when we have a chance (but things are pretty busy right now).

Andrew


Reply all
Reply to author
Forward
0 new messages