CVS edit link for good_man

Hello,

I'm working on a nice content slider module for Drupal. It depends on Scrollable (http://flowplayer.org/tools/scrollable.html) plugin for jQuery, this plugin provides options and very smooth scrolling.

CommentFileSizeAuthor
#1 scrollable_content.zip17.24 KBgood_man

Comments

good_man’s picture

Assigned: Unassigned » good_man
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new17.24 KB
avpaderno’s picture

Assigned: good_man » Unassigned
avpaderno’s picture

Title: good_man [goodman] » good_man [goodman
Status: Needs review » Needs work
  1. The jQuery plugin, and the license file need to be removed.
  2. To verify if the current page is the front page, it's enough to call drupal_is_front_page().
  3.   global $base_url;
    

    The code doesn't actually use the global variable.

  4. 		foreach ($types as $type) {
    			$sql = "SELECT n.nid, n.vid, n.title, teaser FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid "." WHERE n.status=1 AND n.type='" . $type . "' ORDER BY n.created DESC LIMIT $nodes";
    
    			$resource_id = db_query($sql);
    			$resources_array[] = $resource_id;
    			//$nodes_divs .= get_results($resource_id, $image_field, $default_image, $imagecache_preset);
    		}
    

    The code is not correct; it does check the status of the node, but it should also call db_rewrite_sql().

  5.   extract($scrollable_options);
    

    I would avoid to use that function, which makes the code error-prone. Looking at the code, it's not possible to say if you are accessing a variable without to first initialize it (which means the code is difficult to maintain).
    If you want to use default values for an array when that array doesn't contain a value, you can use the following code:

      $settings += $default_settings;
    

    In this way, the indexes already present in $settings will not overwritten by indexes present in $default_settings.

  6.     $output_body .= '</div>';
    
    	$output_body .= '</div>';
    
    	$output_body .= '<a class="next"></a>'."\n";
    
    	$output_body .= '<br clear="all"/>';
    
        $output_body .= '<script type="text/javascript">';
    
        $output_body .= 'if (Drupal.jsEnabled) {'."\n";
        $output_body .= '$(document).ready(function() {'."\n";
    	$output_body .= '$("#scrollable").scrollable({'."\n";
    	$output_body .= 'size: '.$size.','."\n";
    	$output_body .= 'items: "#thumbs",'."\n";
    

    The code should use a single assignment statement.

  7.   function get_results($resources_array, $image_field, $default_image, $imagecache_preset) {
    	global $base_url;
    

    All the function names must be prefixed with the module name; the same is true for the Drupal variables used, and the constant the module defines. See the Drupal coding standards for the other coding suggestion your code is not following.

avpaderno’s picture

Title: good_man [goodman » good_man [goodman]
AjK’s picture

        foreach ($types as $type) {
            $sql = "SELECT n.nid, n.vid, n.title, teaser FROM {node} n INNER JOIN {node_revisions} r ON n.nid = r.nid "." WHERE n.status=1 AND n.type='" . $type . "' ORDER BY n.created DESC LIMIT $nodes";

            $resource_id = db_query($sql);
            $resources_array[] = $resource_id;
            //$nodes_divs .= get_results($resource_id, $image_field, $default_image, $imagecache_preset);
        }

Also, "LIMIT" shouldn't be used in SQL, pager_query() should be used.

good_man’s picture

Component: Miscellaneous » Code
Category: task » support
Status: Needs work » Active

Hi,

Thanks for the great help and review ...

@KiamLaLuno:
Excuse me but I didn't understand point #1 well, we removing the license and plugin file

Hope I'll finish all the mentioned points and some fixes and improvements today or tomorrow

avpaderno’s picture

The license file you added to the archive you uploaded here must be removed; the packaging script already adds the same license file. You are probably not allowed to commit a file LICENSE.txt into CVS.
Any third-party files that are available from other sites must not be included in CVS; the same is true for files that are not licensed under GPL License.

avpaderno’s picture

Component: Code » Miscellaneous
Category: support » task
Status: Active » Needs work

@good_man Please don't edit the issue metadata, apart the status.

good_man’s picture

Status: Needs work » Needs review

yeah I understand now why not including LICENSE but regarding the library (jQuery plugin) it's GPL and I've seen many contributed Drupal modules packaging library files with the module, it's easier than telling the user to put it himself.

avpaderno’s picture

Status: Needs review » Needs work

For an explanation of which code can be added in CVS, see http://drupal.org/node/66113.

good_man’s picture

aha many thanks for clearing things ... expecting the new release today or tommorw (it's night in my local time)

good_man’s picture

Status: Needs work » Needs review

Hello KiamLaLuno,

I'm facing a little problem, the jQuery plugin (Scrollable) that I use has many version now, and the programmer of this library still working on the site, so in the same page you can see many version of the plugin! and these versions are different in the way you call the plugin because the owner still making many big changes. I don't want the user to download a different version that won't work with the module, so can I include it (the jQuery plugin Scrollable) in the module?

avpaderno’s picture

What version are you using?

good_man’s picture

jQuery Tools 1.1 beta, It's not important what version I can use & call whatever but the problem is the developer changing it frequently!

avpaderno’s picture

Do you mean that the version you are using is not compatible with the latest version available?

good_man’s picture

Yes calling the Scrollable js in the new version is done b an API which was not the case in the older one

avpaderno’s picture

Status: Needs review » Needs work

The last version of jQuery Tools is 1.0.2 (June 11, 2009). There is also a version 1.0.3 of jQuery Scrollable (June 3, 2009) on http://plugins.jquery.com/project/scrollable.

good_man’s picture

Status: Needs work » Needs review

As you can see many versions, also from the official site v 1.0.5 http://flowplayer.org/tools/download.html and in the right sidebar v 1.0.2 http://flowplayer.org/tools/scrollable.html !!

avpaderno’s picture

Status: Needs review » Needs work

Version 1.0.5 is the version for jQuery Scrollable, and 1.0.2 is the version for jQuery Tools.
My point is that jQuery Scrollable 1.0.3 is always present in the jQuery web site; there is no reason to include the file into Drupal CVS when it is available from a third-party site.

avpaderno’s picture

Issue tags: +Module review
avpaderno’s picture

Status: Needs work » Closed (won't fix)

There have not been replies from the OP in the past 7 days. I am marking this report as won't fix.

good_man’s picture

It turned out to be a bad idea, since jQuery Tools programmer is keep changing the API and also keep changing the download page! also no previous versions are available so you must download latest ones.

Sorry Kiam but I for my own use of this module find difficulties updating and maintaining the script, so I think people will find it difficult too.

avpaderno’s picture

I still don't understand why the code could not use the version available from http://plugins.jquery.com/project/scrollable.

good_man’s picture

Because it's unlike other projects hosted on jQuery's site (e.g. http://plugins.jquery.com/project/dotnet_string_formatting) there is no download link, to download it you have to go to it's official website (http://flowplayer.org/tools/download.html) where you also have to install only the latest release! so I can't keep this module always compatible with the changing API for Scrollable! you see the problem now!

Another issue, I've update my locale development version of Scrollable module to use the latest 1.1.x Scrollable release, it's only compatible with jQuery 1.3.x, and you know the other problems when updating Drupal's jQuery release from 1.2.x to 1.3.x

P.S. notice the version in jQuery's site is 1.1.0 and in the official site 1.1.2

avpaderno’s picture

Status: Closed (won't fix) » Needs review

You are right: there is not download link in the jQuery web site; the link I saw is for the release page, which doesn't contain a download link.
In that case, I understand if you include the plugin without module.

I will re-queue your CVS application.

avpaderno’s picture

Status: Needs review » Fixed
  $items['admin/settings/scrollable_content'] = array(
    'title' => 'Scrollable Content',
    'description' => t('Configure Scrollable Content.'),

The description should not be passed to t().

good_man’s picture

Thanks for your patience, I'll work on it this week and publish the first release.

good_man’s picture

Thanks guys for the help, the first release is here: Scrollable Content.

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.