logo       

[feature] polls: separating poll-title and actual question: msg#00963

php.drupal.devel

Subject: [feature] polls: separating poll-title and actual question

Project: Drupal
Version: cvs
Component: poll.module
Category: feature requests
Priority: normal
Assigned to: al
Reported by: DiscoFreq
Updated by: Steven
-Status: active
+Status: won't fix

The sideblock title is fixed, I don't see how/why we should fix the main
node title.

Steven



Previous comments:
------------------------------------------------------------------------

June 30, 2002 - 20:24 : DiscoFreq

now the question of the poll is in the title of the block/box, which
makes it multiline (problem with some skins). Wouldn't it be better to
have a short title, and another field with the question? (and some
explanation maybe)

------------------------------------------------------------------------

April 4, 2003 - 04:30 : al

This has been patched up by Kobus for the CVS trunk, but I'm not sure
he's happy about the way he's done it (it should probably be using
title/body/teaser, not add a custom db field). See
http://lists.drupal.org/pipermail/drupal-devel/2003-April/023229.html
[1] for details.
[1]
http://lists.drupal.org/pipermail/drupal-devel/2003-April/023229.html


------------------------------------------------------------------------

April 9, 2003 - 15:13 : Kobus

I will take this feature update for 4.1.0 (Official release). I'll also
look in 4.1.0 branch in CVS as well as CVS version of Drupal, but going
to do this one first in the correct manner.

Regards,

Kobus


------------------------------------------------------------------------

April 9, 2003 - 16:05 : Kobus

Kristjan,

You mentioned before that I could reuse the $node->body or
$node->teaser field. I saw that $node->teaser was used already, so, I
decided on $node->body, however, I can'ty figure out how this can be
done without altering the poll table, as you sit with this query:

db_query("INSERT INTO poll (nid, runtime, voters, active) VALUES ('%d',
'%d', '', '%d')", $node->nid, $node->runtime, $node->active);

There are no references to the node table in any of the SELECT, INSERT
or UPDATE db_query instructions, so, I can't see how this is possible
to do it the way you suggested by reusing the fields? You may assume
that I am stupid and inexperience, because I am!

Would it really be a problem to create the extra field in the poll
table?

Regards,

Kobus


------------------------------------------------------------------------

April 9, 2003 - 17:13 : al


function poll_validate(&$node) {
$node->teaser = poll_teaser($node);
}

Needs to have $node->body = [foo] added to it, where [foo] is the
question text, obviously. You'll want to modify poll_teaser() and other
things, obviously.

Updates to node objects aren't done using SQL statements - all that's
handled for you by the base node class. I suggest you take a look at
the book module for a more straightforward view of how to override node
stuff.


--
View: http://drupal.org/node/view/372
Edit: http://drupal.org/project/comments/add/372





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise