This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Webcatalog and link management

Hi

I've scoured the site looking for a module which will help me manage a simple webcatalog providing listings and links for suppliers of information for the services I'm interested in (business planing) and haven't found anything.

I would like my users to add their own links in a catalog so that the resources offered on my site can grow organically. Link exchange would also be nice between users.

Is there anything there already that I've overlooked? Are there plans to develop something in this line?

As a non-programmer, I'm glad of any help I can get!

Image Module Album Descriptions

How can I get the album description to appear within the album itself? I don't want it appearing on the list of albums, at the top of the album, with the contents of the album displayed below.

Many thanks

Nick

Would welcome some advice on mySQL indexing and performance

I've created a module to generate my own front page by a straight SQL select from several tables - the idea being partly because I wanted a completely different presentation, partly because I want a large number of articles actually visible on the front page, partly to avoid going through calls to hook_nodeapi etc. So far it has worked very well, and has seriously speeded up my front page presentation.

There is only one drawback: as it stands, it doesn't provide the URL alias links, only node links. So I want to modify the SQL to include the url_alias table. Here is the code (the "titles_settings" table belongs to my front-page module by the way):

select t.uid, f.filepath, f.filemime, t.display_name, t.which_column, t.weight, n.nid, n.title, n.created, n.body, n.teaser, n.sticky, u.dst AS path_alias from {titles_settings} t join {node} n on t.uid=n.uid left outer join {files} f on n.nid=f.nid LEFT JOIN {url_alias} u ON CONCAT('node/', n.nid) = u.src where ( n.status=1 and n.moderate=0 and n.promote=1) order by n.sticky desc, t.which_column, t.weight, t.uid, n.created DESC

This executes fine and produces the result I want. Only problem - it seemed to me that it would be better to have an index on url_alias.src in order to optimise the join, so I created one. But looking at the SQL statement with EXPLAIN I can see that the index is not being used.

Can anyone tell me the reason for this, and the reason for not indexing this field in the first place?

Is there 'correct way to theme GET forms in 4.7?

Hello,

I'm currently bugfixing my conversion of the Quotes modules to 4.7. One issue I had was with creating a form to use a GET request.

Essentially the form allows nodes to be sorted on a pages, so I considered that POST functionality -- and indeed the Forms API -- was inappropriate. Instead I'm using theme_select, theme_button etc directly, to allow themability rather than just spitting out HTML.

Please help with mysql query!

Hello,

I am about to finish my first module, which turned out to be nearly as big as system.module!

Unfortunately, I have very poor SQL skills. I haven't dealt with SQL directly in years.
So... well, I need some quick help with a query.
I have two tables. One is the normal "node" one:


+----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+----------------+
| nid | int(10) unsigned | | PRI | NULL | auto_increment |
| vid | int(10) unsigned | | MUL | 0 | |
| type | varchar(32) | | MUL | | |
| title | varchar(128) | | MUL | | |
| uid | int(10) | | MUL | 0 | |
| status | int(4) | | MUL | 1 | |
| created | int(11) | | MUL | 0 | |
| changed | int(11) | | MUL | 0 | |
| comment | int(2) | | | 0 | |
| promote | int(2) | | MUL | 0 | |
| moderate | int(2) | | MUL | 0 | |
| sticky | int(2) | | | 0 | |
+----------+------------------+------+-----+---------+----------------+

How to submit a form with 4.7 form api

I want to develop a simple block module with a simple form. The form has 2 textfields and the values should be saved to a db table. The block developed with the 4.7 form api is shown correctly with my code, but I'm not able to submit the form. Here's my code

<?php

function quickmail_perm(){
return array ('can send quickmail');
}

function quickmail_block($op = "list", $delta = 0) {
if ($op == 'list') {
$block[0]['info'] = t('Quickmail Block');
return $block;
}
elseif ($op == 'view') {
$block['subject'] = 'Quickmail';
$block['content'] = quickmail_form();
return $block;
}
else {
quickmail_submit();
}
}

function quickmail_form($edit = null) {

$form['details']['firma'] = array(
'#type' => 'textfield',
'#title' => t('Firma'),
'#default_value' => $edit['firma'],
'#size' => 15,
'#maxlength' => 128,
'#description' => null,
'#attributes' => null,
'#required' => true,
);
$form['details']['telefon'] = array(
'#type' => 'textfield',
'#title' => t('Telefon Nr.'),
'#default_value' => $edit['telefon'],
'#size' => 15,
'#maxlength' => 128,
'#description' => t('Geben Sie hier die Telefon Nr. ein unter der Sie unseren Rückruf erwarten.'),
'#attributes' => null,
'#required' => true,
);

$form['details']['submit'] = array(
'#type' => 'submit',

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions