vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - Links and Downloads Manager (https://vborg.vbsupport.ru/showthread.php?t=119041)

IrPr 08-16-2007 05:58 AM

Hi Andrew, im just tryin Hack/Modify LDM
and i've one question
why u seprated the catid and keywordid from _linkslink table into _linksltok and linksltoc instead of a field inside _linkslink table? whats this kind of relationship? is that standard?

im creating my own artist and track tables but donno how to make its relationship into _linkslink table
i can add fields called artistid and trackid into _linkslinks structure, and also can use ur method, creating another tables named _linksltoa and _linksltot

but which one is better? im newbie in MySQL database designin

Special thanks for this AWESOME Mod, LDM, even u dont reply this post

PS: sorry if my grammar sux:P
PS2: sorry misspelling, its 10:36 AM here and im still awake:D

AndrewD 08-16-2007 06:22 AM

Quote:

Originally Posted by IrPr (Post 1318702)
Hi Andrew, im just tryin Hack/Modify LDM
just a Q, why u seprated the catid and keywordid from _linkslink table into _linksltok and linksltoc instead if a field inside _linkslink table? whats this kind of relationship? is that standard?

im creating my own artist and track tables but donno how to make its relationship into _linkslink table
i can add fields called artistid and trackid into _linkslinks structure, and also can use ur method, creating another tables named _linksltoa and _linksltot

but which one is better? im newbie in MySQL database designin

Special thanks for this AWESOME Mode, LDM, even u dont reply this post

PS: sorry if my grammar sux:P

The basic question in designing database tables is whether the relationship between an entry and its data is 'one-to-one' or 'one-to-many'. If it's one-to-one (e.g. a category has only one name and always has one name), then you can keep the category name as a column in the same table as the categoryid. However, if it's one-to-many (an entry can be in one or several categories), you can't. Also, ideally, *everything* in a table row should be logically connected and required - a classic example is that a table of professors should not include the courses they teach, because you would lose the ability to deal with new professors and emerti or to efficiently find courses with no professor assigned. (See http://en.wikipedia.org/wiki/Database_normalization if you want the background :))

So in LDM the table structure reflects the fundamental data types - a category, an entry, a keyword, a hit, etc, and the 'XtoY' tables allow you join these together - find all the keywords associated with an entry and vice-versa, all the entries associated with a category, etc.

What you are trying to do is add a feature to LDM that people have suggested for some time (and I haven't had time to deal with), i.e. add extra data to the system. There are pros and cons to doing it in different ways:

- If you add one new column to the 'entries' table (links), then the logic is easy to implement but very inflexible. There are ways of forcing several different data items into the one columns (use the php serialize function, for example), but it becomes a mess.
- If you add a new column for each new datatype, it become a mess very quickly.
- If you handle it in a different table, then the logic is much cleaner, but it can become quite tricky to construct efficient SQL queries.

In LDM, the hairiest piece of code are the routine that build the linkbits (the individual rows which show each entry) [get_linklistbit] and the routine that works out the required SQL query [get_mainsql]. get_mainsql constructs the required 'joins' on tables to pull in the required information. Unfortunately, joins can easily get very expensive, and you can end up killing your server if you are not careful.

For your purposes, I think it would be easiest to create new tables which have this form:

1) artistid, artistname, etc

and 2) linkid, artistid

or

1) trackid, trackname, etc

and 2) linkid

Hope that helps!

IrPr 08-16-2007 06:31 AM

Quote:

Originally Posted by AndrewD (Post 1318716)
The basic question in designing database tables is whether the relationship between an entry and its data is 'one-to-one' or 'one-to-many'. If it's one-to-one (e.g. a category has only one name and always has one name), then you can keep the category name as a column in the same table as the categoryid. However, if it's one-to-many (an entry can be in one or several categories), you can't. Also, ideally, *everything* in a table row should be logically connected and required - a classic example is that a table of professors should not include the courses they teach, because you would lose the ability to deal with new professors and emerti or to efficiently find courses with no professor assigned. (See http://en.wikipedia.org/wiki/Database_normalization if you want the background :))

