CVS edit link for JoBo

I have read the CVS application requirements and see it's not easy, to get in !!

First I like to explain why to contribute this module.

At the moment there is no fast distribution of the rss feeds. All the feeds published by drupal pings the crawlers via ping-o-matic (ping.module) or another subscribers (multiping.module).
One of the limitation is that it could take a while when the subscriber pulls you're RSS feed.
Another limitations is that it is difficult to get updates from services quickly without the crawlers overloading your site servers with update checks.

There are different solutions to distribute your rss feeds faster without it polling problem:

* Simple Update Protocol, that was proposed by Paul Buchheit from Friendfeed. (see http://code.google.com/p/simpleupdateprotocol/)
* PubSub Protocol, that was proposed by Brad Fitzpatrick and Brett Slatkin from Google. (see http://code.google.com/p/pubsubhubbub/)
* rsscloud(see http://rsscloud.org/)

In the future it will be common to use these publish methods. Wordpress has a plugin that support pubsubhubbub. I do not think we would lose by Wordpress.
There is also much demand by the community:

* http://code.google.com/p/pubsubhubbub/wiki/PublisherClients
* http://drupal.org/node/551980

So now i like to approach these features via my fastwebfeed.module.
It extends the default rss.xml for SUP, pubsub and rsscloud.

I also asked for Aron Novak for a collaboration with the feedAPI.
But I think it's usefull to have standalone module for all the users how don't use the feedAPI module.

thx,

Jo Bollen

Comments

avpaderno’s picture

If you re-apply for a CVS account, you still need to upload the code.

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

There have not been replies from the OP, who has not uploaded the code for the review. I am marking this report as won't fix.

mchelen’s picture

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

is the code posted in the other topic what was needed? http://drupal.org/node/590928#comment-2144090

avpaderno’s picture

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

When somebody re-apply for a CVS application, s/he needs to upload the code again.

mchelen’s picture

ah okay, thanks for the update

g.i.joe’s picture

I will publish the first release of this module in a few days... let's say monday 9 november...

g.i.joe’s picture

Component: Miscellaneous » Code
Priority: Normal » Critical
Status: Closed (won't fix) » Postponed (maintainer needs more info)
StatusFileSize
new44.67 KB
new45.25 KB

Can you please review my code. Thanks.

more info @ http://cupid-project.be/

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Needs review
Issue tags: +Module review

Remember to change the status, when uploading new code; differently, who reviews the code will not know there is code to review (it's not just me to review code).

avpaderno’s picture

Component: Code » Miscellaneous
g.i.joe’s picture

Component: Miscellaneous » Code
StatusFileSize
new37.88 KB
avpaderno’s picture

Component: Code » Miscellaneous
Priority: Critical » Normal

Please change only the status, when you upload new code; other metadata are not thought to be changed by the applicant.

g.i.joe’s picture

StatusFileSize
new90.84 KB
new59.22 KB

The first Release Candidate for Drupal 6 is a fact. (fastwebfeed.module-6.x-1.0-RC1)
It supports pubsubhubbub and sup and it inserts this to the drupal RSS feeds.

avpaderno’s picture

I am resetting the review tags. Please change only the status of the report, when you upload new code.

avpaderno’s picture

Status: Needs review » Needs work
  1. function _fastwebfeed_description() {
      global $base_path;
      $module_path = drupal_get_path('module', 'fastwebfeed');
      $module_path_sup = drupal_get_path('module', 'fastwebfeed_sup');
      $module_path_pubsubhubbub = drupal_get_path('module', 'fastwebfeed_pubsubhubbub');
      
      $output = '<p>
                  When the Publisher insert a new node then your RSS feeds will be updated. 
                  The Fastwebfeed module pings the Service(s)/Hub(s) saying that there\'s an update.
                  It\'s a simple way to let people know in real-time when your feed is updated using the SimpleUpdateProtocol and PubSubHubbub.
                </p>'
                .'<h3>Fastwebfeed.module</h3>
      					<ul>';
      $output .= '<li><h3>Settings</h3> Edit the Fastwebfeed settings here. '. l('Administer > Site configuration > Fastwebfeed > Settings ', 'admin/settings/fastwebfeed/settings')
                . '<ul>
                  <li>PubSubHubbub 
                    <ul>'
                . ((module_exists(fastwebfeed_pubsubhubbub))?'
                      <li>fastwebfeed_pubsubhubbub.module
                        <ul>
                          <li>Config here the "hub" definitions '. l('Administer > Site configuration > Fastwebfeed > Pubsubhubbub > Hub(s) settings ', 'admin/settings/fastwebfeed/pubsubhubbub/hub') .'</li>
                			    <li>Read '. l('CHANGELOG.txt', $module_path_pubsubhubbub .'/CHANGELOG.txt') .'</li>
              				  </ul>
              			  </li>':'
              			  <li>'. l('Activate the fastwebfeed_pubsubhubbub.module here. URL: <em>admin/build/modules</em>', 'admin/build/modules', array('fragment' => 'edit-status-fastwebfeed-pubsubhubbub-wrapper', 'attributes' => array('style' => 'color:red'), 'html' => TRUE)) .'</li>
              			  ')
                  . '</ul>
              		</li>'
                . '<li>SimpleUpdateProtocol (SUP)
                    <ul>'
                . ((module_exists(fastwebfeed_sup))?'
                      <li>fastwebfeed_sup.module
                        <ul>
                          <li>Config here the "service" definitions '. l('Administer > Site configuration > Fastwebfeed > SUP > service(s) settings', 'admin/settings/fastwebfeed/sup/services') .'</li>
                  			  <li>Config here the "&lt;LINK&gt; attribute" definitions '. l('Administer > Site configuration > Fastwebfeed > SUP > service(s) &lt;LINK&gt; attributes', 'admin/settings/fastwebfeed/sup/service/link') .'</li>
                  			  <li>Read '. l('CHANGELOG.txt', $module_path_sup .'/CHANGELOG.txt') .'</li>
                			  </ul>
                	    </li>':'
                	    <li>'. l('Activate the fastwebfeed_sup.module here URL: <em>admin/build/modules</em>', 'admin/build/modules', array('fragment' => 'edit-status-fastwebfeed-sup-wrapper', 'attributes' => array('style' => 'color:red'), 'html' => TRUE)) .'</li>')
                  . '</ul>
                  </li>
                  </ul>
                  </li>';
    

    The function is outputting so much HTML without use themes function. The string is not translated.

  2.   if ($plugged_modules == TRUE) {
        $output .= '<li><h3>Plugged modules</h3> Edit the plugged modules settings here '. l('Administer > Site configuration > Fastwebfeed > Plugged modules ', 'admin/settings/fastwebfeed/plugged_modules') .')'; 
      }
    

    It is enough to write if ($plugged_modules) {; PHP is not a strong-typed language.

  3.       '#title' => t('@title', array('@title' => $feed_url)),
    

    The placeholder is not translated; therefore, the call to t() is not used to translate anything.

  4.       if (module_exists(fastwebfeed_sup)) {
            $output_inner = fastwebfeed_sup_include_fastwebfeed_info_admin($feed_url);
            $rows_wrap[] = array( array( 'data' => $output_inner ) );
          }
    

    The first line would cause the error Undefined constant, if executed.

  5.   if ($form !== NULL && $form_state !== NULL && $form_value_prefix !== NULL && $form_value_admin_suffix !== NULL && $form_value_row_prefix !== NULL && is_numeric($total_admin_fields) && is_numeric($total_required_admin_fields)) {
        $check_form = array();
        $check_table_items = array();
        foreach ($form_state['clicked_button']['#post'] as $post_key => $post_value) {
          // $find variables
          $find = strpos((string)$post_key, $form_value_prefix); // $form_value_prefix;
          $find_row = strpos((string)$post_key, $form_value_row_prefix); // $form_value_row_prefix
          // if find is a success
          // then there will be a check if the admin_table_items are empty or full
          if ($find !== FALSE) {
            if ($find_row !== FALSE ) {
              if (isset($form_state['clicked_button']['#post'][$post_key])) {
                $row = explode('_', $post_key);
                $object_id = array_pop($row);
                $object_id_length = (int)strlen($object_id);
                $object_id_length = $object_id_length+1;
                $row_id = array_pop($row);
                $row_id_length = (int)strlen($row_id);
                $row_id_length = $row_id_length+1;
                $prefix_length = (int)strlen($form_value_prefix) + (int)strlen($form_value_row_prefix);
                $row_key = drupal_substr(drupal_substr($post_key, 0, -$object_id_length-$row_id_length), $prefix_length);
                if ($form_state['clicked_button']['#post'][$post_key] != '' || $row_key == 'delete') {
                  $check_table_items['fill'][] = $post_key; 
                }
                else {
                  $check_table_items['empty'][] = $post_key; 
                }
              }
            }
          }
        }
    

    I am missing the purpose of all that code.
    A validation function always get the parameters $form, and $form_state; there isn't the need to check if they are passed.
    Also, &$form_state = NULL is not a valid syntax for a function parameter, in PHP 4. Drupal 6 is still compatible with PHP 4.

  6. function fastwebfeed_form_submit($form = NULL, &$form_state = NULL, $function_query_add = NULL, $function_query_delete = NULL, $function_query_update = NULL, $form_value_prefix = NULL, $form_value_admin_suffix = NULL, $form_value_row_prefix = NULL, $total_admin_fields = 0, $total_required_admin_fields = 0) {
      if ($form !== NULL && $form_state !== NULL && $function_query_add !== NULL && $function_query_delete !== NULL && $function_query_update !== NULL && $form_value_prefix !== NULL && $form_value_admin_suffix !== NULL && $form_value_row_prefix !== NULL && is_numeric($total_admin_fields) && is_numeric($total_required_admin_fields) ) {
        $check_form = array();
        foreach ($form_state['clicked_button']['#post'] as $post_key => $post_value) {
          // $find variables
          $find = strpos((string)$post_key, $form_value_prefix); // $form_value_prefix;
          $find_row = strpos((string)$post_key, $form_value_row_prefix); // $form_value_row_prefix
          // if find is a success
          // then there will be a check if the admin_table_items are empty or full
          if ($find !== FALSE) {
            if ($find_row !== FALSE ) {
              if (isset($form_state['clicked_button']['#post'][$post_key])) {
                if ($form_state['clicked_button']['#post'][$post_key] != '') {
                  $row = explode('_', $post_key);
                  $object_id = array_pop($row);
                  if ($object_id != '0') {
                    $object_id_length = (int)strlen($object_id);
                    $object_id_length = $object_id_length+1;
                    $row_id = array_pop($row);
                    $row_id_length = (int)strlen($row_id);
                    $row_id_length = $row_id_length+1;
                    $prefix_length = (int)strlen($form_value_prefix) + (int)strlen($form_value_row_prefix);
                    $row_key = drupal_substr(drupal_substr($post_key, 0, -$object_id_length-$row_id_length), $prefix_length);
                    $object[$object_id]->$row_key = (string)$post_value;
                  }
                }
              }
            }
          }
        }
        foreach ($form_state['values'] as $post_key => $post_value) {
          // $find variable
          $find_admin = strpos((string)$post_key, $form_value_admin_suffix); // $form_value_admin_suffix
          // if find is a success
          // then there will be a check if the admin_items are empty or full
          if ($find_admin !== FALSE ) {
            if (isset($post_value)) {
              if ($post_value != '' || is_numeric($post_value)) {
                $row_key = drupal_substr(drupal_substr($post_key, 0, -(int)strlen($form_value_admin_suffix)), (int)strlen($form_value_prefix)); // (int)strlen($form_value_admin_suffix)), (int)strlen($form_value_prefix)
                $object[0]->$row_key = (string)$post_value;
              }
            }
          }
        }
        // 	Check that all admin_items are present
        //  then add admin_items
        if (count((array)$object[0]) == $total_admin_fields) { // $total_admin_fields
          $function_query_add($object[0]);
        }
        // 	Check that all admin_table_items are present
        //  then update or delete the admin_table_items
        foreach ($object as $key => $value) { 
          $subject_id = $form_value_prefix .'id';
          $value->$subject_id = $key;
          if (count((array)$object[$key]) >= $total_admin_fields) { // $total_admin_fields
            // Browsers return "on" only for checked checkboxes. Non-checked are completely ignored and not included in the post.
            // So there has been chosen for this preliminary solution. 
            if ($key != 0) {
              if (isset($value->status) && $value->status == '1') {
                $value->status = 1;
              }
              else {
                $value->status = 0;
              }
              $function_query_update($value);
              if ($value->delete == '1') {
                $function_query_delete($value);
              }
            } 
          }
        }
      }
      drupal_set_message(t('The "Fastwebfeed" configuration have been saved.'));
    }
    

    The code is wrong. Did you see any Drupal core module doing that just to read the values passed through the form?

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.