#1 (permalink)  
Old 04-22-2008, 04:09 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default Multiple category MOD

a true multiple category MOD (to replace the current limit of 2 addtional categories), could either be real easy or impossible. At least impossible the way I did it.

I created a multiple category MOD for the free version of INDEXU 5 years ago next month (May 2003). By the end of the year, I had created a multiple category MOD for v3.2 and included it in my v3.2E enhanced version which many folks used.

Over 4 years ago I created a simple clone of INDEXU 5 called links_coder. For the most part, it does what I need: banners, multiple categories and search engine friendly urls in addtion to the standard, new, hot, editor picks, etc.

I say all that to say that the multiple categories MOD actually turned out to be pretty easy. The hard part was the SQL statement.

Here is the actual code from my browse.php page.
Code:
Content visible to License Owner only.
I did say easy or impossible. Here is the same SQL statement from v5.4.
Code:
Content visible to License Owner only.
This is an hardcoded version (notice the idx_link.link_id <> '5' toward the end)

I can do simple SQL statements and some not-so-simple statements. But the statement above already has a left join and adding another may be impossible or easy for someone who is a SQL expert.

So here is the deal. If you know someone who can incorporate the gist of my statement into the INDEXU statement, I'm willing to see if I can make a true multiple category MOD for INDEXU DELUXE v6.


.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #2 (permalink)  
Old 04-22-2008, 05:40 AM
Active Member
 
Join Date: Nov 2004
Posts: 1,828
inspireme is on a distinguished road
Default

Code:
Content visible to License Owner only.
woudlnt this work?

Code:
Content visible to License Owner only.
note the table names though, you will probably have to do this :
LEFT JOIN idx_mcats ON idx_link.link_id = mlink_id WHERE idx_mcats.category_id=$cat_id or idx_mcats.mcat_id=$cat_id

But im not sure which table contains which field though
__________________
Some interesting INDEXU bits :http://www.indexu.co.uk
Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )
Reply With Quote
  #3 (permalink)  
Old 04-22-2008, 05:50 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

i'll give it a shot. after I get some sleep...


.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #4 (permalink)  
Old 04-22-2008, 04:56 PM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

Code:
Content visible to License Owner only.
well, the above did not work. Like I said, it was a very complex SQL statement to begin with.

After I removed all the stuff that was there and replaced it with mine, my multiple category MOD works just fine.

If you want to take a look it, send me a PM.

here is the SQL statement that works:
Code:
Content visible to License Owner only.
Folks are going to be sick at how easy this really is when they see it. (well, except for the SQL statement issue).
  1. create the a two column SQL table (link_id and category_id)
  2. integrate the mcats SQL code (see below) into the browse.php file
  3. generate the category dropdown in the add.php file
  4. add the multiple select html to the add_form.html file

Hey, there may be more but this is probably about 98% of it.

Now if dody will just take this and run with it....!!!



.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #5 (permalink)  
Old 04-22-2008, 06:51 PM
Active Member
 
Join Date: Nov 2004
Posts: 1,828
inspireme is on a distinguished road
Default

Code:
Content visible to License Owner only.
what error does the above come up with?
__________________
Some interesting INDEXU bits :http://www.indexu.co.uk
Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )
Reply With Quote
  #6 (permalink)  
Old 04-23-2008, 01:02 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

well, the above did not work BUT....!!!

The following does work...!!!

Code:
Content visible to License Owner only.
well, with two exceptions. First, if the link is a sponsored link, it shows up only in the category that it sponsors. It does not show up as multiple category link. For example, see idx_link.link_id <> '5' on the last line above. link_id 5 is set as a sponsor link.

Second, if the multiple category link is the only listing on a subsequent page, you will get an error message.

But more testing is needed.


.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #7 (permalink)  
Old 04-23-2008, 02:10 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

If any one wants to test the multiple category MOD, the first thing you need to do is to create the following table.

Code:
Content visible to License Owner only.
Populate the idx_mcats table. Enter the link_id and the additional category that you would like the link to appear in. (Later on, doing this thru the add.php and add_form.html files will be an easy process.)

Next, edit the browse.php file. Look for the following code about line 85:

Code:
Content visible to License Owner only.
remove the above code and replace it with the following:

Code:
Content visible to License Owner only.

.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.

Last edited by esm; 04-23-2008 at 07:38 AM. Reason: removed mlink as primary key
Reply With Quote
  #8 (permalink)  
Old 04-23-2008, 07:36 PM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

well, the only isssue I am seeing with this MOD (but I haven't looked for others ) is that it is not allowing Sponsored links to show up in the additional categories.

But I'm pretty sure that I can find a way to at least include them, either at the beginning or end of the listing. But it is solvable.

But I would be intereted in any other comments...


.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #9 (permalink)  
Old 04-23-2008, 10:44 PM
Mitchell's Avatar
Active Member
 
Join Date: Oct 2007
Location: Sydney
Posts: 584
Mitchell is on a distinguished road
Default

Code:
Content visible to License Owner only.
Would you please kindly tel us which part of add.php do you modify? I love to test it out.

Cheers
Mitchell
Reply With Quote
  #10 (permalink)  
Old 04-23-2008, 11:03 PM
FSGDAG's Avatar
Moderator
 
Join Date: May 2007
Location: NJ, United States
Posts: 977
FSGDAG is on a distinguished road
Default

I'm having a "Miss Cleo" moment I can see ESM winning the Mod of the Month contest!!!
__________________
FSGDAG | IndexU Hosting | Owner
Website | NiceCoder Script Hosting and More! | Blog
General Directory | Deep Links Directory | Bidding Directory
Reply With Quote
  #11 (permalink)  
Old 04-23-2008, 11:29 PM
Mitchell's Avatar
Active Member
 
Join Date: Oct 2007
Location: Sydney
Posts: 584
Mitchell is on a distinguished road
Default

Code:
Content visible to License Owner only.

Perhaps Mod of the year contest, Dody was saying that it would be for the version 7.

Last edited by Mitchell; 04-24-2008 at 12:14 AM.
Reply With Quote
  #12 (permalink)  
Old 04-24-2008, 12:44 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

Code:
Content visible to License Owner only.
for the moment, I'm just testing the browse.php file. I have done anything with the add.php or add_form.html files but in the add.php file you'll need to add a dropdown variable for the categories with a multiple select option. I'm not sure if the current INDEXU code allows that. If not, maybe cloning it. Then add it to the displaytemplate line in the ShowFormAddUrl function. In the add_form.html file, add the placeholder variable, e.g. <%$mult_cats%>.

Now for the hard part. you are going to have to add the mcats data from the form to the mcats table. Probably the section that deals with the add results (about line 272). Since I don't use INDEXU, I'm going to have to study the logic and ask some questions. I know that links can be automatically added, added to the temp file for later approval and there is the issue of paid links (that have either been paid or are pending payment).

Or, it may be that all of this is dealt with the add function in the link.class.php file in the lib folder or the validate_link.php file in the admin folder.

time will tell.



.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #13 (permalink)  
Old 04-24-2008, 12:46 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

Code:
Content visible to License Owner only.
well, there are some behind the scenes coding yet to do. I'm off to Tennessee and then Florida next week so it will be at least next month before I've finished this one.


.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #14 (permalink)  
Old 04-26-2008, 01:57 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default Solved...!!!

Code:
Content visible to License Owner only.
YEAHHHH! SOLVED. That was a little toughie to solve. The MOD works great now. I have almost finished modifying a new DisplayCategoryListBox to allow for multiple selections on the add_form.html and the modify_form.html. and I probably need to do the same for the admin side.

Get out of here cat1 and cat1...!!! Multiple Categories are in the house....!!!!


.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
Reply With Quote
  #15 (permalink)  
Old 04-28-2008, 06:23 AM
Mitchell's Avatar
Active Member
 
Join Date: Oct 2007
Location: Sydney
Posts: 584
Mitchell is on a distinguished road
Default

Hi ESM,

Any chance of releasing the codes?

Cheers
Mitchell
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple category GodParadise Tutorials, Hints & Tips 2 04-06-2007 11:02 PM
Multiple Categories? blacknight v5.x 3 10-10-2006 09:01 PM
Add multiple categories at once craven v5.x 2 08-29-2003 01:21 PM
Multiple entries mediastation Pre-Sales Questions 1 07-09-2002 01:33 PM

HACKER SAFE certified sites prevent over 99.9% of hacker crime.

All times are GMT -5. The time now is 04:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO
SSL Certificate