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

New Module - Shoud data be stored as a new Node type or...?

I'm not sure i'm asking this the right way.

I've been pouring through the API manual and i'm finally getting the hang of writing my own complex module (although i've never written a simple one yet ;-))..

My module will require two new tables that store event and venue data. The module will then relate (JOIN) the data and display it as needed.

I'm confused about a few things:

1) Does my data need to be designed as a NODE? What i mean is must my module ONLY extend type node by creating a new node type "events" and "venues" and then using node hooks and tables with nids behind the scenes?

OR

2) can i just ditch the whole node paradigm and create my own tables without nids but basic primary keys?

I believe views and panels are NOT nodes. So i DO NOT THINK CONTENT THAT IS DISPLAYED IN DRUPAL HAS TO BE OF TYPE (EXTENDED) NODE (but i'm not sure)?

I think one can create whatever table one wants and access it however one wants (whether nodes or custom tables) as long as hook_menu and hook_block are (MUST be) provided in order to output and make the content available on the page - right??

Another way of asking this might be:

1) What do i GAIN by extending my new data types as a node (that i can't foresee right now)?
2) What do i LOSE by NOT extending my new data types as a node (that i can't foresee right now)?

thanks in advance for any and all input regarding this

Switching from Drupal authentication to Active Directory authentication

I'm using Drupal 4.6 to run the intranet for the company I work for. Up to now, we've been using Drupal authentication for access. But as the usability and necessity of this intranet grows, more people are complaining about having to remember a different password from their Active Directory password.

So I've begun experimenting with the LDAP integration module. We've got it to work. When an Active Directory user logs into the test site for the first time using their AD credentials, a new Drupal account is added for them; I can then add any special roles for them and they're good to go--perfect! However, most of our users already have Drupal accounts that used Drupal authentication. When one of those users logs in using their AD credentials, the following message appears at the top:

Another user already exists in this system with the same login name. You should contact the system's administrator in order to solve this conflict.

But the user doesn't appear to be logged in as a different user. They have the same roles and access as before, and I see no new user that's been created. So it seems the warning doesn't have any real purpose. I could comment the message out from the module, but before I do, I'd like to get some input from this forum as to any negative effects from this approach I might be missing. (Disclosure: I'm not a programmer or very knowledgable about Active Directory/LDAP. My knowledge of PHP is self-taught by working with Drupal for the past year.)

FCK 2.3.2, Drupal 5b2: File Browser - Upload OK, Browsing doesnt work

Hi,

i have installed the newest release of the fck module with fck 2.3.2. I use 5.0 beta 2.

It works fine and i configure the file browser too:
- i set up the path within the phpconnector

It works. I am able to upload images, they are stored in the right directory on the server.

BUT!!!!!!
I CAN'T SEE ANY IMAGE IN THE BROWSER OF FCK!!

I used FireBug to debug and got the following error message (x-times, i don't know if this is important):
uncaught exception: Die Erlaubnis für den Aufruf der Methode XMLHttpRequest.open wurde verweigert

Idea for module with some example code....

I had idea for an auto link finder for wikipedia when posting article, similar to trillians(the chat client) has as you type. I wrote some test code to test feasibility of making the module, and was able to get a simple and crude sample script working below. Of course, I left alot to anyone who would want to do this. For one, my strips existing formatting and does not go back and put the newly found article link in original. I suppose you could get around this by using a really nice regular expression that to account for html, code, and whatever else before inserting link. Also i could imagine it being implemented similar to the Glossary filter that puts the superscript I beside words found. One thing I have no idea how you could deal with is articles in reference to word found. I think possible ask user which he wants and doesn't. Again, I don't know that is possible to do with an input filter. Of course this was mostly a proof of concept. I am looking at possible writing this into either Windows Live Writer as a plugin or Xinha the WYSWYG editor, again as a plugin. I think it could be more useful there where the user to view article before posting and edit out wikipedia parts that don't apply.

<?php
//try to get info from wikipedia
define('WIKIPEDIAOS','http://en.wikipedia.org/w/api.php?action=opensearch&search=');

function in_arrayi($str, &$array){
$arrReturn = preg_grep('/(?i)'.$str.'/', $array);
return (is_array($arrReturn)) ? $arrReturn[0] : false;
}

function search_wikipedia($term)
{

$str=file_get_contents(WIKIPEDIAOS.$term);
$m = search_str_to_array($term,$str);
return in_arrayi($term,$m);

}

function search_str_to_array(&$term,&$str)
{
$str = substr($str,strlen($term)+4);

$matches = preg_split('/[\[",\]]/',$str,-1,PREG_SPLIT_NO_EMPTY);
return $matches;
}

function split_words(&$str)
{
$words = strip_tags($str);
$words = preg_split('/\W/',$words);
//now loop over words
foreach ($words as &$word)
{
if(strlen($word)>4)
{
$r=search_wikipedia($word);
if ($r)
{
$word="{$word}";
}
}
}
print implode(" ",$words);
}

$str = '

Only local images are allowed.

Launchy is a "keystroke" launcher for windows. Basically, it allows you to quickly launch programs by typing in a few keys of the name. Its works off a hotkey(alt +space), which birngs up a window where you can type a partial name of the intended application, and hit enter to launch. By default, Launchy indexes your desktop and start menu(it reads shortcut files), but it can be set to scan any number of file types and directories. So, for instance, you could have it set to scan all your mp3s and quick launch your favorite song quickly without ever going to windows explorer or your media player. I\'ve been using Launchy for nearly 6 months now, and I can say it has truly changed and improved my computer experience. Also, one aspect of my digital experience it has defiantly freed me from is my scouring start menus and directories for a program I haven\'t used in months. If I can remember part of the name, or even just the icon, I can find it on Launchy. Launchy is available for free over at http://www.launchy.net/, so go get your copy today.

displaying all nodes of a type on front page (4.7.4)

In Drupal 4.7.4, trying to display a front page consisting of one node of type "page" followed by a list of custom nodes. The custom nodes are visible in the db and through administer >> content. I've configured them to promote to the front page, and have set the front page post limit high, but only one custom node displays. I don't know enough to know if this is a settings issue or if I need to build and pass the list of nodes myself somewhere (and if so, where), or something else.

Thanks in advance.

Clark

API: Creating a custom, compond control

I am trying to figure out how to make a compound control. The example I am trying to build is a time selector, which really is a combination of 3 comboboxes:

Combo 1 --> Contains a selector for the hour
Combo 2 --> Contains a selector for the minutes (in this example, in 5 minute increments
Combo 3 --> Contaisn a selector for AM/PM

Pages

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