So in LDM the table structure reflects the fundamental data types - a category, an entry, a keyword, a hit, etc, and the 'XtoY' tables allow you join these together - find all the keywords associated with an entry and vice-versa, all the entries associated with a category, etc.

What you are trying to do is add a feature to LDM that people have suggested for some time (and I haven't had time to deal with), i.e. add extra data to the system. There are pros and cons to doing it in different ways:

- If you add one new column to the 'entries' table (links), then the logic is easy to implement but very inflexible. There are ways of forcing several different data items into the one columns (use the php serialize function, for example), but it becomes a mess.
- If you add a new column for each new datatype, it become a mess very quickly.
- If you handle it in a different table, then the logic is much cleaner, but it can become quite tricky to construct efficient SQL queries.

In LDM, the hairiest piece of code are the routine that build the linkbits (the individual rows which show each entry) [get_linklistbit] and the routine that works out the required SQL query [get_mainsql]. get_mainsql constructs the required 'joins' on tables to pull in the required information. Unfortunately, joins can easily get very expensive, and you can end up killing your server if you are not careful.

For your purposes, I think it would be easiest to create new tables which have this form:

1) artistid, artistname, etc

and 2) linkid, artistid

or

1) trackid, trackname, etc

and 2) linkid

Hope that helps!

You rock Andrew
Yeah, got ya:)
Special Thanks to you Andrew,

itsblack 08-16-2007 09:19 AM

Andrew, I have a question about vba_moudule ldm_tot.module.
It seems that the "served" option only display with a integer number. But think about that when we have number end with Gbytes, it will probably not so suitable. I hope it can display the resulat like this: "served 2.xx Gbytes". Is it thinkable?

AndrewD 08-16-2007 11:00 AM

Quote:

Originally Posted by itsblack (Post 1318796)
Andrew, I have a question about vba_moudule ldm_tot.module.
It seems that the "served" option only display with a integer number. But think about that when we have number end with Gbytes, it will probably not so suitable. I hope it can display the resulat like this: "served 2.xx Gbytes". Is it thinkable?

Quite thinkable, and even quite do-able, I'm sure. This evening...

Myra 08-16-2007 11:51 AM

I don't know if this question has already been answered and I'm sorry if it is, but can you also set permissions based on user's post count and title/ranks?

AndrewD 08-16-2007 12:23 PM

Quote:

Originally Posted by Myra (Post 1318863)
I don't know if this question has already been answered and I'm sorry if it is, but can you also set permissions based on user's post count and title/ranks?

The 'extras' directory in the release zipfile contains plugins that can block user access and/or limit their download rights according to post count, reputation and some other parameters.

Alfa1 08-16-2007 03:08 PM

Quote:

Originally Posted by AndrewD (Post 1318629)
I imagine you uploaded the code, but did not rerun the installer. Go to VB/admincp/products and plugins and upload the 2.2.8 LDM product installer.

Thanks, that did it. I edited the init file to correct my DB prefix, while I didn't upload the 2.2.8 product installer again after that.

obmob 08-16-2007 03:43 PM

Quote:

Originally Posted by AndrewD (Post 1317845)
Was busy thinking and replacing a busted graphics card.

I'll add a new plugin in the next 2.2.8 upload which does this job.

Thanks! :D

I'm always complaining. :p

Installing RC2 and testing, did i say thanks? ;)

AndrewD 08-16-2007 05:42 PM

Quote:

Originally Posted by itsblack (Post 1318796)
Andrew, I have a question about vba_moudule ldm_tot.module.
It seems that the "served" option only display with a integer number. But think about that when we have number end with Gbytes, it will probably not so suitable. I hope it can display the resulat like this: "served 2.xx Gbytes". Is it thinkable?

Replace the ldm_tot.php file in your forum/modules directory with the attached and let me know if this is ok. I've tried to make it a bit smarter.


All times are GMT. The time now is 11:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02821 seconds
  • Memory Usage 1,759KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete