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

path.module's issue

Hi all.

The problem is here. By default node path is like this: www.mysite.com/node/13 . After assigning an alias the path looks: www.mysite.com/countries/russia . But tabs such as "track" and "edit" base on default path :'(

Spellchecker in TinMCE not working in Drupal

Has anyone gotten the TinyMCE spellchecker plugin to work with drupal? The TinyMCE support page has no more advice for me, so I wonder if it is a drupal problem. I'm using the google check and have done all the changes written in the drupal TinyMCE module install readme. But I still get an error message that says: Could not execute AJAX call, server didn't return a valid XML.

I've already made the changes recommended from the TinyMCE forum, which seems to have helped others, but not me.

Any ideas?

javascript within module

hello

I am trying to create a module which displays a tree menu similar to one that we see in windows explorer. I am using tiagara tree menu. Tiagara tree menu is written in javascript and needs two array to initialize it. I am not sure how can I generate javascript array within modules. I get the data from mysql and now want to create a javascript array. Below is the module code in which I am trying to include javascript.

function viewer_content() {

$path = drupal_get_path('module', 'viewer');
theme_add_style($path . '/custom.css');

// Calculate previous and next record
$index = $_SESSION['QBIndex'];
$prev = $index - 10;
$next = $index + 10;
if($prev < 0) $prev = 0;

// in future this should not be here
db_set_active('spy');
$sql = 'SELECT article_id, title, pub_date FROM article order by title';
$result = @mysql_query($sql);
$output .= '

 

';
$output .= '

';
if(empty($result)) return '';
while ($row = @mysql_fetch_array($result)) {
$output .= '
' . l($row['title'], 'node/4/'. $row['article_id']) . '

';
// instead of putting results in a div
// i need to create a javascript array
// and call a java script function which builds a tree menu
// new tree(treeItems, treeIcons)

}
$output .= '

';
db_set_active('default');
//$output .= '

Current Value is ' . $index . '

';

Auto Linking

Hi all,

I'd like to be able to automatically link to a website when certain words are used on a blog or forum entry by any users.

IE - if someone types google, I'd like it to link to http://www.google.com

I've since found a module called "autolink", but it doesn't seem to work for the latest version of drupal.

Does anyone have any idea's if anything else can do this?

Cheers
James

trimmed version with tinymce

i have problems using tinymce that it doesn't puts <!--break--> into posts, and i have to do this manualy, is there a fix for this?

Problem with writing .install files?

I'm not sure whats wrong with this code? It works when it's in a normal page (or in the module itself) but when it's written into a .install file - it just refuses to work...?

function tablemanager_update_3() {
  $items = array();
  $row = array();
  $sql = db_query("SELECT tm.tid, tm.header FROM {tablemanager} tm ORDER BY tm.tid ASC");
        while ($fetch = db_fetch_object($sql)) {
        $count = 1;
        $temp = unserialize($fetch->header);
                foreach ($temp as $a) {
                        if (is_array($a)) {
                                if (array_key_exists('field', $a)) {
                                $a['field'] = (string)($count);
                                } // end if (array_key_exists)
                        } // end if (is_array)
                $row[] = $a;
                $count++;
                } // end foreach
  $items[] = update_sql("UPDATE {tablemanager} tm SET header='%s' WHERE tm.tid=%d", serialize($row), $fetch->tid);
  unset($row);
        } // end while
  return $items;
}

It also displays literally "UPDATE {tablemanager} tm SET header='%s' WHERE tm.tid=%d" as the output for each table you have rather than the actual output with the serialized strings. If I put the strings directly into the query rather than use '%s' and '%d' then (as expected) the curly brackets get stripped from the string when its put into the db.

Pages

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