Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

ClaimLink plugin:setting links to claimable

Quote Reply
ClaimLink plugin:setting links to claimable
I have the claimlink plugin all set up, but I need to set all the links in the database registered to one user (the admin) to claimable. I am assuming I do that with an sql command. Can anyone get me started?

Thanks

CCUnet
my Christian web
Quote Reply
Re: [ccunet] ClaimLink plugin:setting links to claimable In reply to
if the column you want to set is called "claimable", and your prefix is what you used (lsql_ for example)

update prefix_Links set claimable="value" where LinkOwner = "value2"


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] ClaimLink plugin:setting links to claimable In reply to
Thanks pugdog that did the trick

CCUnet
my Christian web

Last edited by:

ccunet: Jun 17, 2003, 10:20 AM
Quote Reply
Re: [ccunet] ClaimLink plugin:setting links to claimable In reply to
Sorry,

followed the instructions to the letter. Did not change anything.

Anyone got any ideas?

Thanks

Paul
Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
Just checking. Did you change the paarts inred to fit your system?

update prefix_Links set claimable="value" where LinkOwner = "value2"

CCUnet
my Christian web
Quote Reply
Re: [ccunet] ClaimLink plugin:setting links to claimable In reply to
OK,

Kind of got it working - one link at least. Manually changed from '0' to '1' and then the link became claimable.

Few coding issues to sort out such as missing headers and footers but nothing serious.

The problem I have is that I imported 325,000 links. Do I have to manually change each one or is there a way that I can across the board change the lot.

Many thanks.

Paul
Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
If I recall when I did it the values were, Yes and No.

CCUnet
my Christian web
Quote Reply
Re: [ccunet] ClaimLink plugin:setting links to claimable In reply to
The default setting in my links is '0' - therefore the presumtion of fact would be the 'claimable' is '1' - which in the one instance referred to above made the 'claim this link' status appear.

I guess it is somewhat academic as to whether it is yes/no or 1/0. Whatever works is probably the main focus.

What I really need to know is how can I change all 300,000 at once.

Thanks

Paul
Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
update prefix_Links set claimable="1"


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] ClaimLink plugin:setting links to claimable In reply to
Thanks ---

been through all that but no joy whatsoever. I know it SHOULD work but only when I manually edit each link does it work

Dont Know...
Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
Did you try setting it to "Yes" rather than 1 ?

That SQL query is _valid_ and *MUST* work :)


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] ClaimLink plugin:setting links to claimable In reply to
tried that - with the one link I changed manually was to '1' and made it work.

Thats why I know that if I change the value to '1' it is the correct value..

The default value on initial look at the links in the database '0', not 'no', therefore, logic (if that applies) says that 'yes' = '1'.

The answer to me is clear - just need way to change all 300,000 at once.

Paul
Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
Paul,

The answer to me is clear as well. You are doing something wrong, since the SQL query above, and the advice on using it, *WILL* update a field to set that field to a specified value for every record in the database, or, by using the WHERE clause, limit it to a specific user.

But, please feel free to do it manually :)

300,000 links at an average of 1 link every 7 or 8 seconds, would be a worth while project, for some, I guess.

Yes, I'm being *VERY* sarcastic, because the above codes, and solutions work, reguardless of whether you set the field to 1, 0, Yes, or CHEESEBURGER.

You've been given the answers, and the help, and it's worked for pretty much everyone who's tried it.

If you want additional help, please post your EXACT actions, and EXACTLY what happens. Otherwise, I will lock this thread. I'm getting a very bad feeling about this, and it's not going to continue.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] ClaimLink plugin:setting links to claimable In reply to
Was not a waste of time at all.

Finally got it..

The code I used is:..

update lsql_Links set link_claimable="1" where LinkOwner = "Admin";

Had to use phpmyadmin to do it but - I got there.

This is what I was saying about the instructions in another forum.

I stand by that.

Appreciate the help.


Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
Not sure what you were doing before but it seems that what you did actually just follows the instructions pugdog had.

Computers are quirky like that sometimes. I've found that most of the times when instructions received on these forums aren't working it is something simple that I missed. These guys are really good about checking their code examples and coming back with corrections if needed.

pugdog' query worked for me first time out so who knows. But I'm glad you finally got.
my Christian web
Quote Reply
Re: [ccunet] ClaimLink plugin:setting links to claimable In reply to
Yeah - I know what the problem is, however I have said enough.

The saga does not end there.

Having achieved the ability to actually get the links to display 'claim this link' and when the link gets claimed and proccessed the 'claim this link' sign is still there. I believe it should not be there.

Anyone got any ideas on that?
Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
Yep you found a bug. I checked my recently claimed links and found that they had not been updated, so the claim link options still shows.

To fix the problem you need to open the ClaimLink.pm file in your LSQL admin directory in notepad or other plain text editor.

do a search for (link_claimable => it is below this code

($cfg->{update_claimable_when_claimed} ?

change (link_claimable =>1)

to (link_claimable =>0)

That should do the trick. It worked for me.

CCUnet
my Christian web
Quote Reply
Re: [ccunet] ClaimLink plugin:setting links to claimable In reply to
OK,

seemed to make a difference.

Thanks for that. What I did find is in the admin - and this we all know so far - is that it takes admin approval to accept the change of ownership. There is in there all the info relating to the link itself. Including a drop down box with the title 'claimable'..

the default is 'yes' - now when approving a link ownership this also removes the 'claim this link' from the system. It is easy to overlook this in accepting a change. What I feel would be great would be the default to be set to 'no'. Except I do not know the file where to change this.

Anyone with a better knowledge of the files able to assit there.

This I feel is the final link in the chain to ensure what really is a good script - and a needed one - to get it to be quite failsafe in many respects.

Thanks for everyones perserverence in this - at the end of the day any problems need ironing out.
Quote Reply
Re: [Gypsypup] ClaimLink plugin:setting links to claimable In reply to
Not sure if this is what you mean but when you installed the plugin it should have added a list claims link to the plugin menu on the left side of the plugin manager.

If you click that you will find the current links being claimed.Then you can click another link it accept or reject the claim.

With the fix I posted the claimable field in the table should change from yes to no when the accept link claim is clicked and that is reflected in the removal of the claim this link option on the link page.

Glad I could help I know how hard it is to wrap your brain around this stuff sometimes.

CCUnet
my Christian web
Quote Reply
Re: [ccunet] ClaimLink plugin:setting links to claimable In reply to
Hi,

yes it does all that without a problem. Works fine. So there are many thanks for the help in that area.

OK, my concerns were unfounded - ran some more checks and found that the script performs flawlessly now - as best as any stress test I can figure out will allow.

The concern was in a request to modify the resource - and initially I saw the default 'claimable' coming up as 'yes'. in the admin 'modify approval' setup.

In fact - once the resource claim has been approved the admin modify 'claimable' comes up with what is in the database - that being a 'no' - not claimable because, it is already claimed.

I think now we have the issue sorted - hopefully all this will help others so if they encounter problems or concerns it is documented.

Many thanks.
Quote Reply
The Saga In reply to
The saga continues....

It appears I did not do my stress testing well enough after modifying everything...

A user brought to my attention that when they wanted to add a resource for indexing there was a non existant part of the form they had to fill out which was part of the 'claim link' - because the script rejected their input because of this.

Solving the problem was simpler that anything before. The include_form.html simply gets a claimable yes/no option put in.



<tr><td valign=top align=left width='30%'><font face="Tahoma,Arial,Helvetica" size=2>Claimable</font></td><td valign=top align=left width='70%'><font face="Tahoma,Arial,Helvetica" size=2><select name="link_claimable"><option value="">---</option><option value="1">No</option><option value="0" selected>Yes</option></select> We Suggest you leave this at Yes..
</font></td></tr>

This is the code I used and seems to work now. Suggest everyone test their script by putting in a test submission to see if if there is a problem.

The good part about it is that the script actually did keep all email addresses of every person that tried but failed to add a site. I am able to contact all potential link owners that the system is working.

Hope this helps.

And Pugdog - dont ever abuse me again...
Quote Reply
Re: [Gypsypup] The Saga In reply to
I ran into a similar problem with another column I added to the links table. The user should not be setting the claimable link it should not be on the add form. That defeats the purpose of the plugin.

You should check the link_claimable field in your link database to make shoud the not null setting is set to No. The defaut shoud be set to 0.

That is my guess as the cause of your problem

CCUnet
my Christian web