Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Displaying "dead numbers"?

Quote Reply
Displaying "dead numbers"?
I've been using Link2.0 for two months now, and I am quite happy.

However, I let myself annoy by details. When deleting a site from the database, the site ID is left unused. What I am looking for is a way to display unused ID's, so that I can put a site onto it, so that there isn't a gap in the latest ID and total sites.

Hope someone understands where I am getting at?

--------------
Stian Hole
stian@musikkpunkt.com
http://www.musikkpunkt.com/
Quote Reply
Re: [stianhole] Displaying "dead numbers"? In reply to
Why does it matter ? Links 2 can cope with ID numbers as high as you want really (even 10,000), so there is no real chance of you running out of numbers. I see where you are going, but I don't see a reason for it personally. Maybe if you gave us more of a reason to write you a script to do this, other than just wanting to be tidy we may be able to help you Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Displaying "dead numbers"? In reply to
Thanks for the speedy reply :)

Just wanting to see if there was something already made. I guess I'll have to put on my goggles and see what I can find out ;)

And yes, it's my compulsive tidyness :)

--------------
Stian Hole
stian@musikkpunkt.com
http://www.musikkpunkt.com/
Quote Reply
Re: [stianhole] Displaying "dead numbers"? In reply to
Hmmm you'd have to hack the admin code so that when links are deleted the ids are maybe inserted into a new file delimited somehow...eg:

1:24:3:2342:2352:23:526

....then in the admin add form you'd need to read that file, split the numbers and build a select list of them and then you'd open linksid.txt and get the next ID and add that into the select list too and call the select list "ID" then you can either selkect the incremental ID or choose a spare.

Did that make any sense? Blush
Quote Reply
Re: [RedRum] Displaying "dead numbers"? In reply to
How about this. Its a bit more complex, but may be better.

Open up links.db, go through the file and add all the IDs to an array (say @ids). Then cycle through @ids with a $count to see if that number exists. If it doesn't, then break out of the loop and use that spare ID???

Just a sugestion Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Displaying "dead numbers"? In reply to
That means you have to loop through a possibly big database every time which would be a lot slower.
Quote Reply
Re: [RedRum] Displaying "dead numbers"? In reply to
True, but it could be much easier than updating/maintaining another database every time a link is added/deleted, at least IMO. I spose your idea is good, but I prefer mine Smile

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] Displaying "dead numbers"? In reply to
I think I'll go with something similar to AndyNewby's suggestion. I'll probably just make a little snippet squirting out the id's that are available, and then manually enter the ID in the field when adding a link. This because I don't expect to do it to often :)

I'll let you know how it goes!

--------------
Stian Hole
stian@musikkpunkt.com
http://www.musikkpunkt.com/