Hi,
Does anyone know the query for how to find the tag rank for the tags in mt? I can make the count query to mt_tag table but that will just return me number of time a tag record present in the database but not the rank.
Can anyone help me please? Following doesn't work.
SELECT count(tag_id) as num, tag_name FROM `mt_tag` group by tag_name order by num desc
Thanks,
Danish
Reported on Movable Type 4.261

Hi Danish,
You could reconstruct the query following the logic from:
_hdlr_tag_rank
However, why don't you use the tag:
<$mt:TagRank$>
Eventually with the max argument, like this:
<$mt:TagRank max="10"$>
----------------------------------
Mihai Bocsaru
Web Development
Movable Type Consulting
Six Apart Partner
http://www.pro-it-service.com/
----------------------------------
Movable Type Demo
http://www.movabletypedemo.org/
Hi Mihai,
Actually I need to create a RSS Atom Feed for my blogs tags, which is the requirement of one of our clients. I am making the feed in PHP, which I think is easier for me to work with then MT code. So, what is _hdlr_tag_rank and where I can find it in which table of db?
Thanks,
Danish
Hi Danish,
You could see the logic behind it written in PERL on:
/lib/MT/Template/Tags/Tag.pm
Kind Regards,
Mihai Bocsaru
Miahi,
I can't find MT in /lib/. Can't you tell me the way the tag rank is calculated? Appreciate your help.
Thanks,
Danish
Which exact version of movable type are you using?
I am using Movable Type Enterprise version 4.21-en with: Community Pack 1.6, Enterprise Pack 1.1, Professional Pack 1.2
If that's the case, then look at:
/lib/MT/Template/ContextHandlers.pm
Look for:
=head2 TagRank
Read that and continue with:
sub _hdlr_tag_rank
Cheers,
Mihai
Mihai,
I can't find MT in /lib/
sixapart@sixapart1:/lib$ cd MT
-bash: cd: MT: Aucun fichier ou dossier de ce type
sixapart@sixapart1:/lib$
Is this the correct path to the perl script?
Thanks,
Danish
sixapart@sixapart1:~$ cd /
sixapart@sixapart1:/$ ls
bin boot dev etc home initrd initrd.img lib lib64 lost+found media mnt opt proc root sbin srv sys tmp usr var vmlinuz
sixapart@sixapart1:/$ cd lib
sixapart@sixapart1:/lib$ cd MT
-bash: cd: MT: Aucun fichier ou dossier de ce type
sixapart@sixapart1:/lib$
Can't find MT ... :). I don't know why.
Because he's referring to the "lib" directory in your MT folder.