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
| Comment | File | Size | Author |
|---|---|---|---|
| sorting_buttons.png | 159.3 KB | Enxebre | |
| list_buttons.png | 148.78 KB | Enxebre | |
| admin_page.png | 164.07 KB | Enxebre | |
| edit_button.png | 166.13 KB | Enxebre |
Comments
Comment #1
JupiterIII commentedNeeds 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
Comment #2
Enxebre commentedOks, i'm working in it from now.
thank you.
Comment #3
Enxebre commentedOk, I've finished with them.
I hope hear from you soon.
Thanks!!
Comment #4
JupiterIII commentedhttp://ventral.org/pareview/httpgitdrupalorgsandboxenxebre1431492git
These have been fixed?
Comment #5
Enxebre commentedSorry, 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.
Comment #6
Enxebre commentedChecked, errors have been fixed.
Waiting for new review.
Thank you.
Comment #7
ankitchauhan commentedwhy we need this module? While we already have better than yours. Did you do something different?
check this one..
http://drupal.org/project/sharethis
Comment #8
Enxebre commentedI 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.
Comment #9
Enxebre commentedAnybody for review?
Thank you
Comment #10
bart.hanssens commentedYou 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)
Comment #11
bart.hanssens commentedAlso, 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());?Comment #12
bart.hanssens commentedComment #12.0
Enxebre commentedsummary corrections
Comment #12.1
Enxebre commentedsummary corrections
Comment #12.2
Enxebre commentedcorrections
Comment #13
Enxebre commentedOk.
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...
Comment #14
Enxebre commentedAnybody for review?
Thank you.
Comment #15
patrickd commentedPlease 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.
Comment #16
soncco commentedThis is quiet useful module.
There are still issues in codestyle, see here: http://ventral.org/pareview/httpgitdrupalorgsandboxenxebre1431492git-7x-1x
please fix them.
Comment #17
patrickd commentedthese are just minor issues, not worth blocking deeper reviews
Comment #18
Enxebre commentedComment #19
scot.hubbard commentedHi 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:
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.
Comment #20
Enxebre commentedHi 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
Comment #21
jlopez commentedHi 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.
Comment #22
Enxebre commentedHi 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.
Comment #23
Enxebre commentedComment #24
Enxebre commentedComment #25
Enxebre commentedAny body for review or rtbc
Thank you
Comment #26
sylvain lecoy commentedManual 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.
Comment #27
sylvain lecoy commentedSorry, actually you should really fixe these issues. I put it as need work because there is not so much to do.
Comment #28
Enxebre commentedHi 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
Comment #29
Enxebre commentedI have updated the module. Now, js is attached in a cleaner way directly in the render element.
Comment #30
Enxebre commentedI 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.
Comment #31
thursday_bw commentedREADME.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.
Comment #32
Enxebre commentedHi 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.
Comment #33
Enxebre commentedNew update adding hook suggestions for theme_social_media_container and theme_social_media_button
Comment #34
Enxebre commentedAnybody for review?
Thank you
Comment #35
misc commentedThere 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
Comment #36
Enxebre commentedOk. I will take a look!
Thank you
Comment #36.0
Enxebre commentedgit corrections
Comment #37
Enxebre commentedadding PAReview: review bonus tag
Comment #37.0
Enxebre commentedadding Reviews of other projects
Comment #37.1
Enxebre commentedupdating description
Comment #38
klausiAs 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".
Comment #39
Enxebre commentedHi 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!!
Comment #40
Enxebre commentedComment #40.0
Enxebre commentedupdating description