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

[PRE] MyFavLinks Plugin

(Page 1 of 2)
> >
Quote Reply
[PRE] MyFavLinks Plugin
Ok, it was bound to happen. People using MyLinks will need upgrade/support, and the author is no longer around. MyFaves does not use the same database structure.

So, I'm writing a new plugin that will use a *new* database structure, import from both MyFaves and MyLinks and combine features of both programs, into a new upgraded routine.

I'm writing the install now.

During the install, it will try to locate the default MyFaves and MyLinks and ask if you want to:

1) import them
2) ignore them
3) delete them

It will import the data from the programs, into the new tables, then can delete the old templates, scripts and tables, as well as menu functions.

What you will be left with is a MyFavLinks program, and *hopefully* all your data and existing templates will run just fine.

I *know* I said delete templates, but wait and see. I've been thinking about this a lot, and I want to install it on my sites, and might as well make it robust enough to do it all.

Please report any bugs, quirks, or problems with either of the two current versions, so I don't re-engineer those into the new program <G> It's *much* much better to engineer in your own new bugs <G>

I have *not* used either program -- yet -- so this is a pure-code thing, and it's *guaranteed* to not work on every site - especially if you've done a lot of customizations. *but* if you are running the stock plugins, it should work. If you are running customized versions, you will most likely have to do a manual import of some fields, since trying to pick up all eventualities will delay this for way longer than is necessary.

More later.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
Rating field:

In the users record, MyLinks has a "ratings" field. Was this a means of people rating a users list?


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
Pugdog,
yes I believe so

ccunet
my Christian web
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
yes it is for sure
I have been using mylinks plug in for a while.
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
Ok,

What I see from the tables (I still have not looked at the code, or templates) is that it allowed anonymous rating by IP blocking.

Username/IP was stored. That is pretty poor, with dynamic IP balancing, and such, a single user may have dozens of IP's in a single session, and, conversely, dozens of people may share the same IP.

I'll leave it in for compatibility, but the new rating system will be based on my advanced rating, where each logged in user can rate each item only once, but can edit their vote. As lists change, users should be allowed to change their vote. Actual votes will be tracked, and the average stored in the user profile for performance reasons. A logged in user can get a list of all lists/ratings they've made, as well as their average rating, and the number of each rating they have given (eg: 1, 2, 3, ...10)

You will have to do some template editing, and it's better to get it over with now.... and add MFL_ to all the MyFavLinks tags, to prevent crashes with existing (and future) links tags.

The new table will look like MFL_Username, MFL_UserID, MFL_Rating.

MFL_Username will be the "Username" of the logged in user,
MFL_UserID will be the target username being rated
MFL_Rating will be the rating given to that UserID by Username, and the average of all ratings will be stored in Users::MFL_Rating

Unfortunately, looking at the tables, and the complexities of Links/Community/other plugins, the MFL_ prefix is really necessary, and all our plugins, with the next major releases, will be using identify tags to keep them separate.

The more "username" tags running around, the more crashes that are inevitable.

It's a small price to pay to edit the templates and update a few tags.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
Hi

What you are talking about is the main problem we have had with that plug in..
the sufix idea is perfect and will work fine..

The logic of how the plug in works is correct ..
I will be glad to test it for you when it is ready.
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
Great, then I'm on the right track, and I still haven't even looked at the code <G> Tables (the database) tells you a whole heck of a lot. Good data is the first step to a good program :)

One other thing, I see that the links were tracked as:

UserID/LinkID

By adding a 3rd column "Category", you can get simple bookmark type functionality, by being able to group the links by category.

I guess I should add the option of using the first CatLinks category I find, leaving it blank, or setting it to a Default category.

This is *not* going to be absurdly complex. The _entire_ complexity of it was just outlined above <G> No Java script, no drop downs, <G> just a simple grouping.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
One other thing I noticed.

The default column specifications were _not_ compatible with Links. Usernames were 40, or 255 characters, not 50, and Titles were 255 not 100, etc.

For compatibility, these need to be trimmed (or epxanded) for integration into Links SQL. 99% of people do not touch those values. The other 1% will have to edit the tables before doing an import. But, if they changed those values to begin with <G> They know a bit more than the average user.

