Drupal 6 and jQuery

Am I missing something obvious about using jQuery with Drupal 6?

Under Drupal 5.x, I can easily create nodes and/or blocks with jQuery calls using the method described in this post. By adding a simple drupal_add_js call to load a plugin, I can also access plugin functionallity using this method without loading up a special module (assuming you have the jQuery update module installed). For example, I can call the jCarusoelLite plugin without a supporting module by creating a PHP input-type node like:

<?php drupal_add_js('sites/all/modules/jcarousellite/jquery.jcarousellite.pack.js') ?>

<a href="#" class="prev"><</a>&nbsp;<a href="#" class="next">></a>
<div class="anyclass">
  <ul>
    <li><img src="/files/images/IMG_3585.jpg" alt="" /></li>
    <li><img src="/files/images/IMG_3586.jpg" alt="" /></li>
    <li><img src="/files/images/IMG_3587.jpg" alt="" /></li>
  </ul>
</div>

<script type="text/javascript">
$(function() {
$(".anyclass").jCarouselLite({
items: "li",
btnPrev: ".prev",
btnNext: ".next",
speed: 200,
visible: 1
});
});
</script>

Alas, none of this works for me under Drupal 6. I've looked at the code for the small number of jQuery-related modules that are compatible with Drupal 6, but I can't find an obvious clue about why this worked under Drupal 5, but not under Drupal 6.

Need Drupal expert..

hi

We are looking for Drupal experts.

We need clone of wrongdiagnosis.com at healthatcontrol.com

Please advice

Sam

post node by user limitation

Hi,
I want that normal user create node but only the admine accept that will be publish or not for security ?

Any person can help me ? ?

Change content type

Hello,

I've made a module that adds a form to the Book edit page which allows me to change the content type to uneditable (lock the page) or bpage (unlock the page). I have 2 content types, 1 is bpage other is uneditable, uneditable is editable only by moderators, bpage is editable by everyone. The change is done by editing the node type from mysql.

I've added a #element_validate to the form so that the function that changes the mysql is called after the form is submitted. The module works well if i make the validate function use form_set_error, if i don't, it's like the function never gets run.

This is part of the code (i think you'll be able to spot the problem from here, if not, check the entire code after this):


<?php
// above this $form['changer'] is defined (radios type form)

$form['changer']['#element_validate'] = array('changer_validate');
}

// this is the function that gets called after submit
function changer_validate($form, &$form_state) {

// if i uncomment the line below the module works as wanted
// form_set_error('error', t('error'));

$changer_response = $form_state['values']['radios'];
if (arg(0) == 'node' && is_numeric(arg(1))) $nodeid = arg(1);
if($changer_response == "0")
{
db_query("UPDATE `drupal`.`node` SET `type` = 'uneditable' WHERE `node`.`nid` = $nodeid");
}
else if($changer_response == "1")

Need Php coding Help with multiple pages?

Hi all. Newbie
I have a basketball website and I have 1 page(node) for each player on the site
I want to add php code to each page to load the MySqlDatabase with the player info. The problem
is I want to be able to determine what row of my player table to load based on the the name of the page (I used pathauto to rename the pages) or at least the node. I dont know how to read the current node info into the php script.
Hope this is understandable and thanks for any help

Upgrading from 5 to 6.1 - MY SITE IS A MESS!!!!

I just copied all the files over, and now there is a big mess

Warning: Unknown column 'serialized' in 'field list' query: SELECT data, created, headers, expire, serialized FROM cache WHERE cid = 'variables' in /home/altermed/public_html/optimizacijadesign/includes/database.mysql.inc on line 128

Warning: Unknown column 'serialized' in 'field list' query: UPDATE cache SET data = 'a:112:{s:13:\"filter_html_1\";i:1;s:18:\"node_options_forum\";a:1:{i:0;s:6:\"status\";}s:17:\"menu_primary_menu\";i:2;s:19:\"menu_secondary_menu\";i:2;s:15:\"install_profile\";s:7:\"default\";s:17:\"node_options_page\";a:1:{i:0;s:6:\"status\";}s:12:\"comment_page\";i:0;s:14:\"theme_settings\";a:1:{s:21:\"toggle_node_info_page\";b:0;}s:18:\"drupal_private_key\";s:64:\"d3e652038a8968457001c81e69fbd0ccc68a9107de9a396a1a9cb5b3fcf5d11c\";s:27:\"theme_aberdeencopy_settings\";a:16:{s:11:\"toggle_logo\";i:0;s:11:\"toggle_name\";i:1;s:13:\"toggle_slogan\";i:0;s:14:\"toggle_mission\";i:0;s:24:\"toggle_node_user_picture\";i:0;s:27:\"toggle_comment_user_picture\";i:0;s:13:\"toggle_search\";i:1;s:14:\" in /home/altermed/public_html/optimizacijadesign/includes/database.mysql.inc on line 128

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x