Glossary

 
 
Picture of Sean S
no autolinking on a per instance basis
 
Is it possible to not have a term auto linked on a per basis situation. I want terms to be linked in forums etc.. but sometimes I do not want to clutter up the page with too many links.. How can I do this?
 
Average of ratings: -
Picture of Hans de Zwart
Re: no autolinking on a per instance basis
Group Developers
In general you can turn autolinking of for certain content by putting it in between <nolink> and </nolink> tags. (Very usefull for quiz questions!).
 
Average of ratings: -
Picture of Sean S
Re: no autolinking on a per instance basis
 
i tried it in my forum but it isn't working... any ideas? I'm running 1.3.4
 
Average of ratings: -
Picture of Tim Allen
Re: no autolinking on a per instance basis
 
<link>...</nolink> works for Firefox, but not IE, which converts the code to something else. There is a hack for it though - http://moodle.org/mod/forum/discuss.php?d=8888#42897

HTH, Tim. smile
 
Average of ratings: -
Picture of Paul Evans
Re: no autolinking on a per instance basis
 
You can also stop it doing a whole module by editing the php for the module you don't want to link. Just look for lines with the word 'filter'.

For example, the forum module: look in lib.php and you'll see where a test is done to perform the filter. Just search on the word 'filter'.

Comment out the lines that do the filtering. Make sure you keep searching afterwards as there may be multiple instances.

From what I've seen so far, the filtering is always done locally, but just checks a site-wide variable as a condition.

 
Average of ratings: -
Me and Ray
Re: no autolinking on a per instance basis
 
Dear Paul Evans,

Thanks very much for the suggestion on how to reduce autolinking Paul.

I may even hack all the modules except the recources, which is the only place I want to have the autolinking take place.

I wonder what impact this will have on speed. As you know from the other threads, that is what i am after.

I guess that there is a filter section in the course formats as well.
If I were using a linux box I could grep.

Tim
 
Average of ratings: -
Picture of Paul Evans
Re: no autolinking on a per instance basis
 

Dear Tim,

There were a couple of other things I did too, but neglected to mention, sorry.

I also reduced the number of items per page to some small number (since using it directly as a glossary is not my primary aim for it) as it then has less work to do.

At first I increased max execution time in /etc/phpconfig too, so the 'All' wouldn't time out. On my copy of moodle cvs1.4xx turning it off in the glossary setup didn't turn it off from alphabetical.

Finally I nuked it from the page by the simple expedient of "translating" the word 'All' in the language packs I use to " ", i.e. just a couple of spaces which don't show up and, hence, can't be clicked.

If you are stuck on windows to talk to your *bsd server, have you tried these? :

winscp which includes this

putty

The former is very good for msw users if you copy keys and make them a shortcut as it gives them an ssh connection with a fairly normal looking msw window to drag and drop from with no fuss about logging in and passwords. It will even use scp to copy to a tmp file so you can use e.g. notepad to edit files transparently and save back to the server.

I use them all the time when I'm stuck on an msw box at a client's place. Then you can grep, pipe, sed, awk, etc to your heart's content.

I know I just posted about commenting out the filtering somewhere on this site, but I've been cruising through the quiz module for the last little while and haven't seen where exactly that happens yet for that particular module; a recursive grep on 'filter' wasn't helpful. Dunno. When I find it (and I will, because I have Been Told To), I'll post wink

Funny. It's obvious in other places.

It's 0340 for me here in PST, so I'm turning in now …

Thanks for your kind words. Glad my post was useful to you.

Regards,

Paul Evans

 
Average of ratings: -
Me and Ray
Re: no autolinking on a per instance basis
 

Dear Paul,

I think that your suggestion for decreasing the load created by filtering (by implementing filtering by module) is the future, and I look forward to a time when the filter management page has setup options for each of the modules (perhaps, one day).

But since I have already hacked my 1.4.1+ extensively, and I am going to have to hack 1.4.2 in the same way, I have not yet found the energy to remove the filter calling parts of thevarious modules. And if you can't find where it is called in the quiz -- the most important module for me-- then I am pretty sure that I will not be able to find it either.

There are some parts of your post above that I do not understand since I am not nearly as savvy as you. Please do NOT feel oblidged to explain to me. I am unwashed. But I include a brief list of my confusion since I don't want to pretend to have understood. That would be an insult to your dillegence.

Reducing the number of items per page... Is this a setting in the glossary I wonder. Or in the glossary code, I wonder again. I am using the glossary as a glossary (or dictionary) so I don't think that I can take this path if so.

I am not sure what the "All" you mention is!

winscp and putty look beyond me but I guess it is a way of gaining linux/unix like control, and grep in particular, on windows systems. I seem to remember attempting to install putty or something vaguely similar so as to be able to access the moodle cvs from my windows boxes. I can't code php but the Japanese language translator wants help translating so I tried to join the moodle cvs community. The software I attempted to use, and failed to install, was a sort of linux command line for windows. Putty? Gutty?  

I have in the distant past downloaded a text editor that allowed me to search for strings in files on windows. Can't remember what it was now. The windows search capability says that it searches for strings, but I find that it does not!

But anyway, since I am not linux/unix savvy and am a windows waller, I don't think putty is for me, in this case. I beg to be forgiven for waiting in the hope that, to put it bluntly, you will find the filtering parts of the code for me. Ach... and even then, I probably will not have the time to hack them all out.

No... I think that I should just give up on my mammoth glossaries and for the time being and hope for more filtering control in future.

I am still wondering how http://rikai.com manages to filter so much so quickly.

Tim
takemoto

 
Average of ratings: -
Picture of Paul Evans
Re: no autolinking on a per instance basis
 
Dear Tim,

Hey - chin up - it's only ascii, there's always a way around things. Eventually smile

>Reducing the number of items per page.

Is a glossary setting you can twiddle.

The 'All' I'm talking about is the one which the user can click to get 'all' pages - it really eats up cpu and time doing that.

About winscp: just download it and try it out, trust me, it's very simple to install and use. If you don't have a shell account on your University's servers, just write me real email at pevans@catholic.org and I will make you an account on one of my boxes so you can play with it until you are comfortable (don't worry, it won't be on a production server smile )

About the quiz thing, it was late and I was a little burned out. Here's something that seems to work ok. It relies on matching a word in the URL to prevent the filtering, so you could use it for other modules too. I just used strpos() instead of a regex to speed things up, but that's why I included the forward slashes around the target word. strpos() isn't as a 'bright' as a regex can be.

So, try this out if you like: edit the file filter.php in /mod/glossary. Locate function glossary_dynamic_link, which is right near the top and right after the line with 'global $CFG' put

 
// Nolink for quizzes (or any other word in the path you like)
// $_SERVER['REQUEST_URI'] looks like e.g. : /mysite/mod/quiz/view.php?id=21
if (strpos($_SERVER['REQUEST_URI'], "/quiz/")) {
return $text;
}


You can extend it to other modules by using their name instead of quiz I imagine.

You could do it 'nicely' by looping through a (possibly stored) list or simply make more copies of the above.

Let me know if that works for you please since I haven't tested it too much yet. Mind you, it doesn't seem like much could go wrong with two lines of php smile famous last words.

cheers,

Paul
 
Average of ratings: -
Me and Ray
Re: no autolinking on a per instance basis
 

Dear Paul

The php looks really good. I will check it and winscp out soon.
Thanks very much indeed.

I tried the winscp first. Wow. Wow. Burn your ftp clients! This is really space goat. I am going to have so many more friends now. I can move files. I can edit them in a text editor and save them to remote server. And I have not even started to use Putty. Thank you very much for this recommendation.

I recommend this winscp to everyone. Trust Paul, and me, and download it now.

Tim

 
Average of ratings: -
Picture of Paul Evans
Re: no autolinking on a per instance basis
 
Dear Tim,

I'm not familiar with the space goat idiom, but I take it that it's a Good Thing smile

Glad to hear it. Let me know about that shell account and I'll lead you through the basics of getting around on *nix boxen if you like. That would round things out nicely and you'd really be flying!

