View Full Version : How to force comments to be all gallery or all image
jfriend
Jul-15-2009, 03:16 PM
Comments give the user a choice of leaving a gallery comment or an image comment. Most users probably don't actually pay any attention to that setting.
Some people want to force comments to be either all gallery comments or all image comments. You can do either of those by first adding this CSS to hide the comment type chooser:
#galleryCommentRating .title, #commentType {display:none;}
Then, to force all comments to be image comments, insert this script in your bottom javascript:
// change default comment to photo
YE.onAvailable("commentType", function() {this.selectedIndex = 1;});
To force all comments to be gallery comments, use this script instead:
// change default comment to gallery
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
If you don't insert the CSS to hide the selection box, then this will just change the default comment type and the user can still override it with their own selection.
If you only want this change to apply to one particular gallery, then you can implement this form of script where you just need to insert your own gallery ID (in place of the numbers in red):
// change default comment to gallery
if (YD.hasClass(document.body, "gallery_1234567"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
}
And the CSS can be made gallery specific like this (where you again put your own gallery number in):
.gallery_1234567 #galleryCommentRating .gallery_1234567 .title, #commentType {display:none;}
If you want to hide the rating too so all the user can do is enter the comment, you would use this CSS instead:
.gallery_1234567 #galleryCommentRating {display:none;}
Andrew Gould
Aug-15-2009, 06:13 AM
It was with John Friend's help in this forum that I was able to set my guestbook gallery to gallery comments only.
This was important because if comments were made with "this photo" selected from the drop down menu, I would lose these on changing the guestbook gallery portrait of myself in the future.
What I'm trying to do now is to do the opposite with my "daily image photoblog" gallery. Here then, I want comments to be photo only. (Links to this gallerey and to my guestbook can be found in the navbar of my site.)
This is extremely important to me as I'm starting to get comments on photos in the daily image photoblog gallery from non Smugmug photographers who are not aware of the entire gallery versus photo only comment system, and have left the comment on "entire gallery", and then written specifically on a photo. This comment then appears below every photo in the gallery and makes no sense. I need, then, for visitors to have no choice in the matter.
I've returned to John's instructions on how to make comments gallery or photo ones only here
http://www.dgrin.com/showthread.php?p=1160497
and have tried to accomplish the above aim of keeping the guestbook gallery to gallery comments only, while having the daily image gallery set to photo comments only.
What has happened is that I end up with the daily image photoblog gallery forced to gallery comments only, just like the guestbook gallery.
This seems to be because the code for the bottom jarva script box is not gallery specific.
I already had the following in place to modify my guestbook gallery (taken from the above thread):
// change default comment to gallery
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
It's obvious, then, that I can't just put the above again with the word "photo" instead of "gallery" for the daily image gallery, as there is no reference for it to apply to a single gallery.
I'm hoping there's another solution for what I want, and would appreciate help with this.
Thanks,
Andrew.
jfriend
Aug-16-2009, 06:34 AM
It was with John Friend's help in this forum that I was able to set my guestbook gallery to gallery comments only.
This was important because if comments were made with "this photo" selected from the drop down menu, I would lose these on changing the guestbook gallery portrait of myself in the future.
What I'm trying to do now is to do the opposite with my "daily image photoblog" gallery. Here then, I want comments to be photo only. (Links to this gallerey and to my guestbook can be found in the navbar of my site.)
This is extremely important to me as I'm starting to get comments on photos in the daily image photoblog gallery from non Smugmug photographers who are not aware of the entire gallery versus photo only comment system, and have left the comment on "entire gallery", and then written specifically on a photo. This comment then appears below every photo in the gallery and makes no sense. I need, then, for visitors to have no choice in the matter.
I've returned to John's instructions on how to make comments gallery or photo ones only here
http://www.dgrin.com/showthread.php?p=1160497
and have tried to accomplish the above aim of keeping the guestbook gallery to gallery comments only, while having the daily image gallery set to photo comments only.
What has happened is that I end up with the daily image photoblog gallery forced to gallery comments only, just like the guestbook gallery.
This seems to be because the code for the bottom jarva script box is not gallery specific.
I already had the following in place to modify my guestbook gallery (taken from the above thread):
// change default comment to gallery
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
It's obvious, then, that I can't just put the above again with the word "photo" instead of "gallery" for the daily image gallery, as there is no reference for it to apply to a single gallery.
I'm hoping there's another solution for what I want, and would appreciate help with this.
Thanks,
Andrew. I ask the moderators to move your posting to this thread, since it is a question about this customization.
Can you help me understand exactly what you want? Do you want all galleries except one to default to gallery comments and you want that one gallery to default to image comments?
Or so you want one gallery to default to image comments and one gallery to default to gallery comments and the rest can just be what they would normally be?
Did you try the second half of the instructions which tell you how to change the comment for only one particular gallery? You can have multiple copies of that code with different gallery numbers in it to affect different galleries differently.
Andrew Gould
Aug-17-2009, 08:26 PM
I ask the moderators to move your posting to this thread, since it is a question about this customization.
Can you help me understand exactly what you want? Do you want all galleries except one to default to gallery comments and you want that one gallery to default to image comments?
Or so you want one gallery to default to image comments and one gallery to default to gallery comments and the rest can just be what they would normally be?
Did you try the second half of the instructions which tell you how to change the comment for only one particular gallery? You can have multiple copies of that code with different gallery numbers in it to affect different galleries differently.
Thank you, John.
I think I need to explain more clearly, then.
Refering to the galleries that can be accessed from the links in my navbar, I want :
-- "guestbook, contact & links" to default to gallery comments only with no star rating showing.
-- "daily image photoblog" to default to photo comments only with star rating availiabe.
-- "galleries" (these are all my general photo galleries) to NOT be affected at all by default settings for guestbook. I have gallery customization set for these at the moment so that no comment is possible at all, but want the option to change this in the future. I therefore want these galleries to be independent in their settings.
IMPORTANT NOTE:
I had the "guestbook, contact and links" gallery with default as indicated above, and it seemed to be working perfectly. Problem now though is guestbook gallery shows the star rating when "Add Comment" is clicked on.
I need to fix this up before proceeding further.
Here is what is in my CSS for that gallery:
.gallery_9058360 #galleryCommentRating {display:none;}
.gallery_9058360 #comments .boxTop .boxNote {display:none;}
.gallery_9058360 #breadCrumbTrail {display:none;}
.gallery_9058360 #slideshowButton, .gallery_9058360 .pageNav {display:none;}
I cannot see why the star rating shows because the second item above should prevent it.
This is in my bottom jarvascript box, too:
// change default comment to gallery
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
But maybe I should have this:
// change default comment to gallery
if (YD.hasClass(document.body, "gallery_9058360"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
}
Plus this for the daily image photoblog gallery to change the default to photo:
// change default comment to photo
if (YD.hasClass(document.body, "gallery_8620178"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
}
As I have everything perfect for my site right now, except for what I've mentioned above, I'm scared to make any more changes until I've confirmed that this is the right way to go.
Thanks,
Andrew.
Andrew Gould
Aug-28-2009, 10:30 PM
Thank you, John.
I think I need to explain more clearly, then.
Refering to the galleries that can be accessed from the links in my navbar, I want :
-- "guestbook, contact & links" to default to gallery comments only with no star rating showing.
-- "daily image photoblog" to default to photo comments only with star rating availiabe.
-- "galleries" (these are all my general photo galleries) to NOT be affected at all by default settings for guestbook. I have gallery customization set for these at the moment so that no comment is possible at all, but want the option to change this in the future. I therefore want these galleries to be independent in their settings.
IMPORTANT NOTE:
I had the "guestbook, contact and links" gallery with default as indicated above, and it seemed to be working perfectly. Problem now though is guestbook gallery shows the star rating when "Add Comment" is clicked on.
I need to fix this up before proceeding further.
Here is what is in my CSS for that gallery:
.gallery_9058360 #galleryCommentRating {display:none;}
.gallery_9058360 #comments .boxTop .boxNote {display:none;}
.gallery_9058360 #breadCrumbTrail {display:none;}
.gallery_9058360 #slideshowButton, .gallery_9058360 .pageNav {display:none;}
I cannot see why the star rating shows because the second item above should prevent it.
This is in my bottom jarvascript box, too:
// change default comment to gallery
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
But maybe I should have this:
// change default comment to gallery
if (YD.hasClass(document.body, "gallery_9058360"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
}
Plus this for the daily image photoblog gallery to change the default to photo:
// change default comment to photo
if (YD.hasClass(document.body, "gallery_8620178"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
}
As I have everything perfect for my site right now, except for what I've mentioned above, I'm scared to make any more changes until I've confirmed that this is the right way to go.
Thanks,
Andrew.
I should clarify further that my "guestbook, gallery & links" gallery IS defaulting to gallery comments only, but it is still possible to give a star rating, and I don't want this at all.
I have now gone ahead and tried what I said above I was afraid to try, but I cannot get what I want there, or in my "daily image photoblog" gallery, where I need it to be forced to image comments only.
The problem with the "daily image photoblog" gallery is really huge for me, as I'm receiving quite a few comments from photobloggers outside of Smugmug, where they are not noticing the gallery/photo comment choice, and are setting it to gallery comment, then specifically commenting on a single photo. This comment then appears, of course, below every photo in the gallery, and makes no sense at all. I've had to delete some of these valuable comments, and you can imagine how bad that feels.
I am currently attempting to divert traffic from my old photoblog on the Internet to this photoblog gallery on my SmugMug site. This is of vital importance to me, but due to the above problem, I cannot get on with it.
Can anyone help me work out what I have to do to fix this, then?
Thanks,
Andrew.
jfriend
Aug-29-2009, 07:17 AM
I should clarify further that my "guestbook, gallery & links" gallery IS defaulting to gallery comments only, but it is still possible to give a star rating, and I don't want this at all.
I have now gone ahead and tried what I said above I was afraid to try, but I cannot get what I want there, or in my "daily image photoblog" gallery, where I need it to be forced to image comments only.
The problem with the "daily image photoblog" gallery is really huge for me, as I'm receiving quite a few comments from photobloggers outside of Smugmug, where they are not noticing the gallery/photo comment choice, and are setting it to gallery comment, then specifically commenting on a single photo. This comment then appears, of course, below every photo in the gallery, and makes no sense at all. I've had to delete some of these valuable comments, and you can imagine how bad that feels.
I am currently attempting to divert traffic from my old photoblog on the Internet to this photoblog gallery on my SmugMug site. This is of vital importance to me, but due to the above problem, I cannot get on with it.
Can anyone help me work out what I have to do to fix this, then?
Thanks,
Andrew. If you're talking about your Daily Image 2009 gallery, then it doesn't look like you have the gallery ID correct. To hide the comment rating and type, you would use this:
.gallery_8620178 #galleryCommentRating {display:none;}
If you're asking about some other gallery, please include a link to that specific gallery.
Andrew Gould
Aug-29-2009, 12:56 PM
If you're talking about your Daily Image 2009 gallery, then it doesn't look like you have the gallery ID correct. To hide the comment rating and type, you would use this:
.gallery_8620178 #galleryCommentRating {display:none;}
If you're asking about some other gallery, please include a link to that specific gallery.
Thanks for the reply, John, but I can see that that is the correct gallery ID.
I'm now confused. Does this piece of code above --
.gallery_8620178 #galleryCommentRating {display:none;}
-- prevent the star rating from appearing?
If so, that's what I need in my "guestbook, contact & links" gallery.
To sum up about that gallery, that's all I want to do now: stop the star rating from appearing.
In the "daily image photoblog" gallery I want comment type forced to photo. No other change to be made.
Thanks,
Andrew.
jfriend
Aug-29-2009, 01:10 PM
Thanks for the reply, John, but I can see that that is the correct gallery ID.
I'm now confused. Does this piece of code above --
.gallery_8620178 #galleryCommentRating {display:none;}
-- prevent the star rating from appearing?
If so, that's what I need in my "guestbook, contact & links" gallery.
To sum up about that gallery, that's all I want to do now: stop the star rating from appearing.
In the "daily image photoblog" gallery I want comment type forced to photo. No other change to be made.
Thanks,
Andrew. I really don't know what you need help with. I see no rating drop-down in your contacts & links gallery here (http://www.andrewgouldphotography.com/gallery/9058360_VetrC). The text for "stars" cannot be independently hidden without writing some custom javascript code because it isn't independently styled so there's no way to target it directly with a CSS rule.
Also, when you say "default to photo comments only" do you mean that it starts out set to Photo, but the user can change it? Or do you mean that it's forced to "photo comments" and the user cannot change it? There's a difference. In both, we set it initially with javascript. To prevent the user from changing it, we also hide it.
There is code elsewhere in this thread for forcing the comment setting for a particular gallery, but I don't see that you've implemented that code anywhere. Are you having trouble with it? Or where did you put it? Or have you just not done it?
If you still want help with something, please supply a direct link to the gallery and a specific description for what you want to change. With all the confusion, I would suggest you pick one gallery at a time and do that to your satisfaction before moving to other galleries.
Andrew Gould
Aug-29-2009, 01:39 PM
I really don't know what you need help with. I see no rating drop-down in your contacts & links gallery here (http://www.andrewgouldphotography.com/gallery/9058360_VetrC). The text for "stars" cannot be independently hidden without writing some custom javascript code because it isn't independently styled so there's no way to target it directly with a CSS rule.
Also, when you say "default to photo comments only" do you mean that it starts out set to Photo, but the user can change it? Or do you mean that it's forced to "photo comments" and the user cannot change it? There's a difference. In both, we set it initially with javascript. To prevent the user from changing it, we also hide it.
There is code elsewhere in this thread for forcing the comment setting for a particular gallery, but I don't see that you've implemented that code anywhere. Are you having trouble with it? Or where did you put it? Or have you just not done it?
If you still want help with something, please supply a direct link to the gallery and a specific description for what you want to change. With all the confusion, I would suggest you pick one gallery at a time and do that to your satisfaction before moving to other galleries.
Hi again John.
Interesting that you don't see the star raing drop down box in my guestbook. Logged OUT, I see it in Firefox, IE and Safari.
It turns out, though, that this does not matter.
I was fooled because on seeing the star rating system appear, I presumed that a commenter could rate. (Seems logical, does it not?)
I have just made two test comment. In these, I rated with 5 stars, then 2. The stars don't show in the comments, but when I log back in again, and go to my stats, the stars appear.
This is not a problem then, so sorry for asking about it.
Only problem now:
My daily image photoblog gallery:
http://www.andrewgouldphotography.com/gallery/8620178_YAJJ9#633264712_acpFu
What I meant was that I want the commenter to have absolutely NO choice at all. They should only be able to make a comment on individual photos, and NOT on the gallery.
I DO want them to be able to give a star rating here, so no change to that.
You asked if I've tried to implement code for this. Answer is yes, but now I'm just so confused...
Thanks!
jfriend
Aug-29-2009, 01:55 PM
Hi again John.
Interesting that you don't see the star raing drop down box in my guestbook. Logged OUT, I see it in Firefox, IE and Safari.
It turns out, though, that this does not matter.
I was fooled because on seeing the star rating system appear, I presumed that a commenter could rate. (Seems logical, does it not?)
I have just made two test comment. In these, I rated with 5 stars, then 2. The stars don't show in the comments, but when I log back in again, and go to my stats, the stars appear.
This is not a problem then, so sorry for asking about it.
Only problem now:
My daily image photoblog gallery:
http://www.andrewgouldphotography.com/gallery/8620178_YAJJ9#633264712_acpFu
What I meant was that I want the commenter to have absolutely NO choice at all. They should only be able to make a comment on individual photos, and NOT on the gallery.
I DO want them to be able to give a star rating here, so no change to that.
Thanks!
OK, you can change the initial setting of the comment type for the photoblog gallery with this in your bottom javascript:
// change comment type to "This Photo" for daily photo blog gallery
if (YD.hasClass(document.body, "gallery_8620178"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 1;});
}
And, then add this CSS to hide the rating type so it can't be changed:
.gallery_8620178 #galleryCommentRating .title, .gallery_8620178 #commentType {display:none;}
Andrew Gould
Aug-29-2009, 03:14 PM
OK, you can change the initial setting of the comment type for the photoblog gallery with this in your bottom javascript:
// change comment type to "This Photo" for daily photo blog gallery
if (YD.hasClass(document.body, "gallery_8620178"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 1;});
}
And, then add this CSS to hide the rating type so it can't be changed:
.gallery_8620178 #galleryCommentRating .title, .gallery_8620178 #commentType {display:none;}
I've followed your instructions, John, and it works.
One very last thing concering the above daily image photoblog gallery.
I know I said I wanted the star rating to still show in this gallery. Even so, I have added this to the CSS to experiment for any future desire for the star rating NOT to show:
.gallery_8620178 #comments .boxTop .boxNote {display:none;}
It works.
Following on from this --
You said that there is no piece of CSS code to actually stop the drop down star rating box from appearing when a commenter clicks to comment.
Although the system is good enough as it is, I wish there was a way to hide this drop down star rating box. This is because I believe it may be confusing for the commenter who has consciously given a star rating, and then wonders why it hasn't appeared after their comment has been made.
I know most people won't even look back at the stars they've given after commenting, but having the ability to totally hide the drop down box would make it perfect.
Just a though, then, and if it's really not possible, I'll have to accept that.
Many thanks for helping get things to be workable for what I want.
Andrew.
jfriend
Aug-29-2009, 03:21 PM
I've followed your instructions, John, and it works.
One very last thing concering the above daily image photoblog gallery.
I know I said I wanted the star rating to still show in this gallery. Even so, I have added this to the CSS to experiment for any future desire for the star rating NOT to show:
.gallery_8620178 #comments .boxTop .boxNote {display:none;}
It works.
Following on from this --
You said that there is no piece of CSS code to actually stop the drop down star rating box from appearing when a commenter clicks to comment.
Although the system is good enough as it is, I wish there was a way to hide this drop down star rating box. This is because I believe it may be confusing for the commenter who has consciously given a star rating, and then wonders why it hasn't appeared after their comment has been made.
I know most people won't even look back at the stars they've given after commenting, but having the ability to totally hide the drop down box would make it perfect.
Just a though, then, and if it's really not possible, I'll have to accept that.
Many thanks for helping get things to be workable for what I want.
Andrew. If you want to hide both the comment type and the ability to specify a rating, that is easy by hiding the comment parent object:
.gallery_8620178 #galleryCommentRating {display:none;}
What cannot easily be hidden all by itself in the Add Comment UI is just the rating.
Andrew Gould
Aug-29-2009, 04:49 PM
If you want to hide both the comment type and the ability to specify a rating, that is easy by hiding the comment parent object:
.gallery_8620178 #galleryCommentRating {display:none;}
What cannot easily be hidden all by itself in the Add Comment UI is just the rating.
Thanks John.
Just tried with that code above, and it works. This is even better, as I've decided I would like to have no star rating showing for commenters and no comment type choice.
I am now attempting to do the same with the guestbook gallery.
I mean the same in the sense that I want no star rating choice visible to commenters and no comment type choice, but the comment type MUST still appear as a gallery comment.
So then, the only difference should be that in the photblog gallery, comments are photo only, and in the guestbook gallery, comments are gallery only.
I tried to do this with the guestbook gallery like this:
Removed from CSS:
.gallery_9058360 #galleryCommentRating {display:none;}
.gallery_9058360 #comments .boxTop .boxNote {display:none;}
Added instead:
.gallery_9058360 #galleryCommentRating {display:none;}
but it didn't work. The star rating choice still shows for a commenter. Where am I going wrong?
Thanks,
Andrew.
Andrew Gould
Aug-29-2009, 05:04 PM
Thanks John.
Just tried with that code above, and it works. This is even better, as I've decided I would like to have no star rating showing for commenters and no comment type choice.
I am now attempting to do the same with the guestbook gallery.
I mean the same in the sense that I want no star rating choice visible to commenters and no comment type choice, but the comment type MUST still appear as a gallery comment.
So then, the only difference should be that in the photblog gallery, comments are photo only, and in the guestbook gallery, comments are gallery only.
I tried to do this with the guestbook gallery like this:
Removed from CSS:
.gallery_9058360 #galleryCommentRating {display:none;}
.gallery_9058360 #comments .boxTop .boxNote {display:none;}
Added instead:
.gallery_9058360 #galleryCommentRating {display:none;}
but it didn't work. The star rating choice still shows for a commenter. Where am I going wrong?
Thanks,
Andrew.
NO! I see I've made a mistake!
I've removed and replaced the same thing with one of those pieces of code.
Still don't know what to do, though.
Is this getting to be too complicated?
In that case, -- the bottom line -- a summary:
Followed your last instructions. They worked: Photoblog gallery now is: no comment type choice available. Comment shows as a photo comment only. Star rating drop down box does not show. Great!
Want same for guestbook gallery, but comment type must continue to show as gallery only.
UPDATE to the above:
I previously wrote this:
I tried to do this with the guestbook gallery like this:
Removed from CSS:
.gallery_9058360 #galleryCommentRating {display:none;}
.gallery_9058360 #comments .boxTop .boxNote {display:none;}
Added instead:
.gallery_9058360 #galleryCommentRating {display:none;}
but it didn't work. The star rating choice still shows for a commenter. Where am I going wrong?
BUT...
I now see my mistake. REMOVING the code is wrong. That made the stars visible again. LEAVING my code PLUS adding what you recommended makes the daily image photoblog gallery be the way I want it (no star rating visible for commenters, all comments to be photo comments.)
Sorry about all the complications, but I'm thinking my way through this. I will now try same approach to the guestbook gallery, and will come back here to say whether it works or not...
jfriend
Aug-29-2009, 05:26 PM
NO! I see I've made a mistake!
I've removed and replaced the same thing with one of those pieces of code.
Still don't know what to do, though.
Is this getting to be too complicated?
In that case, -- the bottom line -- a summary:
Followed your last instructions. They worked: Photoblog gallery now is: no comment type choice available. Comment shows as a photo comment only. Star rating drop down box does not show. Great!
Want same for gustbook gallery, but comment type must continue to show as gallery only. I have no idea what the first three sentences in your post mean. If you need something from me for that, please clarify.
So, in the guestbook gallery, do you want rating type locked to gallery and thus ratings hidden so they don't see that?
If so you have a poorly designed script that is changing "gallery" to "guestbook", even in the classnames of the various objects that are not text or titles. I'll take a look at that script in a bit. That's why your existing CSS isn't working.
Andrew Gould
Aug-29-2009, 05:29 PM
I have no idea what the first three sentences in your post mean. If you need something from me for that, please clarify.
So, in the guestbook gallery, do you want rating type locked to gallery and thus ratings hidden so they don't see that?
If so you have a poorly designed script that is changing "gallery" to "guestbook", even in the classnames of the various objects that are not text or titles. I'll take a look at that script in a bit. That's why your existing CSS isn't working.
Sorry John!
I must have updated my last post to this thread while you were writing this.
jfriend
Aug-29-2009, 05:30 PM
Sorry John!
I must have updated my last post to this thread while you were writing this.Please note that the same CSS will not work in the guestbook gallery until we fix you bad script that is changing the classnames.
Andrew Gould
Aug-29-2009, 05:44 PM
Please note that the same CSS will not work in the guestbook gallery until we fix you bad script that is changing the classnames.
John...
Above, you wrote:
So, in the guestbook gallery, do you want rating type locked to gallery and thus ratings hidden so they don't see that?
Yes, I do!
If you can help me solve this, I'll try not to ask any more on the topic! And, if i do have to, I'll try to give simple, step by step information on the problem.
Thanks.
(All is well in the photoblog gallery now.)
jfriend
Aug-29-2009, 06:01 PM
John...
Above, you wrote:
So, in the guestbook gallery, do you want rating type locked to gallery and thus ratings hidden so they don't see that?
Yes, I do!
If you can help me solve this, I'll try not to ask any more on the topic! And, if i do have to, I'll try to give simple, step by step information on the problem.
Thanks.
(All is well in the photoblog gallery now.)
In your bottom javascript, replace the ModifyText function with this version:
function ModifyText ()
{
if (YD.hasClass(document.body, "gallery_9058360"))
{
var objElement = YD.get("comment")
if (objElement != null)
{
var str = new String(objElement.innerHTML);
str = str.replace(/Gallery Comments/, 'Guestbook Comments');
objElement.innerHTML = str;
}
}
}
YE.onAvailable("comment", ModifyText);
Then right below that function in your bottom javascript, remove the text:
Code:
that is sitting on a line all by itself.
Andrew Gould
Aug-29-2009, 06:13 PM
In your bottom javascript, replace the ModifyText function with this version:
function ModifyText ()
{
if (YD.hasClass(document.body, "gallery_9058360"))
{
var objElement = YD.get("comment")
if (objElement != null)
{
var str = new String(objElement.innerHTML);
str = str.replace(/Gallery Comments/, 'Guestbook Comments');
objElement.innerHTML = str;
}
}
}
YE.onAvailable("comment", ModifyText);
Then right below that function in your bottom javascript, remove the text:
Code:
that is sitting on a line all by itself.
Hi again...
I did the above, updated, and it worked perfectly.
Now the guestbook does not show the star rating to a commenter, and the comment type is only gallery.
Thank you so much!
Allen
Aug-31-2009, 08:37 AM
In your bottom javascript, replace the ModifyText function with this version:
function ModifyText ()
{
if (YD.hasClass(document.body, "gallery_9058360"))
{
var objElement = YD.get("comment")
if (objElement != null)
{
var str = new String(objElement.innerHTML);
str = str.replace(/Gallery Comments/, 'Guestbook Comments');
objElement.innerHTML = str;
}
}
}
YE.onAvailable("comment", ModifyText);
Then right below that function in your bottom javascript, remove the text:
Code:
that is sitting on a line all by itself.
John, should I update the js on this page (http://allen-steve.smugmug.com/gallery/3819841)?
Only difference I see is this.
str = str.replace(/\gallery/gi, 'guestbook');
vs
str = str.replace(/Gallery Comments/, 'Guestbook Comments');
jfriend
Aug-31-2009, 08:38 AM
John, should I update the js on this page (http://allen-steve.smugmug.com/gallery/3819841)?
Only difference I see is this.
str = str.replace(/\gallery/gi, 'guestbook');
vs
str = str.replace(/Gallery Comments/, 'Guestbook Comments'); Yes, that would be a good idea.
Allen
Aug-31-2009, 08:49 AM
Yes, that would be a good idea.
Thanks, done.:thumb
Art Scott
Jan-31-2011, 09:50 AM
I have not written any code in over 12 yrs or so and I have absolutely no idea about writing css, java or any other code...so with that out of the way....I admit I am more than just ignorant or stupid of this..........
I cut this from JFriends page:
Some people want to force comments to be either all gallery comments or all image comments. You can do either of those by first adding this CSS to hide the comment type chooser:
#galleryCommentRating .title, #commentType {display:none;}
Then, to force all comments to be image comments, insert this script in your bottom javascript:
Code:
// change default comment to photo
YE.onAvailable("commentType", function() {this.selectedIndex = 1;});
What I need is to limit commenting to Image only to one Category (Galleries for Clients).
1- Can this be done?
If I have to do this for each gallery I currently have and for all future galleries then I need detailed explicit instructions on where to place any and all code (1,2,3, and so on.....I can follow well)
2- in the above code what do I do to make this work only for specific galleries if I have to go this way??
Think I am done revising my post now............................................... .............................................
Andy
Jan-31-2011, 09:52 AM
Is there a question here?
jfriend
Jan-31-2011, 10:03 AM
For others interested in this customization, the full instructions and the latest revision of this customization are here (http://www.dgrin.com/showthread.php?p=1160497).
Glad you got it to work Art.
Art Scott
Jan-31-2011, 10:10 AM
Is there a question here?
I posted and then immediately when into edit mode as I need to see what was happening to my post....I am not done and I have not done anything.,.......to my site...so yes Andy I have questions coming...I am going back into edit mode to try and finish up......it is a case of write and check...write and check...write and check...so I guess DGRIN needs to not show a post that is in edit mode..huh??????:D:D:wink:wink
jfriend
Jan-31-2011, 10:16 AM
I posted and then immediately when into edit mode as I need to see what was happening to my post....I am not done and I have not done anything.,.......to my site...so yes Andy I have questions coming...I am going back into edit mode to try and finish up......it is a case of write and check...write and check...write and check...so I guess DGRIN needs to not show a post that is in edit mode..huh??????:D:D:wink:winkArt, I'm asking the moderators to move this thread onto the end of the thread (http://www.dgrin.com/showthread.php?p=1160497) where the customization itself is described. That's the best place to go into all your questions and it will be best for other people interested in that customization to be able to see the answers there too. I'll look into your questions.
Art Scott
Jan-31-2011, 10:25 AM
Thanks...I will close this tab and keep the one for YOUR thread where I cut the above info from.
jfriend
Jan-31-2011, 12:08 PM
I have not written any code in over 12 yrs or so and I have absolutely no idea about writing css, java or any other code...so with that out of the way....I admit I am more than just ignorant or stupid of this..........
I cut this from JFriends page:
What I need is to limit commenting to Image only to one Category (Galleries for Clients).
1- Can this be done?
If I have to do this for each gallery I currently have and for all future galleries then I need detailed explicit instructions on where to place any and all code (1,2,3, and so on.....I can follow well)
2- in the above code what do I do to make this work only for specific galleries if I have to go this way??
Think I am done revising my post now............................................... .............................................Yes, the code can be made active for only one category. Instead of using this to affect all galleries:
// change default comment to photo
YE.onAvailable("commentType", function() {this.selectedIndex = 1;}); You would use this in your bottom javascript:
// change default comment to gallery for all galleries in this category
if (YD.hasClass(document.body, "category_GALLERIES_for_CLIENTS"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 1;});
}
and you would use this CSS to hide the ability to change the comment type in that category:
.category_GALLERIES_for_CLIENTS #galleryCommentRating {display:none;}
Art Scott
Jan-31-2011, 01:40 PM
That is great.....
Where exactly do I place this so it only effects the Category - Galleries for Clients (http://www.artscottfotografie.com/GALLERIES-for-CLIENTS) ?
jfriend
Jan-31-2011, 01:42 PM
That is great.....
Where exactly do I place this so it only effects the Category - Galleries for Clients (http://www.artscottfotografie.com/GALLERIES-for-CLIENTS) ?The CSS goes in the CSS section of the advanced customization. The script goes in the bottom javascript section of the advanced customization. Both are global locations, but they are coded to only affect galleries in that category.
Art Scott
Jan-31-2011, 02:18 PM
The CSS goes in the CSS section of the advanced customization. The script goes in the bottom javascript section of the advanced customization. Both are global locations, but they are coded to only affect galleries in that category.
OK so i just cut and paste and I am done?
jfriend
Jan-31-2011, 02:46 PM
OK so i just cut and paste and I am done?Yes, copy/paste. Just make sure you copy them into the right boxes in the advanced customization and make sure you get exactly the characters you need, no extra, no missing characters. And then, hit the Update button in the bottom of the window. Then after the page returns, verify that they were accepted and are still there. Then, it should just be in effect. If it doesn't seem to work, then post back here after you've put it in your page and we can see what isn't working.
Art Scott
Jan-31-2011, 03:23 PM
Coool
Art Scott
Jan-31-2011, 03:34 PM
Still have the option of photo or gallery..checked in FF (using Visitors View) and also IE (as the Client)
Art Scott
Jan-31-2011, 03:42 PM
Got it...took 4 times for the css to take...guess it did not like me having a space betwwen the other css for the breadcrumbs.......that is prob 1 reason I cannot seem to read css...12-15 yrs ago HTML was readable, zI did have a book referencing most of the html code ....
jfriend
Jan-31-2011, 03:43 PM
Still have the option of photo or gallery..checked in FF (using Visitors View) and also IE (as the Client)I see the customization successfully in some of your pages, but it is not active in the galleries I looked at because they are set for Appearance = Smugmug instead of Appearance = Custom (a setting in gallery options). Appearance = Smugmug means that you don't want your customizations to apply that gallery. Appearance = Custom means you do want your customizations to apply.
Art Scott
Jan-31-2011, 03:46 PM
Thanks.......head hurts..............break time........tasbs to close
Art Scott
Jan-31-2011, 04:00 PM
Oh...yes I will be going into each clients gallery and changing appearence to custom...THANX AGAIN
Cougar548
Apr-29-2011, 05:56 PM
Ok, this is something I would like to do and think I have it figured out, but wanted to check to see if I have my coding right. What I want to do is have all comments be picture specific except the guestbook is to be gallery specific. I don't want them to ever have to worry about selecting an option. So here is what I think the coding should be:
#galleryCommentRating .title, #commentType {display:none;}
// change default comment to photo
YE.onAvailable("commentType", function() {this.selectedIndex = 1;});
// change default comment to gallery
if (YD.hasClass(document.body, "Guestbook/Guestbook/16710374_cb6px2"))
{
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});
}
Is that right?
Also, what about if I want to remove the "Link" field next to the Name and Email fields? Is it the "AlbumCommentLink" field? Thanks!
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.