This is why I'm now separating the import/delete routines for MyLinks and MyFaves into an admin option AFTER the MyFavLinks plugin installs sucessfully.

If it finds the other installations on install, you can be pretty assured that after it installs it will be able to find/import/delete them. To prevent confusion, it will enable the "import" features ONLY if it finds a previous install. It will disable them with a warning after the first import. But, by making it a several step procedure, instead of an automated one, it will reduce complexity significantly, and give the 1% of the users who need to make some modifications to the table structure the ability to do so (or to do a manual import), while still having semi-automated import routines to do all the work.

NOTE: some of this is necessary if this plugin is to be modded into an Adress Book, Contact List, etc, and it can be, by concentrating on different fields or tables, while keeping the same core code. Nothing in the layout precludes this from not only being a MyFavLinks, but also a MyFavPeople, MyFavImages, etc. Fields need to be consistent, and names need to be collision proof. But, I can see the day this is released, the first question will be "Can I use this for an address book or contact list" <G>, so I'm just trying to stay ahead of the curve. For a little insight: The custom table can be used for pretty much anything you want, and any additional fields can be added. It's still incomplete, but the potential is there.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
All what you have mentioned (If I can recall the discussions) are things we talked about when the plug in came out first..
Many users came with their own way around the problems
BUT if your plug in will provide the solutions and many new functions within the code itself that will be more than good..

ONE thing many users asked for is the users ability to export their links to a secondary favorites list like IE or so..
I know this is a future add on BUT some basic coding might be needed if you will ever consider adding this.
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
I'm not sure how to export the list to anything. But by using a template, you can format the data to be in an importable format.
I have tried very, very hard to avoid java script, windows programming, or anything not resembling perl on unix ;) It's made that aspect of life a lot more fun :)

I guess I should look up some old threads, but really, all this is just from looking at the database, and the Install.pm files. I haven't looked at any code or templates yet, since my way of doing things is probably quite different. I'll have to go over them at least a bit, to ensure backwards compatibility, but I think a fresh perspective on all this, given a links 2.12 environment, and several years more coding experience is a good thing.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
To be honest with you.. The way you write your plug in is different and way more professioanl than many others...

JUST A SUGGESTION.. I think figuring out a way to export the data and reimporting it to your new plug in is the main issue... So may be having a good idea of your future plug in structure will help ease this up for you. Unimpressed
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
Sounds like good stuff Pugdog!

ccunet
my Christian web
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
>> To be honest with you.. The way you write your plug in is different and way more professioanl than many others

Thanks, we try hard -- especially if we have to put our name on it ;)

>> I think figuring out a way to export the data and reimporting it to your new
>> plug in is the main issue... So may be having
>> a good idea of your future plug in structure will help ease this up for you

This is why I started out with the database tables. Someone asked about an import, and I wondered how the table structures aligned.

Right now, as planned,

1) you install the plugin. It searches for traces of MyLinks and MyFaves (all traces, not just a marker)
2) if it finds traces, it enables an import/delete set of menus
3) after import, you can choose which to import, and it will match fields and do the import.
4) "custom" imports are too much coding work, for too little gain. Any site that needs a custom import, it's better to write a set of SQL statements to do it.

Export/import is a trickier issue, but anything in a database can be exported/imported.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
This plugin suddenly expanded, and I'm going to have to make changes to the database structure. It shouldn't affect any import, but "special" features, if any, may not work, or will have to be reenabled.

The database structure, with only a little change, can be used to set up any sort of list.

The admin can configure a database with fields of any sort, which can be a list for a user.

For example, rather than hard-coding the FavLinks table in, make it flexible, and set up several tables.

That way it can be used for a wish list, a contact list, an address book, a fav links, or anything else.

There are a few ways to do this, and I'm not sure which one I'm going to do. I'm not sure which is more flexible, and logical to code.

One way is to actually create separate lists, and manage them.

Or, to make one list manager, but use a "category" type structure.

Which I pick has more to do with coding ease, than anything else, since I want to get this out ASAP.

Actually, what might happen, is I'll finish this plugin as is, leaving it as a dedicated MyFavLinks and get it out, then create a more flexible version, later.

The "wishlist" feature would be much more valuable for sales sites, books, videos, etc.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
In Reply To:

Actually, what might happen, is I'll finish this plugin as is, leaving it as a dedicated MyFavLinks and get it out, then create a more flexible version, later.

The "wishlist" feature would be much more valuable for sales sites, books, videos, etc.

I'd second that.

ccunet
my Christian web
Quote Reply
Re: [ccunet] [PRE] MyFavLinks Plugin In reply to
Is there any functionality in the "send favorite" link that is not in the Recommend_IT plugin?

It would make more sense to _not_ duplicate that functionality in this plugin, unless something special was going on.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
The only catch with this feature is it CUT & Paste the listing to the other users favorites list, not send him an email ..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
We would be interested in switching from MyLinks to MyFavLink if any of the suggestions in http://www.gossamer-threads.com/...orum.cgi?post=216093 could be implemented.
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
Not sure what you mean?

The script can handle a means of a user adding the link to their MyFavLinks if they have an account, but if the user is not registered with the system, and a person just wants to share the link, then they need to send the link as an email.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
Ok,

Another change to the system,

The custom link table has the following fields:

'MFL_UserID' => {
'MFL_Title' => {
'MFL_URL' => {
'MFL_Description' => {
'MFL_Add_Date' => {
'MFL_Last_Visit' => {


It lacks a LinkID, since there is no associated LinkID field. (this becomes an issue, if a user submits a link to the Link directory, and it's accepted, and gets a link ID....)

The regular links table, the one that used to just have UserID::LinkID now has:

'MFL_UserID' => {
'MFL_LinkID' => {
'MFL_Title' => {
'MFL_Description' => {
'MFL_Add_Date' => {
'MFL_Last_Visit' => {

The reason is, I'm heading off requests I can see coming. <G>

The MFL_Add_Date is the date the link was added to your list.
The MFL_Last_Visit was the date you last visited it (from your list).
The MFL_Description is _your_ description/info on the link
The MFL_Title is _your_ title or way to remember the link.

The system only uses MFL_UserID and MFL_LinkID, and most likely, in the templates, there will be "<%if MFL_Title%><%MFL_Title%><%else%><%Title%><%endif%>

This will allow maximum flexibility in presenting data output. To do this in the code, prevents you from choosing which format you want easily.

I was going to use the "Custom" table for all links, but duplicating or eliminating the URL created a logical/data-normalization problem and potential problems if the Link was removed from the main table, or the URL or other information in the main link table changes -- how to reconcile this is not going to be easy.

I mght add a "Move to Custom" link, which will check URL only, and if the URL doesn't exist in the Custom table, it will copy the info from the Links and MyFavLinks tables to the MyFavLinks_Custom table.

I'm hoping to make this work, (and believe it or not, I still have not looked at the code, I'm messing with the tables and database and set up), so the details may change here. Sometimes, interface restrictions change the data layout.

I'm still looking at this as a MyFavLinks program, and that means the links should match the Links table. Future versions, may remove the LinkID as a required field.

The way this would work, is when a MyFavLink is added to a user list, the data from the original link is copied, and if there is a LinkID it's copied also. The assumption is made that LinkID's are _NEVER_EVER_ reused. To do so, breaks so many rules..... Any way. Once copied over, the user can edit/change the information in their local bookmarks. Thes no longer resemble the link record in the main database.

For now, I'm still trying to figure this all out....

This little rewrite suddenly became a big, bad, hairy bear.

Data structure is more important, as all the code to do this has been written in the original programs (or at least basic logic has), and in reality, once the data tables are set up, all we are doing is basic Add, Modify, Update, Select, Review, etc functions. Nothing that is not done in almost every other plugin we've written. Data Structure.... that's the killer.

LinkID and URL are going to be the problem in all this. Where/how to deal with them.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
Just started work on the .pm file. I *think* the database is set, though it's possible a field or two will be added (and I need to figure out how to add the ratings in -- whether I'll modify the advanced ratings plugin, or I'll actually build it in, but that's not a big issue.

First thing to go was any expiration code.

The templates will be rewritten to handle the new tags, and will use the Links default set, with the "content" or "active" area clearly defined so you can cut/paste it into your own default set.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
In Reply To:
Not sure what you mean?

The script can handle a means of a user adding the link to their MyFavLinks if they have an account, but if the user is not registered with the system, and a person just wants to share the link, then they need to send the link as an email.

All this is correct EXCEPT that if both are registered users the link will be added to the receiving person's list and an email will be send for him to confirm..
I think your logic is not any differnt in the end..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] [PRE] MyFavLinks Plugin In reply to
I wouldn't want "automatic" adding of links, since that could be considered a form of spam....


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
This project has gotten way out of hand. Not a bad thing, but not conducive to getting a 1st version out the door.

I think the database is set, and flexible enough that features can be easily added in, and that modifications will be able to be made by people through globals, and <%function::calls%> in the templates. There are loads of ways to customize it, and as future releases come out, it should be easy to modify the internal functions to handle override parameters -- such as default templates or return counts.

Right now, I *think* I handled, or addressed (at least internally) the points brought up, and features that made sense function or time wise.

Also, this should lead easily to the "Wishlist" program that will integrate with any sales site, collectibles site, and the Amazon, Classifieds, and Auction programs (maybe even Matchmaker program??)

So, I'm going to stop looking at "features" and just get the core functionality out as described. Some things talked about here may not be enabled yet, but the database structure *should* allow any and all features to be added at some point. Between that and the templates customizations should be fairly easy.

The two things that are still in conflict, and may not satisfy all people, are the IP/Username rather than Logon feature for ratings, and the Cookie vs SQL in Andy's program. SQL is _better_ all around, and I'm going that route first. When I get a little more time, I'll add the cookie code back in. I'm not against it, it's just a bunch more stuff to figure out before I could potentially relase the program -- and keeping the data in a cookie is a bit more private (eg: no user database stored on the server). As for the not logging in, that is a peeve of mine, but I should be able to allow it to be an admin option.

So, with luck, I could have a first release before the weekend.

The only sites that should _not_ plan on at least trying this, are sites using cookies. If I have time, I'll make an "Import Cookie" feature, that will allow a user to switch their cookie held data to the SQL database. That way sites using cookies can switch over.

Believe me, there will be much more power, and features, available if you don't use cookies. Cookies have limits.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] [PRE] MyFavLinks Plugin In reply to
The install routines work, had a few interface things to fix up, and a couple of really, really weird perl errors to fix... apparantly the parser doesn't like ){ constructs in a loop set up... you need to put in the white space ) { .....

I'm editing and reformatting the MyLinks templates --- geeze were there HTML errors, broken tables, missing tags, no closing </form> ... wonder how it all worked. I've got almost all the templates 90% fixed up, and what's left is to go through the .pm file, changing the code, and cleaning it up, and moving a lot of "logic" (?????) around.

The goal was originally to migrate people from MyLinks to MyFaves, so I've started with MyLinks, but everyone gets migrated to the MyFavLinks eventually <G> The MyFaves features will be added in, after this major migration is over.

Quite a few weird things in the .pm files also, odd choices, and why the "hide/show" was on the listing page, not the preferences page, I'll never know. That was _really_ screwy, and stuck out in the code like a wart or boil. The script checked if you changed your hide/show preferences for pretty much every request made... that's a source of trouble if the form was accidentally modified. Gone :).

One goal for a future release is to get rid of a load of templates. The whole purpose of a template system is to not have to make changes in loads of files, yet there are templates all over (Links included) that are pretty much one-line changes from dozens of others. Passing in a <%Template_Name%>, <%Function_Name%> and <%Message%> tag would cover virtually all eventualities.

Actually, if we could <%include message_file%> where <%message_file%> was a file name, then then various messages could set in their own message.txt or message.inc files, and simply inserted into a generic display page. Full tag editing and customization would be allowed, but 90% of the duplicate page formatting would be eliminated. And, with nested tables, complex layouts, XML, etc, the fewer pages that need changed the better -- and the simpler the files that _are_ edited (eg: included files) the better -- leave the complicated default page alone.

I've been working on something like that for several of my development sites, and maybe a "lean" template set is in the future once I get the quirks worked out. Basically it would give far fewer templates that had to be modified to change the look/feel of the site completely, while keeping the "data nuggets" intact.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
> >