You can change strings in thousands of files very quickly indeed with regular *nix tools. 'Course, that's another way of saying you can make huge mistakes with hardly any effort wink

For msw you will find this tool handy:
http://www.adsoft-development.com/portfolio/portfolio.php3?cid=5

I've used it to fix huge GIS models under windows. Nearly a terrabyte of photos served. works.

For a text editor you want this (not to start a war):
http://www.notetab.com/ntl.php

and this, since you prolly don't have a clipboard history:
http://www.yankee-clipper.net/index.html

and this for a file manager you can use in an ms-dos shell:
http://www.egner-online.de/vc/en/downloads.shtml

(alpha version free?, stable is shareware)

Finally (and completely off topic), this cheap and cheerful image viewer/editor:
http://www.irfanview.com/

All free as in beer, but not speech.

I used msw on my own box once for about 7 months and those are what kept me sane. More or less.

I can direct you to more powerful versions of any of those if you need to stay with windows and have greater needs. All free of course in one form or another.


Regards,
Paul Evans

p.s. a note to any future readers: I am *not* in the business of just handing out shell accounts, so please don't contact me for free shell accounts and tutorials. I guess I was just impressed with Tim's diligence or something wink
 
Average of ratings: -
Picture of Paul Evans
Re: no autolinking on a per instance basis
 
One last thing, you may want to do linking from your glossary for only one type of thing. In which case it would be simpler to invert the logic and say like:

if NOT condition(s) met:
return the text
else
filter it

that way you only need to do one thing.

Also, notice that you can put anything in for the match, so you can make it finer grained by making the match longer e.g. '/quiz/foo.php' instead of just '/quiz/'.

Too bad I'm -17h from you here. Makes conversations slow : - /

 
Average of ratings: -
Me and Ray
Re: no autolinking on a per instance basis
 

Thanks again Paul,

I am still at work with various dull things to do, but I will be trying at least some of the above software and the NOT (!) version of the two lines of php in your last version above. All I need is the resources linked.

BTW I appreciate the special offer of a shell account, but the truth is I have a linux box too ( I hope that does not piss you off). I have a Redhat 9 box, but I am not familiar with using it (other than the redhat gui, a bit), I only use it as a server and can't get my knees under the table where it is, so I don't use it much but I have ample oportunity for practice. And now that I can (when I have got the hang of things) get a command line from my main windows computer, I anticipate improvements.

Yep, I have a "unix like" command prompt for my university's server, and my linux box with no leg room.  So far I have managed to cd and ls but I will find a website with more instructions. This is not putty though. I need to install that seperately it seems.

Yankee Clipper looks very helpful too. It is something I have wanted for a while.

I have photoimpact so I don't think I will be using ifranview (which I have used many years ago. Just befoer I bought photoimpact I experimented with GIMP but it crashes on this msw.

For the time being I am very happy with the friendliness of winscp over and above the ftp client I have been using till now. I had tried to set up Samba and had failed but this requires nothing more than copying accross the details from my ftp client.

It looks like winscp is going to be the answer to my backup worries too. The compare directory and synchronisation features look very promising. I had been using AJC directory sychroniser (shareware) but it does not lie well with Japanese folder names, unlike winscp.

When I have a bit more time I will implement more of your advice.

Gratefully

Tim

 
Average of ratings: -
Picture of Paul Evans
Re: no autolinking on a per instance basis
 
I'm not one to talk about failing to dive into linux straight away. When I first tried it in 1994 it took me two *weeks* of evenings and weekends to even get X11 to work -- and then I had no apps to run on it, so I went back to my trusty team of csh and rexx on the amiga. It would be another couple of years before I used linux in any serious way and I had an install of it the whole time as do you.

About only linking resources -- you're right - that's all I need myself. Thanks for pointing that out.

Between that and lengthening the cache, I think we just won.

Well, till next time,
cheers
 
Average of ratings: -
Picture of Paul Evans
Re: no autolinking on a per instance basis
 
Last note, in practice I found that I wanted to allow both 'glossary' and 'resource' to filter (the recursion on the glossary is too nice to lose).
 
Average of ratings: -