I am sorry to bring this up here but in the instructions it says the profile field MUST be set on private. Can it be put on hidden if i do not want to share revenue?
It seems pretty mean to have an adsense field on user profiles and not share revenue.
Please let me know. Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | README_appended.txt | 3.1 KB | zoon_unit |
Comments
Comment #1
kbahey commentedThe help in admin/settings/adsense clearly says :
Comment #2
mstef commentedOK, i just had trouble understand why hidden could be less secure than private
Comment #3
kalashari commentedIs it somehow possible for regular users NOT to have a field "Google AdSense client ID" when they go to edit their profile? It doesn't make sense for regular users to have this field if I am not using "revenue sharing".
Comment #4
darren ohYes, it's possible. We could use hook_form_alter() to hide the field based on a user's access permissions.
Comment #5
drewish commentedi think the whole revenue sharing is a nice feature but it shouldn't be the default. you should be able to use this module without going to the hassle of adding the profile field if you're not going to use revenue sharing.
Comment #6
BobLouis commentedI have just installed the module, and I agree with Drewish, Kalashari...
So, has a solution been found for regular users NOT to have a field "Google AdSense client ID" displayed when they edit their profile?
Comment #7
Petra commentedI am also interested in this solution. I am still untrained in drupal - I read the solution with more hook_form_alter () in such a way, as if I would have to change thereby profile modules.
In addition it would be useful, if thereby not only individual fields, but a profile Category for user of roles could be activated/deactivated. (I have the field "Google AdSense client ID" assigned to a category, in which there is no other field. And it would be just as unpleasant, if each user gets the category, but therein no field is indicated.)
And a solution, which is compatible to http://drupal.org/node/144599 (Different sharing percentage basing on user role) would be great.
Comment #8
BlakeLucchesi commentedHackish as it may be, it works...
In your user.module file you will have to set a conditional statement around the menu declaration (somewhere around line 818)
Now when you define your new profile field create it in its own profile category called 'adsense' if you name it something else.. it won't work. Hope this helps someone else out, it's really not a great fix because updating your site will cause it to be overwritten, but for those desperate to get it to work, this will have to do. There really isn't any other work around unless the adsense module actually creates its own menu hook and tracks user submitted codes in its own table...
regards,
Blake
Comment #9
BlakeLucchesi commentedoops. I forgot to add a condition to the if statement that checks to see if the user is the admin (user id = 1).
you can do this by substituting this line of code for the line i mentioned in the above post
Comment #10
drewish commentedblucches, you offered up a hack which is nice but it's not really the conclusive solution that would usually warrant closing an issue.
Comment #11
zoon_unit commentedHere's a workaround for this issue:
1) Set up the profile field as described in the help file ("Private field, content only available to privileged users") and enter your account number. Press save. This will store the record in the profile_values table.
2) Go back and set the field to "hidden profile field, only accessible by administrators, modules and themes" This option stores the value in a completely different table, which is why it won't work normally for Google Adsense, which is designed to retrieve the value from the profile_values table. The key HACK here is by initially setting the field up correctly and saving, you have stored the value in the proper location. When you go back and change the field type, it DOES NOT delete the original value in the profile_values table, so the Adsense module will continue to find and load the ID properly. However, the field will now be invisible to other users.
NOTE: Just keep in mind that if you need to change the ID value later, you will first need to:
1) Set the field option back to "Private field, content only available to privileged users"
2) Put in the new value and save
3) Then set the field option to "hidden profile field, only accessible by administrators, modules and themes"
You can check to make sure the Adsense module is picking up the proper value by viewing the source of a page with the ads and checking the javascript code. You should see the value of your account there.
Comment #12
darren ohIf you will add this to README.txt, I'll get it committed.
Comment #13
zoon_unit commentedHere is the new readme.txt file, renamed readme_appended.txt.
Feel free to use or change at your discretion.
Comment #14
darren ohComment #15
darren ohAdded in CVS commit 72117.
Comment #16
kbahey commentedComment #17
(not verified) commentedComment #18
vrc3 commentedI have to say, this is a very annoying "feature". Enough to make me not want to use this module. :(