Current code is changing by a time so we need this issue to track changes

Let's aggregate here version history and all staff around integration with trustlink.ru

Comments

andypost’s picture

Status: Active » Needs work

Current code needs to be updated:
1) add inline style for links
2) change color if links display

spleshka’s picture

Assigned: Unassigned » spleshka
Status: Needs work » Patch (to be ported)
StatusFileSize
new39.83 KB

Inline styles for trustlink were added. Also were added possibility of setting block name for css.
Improved trustlink.php file (there were problems with multisiting). Problems with trustlink code recognition were fixed too.

andypost’s picture

Status: Patch (to be ported) » Needs work

Mostly errors about formatting and code style.

You're changing logic for default values but forget about sites that use this module (156 for now).

Do not change default values - you could broke current site designs!!!

Please tune you text editor to remove empty spaces at the end of lines!

+++ seonet.admin.inc	17 Feb 2011 01:21:18 -0000
@@ -11,33 +11,39 @@
-    '#default_value' => variable_get('seonet_css', ''),
+    '#default_value' => variable_get('seonet_css', str_replace('.', '', $_SERVER['HTTP_HOST'])),

Default css should be block's system default not a host name

+++ seonet.admin.inc	17 Feb 2011 01:21:18 -0000
@@ -138,18 +156,17 @@
-  if (function_exists('eaccelerator_get')) {
+  if (function_exists('eaccelerator_get')) ¶
     $cache_systems['eaccelerator'] = 'eaccelerator';
-  }

This is wrong by drupal coding standards http://drupal.org/coding-standards

+++ seonet.admin.inc	17 Feb 2011 01:21:18 -0000
@@ -164,9 +182,8 @@
-  if (variable_get('seonet_sape_id', '000') != '000') {
+  if (variable_get('seonet_sape_id', '000') != '000') ¶
     $form['#after_build'] = array('seonet_admin_sape_preview');
-  }

the same

+++ seonet.admin.inc	17 Feb 2011 01:21:18 -0000
@@ -234,35 +264,63 @@
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save'),
+  );

Use system_settings_form() with additional $form['#submit'] handler to trim() code and create files

+++ seonet.admin.inc	17 Feb 2011 01:21:18 -0000
@@ -295,66 +353,72 @@
+    '#default_value' => variable_get('seonet_linkfeed_css', str_replace('.', '', $_SERVER['HTTP_HOST'])),

This all over patch - DO NOT USE host name as css identifier - currently sites could use default (system block ID) in their themes so this change could lead to broken design.
This is not acceptable for public module!!!

+++ seonet.admin.inc	17 Feb 2011 01:21:18 -0000
@@ -295,66 +353,72 @@
-  if (variable_get('seonet_linkfeed_id', '000') != '000') {
-    $form['#after_build'] = array('seonet_admin_linkfeed_preview');
-  }
+  if (variable_get('seonet_linkfeed_id', '000') != '000') ¶
+    $form['#after_build'] = array('seonet_admin_linkfeed_preview');  ¶

Code styling as above

+++ seonet.info	17 Feb 2011 00:46:38 -0000
@@ -1,4 +1,11 @@
+
+
+; Information added by drupal.org packaging script on 2010-07-02
+version = "6.x-1.0"
+core = "6.x"
+project = "seonet"
+datestamp = "1278112209"
+

Do not touch this part!

+++ seonet.install	17 Feb 2011 01:22:34 -0000
@@ -16,32 +21,33 @@
+  variable_del('seonet_sape_css');
   variable_del('seonet_sape_fetch');
   variable_del('seonet_sape_host');
   variable_del('seonet_sape_cache_clear');
   variable_del('seonet_sape_cache');
   variable_del('seonet_sape_mc');
   variable_del('seonet_sape_hash');
-  variable_del('seonet_sape_css');

Any reason to reorder this? This change make no sense but make the patch bigger.

+++ seonet.module	17 Feb 2011 01:17:03 -0000
@@ -82,29 +82,38 @@
-    case 'list':
-      $count = variable_get('seonet_sape_blocks', 3);
+    case 'list':      ¶
 
-      for ($i=1; $i < $count + 1; $i++) {
-        $blocks[] = array(
-          'info' => 'Sape ' . $i,
+      if (variable_get('seonet_sape', 0)) {      ¶
+        $count = variable_get('seonet_sape_blocks', 3);
+        for ($i=1; $i < $count + 1; $i++) {
+          $blocks[] = array(
+            'info' => 'Sape ' . $i,
+            'cache' => BLOCK_NO_CACHE,
+          );
+        }
+      }      ¶
+      ¶
+      if (variable_get('seonet_trustlink', 0)) {
+        $blocks['trustlink'] = array(
+          'info' => 'TrustLink',
           'cache' => BLOCK_NO_CACHE,
         );
       }
-      $blocks['trustlink'] = array(
-        'info' => 'TrustLink',
-        'cache' => BLOCK_NO_CACHE,
-      );
-      $blocks['linkfeed'] = array(
-        'info' => 'LinkFeed',
-        'cache' => BLOCK_NO_CACHE,
-      );
+
+      if (variable_get('seonet_linkfeed', 0)) {
+        $blocks['linkfeed'] = array(
+          'info' => 'LinkFeed',
+          'cache' => BLOCK_NO_CACHE,
+        );
+      }

Any reason to hide blocks?

Also trailing whitespace

+++ seonet.module	17 Feb 2011 01:17:03 -0000
@@ -150,6 +175,50 @@
+      ¶
+  $css = '
+    ul.'. $user_id .' p.head{font-size: 14px; !important;}
+    ul.'. $user_id .' a{color: #0000cc !important;}
+    ul.'. $user_id .' p{font-size: 12px; !important;}
+    ul.'. $user_id .' p small{color: #000000 !important;}
+    ul.'. $user_id .' p b{color: #006600; font-weight: normal;}';
+      ¶

Check your code with *coder* module

Powered by Dreditor.

spleshka’s picture

StatusFileSize
new37.96 KB

Ok, I fixed my code styles. I'll comment some your notes:

1. Use system_settings_form() with additional $form['#submit'] handler to trim() code and create files
I need not default form processing, so I returned just $form, and after that I process it in my way

2. Any reason to reorder this? This change make no sense but make the patch bigger.
That was not specially :)

3. Any reason to hide blocks?
Yes, I see a big reason. I think that block shouldn't be displayed on block page, if user didn't turn it on.

So you can get newer version of patch from attachment.

andypost’s picture

Patch still needs some love, as I said before - don't change defaults.

+++ seonet.admin.inc	17 Feb 2011 11:37:10 -0000
@@ -1,5 +1,5 @@
-// $Id: seonet.admin.inc,v 1.2 2010/07/03 20:36:56 andypost Exp $
+// $Id: seonet.admin.inc,v 1.1 2010/07/02 22:51:18 andypost Exp $

try to use current version

+++ seonet.admin.inc	17 Feb 2011 11:37:10 -0000
@@ -11,33 +11,39 @@
+  ¶

A lot of ending spaces that should be trimmed

+++ seonet.admin.inc	17 Feb 2011 11:37:10 -0000
@@ -107,8 +121,9 @@
-    '#description' => t('Replacement for blocks system identifier. Allowed only English lowercase characters. Default: %name.', array('%name' => '0')),
+    '#description' => t('Replacement for blocks system identifier. Allowed only English lowercase characters. Default: %name.', array('%name' => 'seonet')),

Each provider's block should have own stile by default (as it was before)

+++ seonet.admin.inc	17 Feb 2011 11:37:10 -0000
@@ -182,10 +200,10 @@
-    $items[] = 'Sape context: ' . $sape->_error;
+    $items[] = 'Sape: ' . $sape->_error;

What this for? Sape and it's context are different things

+++ seonet.admin.inc	17 Feb 2011 11:37:10 -0000
@@ -224,7 +255,7 @@
-    '#description' => t('Replacement for blocks system identifier. Allowed only English lowercase characters. Default: %name.', array('%name' => 'trustlink')),
+    '#description' => t('Replacement for blocks system identifier. Allowed only English lowercase characters. Default: %name.', array('%name' => 'seonet')),

Do not change a defaults. Remember about current users

+++ seonet.admin.inc	17 Feb 2011 11:37:10 -0000
@@ -295,57 +355,64 @@
-    '#default_value' => variable_get('seonet_linkfeed_css', ''),
-    '#description' => t('Replacement for blocks system identifier. Allowed only English lowercase characters. Default: %name.', array('%name' => 'linkfeed')),
+    '#default_value' => variable_get('seonet_linkfeed_css', str_replace('.', '', $_SERVER['HTTP_HOST'])),
+    '#description' => t('Replacement for blocks system identifier. Allowed only English lowercase characters.'),

Same as above

+++ seonet.install	17 Feb 2011 11:37:04 -0000
@@ -1,5 +1,10 @@
-// $Id: seonet.install,v 1.2 2010/07/03 20:36:56 andypost Exp $
+// $Id: seonet.install,v 1.1 2010/07/02 22:51:18 andypost Exp $

use current version from cvs (git upcoming tomorrow )

+++ seonet.module	17 Feb 2011 11:35:53 -0000
@@ -82,29 +82,38 @@
-    case 'list':
-      $count = variable_get('seonet_sape_blocks', 3);
+    case 'list':      ¶
 
-      for ($i=1; $i < $count + 1; $i++) {
-        $blocks[] = array(
-          'info' => 'Sape ' . $i,

hook_block() should have all module's blocks on a page listing. You have no ability to change number of blocks from module's settings so please revert this part!!! block_rehash() is another WTF so is not usable for this purpose

+++ translations/general.pot	17 Feb 2011 01:27:32 -0000
@@ -1,4 +1,4 @@
-# $Id: general.pot,v 1.2 2010/07/03 20:36:56 andypost Exp $
+# $Id$

No need to change pot file in this patch. You should care about code first and update pot in follow-up patch

Powered by Dreditor.

andypost’s picture

StatusFileSize
new37.69 KB

Current state of patch, please fix code of blocks and test this patch against 6-dev

spleshka’s picture

StatusFileSize
new11.08 KB

Due to trustlink code updates I maked new patch that provides some additional trustlink options (based on 6-dev module version). Also was fixed some SEO features. Module was tested on Drupal 6 - I didn't found any bugs or errors.

andypost’s picture

I've just commited updated trustlink code http://drupalcode.org/project/seonet.git/commit/7fd4d1f

Admin settings still needs some love

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new21.37 KB

I'm going to commit this patch

andypost’s picture

Status: Needs review » Fixed

Commited.
http://drupalcode.org/project/seonet.git/commit/c30466b
http://drupalcode.org/project/seonet.git/commit/9199c72

Feel free to reopen if any troubles. DEV will be generated within 12 hours. Suppose we could release new version after testing

Status: Fixed » Closed (fixed)

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