The Social media module provides a flexible and very scalable way to add social buttons (programmatically or through an UI) dynamically to every bundles in the application.

Once you install Social media module you will have access to an admin page where you will be able to
choose which bundles you want to have social buttons, even if these bundles are not part of the core

ou can add buttons to every existing entity or bundle like node types, user,
comments, etc. and it dynamically offers you the possibility to add buttons
to new entities you create.

In social media module you can configure each button visibility
independently for every views mode you create, not only
Full or teaser (display suite module integration) for every existing bundle.

You are not limited to any module, service, API or button list.

You can add new buttons in any moment without dependence of the module or
any service in a very easy way through UI or developing a simple module
invoking hook_social_media_info() and making use of
hook_social_media_contructor_alter.

Each button is a render element achieving this way the relevant powerful
of theme functions ("theme_social_media_buttons()" and "theme_social_button()").
The module provide some hook_suggestion for rendering contextually depending on the bundle
or the button type if you want.

This properties make a very scalable and flexible module of Social media
module that allows possible future rules or ctools integrations in a
easy way.

Anyway, this is not a competitive module. it only provides another approach
to the problem focused in the advantages that working with D7 entities.

This is a Drupal 7 module
http://drupal.org/sandbox/Enxebre/1431492
git clone --branch 7.x-1.x Enxebre@git.drupal.org:sandbox/Enxebre/1431492.git

Reviews of other projects:
http://drupal.org/node/1670352#comment-6273324
http://drupal.org/node/1677904#comment-6273490
http://drupal.org/node/1615068#comment-6273606

CommentFileSizeAuthor
sorting_buttons.png159.3 KBEnxebre
list_buttons.png148.78 KBEnxebre
admin_page.png164.07 KBEnxebre
edit_button.png166.13 KBEnxebre

Comments

JupiterIII’s picture

Status: Needs review » Needs work

Needs some work to bring the code to proper coding standards. Once you've fixed the stuff on the page below, I'll be sure to investigate its functionality!

http://ventral.org/pareview/httpgitdrupalorgsandboxenxebre1431492git

Enxebre’s picture

Oks, i'm working in it from now.
thank you.

Enxebre’s picture

Status: Needs work » Needs review

Ok, I've finished with them.
I hope hear from you soon.
Thanks!!

JupiterIII’s picture

Enxebre’s picture

Sorry, i didn't know that it was necessary for D7, the http://ventral.org/pareview is not working for me now, it always stop at 33%, but i think i have fixed last errors.

Thank you.

Enxebre’s picture

Checked, errors have been fixed.
Waiting for new review.
Thank you.

ankitchauhan’s picture

Status: Needs review » Needs work

why we need this module? While we already have better than yours. Did you do something different?

check this one..
http://drupal.org/project/sharethis

Enxebre’s picture

Status: Needs work » Needs review

I know about sharethis module. As I explain in the summary, social media module work with entities and bundles like user or comments, not just with nodes. And it dynamically offers you the possibility to add buttons to new entities you could create.

In social media module you can configure each button visibility independently for every views mode you could create, not only Full or teaser (display suite module integration).

You can add new buttons without dependence of sharethis API in a very easy way through UI or developing a simple module such as the social_media_gplusone included with the module.

All this properties make a very scalable and flexible module of Social media module that allows possible future rules or ctools integrations in a easy way.

Anyway, this is not a competitive module. it only provides another approach to the problem focused in the advantages that working with D7 entities.

Thank you very much for your time.

Enxebre’s picture

Anybody for review?
Thank you

bart.hanssens’s picture

You should remove the files from the master branch, and only use the 7.x-1.x branch (http://drupal.org/node/1127732)

You might also explain what the difference is between this module and http://drupal.org/project/service_links and http://drupal.org/project/social-share (I assume your module is more flexible because it also supports links on entities)

bart.hanssens’s picture

Also, is there a reason why you use

variable_get("social_media_buttons") != NULL ? variable_get("social_media_buttons") : array();

in social_media.admin.inc instead of just

variable_get("social_media_buttons", array()); ?

bart.hanssens’s picture

Status: Needs review » Needs work
Enxebre’s picture

Issue summary: View changes

summary corrections

Enxebre’s picture

Issue summary: View changes

summary corrections

Enxebre’s picture

Issue summary: View changes

corrections

Enxebre’s picture

Status: Needs work » Needs review

Ok.
Master branch cleaned.
There are no reason for #11, just a bad coding practice (I'm sorry) but I have already fixed.

I have added to the summary issue, to the project description and to the Readme.txt file a section where I explain the advantages and differences between similar modules.

Thank you for your time bart.hanssens.

Waiting for new review...

Enxebre’s picture

Anybody for review?
Thank you.

patrickd’s picture

Assigned: Enxebre » Unassigned

Please don't assign the issue to your self, only the current reviewer should do this.

Sorry for the delay
as there are currently many applications in queue we need more reviewers,
so think about getting a review bonus and we will come back to your application sooner.

soncco’s picture

Status: Needs review » Needs work

This is quiet useful module.

There are still issues in codestyle, see here: http://ventral.org/pareview/httpgitdrupalorgsandboxenxebre1431492git-7x-1x
please fix them.

patrickd’s picture

Status: Needs work » Needs review

these are just minor issues, not worth blocking deeper reviews

Enxebre’s picture

Priority: Normal » Major
scot.hubbard’s picture

Priority: Major » Normal

Hi Enxebre,

I have just done a manual and automatic review of your module. Here are my findings:

There are no license issues with the code in this module, no third party libraries are included.

While there are similar modules out there, I do not consider this to be a duplicate of any existing module, and this is echoed in the readme file.

There still appear to be some coding issues that need to be fixed: http://ventral.org/pareview/httpgitdrupalorgsandboxenxebre1431492git-7x-1x

As your module has an admin page (if the UI module is enabled) you should add the configuration parameter to the UI module's .info file so that the admin link shows up in the admin/modules/list page.

social_media.admin.inc is loaded on line 8 of .module file but is also included in hook_menu.
If this include is providing functions that are called upon throughout the .module file I would
separate these into another include file, leaving just the code for the menu callback in the file
included by hook_menu.

line 56 social_media.admin.inc: change comment to read:

/**
 * Implements hook_form_BASE_FORM_ID_alter().
 */

In the file 'social_media_ui.module', change line 21 from

'type' => MENU_LOCAL_TASK,

to

'type' => MENU_DEFAULT_LOCAL_TASK,

Doing this will make sure that the first tab is active when you go to your admin section from the main admin menu.

social_media_gplusone.module:

In this function social_media_gplusone_social_media_process_element you have used " instead of ' for
consistency I would correct this.

The module installed and uninstalled cleanly.

IMHO the some of the points above should be fixed before going any further.

Enxebre’s picture

Priority: Normal » Major

Hi scot.hubbard,
thanks for your revision.

I have made some changes after reading your comments.

I would be gratefull if anybody could make a deeper review to the module from now.

Thanks in advance

jlopez’s picture

Priority: Major » Normal
Status: Needs review » Needs work

Hi Enxebre,

After a manual review of your code, I found the following:

+ Inconsistent use of single and double quotes between modules, within modules and within the same functions. Some examples:
- social_media.admin.inc - line 22 and line 29 - $form[.
- social_media_ui.admin.inc - line 273 and line 277 - $form_state[.
- social_media.module - line 107 and line 108 - $element[.
+ Inconsistent spacing between array elements, variable declarations, etc. Some examples:
- social_media.module - line 134 versus social_media_ui.admin.inc - line 218.
- social_media.module - line 94 versus line 164.
- social_media.module - line 157 - "weight" =>40 versus "weight" => 40.
+ What is the purpose of social_media_ui.module? - line 68 - if (1 == 1) { - It will always evaluate to true.
+ Comment issues that do not follow coding standards. See Doxygen and comment formatting conventions page
- Various cases of missing param - social_media_ui.admin.inc - line 137 - $button or line 231 - $value or line 150 - $current_button.
+ Newline in comment in social_media_ui.module - line 86. Saw all of the coding standard review comments above. Not sure why some of this stuff wasn't caught then.
+ Missing default value in variable_get in social_media.api.php - line 21, social_media_ui.module - line 66 and social_media_ui.admin.inc - line 249.

The examples should give you an idea of where I found issues although there are more cases. Please be sure to thoroughly check each of the cases across all of your code.

Good luck.

Enxebre’s picture

Status: Needs work » Needs review

Hi jlopez,
thank you for your time,
i have fixed the inconsistencies that i found.
I have deleted line 68 - if (1 == 1), it was for testing.

Hoping for a deeper functionality review again.

Thank you.

Enxebre’s picture

Priority: Normal » Major
Enxebre’s picture

Priority: Major » Critical
Enxebre’s picture

Any body for review or rtbc

Thank you

sylvain lecoy’s picture

Status: Needs review » Reviewed & tested by the community

Manual review:

- In general I don't like the use of _ (underscore) in urls. You make use of it in your admin paths. But this is just my point of view.
- There is some coding practises which are a bit wierd, such as l.90, l.151 of social_media.module. You are casting a value to an integer, and check if its equals to 1. Why just not using a boolean instead ?
- The README file is very nice, however notice that you pointed your URL to http://drupal.org/user/, instead of your own user ID.
- There is a temporary file to clean up in your social_media_ui: social_media_ui.info~.
- In social_media_gplusone, l.36, you can use drupal_add_js() instead of.

Although you should fixe these issues, I think I can RTBC you.

sylvain lecoy’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, actually you should really fixe these issues. I put it as need work because there is not so much to do.

Enxebre’s picture

Status: Needs work » Needs review

Hi Sylvain Lecoy!
I am agree with you at all.

I have changed somethings to achieve a cleaner code.
I have added my user id.

The most important thing: I have changed the render functions for render elements achieving this way the relevant powerful of theme functions.

As soon as possible, I change "_" for "-" in url and i will try to attach the js in other way, like #attached in the render element or drupal_add_js.

I will be grateful, if you or anybody can change my status to RTBC.

Thank you very much for your time

Enxebre’s picture

I have updated the module. Now, js is attached in a cleaner way directly in the render element.

Enxebre’s picture

I have made some important changes:

- There is no more hook_social_media_process_element or gplusone example module.

- Instead of that, there is a new hook_social_media_info where you can declare every social plugins that you want putting the code provided by the service (google, facebook...). you can see an example in social_module.api

- Function social_media_constructor is called by social_media_preprocess_social_media_container

- In function social_media_constructor an array containing the social buttons render elements is created.

- You can modify from a custom module the construction of the array render elements through hook_social_media_constructor_alter.

With this changes and render elements the module achieve much more flexibility.

Waiting for review and rtbc.

Thank you.

thursday_bw’s picture

Status: Needs review » Needs work

README.txt
1. Has a lot of trailing whitespaces on lines of text.

social_media.module

2. The $output variable in function social_media_help should perhaps be rendered via a themeable template
3. Throughout this project there is inconsistent user of single quotes and double quotes. Which can look a little untidy in some cases. In most situations it is preferred to use single quotes when no variable substitution is required and there is limited escaping required.
example:
social_media.module:242: $extra[$entity_type][$bundle_name]["display"]['social_buttons'] = array(
try
social_media.module:242: $extra[$entity_type][$bundle_name]['display']['social_buttons'] = array(

It looks especially odd when single and double quotes are used together when accessing a specific element of a multidimensional associative array.

4. In function social_media_preprocess_social_media_container you have a superfluous ; on
$variables['element']['social_buttons'] = social_media_constructor($variables);;
not a biggie

modules/social_media_ui/social_media_ui.install
5. in function social_media_ui_install
What is the reasoning behind doing variable_initialize(array("social_media_ui_buttons")); and not using it's return value?
Please add an in-line comment to explain this?

modules/social_media_ui/social_media_ui.info
6. Please consider adding a configure parameter to the info file for your social_media_ui.

With the above issues attended to, as far as I can tell, apart from coding standards issues, of which there are a few, this module is looking pretty good now.

Enxebre’s picture

Status: Needs work » Needs review

Hi bevanw!

- Help is more specific now.

- Trailing whitespaces and coding standards issues fixed.

- Sorry for the inconsistent with the quotes. It is already fixed for all files.

- There is no reason for variable_initialize, and old use I suppose. I have deleted it.

- Both .info have a configure parameter now.

Thank you for your time!

waiting for your reply.

Enxebre’s picture

New update adding hook suggestions for theme_social_media_container and theme_social_media_button

Enxebre’s picture

Anybody for review?

Thank you

misc’s picture

There are a lot of applications waiting, if you you would like to speed up your process, please take part in the review bonus program: http://drupal.org/node/1410826

Enxebre’s picture

Ok. I will take a look!

Thank you

Enxebre’s picture

Issue summary: View changes

git corrections

Enxebre’s picture

Issue tags: +PAreview: review bonus

adding PAReview: review bonus tag

Enxebre’s picture

Issue summary: View changes

adding Reviews of other projects

Enxebre’s picture

Issue summary: View changes

updating description

klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)

As already said there are numerous modules that do very similar things:
http://drupal.org/project/sharethis
http://drupal.org/project/service_links
http://drupal.org/project/addthis

Module duplication is a huge problem on drupal.org and we prefer collaboration over competition. Please take a look at these 3 modules, I think you could easily develop your improvements for one of them. I guess there are even more similar modules out there that I have not found right now.

Get in contact with the maintainer of the module that you prefer. If that fails for whatever reason and you absolutely have to create yet another social media module, then please add a comparison to each of the existing projects to your project page. That will ease the module selection process for site builders. Of course they would not have to choose if you just incorporate your stuff into one existing module ;-) If you have to do that set this issue back to "needs review".

Enxebre’s picture

Hi klausi!

I made the comparison time ago to draw the next conclusion (It is in Readme.txt module):

Similar modules and main points:

Social media module provides a different approach to the problem
from other similar modules like sharethis, service-link or
social-share because it works with entities and bundles.

You can add buttons to every existing entity or bundle like node types, user,
comments, etc. and it dynamically offers you the possibility to add buttons
to new entities you create.

In social media module you can configure each button visibility
independently for every views mode you create, not only
Full or teaser (display suite module integration) for every existing bundle.

You are not limited to any module, service, API or button list.

You can add new buttons in any moment without dependence of the module or
any service in a very easy way through UI or developing a simple module
invoking hook_social_media_info() and making use of
hook_social_media_contructor_alter.

Each button is a render element achieving this way the relevant powerful
of theme functions ("theme_social_media_buttons()" and "theme_social_button()") and hook_suggestions.

This properties make a very scalable and flexible module of Social media
module that allows possible future rules or ctools integrations in a
easy way.

Anyway, this is not a competitive module. it only provides another approach
to the problem focused in the advantages of working with D7 entities.

As you say, may be this wasn´t enough to create a new contrib module becouse of Module duplication problem so I´ll try to contact with some maintainer to see the viability of an integration :-)

Thank you very much for your time!!

Enxebre’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)
Enxebre’s picture

Issue summary: View changes

updating description