I would have expected that after a user logs in and clicks Modify a Resource, that they would be presented with a list of their links and simply choose the one to modify. As it is they have have to remember the exact URL, which some do not type correctly thus generating e-mail that must be delt with.
Dec 9, 2000, 2:13 PM
Veteran / Moderator (6956 posts)
Dec 9, 2000, 2:13 PM
Post #3 of 19
Views: 6574
This actually shouldn't be too hard to add.
I will be updating the editor/password log in to add the missing features from this 1.1x mod to the 2.0 version. I think the only parts that need to be moved are the changes to the templates, and a subroutine to select the links owned by the current log-in user.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ
I will be updating the editor/password log in to add the missing features from this 1.1x mod to the 2.0 version. I think the only parts that need to be moved are the changes to the templates, and a subroutine to select the links owned by the current log-in user.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ
Dec 9, 2000, 11:32 PM
Veteran / Moderator (6956 posts)
Dec 9, 2000, 11:32 PM
Post #5 of 19
Views: 6568
I actually hacked something together. It's not perfect, but all it requires is a change to modify.cgi and to the templates.
It's based on the modify.html template in the editor_logon mod I made before. The only change is <%Links%> is now <%User_Links%>, and the columns are different in the output table(and you can change those by editing the routines).
This is the template part of the code, including the "error" handler.
<p>Select the link you would like to modify:</p>
<table cellpadding="1" cellspacing="0" border="0">
<tr bgcolor="#000000">
<td>
<table width="100%" cellpadding="5" cellspacing="0" border="0" BGCOLOR="WHITE">
<tr bgcolor="#0066cc" valign="middle">
<td><font face="verdana, arial" color="#ffffff" size="1"><b>ID</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Name</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Hits</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Add Date</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Rating</b></font></td>
</tr>
<%User_Links%>
</table>
</td>
</tr>
</table>
<p>
<%if span%>
<%span%>
<%endif%>
</p>
<%endif%>
<%ifnot User_Links%>
<%ifnot ID%>
No Links to Modify!
<%endif%>
<%endif%>
<%if error%>
<%error%>
<%endif%>You need to make two changes to modify.cgi:
Right after the user authentication, add:
## at this point we do have a logged in user.
if (!$link_id ) {
my $results = &get_user_links();
print $IN->header();
print Links::SiteHTML::display('modify', { User_Links => $results} );
return;
}Then, where you have the subroutines.
# --------------------------------------------------------
# generate the list of users links
#
my $dbh = $DB->table ('Links');
my $results = '' ;
my $links = $dbh->select ({ LinkOwner => $USER->{'Username'} });
($links->rows ) || return ( {error => 'No Links To Modify'} );
while (my $link = $links->fetchrow_hashref){
## $results .= Links::SiteHTML::display ('link', $link);
my $id = $link->{'ID'};
$results .= qq|<TR>
<TD><A HREF=$CFG->{'db_cgi_url'}/modify.cgi?LinkID=$id> $id </A></TD>
<TD>$link->{'Title'}</TD>
<TD>$link->{'Hits'}</TD>
<TD>$link->{'Add_Date'}</TD>
<TD>$link->{'Rating'}</TD>
</TR>
|;
}
return ($results);
}This isn't complete, or completly debugged, and there are a few things that would be nice to have. Also, while it includes the span pages tags, that is from the old mod, and is not in this one yet.
But, let me know if you get it to work.
I'll probably flesh it out a bit in the next few days.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ
It's based on the modify.html template in the editor_logon mod I made before. The only change is <%Links%> is now <%User_Links%>, and the columns are different in the output table(and you can change those by editing the routines).
This is the template part of the code, including the "error" handler.
Code:
<%if User_Links%> <p>Select the link you would like to modify:</p>
<table cellpadding="1" cellspacing="0" border="0">
<tr bgcolor="#000000">
<td>
<table width="100%" cellpadding="5" cellspacing="0" border="0" BGCOLOR="WHITE">
<tr bgcolor="#0066cc" valign="middle">
<td><font face="verdana, arial" color="#ffffff" size="1"><b>ID</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Name</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Hits</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Add Date</b></font></td>
<td align="center"><font face="verdana, arial" color="#ffffff" size="1"><b>Rating</b></font></td>
</tr>
<%User_Links%>
</table>
</td>
</tr>
</table>
<p>
<%if span%>
<%span%>
<%endif%>
</p>
<%endif%>
<%ifnot User_Links%>
<%ifnot ID%>
No Links to Modify!
<%endif%>
<%endif%>
<%if error%>
<%error%>
<%endif%>
Right after the user authentication, add:
Code:
## generate the page with the users links. If no LinkID is passed in, generate the form. ## at this point we do have a logged in user.
if (!$link_id ) {
my $results = &get_user_links();
print $IN->header();
print Links::SiteHTML::display('modify', { User_Links => $results} );
return;
}
Code:
sub get_user_links { # --------------------------------------------------------
# generate the list of users links
#
my $dbh = $DB->table ('Links');
my $results = '' ;
my $links = $dbh->select ({ LinkOwner => $USER->{'Username'} });
($links->rows ) || return ( {error => 'No Links To Modify'} );
while (my $link = $links->fetchrow_hashref){
## $results .= Links::SiteHTML::display ('link', $link);
my $id = $link->{'ID'};
$results .= qq|<TR>
<TD><A HREF=$CFG->{'db_cgi_url'}/modify.cgi?LinkID=$id> $id </A></TD>
<TD>$link->{'Title'}</TD>
<TD>$link->{'Hits'}</TD>
<TD>$link->{'Add_Date'}</TD>
<TD>$link->{'Rating'}</TD>
</TR>
|;
}
return ($results);
}
But, let me know if you get it to work.
I'll probably flesh it out a bit in the next few days.
PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ
Mar 8, 2001, 12:08 AM
Veteran / Moderator (6956 posts)
Mar 8, 2001, 12:08 AM
Post #7 of 19
Views: 6469
I must be missing something.
When a user logs in, they are prompted with a list of their links to modify, or a message saying "No links to modify."
You might need to make sure your templates are all up to date. Make sure you aren't missing any.
Also, unless a link has a LinkOwner listed, it won't be shown.
The system isn't perfect, but if you have people log-in before they can enter links, then when they log in, and click "Modify" they are presented with a list of all their links.
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
When a user logs in, they are prompted with a list of their links to modify, or a message saying "No links to modify."
You might need to make sure your templates are all up to date. Make sure you aren't missing any.
Also, unless a link has a LinkOwner listed, it won't be shown.
The system isn't perfect, but if you have people log-in before they can enter links, then when they log in, and click "Modify" they are presented with a list of all their links.
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Mar 8, 2001, 6:54 AM
Veteran (1264 posts)
Mar 8, 2001, 6:54 AM
Post #8 of 19
Views: 6498
If they're using version 2.0.3 (?), I had the same problem with it not displaying the users links, and instead defaulting to stardard modify page.
I just altered this small piece of code at the top of modify.cgi, and now it brings up the list of links for that user fine. I don't know if it's technically correct, but it seems to work. :)
I changed this...
$CFG->{user_required} or $USER and do { _list_owned_links(); last CASE; };
to this...
$USER and do { _list_owned_links(); last CASE; };
Regan.
I just altered this small piece of code at the top of modify.cgi, and now it brings up the list of links for that user fine. I don't know if it's technically correct, but it seems to work. :)
I changed this...
$CFG->{user_required} or $USER and do { _list_owned_links(); last CASE; };
to this...
$USER and do { _list_owned_links(); last CASE; };
Regan.
Mar 10, 2001, 8:51 PM
User (387 posts)
Mar 10, 2001, 8:51 PM
Post #12 of 19
Views: 6454
Check your templates 'very carefully' - I know the AV template codes work alright ...
What you are asking seems to work straight out of the box without any hacking etc.
The secret is ... a person must be logged on .. and in the form.txt you use:-
<%if URL%<%URL%<%endif%
etc...
There are also some hidden codes there (in particular %URL%) ones that I missed in the changeover ... but now it is working perfectly.
Regards,
Clint.
--------------------------
http://www.AffiliatesDirectory.com - Affiliate Programs Directory
What you are asking seems to work straight out of the box without any hacking etc.
The secret is ... a person must be logged on .. and in the form.txt you use:-
<%if URL%<%URL%<%endif%
etc...
There are also some hidden codes there (in particular %URL%) ones that I missed in the changeover ... but now it is working perfectly.
Regards,
Clint.
--------------------------
http://www.AffiliatesDirectory.com - Affiliate Programs Directory
Mar 11, 2001, 6:02 AM
User (100 posts)
Mar 11, 2001, 6:02 AM
Post #14 of 19
Views: 6454
If we are talking about the modify_select.html template, where after a user logs in they can hit 'modify links' and be presented with a list of their links, I had a similar problem. It turned out that my old template was missing this new line of code:
<table border=0>
<%loop link_results%><tr><td>
<input type=radio name=LinkID value="<%ID%>">
</td></tr><%include link.html%>
<%endloop%>
</table>
Once I put that in, it worked fine.
Bryan
<table border=0>
<%loop link_results%><tr><td>
<input type=radio name=LinkID value="<%ID%>">
</td></tr><%include link.html%>
<%endloop%>
</table>
Once I put that in, it worked fine.
Bryan
Mar 15, 2001, 4:34 PM
User (119 posts)
Mar 15, 2001, 4:34 PM
Post #15 of 19
Views: 6400
Call me crazy but why would any directory owner want to convey onto an unknown user the privilege of ownership to a link that he/she happened to submit? Who's to say that they authored the content in the link they submitted? And why would anyone want to expose themselves to having to mediate disputes over true ownership?
In a perfect world this might not be an issue but this is the real world. Think long and hard about choosing to relinquish ownership of links in your directory. It can turn around and bite you.
IMHO
Mark Brasche
http://SurfSafely.com/
In a perfect world this might not be an issue but this is the real world. Think long and hard about choosing to relinquish ownership of links in your directory. It can turn around and bite you.
IMHO
Mark Brasche
http://SurfSafely.com/
Mar 15, 2001, 7:06 PM
Veteran (1264 posts)
Mar 15, 2001, 7:06 PM
Post #16 of 19
Views: 6403
I let the owners of web sites submit links becuase...
A. They fill in more detailed descriptions and treat it more as a marketing exercise which makes the directory more credible.
B. It builds a mailing list of people who 'want' to be there and are potential buyers for other products.
C. It makes them have an afinity with my web site, as they come back to see/change their link and tell others about it.
D. They keep the links up to date and relevant themselves, I just approve or deny them.
E. If a stranger registers a site, and the owner then contacts me, I hand it straight over to the owner - this is a condition on the submission page.
In my limited experience, I have found that the person submitting the link usually has an affinity with the site they're submitting in some way.
But thats just my site, yours may be different.
Cheers
R.
A. They fill in more detailed descriptions and treat it more as a marketing exercise which makes the directory more credible.
B. It builds a mailing list of people who 'want' to be there and are potential buyers for other products.
C. It makes them have an afinity with my web site, as they come back to see/change their link and tell others about it.
D. They keep the links up to date and relevant themselves, I just approve or deny them.
E. If a stranger registers a site, and the owner then contacts me, I hand it straight over to the owner - this is a condition on the submission page.
In my limited experience, I have found that the person submitting the link usually has an affinity with the site they're submitting in some way.
But thats just my site, yours may be different.
Cheers
R.
Mar 15, 2001, 7:46 PM
User (100 posts)
Mar 15, 2001, 7:46 PM
Post #17 of 19
Views: 6432
I hadn't really thought about it, but I intend to give ownership of the site to the person whose email address appears on the site.
Most of my links will be individuals, and I want them to be able to update their own links and descriptions. I feel that they will also be able to categorize themselves better than I can.
I do see your point though, and I think I will make sure that I have some kind of checks in place to prevent fraudelent ownership of links.
Bryan
Most of my links will be individuals, and I want them to be able to update their own links and descriptions. I feel that they will also be able to categorize themselves better than I can.
I do see your point though, and I think I will make sure that I have some kind of checks in place to prevent fraudelent ownership of links.
Bryan
Mar 17, 2001, 7:04 AM
Novice (28 posts)
Mar 17, 2001, 7:04 AM
Post #19 of 19
Views: 6374
Working solution for Links SQL 2.0.3 (works for me very fine, if you have any bugs respond here)
YOU DON'T NEED to change any cgi-files for giving user a chance to select links before modifying.
Thanks to BrianL - his code is working fine, only you need to modify some things more:
1) This is what you need to place in modify_select.html:
<%if error%>
<%error%>
<%endif%>
<%if next%>
<p align=right><small>Pages: <%next%></small></p>
<%endif%>
<form action="<%db_cgi_url%>/modify.cgi" method=post>
<table border=1 cellpadding=2 cellspacing=0 width=100%>
<%loop link_results%>
<tr><td>
<input type=radio name=LinkID value="<%ID%>"> Check to modify this link:
<%include link_modify.html%>
<%endloop%>
</td></tr>
</table>
<input type=submit value="Modify selected link">
</form>
Of course, + headers +footers and so on... but above is necessary thing.
2) You need to create link_modify.html so modify_select includes not usual link.html file (because "popular", "updated" and "new!" marks are not working correctly with that. In another words, you need to delete all un-usable things from link.html and copy it as link_modify.html.
3) Please, correct the language.txt after that, the 'MODIFY_NOLINKS' vairable. In 2.0.3., it is saying "Sorry, but you do have any links to modify."; in this case, type "Sorry, but you don\'t have any links to modify."
Hope this helps.
YOU DON'T NEED to change any cgi-files for giving user a chance to select links before modifying.
Thanks to BrianL - his code is working fine, only you need to modify some things more:
1) This is what you need to place in modify_select.html:
<%if error%>
<%error%>
<%endif%>
<%if next%>
<p align=right><small>Pages: <%next%></small></p>
<%endif%>
<form action="<%db_cgi_url%>/modify.cgi" method=post>
<table border=1 cellpadding=2 cellspacing=0 width=100%>
<%loop link_results%>
<tr><td>
<input type=radio name=LinkID value="<%ID%>"> Check to modify this link:
<%include link_modify.html%>
<%endloop%>
</td></tr>
</table>
<input type=submit value="Modify selected link">
</form>
Of course, + headers +footers and so on... but above is necessary thing.
2) You need to create link_modify.html so modify_select includes not usual link.html file (because "popular", "updated" and "new!" marks are not working correctly with that. In another words, you need to delete all un-usable things from link.html and copy it as link_modify.html.
3) Please, correct the language.txt after that, the 'MODIFY_NOLINKS' vairable. In 2.0.3., it is saying "Sorry, but you do have any links to modify."; in this case, type "Sorry, but you don\'t have any links to modify."
Hope this helps.