Randomizzare le associazioni tassonomia/nodi su drupal..

Printer-friendly versionPrinter-friendly version
Druplicon

Non so perché, ma ultimamente il modulo devel generate mi sta dando alcuni problemi.. in particolare, non riesce a creare associazioni decenti nodi generati/termini tassonomia.
Ma il tutto si può facilmente risolvere con un paio di query a livello database...

1
2
3
4
5
6
7
TRUNCATE TABLE term_node;
INSERT INTO term_node (
  SELECT n.nid, n.vid, t.tid
  FROM `node` n
  CROSS JOIN `term_data` t
  ORDER BY rand() LIMIT 1000
)

In pratica, una volta creati Nn nodi e Nt termini della tassonomia, questa query per prima cosa svuota la tabella term_node contenente le associazioni nodo/termine, quindi la ripopola prendendo 1000 associazioni generate casualmente (cross-join tra termini e nodi [== prodotto cartesiano], ordinazione casuale, limitata ai primi 1000 elementi).

2 comments

 
Anonymous wrote 3 days 12 hours ago

respond this post

The teachers require to study the skills of writing, hence, we need to opt for dissertation service to purchase find a dissertation. In such way you confirm the writing technique. And as well you would take thesis writing.

 
Anonymous wrote 3 days 12 hours ago

reply this topic

If you keep on working on your perfect research associated with this good topic, could you please write something about order custom essay, because I want to order custom papers in the essay writing service.

Who Am I?

~redShadow~ A.K.A. Samuele Santi is an Italian Open Source developer, currently working as a freelance developer, mainly in the web applications sector. Favourite programming languages: PHP and, of course, Python!

database (3) development (11) curl (1) apache (1) aoe (1) audio (1) debian (1) alcool (1) C++ (2) contact manager (1) cryptography (1) aircrack (1) e-mail (2) archive (1) awstats (3) Drupal (21) cars (1) arduino (1) citroen (1) debug (1) doku (1) blogroll (7) 3d (3) cartoons (1) como lake rovers (1) dmcrypt (1) camera mia (1) circuits (1) algorythms (1) backup (3) caos (1) documentation (2) blender (3) cocktails (1) Drupal Forms (1) apt (1) 2v (1) code (3) address book (2) bash (11)