Yes, I did search before posting. Found many questions but not so many answers; if I overlooked something, please give me a pointer.

I installed weblink 4.6., created the new tables and ran the update script. I got a blank page on it, no error messages, no data in the tables. Finally guessed that directory.module should be there before updating and reran the update. The script said:

query: SELECT * FROM weblink
error:

Updated weblink 'http://www.pink.at/'
Updated weblink 'http://www.freefly.com/'
Updated weblink 'http://www.fallschirmshop.at/'
[...]

All of my weblinks were listed as "updated", and the new tables are populated, so I am not sure what the "error" is meant to say?

If I understand right, the new weblink module does not have any display-options, and directory.module is to be used instead. Directory looks nice, except that excluding vocabularies does not work yet (ok, this has been covered). But the directory is a node-listing, thus linking to the node, not the weblink-url. I really wouldn't want to make my users cklick twice, I think this would be bad usability.

So, the question is, has anybody got this working in any way? The Weblinks are an important part of my site, wouldn't want to lose them.

thx,
Chronistin

Comments

stevryn’s picture

I have made the same discovery....linking to nodes as opposed to url...I have submitted various posts regarding it. it applies to the urls created via flexinode as well. Thats the word I was searching for earlier!! Usability!! :)

Chronistin’s picture

With my very limited php-knowledge, I tried to edit the directory.module. I thought that hardcoding it to my weblink-vocabulary id would provide a quick & dirty interim-solution. But as soon as I address a specific vocabulary, there is an error message:

Fatal error: Call to undefined function: node_access_join_sql() in /httpdocs/modules/directory.module on line 230

This error also occurs in the original version when addressing a certain vocabulary in the form

directory/term/2 (as described within the module itself).

Chronistin’s picture

sorry, but I've really been struggling to get it to work in some way, using my limited php-knowledge far beyond my limits - no success. Any hint would be appreciated.

thx,
Chronistin

stevryn’s picture

I havent used directory module. What I have is just the weblinks module which I have reinstalled a zillion times after playing around with it. One thing I did each time was completely remove EVERYTHING, including any links I had. Since I couldnt get update to work, I just started over. I have the module working all except when I use the Latest Weblinks" block, I get the same result as you, clicking takes you to the node, not the external site. It is my understanding this is by design....to provide "tracking" capability.
I also ran in to this with using flexinode's url field, and using taxonomy dhtml menu. With that, you can pick which vocabs you dont want to be listed. I was able to get THAT fixed with help from a guy that works with me. I currently am trying to get the weblinks module adjusted as well. Are you trying to create a links page based upon vocabularies in a menu type format? You may want to try flexinode & taxonomy dhtml menu, then we can adjust yours to make the links go to the external page.

Chronistin’s picture

Maybe I misunderstood everything from the beginning? In the notes/changelog it says:

Removed browsing and directory interface. Use directory module instead.

That's what I'm trying to do. I think directory would make for a nice interface, except for the flaws mentioned above.

I'm not trying to get a "menu" (in a block or anything), all I want to achieve is a nice list in the middle (node-)area on a page with its own url. Much like it was with the old weblinks.module, actually. I can't believe I am the only one missing this approach? Or am I just too stupid?

I also found this discussion. There's a lot of suggestions, but no final solution. I do not understand why I should create a flexinode type, when all the information is already in the weblinks-tables? I also do not see the article module helping in any way, as it is all about in-site modules and still would not solve the problem of having to click twice (I did not actually install it, but that was the impression I got browsing other people's use of it)

I am starting to think that I am overlooking something really obvious here...

boris mann’s picture

The new "links" bundle seems to have lost a lot of functionality. It may eventually have some interesting additional capabilities, but a directory of links is less easy to achieve today.

stevryn’s picture

I just dont see how its "better", I am trying to do something so simple yet its such a nightmare.

I have managed a tree like menu, with direct links to external sites. But getting the block I want to work is another story. I dont see the "open in new window" setting too that was there before, did that go somewhere?

Again perfect word ~usability~

stevryn’s picture

I cant even find the directory module to look at it. I have my links categorized, but you probably could just created one vocab, and they would just list without the tree like structure.

Try this, you have a weblinks vocab correct? Go and grab the taxonomy dhtml module. Set is to show you only the weblinks vocab. If you like the look but hate that it goes to the node, I will show you the way to fix that.....

sepeck’s picture

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Chronistin’s picture

[oops, misunderstanding]

Chronistin’s picture

...I really don't like that fancy dhtml stuff too much, but it seems like this is the best thing I can get right now. I had a look at the code & guess it has to do with the 'content' variable... but that's really just a guess. So, how did you do it?

Thanks,
Chronistin

stevryn’s picture

I use taxonomy dhtml with flexinode, and modified it. Im looking at the weblinks module now to see how it pulls the link.

Will let you know today the progress! I have a building full of developers but only a few know PHP, and all are pretty busy.

In taxonomy_dhtml.module look for this:

$type_q = ($type ? " AND n.type = '$type'" : 1);
    $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.type, u.uid, u.name FROM {term_node} r LEFT JOIN {node} n ON r.nid = n.nid LEFT JOIN {users} u ON n.uid = u.uid WHERE $type_q AND r.tid = '$term->tid' ORDER BY n.changed DESC"), 0, variable_get("taxonomy_dhtml_overview_count", 50));
    while ($node = db_fetch_object($result)) {                 
      if (module_exist('comment')) {
        $detail = t("Author: %name, comments: %num", array ("%name" => strip_tags(format_name($node)), "%num" => comment_num_all($node->nid)));
      }
      $link = l($node->title, "node/$node->nid", array ("title" => $detail, "class" => "dhtml_node"));
      $term_node = array2object(array ("nid" => $node->nid, "depth" => $term->depth+1, "link" => $link));
      $part1 = array_slice($tree_node, 0, $i+1);
      $part2 = array_slice($tree_node, $i+1, count($tree_node));
      $part1[] = $term_node;
      $tree_node = array_merge($part1, $part2);
    }

