Webmastersite.net
Register Log In

Display all link categories

Comments on Display all link categories

Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Jun 15, 2006 - 9:55 AM:

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.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 17, 2006 - 7:18 PM:

{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;
}
Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Jun 18, 2006 - 4:15 AM:

Great, thanks. Will try that in a second smiling face
Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Jun 18, 2006 - 10:20 AM:

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 sad
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 20, 2006 - 11:45 AM:

It's the language item named 'aliaslist'.

Edit: I see it doesn't exist by default for some reason, but just create it.
Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Jul 27, 2006 - 4:19 PM:

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:
<a href="http://www.icon-search.com/index.php?action=displaycat&catid={LINKCATID}">{LINKCATNAME}</a> {LINKALIASEDIN} {LINKDESCRIPTION}<bR>

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?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 30, 2006 - 10:33 PM:

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)."
Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
Posted Jul 31, 2006 - 2:22 AM:

Paul wrote:
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 sad
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 31, 2006 - 11:28 PM:

{LINKORIGINALCATNAME} works for me.
Jenny
Forum Regular

Usergroup: Customer
Joined: May 11, 2003

Total Topics: 64
Total Comments: 199
Jenny
#10 - Quote - Permalink
Posted Aug 09, 2006 - 3:10 PM:

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 ",".
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#11 - Quote - Permalink
Posted Aug 10, 2006 - 8:57 AM:

Odd, it worked with one link but now trying with another it doesn't.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#12 - Quote - Permalink
Posted Aug 10, 2006 - 9:08 AM:

Fixed for 3.4.1.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.