Is there a way to display all the category names a link is in, including aliases?
I have a directory where most of the links are stored in multiple categories, and I'd like to be able to show the names of all the categories for each link, so I don't have to write all of them down in the description as well.
{LINKCATNAME} seems to post only the name of the current category. {LINKALIASEDIN} puts out nothing, doesn't seem to be working in admin validating area either. BTW, in the "link edit validation" list the "Category" isn't displayed either.
{LINKALIASEDIN} works fine for the original link, but fails when viewing the alias.
Edit: Ah, it depends on the categories being in the sitemap too in order to run quicker. Will change it back to the slower by more reliable way. Here's the new version of the function in classes/onelink.php:
function aliasedin($validation = 'yes') { global $db, $settings, $language; if ($language->aliaslist == '') $language->aliaslist = '<a href="index.php?action=displaycat&catid={CATID}">{CATNAME}</a>, '; if ($this->alias) $real = new onelink('id', $this->alias); else $real = $this;
if ($validation == 'unvalidatededit') { if ($real->allaliases != '') $idlist = explode(',', $this->allaliases); } else { if ($validation == 'yes') $query = $db->select('catid', 'linkstable', 'alias='. $real->id .' AND validated=1 AND deleted=0', '', ''); else $query = $db->select('catid', 'linkstable', 'delete=0 AND alias='. $real->id, '', ''); $num = $db->numrows($query); for ($x=0; $x<$num; $x++) { $idlist[] = $db->rowitem($query); } } if (is_array($idlist)) { foreach ($idlist as $thisid) { $cat = new category('id', $thisid); $aliaslist .= categoryreplacements($language->aliaslist, $cat); } } $aliaslist = rtrim($aliaslist, " \t\n\r,|"); return $aliaslist; }
That's perfect!!! One last question: is it possible to display these categories without the link? just as plain text? I can see the part in the function, but I don't dare to mess with it
I think you're talking about something else. I mean, when I use {LINKALIASEDIN} all the categories appear, but they are all linking to the respective category. Is it possible to have just the category name instead of the category name linking to the category? It should be this line in onelink.php
if ($language->aliaslist == '') $language->aliaslist = '<a href="index.php?action=displaycat&catid={CATID}">{CATNAME}</a>, ';
But I don't wanna remove the link here, because obviously the link on the search results page would be gone as well...
Another question: what are those aliased categories sorted by? And is it possible to change the order? I couldn't figure it out, but it doesn't seem to be by alphabet or ID...
And why is it that sometimes the main category is listed among the aliased categories and sometimes it's not?
edit okay, I think I found my problem: I have a directory at http://www.icon-search.com where basically all links are in more than one category. To make things easier I want to list all categories along with all keywords (entered in the description box). This is what I use to display all of these:
The thing is that {LINKCATNAME} does not display the actual main category of the link, but the category I am in at that time. For example take a look at this category: www.icon-search.com/index.p...action=displaycat&catid=52 the first link "beltaine_icons" is in category "Chronicles Of Narnia" and aliased in "Flowers & Plants". When you see the link in the "Flowers & Plants" category, it's the only category displayed. When you are in the "Chronicles Of Narnia" category (www.icon-search.com/index.p...ction=displaycat&catid=475) you see both categories listed. Is there a way to really display all of the categories a link is in?
I just upgraded to 3.4.0 hoping that it might work, but it still doesn't. When visiting the original category, {LINKORIGINALCATNAME} will show the original category. but in any other category the link is aliased in, {LINKORIGINALCATNAME} is just blank.
Example: www.icon-search.com/index.p...action=displaycat&catid=52 where "Flowers & Plants" is the original category it's displayed fine. If another category is the original one, the first spot is empty and the list starts with a ",".
Comments on Display all link categories
Forum Regular
Usergroup: Customer
Joined: May 11, 2003
Total Topics: 64
Total Comments: 199
Is there a way to display all the category names a link is in, including aliases?
I have a directory where most of the links are stored in multiple categories, and I'd like to be able to show the names of all the categories for each link, so I don't have to write all of them down in the description as well.
{LINKCATNAME} seems to post only the name of the current category.
{LINKALIASEDIN} puts out nothing, doesn't seem to be working in admin validating area either. BTW, in the "link edit validation" list the "Category" isn't displayed either.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
{LINKALIASEDIN} works fine for the original link, but fails when viewing the alias.
Edit: Ah, it depends on the categories being in the sitemap too in order to run quicker. Will change it back to the slower by more reliable way. Here's the new version of the function in classes/onelink.php:
Forum Regular
Usergroup: Customer
Joined: May 11, 2003
Total Topics: 64
Total Comments: 199
Great, thanks. Will try that in a second
Forum Regular
Usergroup: Customer
Joined: May 11, 2003
Total Topics: 64
Total Comments: 199
That's perfect!!! One last question: is it possible to display these categories without the link? just as plain text?
I can see the part in the function, but I don't dare to mess with it
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
It's the language item named 'aliaslist'.
Edit: I see it doesn't exist by default for some reason, but just create it.
Forum Regular
Usergroup: Customer
Joined: May 11, 2003
Total Topics: 64
Total Comments: 199
I think you're talking about something else.
I mean, when I use {LINKALIASEDIN} all the categories appear, but they are all linking to the respective category. Is it possible to have just the category name instead of the category name linking to the category?
It should be this line in onelink.php
But I don't wanna remove the link here, because obviously the link on the search results page would be gone as well...
Another question: what are those aliased categories sorted by? And is it possible to change the order? I couldn't figure it out, but it doesn't seem to be by alphabet or ID...
And why is it that sometimes the main category is listed among the aliased categories and sometimes it's not?
edit
okay, I think I found my problem:
I have a directory at http://www.icon-search.com where basically all links are in more than one category. To make things easier I want to list all categories along with all keywords (entered in the description box).
This is what I use to display all of these:
The thing is that {LINKCATNAME} does not display the actual main category of the link, but the category I am in at that time.
For example take a look at this category:
www.icon-search.com/index.p...action=displaycat&catid=52
the first link "beltaine_icons" is in category "Chronicles Of Narnia" and aliased in "Flowers & Plants". When you see the link in the "Flowers & Plants" category, it's the only category displayed. When you are in the "Chronicles Of Narnia" category (www.icon-search.com/index.p...ction=displaycat&catid=475) you see both categories listed.
Is there a way to really display all of the categories a link is in?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
It should be this line in onelink.php
No, do not edit PHP. As I said above it's a language item. The PHP only has a default for if you don't set the language.
Is there a way to really display all of the categories a link is in?
Checking scripts.webmastersite.net/w...inks/wsnmanual/articles/10 I read "{LINKORIGINALCATNAME} - The name of the original category of an aliased link (or just regular category name otherwise)."
Forum Regular
Usergroup: Customer
Joined: May 11, 2003
Total Topics: 64
Total Comments: 199
Checking scripts.webmastersite.net/w...inks/wsnmanual/articles/10 I read "{LINKORIGINALCATNAME} - The name of the original category of an aliased link (or just regular category name otherwise)."
Tried that, would have been great, but there's nothing showing up
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
{LINKORIGINALCATNAME} works for me.
Forum Regular
Usergroup: Customer
Joined: May 11, 2003
Total Topics: 64
Total Comments: 199
I just upgraded to 3.4.0 hoping that it might work, but it still doesn't. When visiting the original category, {LINKORIGINALCATNAME} will show the original category. but in any other category the link is aliased in, {LINKORIGINALCATNAME} is just blank.
Example: www.icon-search.com/index.p...action=displaycat&catid=52
where "Flowers & Plants" is the original category it's displayed fine. If another category is the original one, the first spot is empty and the list starts with a ",".
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Odd, it worked with one link but now trying with another it doesn't.
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Fixed for 3.4.1.