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

hook_db_rewrite_sql can make nid unavailable - how to fix it?

Hi,

This is possibly a nasty problem. However, it could just be me being incompetent...
I have a table called drulig_node, like this:

mysql> describe druligg_node;
+--------------+------------------+------+-----+---------+-------+
| Field        | Type             | Null | Key | Default | Extra |
+--------------+------------------+------+-----+---------+-------+
| nid          | int(10) unsigned | NO   | PRI | 0       |       | 
| promoted_on  | int(11)          | NO   |     | 0       |       | 
| killed       | int(2)           | NO   |     | 0       |       | 
| url          | char(128)        | NO   |     |         |       | 
| title_url    | char(128)        | NO   | UNI |         |       | 
| safe_section | char(128)        | NO   |     |         |       | 
| bury_count   | int(11)          | NO   |     | 0       |       | 
+--------------+------------------+------+-----+---------+-------+

Now, I want to make sure that "killed" entry are never visualised unless the user types their URL directly.
So, I wrote:


function druligg_db_rewrite_sql($query, $primary_table, $primary_field, $args){

if($primary_table='n' && $primary_field == 'nid'){

if( !( arg(0)=='node' && is_numeric(arg(1)) )){
$return['where'] .= " AND !(n.type='druligg' AND dn.killed=1 ) ";

how to access the extern mysql database and display the result on drupal page node?

if there is another mysql data base and there is a table with some data in it.
can we write code in page node write php code to access it , i mean can we use drupal 's database abstract layer to access that database and can we use the drpal's display template engine to display the result ??

thank you.

if you give me some example in use drupal's database access abstract layer and use drupal display template engine will be very appreciated.

Tabular Content

I have a lot of pages that contain simple HTML tables with data in the cells. I can obviouslly use the wysiwyg to create a table and to enter the data, but I'd rather just enter the data and have the table built for me. This way I only need to enter pure data, cell by cell, and perhaps I can tab to each input making input very quick.

Any ideas?

CCk fubctionality question

Hi all, I hope this is the right forum.

Is there a way to have CCK field be selectable by the user??

I want one data field type to have multiple entries. I know that I could create a content type and create a custom field (Data - Text Field) for each value and have them all displayed on one form. (ie, name, address, weight, sex,....)

But what if names of the data field are up to the user and they can have as many as they choose??

Drupal not recognizing page function in new module

I've gone through the "5.x Create Module Tutorial" at http://drupal.org/node/22750 and I'm stuck a the point where you create: function onthisdate_all and function onthisdate_link because when I click on the "More Link" it generates the right URL .../drupal/?q=onthisdate but I get the error, Page Not Found, rather than showing me the page.

I've tried disabling and enabling the module, running the update.php, etc. to no avail.

What should I look at next in my troubleshooting process?

-- David.

way to have urls automatically be turned into links?

I use Drupal 4.7 with Tinymce as my WYSIWYG editor. I've just created a forum for users to have online discussions.

It does not appear to be obvious to all of my users how to create a url link in a post. They are not figuring out how to highlight the link in their post, then use the "link" button in Tinymce to paste in the appropriate url. I did not expect this to be a problem, but since they are not immediately catching on, I'd like to make it easier for them.

I think they are expecting the urls to automatically show up as links, as would happen in Microsoft Word.

Pages

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