This is an addition for the Smileys module that adds an ajax form to the user profile page where each user can select a word describing their current mood and a Smiley face - can be used to display user emotions or users current mood.
Extract and add to your sites/all/modules/smileys directory. So the path will be sites/all/modules/smileys/smileys_mood. Enable the module. That's it. (Unless your domain points to a subdirectory! See below.)
TODO:
- Clean up module code a bit
- Add support for more... Smileys list
- Add support for subdirectory? (in external script)
- Add to admin section + editable array for word list
- Could use some tpl work
Potential problems: The external script has to be updated manually if your domain points to a subdirectory. Update smileys_mood/scripts/updateusermood.php - no problems if your Drupal install is in the root directory.
Code:
<?php
// Go to drupal path..
$drupal_path = $_SERVER['DOCUMENT_ROOT']; // <---- change this one to fit yours i.e. $_SERVER['DOCUMENT_ROOT'].'/subfolder';
?>
Comment | File | Size | Author |
---|---|---|---|
#19 | err.png | 158.21 KB | JohnnyW |
#14 | Capture.JPG | 15.27 KB | JohnnyW |
#11 | smileys_mood.zip | 5.68 KB | Nathaniel |
#6 | smileys_mood.tar_.gz | 5.09 KB | Nathaniel |
#5 | smileys_mood.tar_.gz | 4.33 KB | krutipatel |
Comments
Comment #1
Nathaniel CreditAttribution: Nathaniel commentedTechnical difficulties... Here is the file.
Comment #2
Gurpartap Singh CreditAttribution: Gurpartap Singh commentedooooooooohhhhhhhh you stole my idea
heheheheheh
I'm getting an error when trying to set a text or image mood:
Comment #3
Nathaniel CreditAttribution: Nathaniel commentedIt should work. The trick is in the $drupal_path
File:
smileys_mood/scripts/updateusermood.php
You can use:
print $drupal_path;
to test and see if it points to the drupal directory where the includes folder is located.
Comment #4
krutipatel CreditAttribution: krutipatel commentedHello Nathaniel,
Thanks for the module...
after changing $drupal_path
File:
smileys_mood/scripts/updateusermood.php
i m getting error like (Fatal error: Cannot redeclare db_status_report() (previously declared in D:\home\networking\includes\database.mysql.inc:20))
Comment #5
krutipatel CreditAttribution: krutipatel commentedHello,
I have modified 2 files
1. smileys_mood/scripts/updateusermood.php
2. smileys_mood/smileys_mood.module
now it is working well. you need to set path in File : smileys_mood/scripts/updateusermood.php if you are using sub-folder.
Check attached file
Comment #6
Nathaniel CreditAttribution: Nathaniel commentedMade a lot of updates / clean up. Drupal friendly now, no need to modify anything.
DONE:
TODO:
Attached is new directory with all module updates. Install in /sites/all/modules directory.
Comment #7
artatac CreditAttribution: artatac commentedat /user/1 I can select a mode but there is no save button and it defaults remains no mood
Comment #8
Nathaniel CreditAttribution: Nathaniel commentedI will take a look and run a few tests. Do you have javascript enabled? Right now this feature requires it.
Comment #9
artatac CreditAttribution: artatac commentedI have javascript ui and javascript plugin modules enabled
the demo site is at
http://venturacottage.homedns.org/619abstmp/user
webmaster
aa
Comment #10
Nathaniel CreditAttribution: Nathaniel commentedThanks for the demo site, very helpful. I am 90% sure it has something to do with subdomain / ajax issue, not sure how to fix at the moment, will do some research. Maybe install subdomain module and enable ajax callbacks as needed.
Paths:
smileys/mood/js
smileys/mood/get
OR
smileys/mood*
Comment #11
Nathaniel CreditAttribution: Nathaniel commentedCleaned up the code to better meet drupal standards.
*Fixed image path for smiley faces.
Comment #12
artatac CreditAttribution: artatac commentedI installed the revised mood module at www.venturacottage.com and can confirm it is now accepting the mood and its revisions.
I was hoping to use this as the basis of a feature in a Junior School website. The Mood would appear in a block on most pages and allow the pupil to set their mood. The only thing that works against this is that If a pupil sets their mood (after a bad test) to Sad then it will stay like that unless they alter it. For a mood to be correct does it not need to alter itself back to neutral after say 1hr so that if someone is set to sad (or happy) it reflects their current mood?
Comment #13
Nathaniel CreditAttribution: Nathaniel commentedThanks for the update. Interesting concept. This could be done by adding a timestamp field to the smileys_user_mood database table and maybe writing a script that runs during cron to update moods that are not neutral and are more than one hour old. I have no idea what the server workload would be to do this (depends on how many users are using the mood module I suppose).
Comment #14
JohnnyW CreditAttribution: JohnnyW commentedHuh, I seem to try, but when selecting from either drop down list, or image, it shows my index/ then all files in directory INDEX of /
Any suggestions?
Comment #15
JohnnyW CreditAttribution: JohnnyW commentedNo response yet? :(
Comment #16
JohnnyW CreditAttribution: JohnnyW commentedStill no response? :(
Comment #17
Nathaniel CreditAttribution: Nathaniel commentedWhat is your development environment? Have you tried it on a live site? Are you using sub domains? Can you post a link for testing? Are you using the latest from comment #11?
Comment #18
JohnnyW CreditAttribution: JohnnyW commentedThank you so much for replying...
My development environment is WAMP, Windows 7, localhost -- to migrate to Ubuntu server once running properly.
I am using Drupal 6.22, PHP 5.3.4, and Apache 2.2.17
No sub domains.
No link to testing, because its on my local server.
I am using from comment #11.
Any suggestions we be sincerely appreciated... . I did post a picture on my earlier post.
Thank you so much.
Comment #19
JohnnyW CreditAttribution: JohnnyW commentedOkay, I noticed when I saved, this comes up for a split of a second, and I captured the image with print screen... it occurs when I press save.
What permissions do you think its talking about? I am admin.
Thank you again!!!!
Comment #20
Nathaniel CreditAttribution: Nathaniel commentedRan a few tests and everything seems to be working okay. I could not reproduce the problem. I suggest trying the module on a fresh install and/or a different server.
Comment #21
shenagarg CreditAttribution: shenagarg commentedNathaniel
I used the smileys_mood module from #11. When I open my account page then for mood it shows "no mood". Then after i choose some mood then it shows "It works!" instead of "no mood" text.
I refreshed my account page to see if changes have taken place but again it showed "no mood". I tried to check the table "smileys_mood_user", and I saw that it contains no record. It is empty table. I am just wondering if it depends on some other module or some setting intially which I need to do before I get it running.
Thanks in advance. Really appreciate all the efforts put forward by people in this community.
Comment #22
Nathaniel CreditAttribution: Nathaniel commentedHrmm. Did you get it to work?
Installed and tested on fresh install of Drupal 6.22.
The only thing I can think of is that the permission "use smiley select box" is required if you are not user 1 (admin).
Comment #23
shenagarg CreditAttribution: shenagarg commentedYes I installed on fresh install of Drupal 6.22. Also, I was trying to use it as admin. Still it didn't work.
Comment #24
JohnnyW CreditAttribution: JohnnyW commentedTried Smiles in comment box, but brakes user interface for Tiny WYSIWYG module.
Had to uninstall it.