Closed (fixed)
Project:
Amazon associate tools
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
28 Oct 2006 at 17:52 UTC
Updated:
14 Mar 2007 at 20:16 UTC
This patch inserts a link to the existing node rather than a checkbox which makes the import process somewhat more user friendly.
$ diff amazon.module.orig amazon.module
1044,1049c1044,1062
< $output['add'] = array(
< '#type' => 'checkbox',
< '#default_value' => 0,
< '#prefix' => '<td>',
< '#suffix' => '</td>'
< );
---
> $exists_query = db_query('SELECT n.nid FROM {node} n JOIN {amazonnode} a ON n.nid = a.nid '
> ."WHERE n.type = 'amazon_node' AND a.asin = '$node->asin'");
> $exists = db_num_rows($exists_query);
> if (!$exists) {
> $output['add'] = array(
> '#type' => 'checkbox',
> '#default_value' => 0,
> '#prefix' => '<td>',
> '#suffix' => '</td>'
> );
> } else {
> $existing_node = db_fetch_object($exists_query);
> $output['add'] = array(
> '#type' => 'markup',
> '#value' => "<a href=\"/node/$existing_node->nid\">X</a>",
> '#prefix' => '<td>',
> '#suffix' => '</td>'
> );
> }
Comments
Comment #1
samj commentedShould also turn off taxonomies when the node already exists:
Comment #2
Prometheus6 commentedThat's not a bad idea.
I'm postponing it because I want to eliminate some bugs in the 4.7 version before working the 5.0 version. It will definitely be in the 5.0 version.
Comment #3
Prometheus6 commentedIt's not in there yet, but it will be so back to active status.
Comment #4
khoogheem commentedI would like to see something even more user friendly.. (sorry).
I would like to see there be an option on the import that allows you to
1) See already imported nodes (use the above patch to show the links)
2) Don't show already imported nodes. This should help speed things up so you can quickly import new items.
The other thing I would like is rather then just a button setup. It would be nice to see it setup more like the pager so you can get 1.2.3.... so if you have a bunch of items you can go to futher down then just one page at a time.
Comment #5
Prometheus6 commentedCan't have the normal pager links because they would have to use a different form input method (GET rather than PUT).
I've added an edit field though, so you can input the page you want to go to directly. And I've decided to backport it to the 4.7 branch. It is more user friendly.
Comment #6
csc4 commentedI was wondering if you could confirm if this is in 4.7 yet and if not do you have any idea when it might be?
Comment #7
Prometheus6 commentedIt's in the dev package...I'll create a release today.
I didn't create a link to the existing node though...I just disappeared the check box.
Comment #8
Prometheus6 commentedComment #9
(not verified) commented