Thats where the changes need to be made, if you want to play around there....you need to pull the url from weblinks table so that you can change the "node/$node->nid", to reflect the url. With my flexinode we made some joins...I am PHP dumb here, so I did it with help from a guy here. Maybe together we can figure it out..

My code looks like this now:

$type_q = ($type ? " AND n.type = '$type'" : 1);
    $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.type, u.uid, u.name, f.textual_data FROM {term_node} r LEFT JOIN {node} n ON r.nid = n.nid LEFT JOIN {users} u ON n.uid = u.uid LEFT JOIN {flexinode_data} f ON f.nid = n.nid WHERE f.field_id =23 and $type_q AND r.tid = '$term->tid' ORDER BY n.changed DESC"), 0, variable_get("taxonomy_dhtml_overview_count", 50));
    while ($node = db_fetch_object($result)) {                 
      if (module_exist('comment')) {
        $detail = t("Author: %name, comments: %num", array ("%name" => strip_tags(format_name($node)), "%num" => comment_num_all($node->nid)));
      }
      $link = l($node->title, "$node->textual_data", array ("title" => $detail, "class" => "dhtml_node"));
      $term_node = array2object(array ("nid" => $node->nid, "depth" => $term->depth+1, "link" => $link));
      $part1 = array_slice($tree_node, 0, $i+1);
      $part2 = array_slice($tree_node, $i+1, count($tree_node));
      $part1[] = $term_node;
      $tree_node = array_merge($part1, $part2);

Hope this helps some
~T~

Chronistin’s picture

I should be able to get something to work with this example. Adapting this to the weblink table structure seems to lie mostly in the sql query. Shouldn't be too hard. I'll try it right away.

Chronistin’s picture

Thanks again for the ideas & example, stevryn!

If anybody else wants to tweak taxonomy_dhmtl for the purpose of creating a linklist from existing 4.6 weblink.module tables, this is the code that works for me (line 149 to 154 in taxonomy_dhtml.module) (But be aware that the modified module will not be suitable for its original purpose any more)

    $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.type, u.uid, u.name, x.lid FROM {term_node} r LEFT JOIN {node} n ON r.nid = n.nid LEFT JOIN {users} u ON n.uid = u.uid LEFT JOIN {weblinks_node} x ON x.nid = r.nid WHERE n.status = 1 AND $type_q AND r.tid = '$term->tid' ORDER BY n.title DESC"), 0, variable_get("taxonomy_dhtml_overview_count", 50));
    while ($node = db_fetch_object($result)) {
      if (module_exist('comment')) {
        $detail = t("Author: %name, comments: %num", array ("%name" => strip_tags(format_name($node)), "%num" => comment_num_all($node->nid)));
      }
      $link = l($node->title, "weblink/goto/$node->lid", array ("title" => $detail, "class" => "dhtml_node"));

The changes, in Detail are: JOINing the weblogs-node table to the existing sql to get out the "lid" and changing the link portion from "node/$node->nid" to "weblink/goto/$node->lid", thus using the existing weblink redirection mode to go to the desired address. I also changed the sort order, since sorting by title seems more appropriate for links.

stevryn’s picture

I havent had a chance to work this out, so this is a GREAT help! See what cooperation can do :)

Chronistin’s picture

I'm still "hacking around" the module. Would like to make a bigger difference in appearance between actual links & subcategories, but that's more of a design issue. The corresponding CSS looks kind of messy to begin with.

And then it would be nice to also display the weblink text & the number of clicks, which means linking another table in the query. I guess I'll leave that to tomorrow. (But I will gladly post more code if successful).

stevryn’s picture

The user had to click, it went to the node, then when they clicked the visit link, their click was recorded. I myself dont need to track, 90% of the documents are internal.

Chronistin’s picture

As far as I understand it (which is not necessarily right), using the link format "weblink/goto/[lid]" is sufficient for recording the number of times a link is clicked. I *think* this is the way how the block "top weblinks" is calculated. I'll have a closer look tomorrow.

Chronistin’s picture

Showing the klicks wouldn't be hard, but there's no place to show them beside the title-attribute, and nobody ever looks at that anyway... Showing associated text would be much harder, everything is designed to go inside the link, and it would probably be nonsense to change that. I'll leave it at that, sufficient for the time being.

syren-1’s picture

Did anyone ever figure out how to make your nodes listed in the directory actual hyperlinks as opposed to having to click twice - once to get to the node's page and then to go to the actual URL?

stevryn’s picture

put the full URL into the path alias......It worked for me for flexinode urls

dmjossel’s picture

This module seems to be going the way of many core and contributed modules-- being rewritten as frameworks with barebones functionality, with all the old features plus new ones in a CVS only module that still isn't released long after 4.6 was, and still doesn't actually do what the old module did.

There is an easier way-- just use the old weblinks.module. All the features work except the use of the goto/nid links to count clicks. If, like me, you just need a weblinks directory (and I think most users who use taxonomies extensively on their sites for organizing other kinds of content will find it impossible to use the directory module for this) and don't care about counting clicks, you can get around this.

Change lines 785-6 of the old weblinks.module to read:

  $output .= l($node->title, $node->weblink, _weblink_attributes($node));
  $output .= "</dt>";

That will remove the links to goto/$nid and allow users to link directly to the page in question.