webdesign-android-devlopement-news-portal-designing-india-indore-bhopal-mp

ब्लॉगर Thread कमेन्ट में reply बटन क्यों काम नहीं कर रहा..??

Posted :| Posted By: Piush Trivedi | Labels: , 4 Comments
Posted by: Piush

कुछ ही महीनो पहले ब्लॉगर टीम द्वारा नयी सुविधा " ब्लॉगर Thread Comment" को सार्वजनिक किया गया ... लगभग सभी ने इसे अपने ब्लॉग पर सक्रिय कर लिया होगा... ब्लॉगर द्वारा सुझाये गए इस कमेन्ट फॉर्म और साधारण कमेन्ट फॉर्म में कई संशोधन के साथ ही नए thread comment में कई नयी सुविधाओ को भी जोड़ा गया ॥ जिनमे एक मुख्य .....कमेन्ट का reply बटन ... जिसके द्वारा पाठको द्वारा लेख पर दी गयी प्रतिक्रिया पर अन्य पाठक भी अपने विचार सीधे reply बटन द्वारा पूर्व में टिपण्णी करता को भेज सकते है॥ जैसे ही टिपण्णी में reply बटन या प्रतिउतर बटन का इस्तेमाल कर प्रतिक्रिया भेजी जाती है ब्लॉगर द्वारा उसे स्वतः ही सम्बंधित टिपण्णीकर्ता के ईमेल पते पर अग्रेषित कर दिया जाता है...
सभी ने इसे सुविधा को अपने ब्लॉग पर सक्रिय तो कर लिया ,,, मगर बहुत से ब्लोगों पर " reply" बटन अभी भी कार्य नहीं कर रहा है॥ इसके जीवंत उदाहरण मैने बहुत से हिंदी ब्लोगों पर देखे है ॥ इसी के चलते सोचा आज इसी परेशानी के निराकरण हेतु एक पोस्ट लिखी जाये ॥ सबसे पहले ये समझे के thred comment सुविधा शुरू होने के बाद reply बटन का कार्य न करने का क्या कारण है ... इसका जवाब सिर्फ एक ही है की ब्लॉगर thred comment में thread comment हेतु प्रक्रिया तो पूर्ण कर ली गयी मगर सुविधा हो पूर्ण करने के पश्चात् ब्लॉगर द्वारा ब्लॉग टेम्पलेट में स्वतः ही एक स्क्रिप्ट को add कर लिया जाता है ॥ अतः यह जान ले की reply बटन का काम न करना का एक और सिर्फ एक कारन इस स्क्रिप्ट का छतिग्रस्त होना ही है॥ अतः आज इस लेख में यही बताया गया है की कैसे इस छतिग्रस्त स्क्रिप्ट को बदल कर ब्लॉग पर reply बटन सक्रिय किया जाये ॥
अतः reply बटन सक्रिय करने के लिए नीचे बताई प्रक्रिया अपनाये ....:)

ध्यान दे:-टेम्पलेट में कुछ भी बदलाव करने से पहले नीचे छवि में बताये अनुसार लिंक पर क्लिक कर टेम्प्लेट जरुर डाउनलोड कर ले




Step 1

  • अपने blogger dashboard पर जाए
  • यहाँ जाए Dashbord > Design > Edit HTML
  • अब ऊपर Expand Widgets चेक बॉक्स पर क्लिक करे
  • यहाँ पर <b:includable id='threaded_comment_js' var='post'> कोड तलाशे
  • इस कोड के ठीक नीचे एक स्क्रिप्ट होगी , अतः इस कोड को मय स्क्रिप्ट नीचे बताये कोड से बदले


<b:includable id='threaded_comment_js' var='post'>
<script async='async' expr:src='data:post.commentSrc' type='text/javascript'/>
<script type='text/javascript'>
(function() {
var items = <data:post.commentJso/>;
var msgs = <data:post.commentMsgs/>;
var config = <data:post.commentConfig/>;
// <![CDATA[
var cursor = null;
if (items && items.length > 0) {
cursor = parseInt(items[items.length - 1].timestamp) + 1;
}
var bodyFromEntry = function(entry) {
if (entry.gd$extendedProperty) {
for (var k in entry.gd$extendedProperty) {
if (entry.gd$extendedProperty[k].name == 'blogger.contentRemoved') {
return '<span class="deleted-comment">' + entry.content.$t + '</span>';
}
}
}
return entry.content.$t;
}
var parse = function(data) {
cursor = null;
var comments = [];
if (data && data.feed && data.feed.entry) {
for (var i = 0, entry; entry = data.feed.entry[i]; i++) {
var comment = {};
// comment ID, parsed out of the original id format
var id = /blog-(\d+).post-(\d+)/.exec(entry.id.$t);
comment.id = id ? id[2] : null;
comment.body = bodyFromEntry(entry);
comment.timestamp = Date.parse(entry.published.$t) + '';
if (entry.author && entry.author.constructor === Array) {
var auth = entry.author[0];
if (auth) {
comment.author = {
name: (auth.name ? auth.name.$t : undefined),
profileUrl: (auth.uri ? auth.uri.$t : undefined),
avatarUrl: (auth.gd$image ? auth.gd$image.src : undefined)
};
}
}
if (entry.link) {
if (entry.link[2]) {
comment.link = comment.permalink = entry.link[2].href;
}
if (entry.link[3]) {
var pid = /.*comments\/default\/(\d+)\?.*/.exec(entry.link[3].href);
if (pid && pid[1]) {
comment.parentId = pid[1];
}
}
}
comment.deleteclass = 'item-control blog-admin';
if (entry.gd$extendedProperty) {
for (var k in entry.gd$extendedProperty) {
if (entry.gd$extendedProperty[k].name == 'blogger.itemClass') {
comment.deleteclass += ' ' + entry.gd$extendedProperty[k].value;
}
}
}
comments.push(comment);
}
}
return comments;
};
var paginator = function(callback) {
if (hasMore()) {
var url = config.feed + '?alt=json&v=2&orderby=published&reverse=false&max-results=50';
if (cursor) {
url += '&published-min=' + new Date(cursor).toISOString();
}
window.bloggercomments = function(data) {
var parsed = parse(data);
cursor = parsed.length < 50 ? null
: parseInt(parsed[parsed.length - 1].timestamp) + 1
callback(parsed);
window.bloggercomments = null;
}
url += '&callback=bloggercomments';
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
document.getElementsByTagName('head')[0].appendChild(script);
}
};
var hasMore = function() {
return !!cursor;
};
var getMeta = function(key, comment) {
if ('iswriter' == key) {
var matches = !!comment.author
&& comment.author.name == config.authorName
&& comment.author.profileUrl == config.authorUrl;
return matches ? 'true' : '';
} else if ('deletelink' == key) {
return config.baseUri + '/delete-comment.g?blogID='
+ config.blogId + '&postID=' + comment.id;
} else if ('deleteclass' == key) {
return comment.deleteclass;
}
return '';
};
var replybox = null;
var replyUrlParts = null;
var replyParent = undefined;
var onReply = function(commentId, domId) {
if (replybox == null) {
// lazily cache replybox, and adjust to suit this style:
replybox = document.getElementById('comment-editor');
if (replybox != null) {
replybox.height = '250px';
replybox.style.display = 'block';
replyUrlParts = replybox.src.split('#');
}
}
if (replybox && (commentId !== replyParent)) {
document.getElementById(domId).insertBefore(replybox, null);
replybox.src = replyUrlParts[0]
+ (commentId ? '&parentID=' + commentId : '')
+ '#' + replyUrlParts[1];
replyParent = commentId;
}
};
var hash = (window.location.hash || '#').substring(1);
var startThread, targetComment;
if (/^comment-form_/.test(hash)) {
startThread = hash.substring('comment-form_'.length);
} else if (/^c[0-9]+$/.test(hash)) {
targetComment = hash.substring(1);
}
// Configure commenting API:
var configJso = {
'maxDepth': config.maxThreadDepth
};
var provider = {
'id': config.postId,
'data': items,
'loadNext': paginator,
'hasMore': hasMore,
'getMeta': getMeta,
'onReply': onReply,
'rendered': true,
'initComment': targetComment,
'initReplyThread': startThread,
'config': configJso,
'messages': msgs
};
var render = function() {
if (window.goog && window.goog.comments) {
var holder = document.getElementById('comment-holder');
window.goog.comments.render(holder, provider);
}
};
// render now, or queue to render when library loads:
if (window.goog && window.goog.comments) {
render();
} else {
window.goog = window.goog || {};
window.goog.comments = window.goog.comments || {};
window.goog.comments.loadQueue = window.goog.comments.loadQueue || [];
window.goog.comments.loadQueue.push(render);
}
})();
// ]]>
</script>
</b:includable>


अब परिवर्तन सेव करे ... आशा करता हूँ आपके ब्लॉग पर " Reply" बटन कार्य करने लगा होगा... किसी परेशानी के चलते कमेन्ट के माध्यम से संपर्क करे ...:)


Do you Like this Article?

rss twitter facebook
Get Subscribe to Free Email Updates!!
*Your email address will not be shared with anyone.

Post A Comment Blogger Disqus

4 comments:


लेख पर अपनी प्रतिक्रिया अवश्य दे..
ध्यान दे !!:-
• हिंदी में प्रतिक्रिया देने के लिए यहाँ क्लिक करे
• टिप्पणी में Html Code डाला जा सकता है
• टिप्पणी में Image डालने के लिए [im]Your Image Link [/im] कोड का उपयोग करे
• टिप्पणी में Youtube Video डालने के लिए [youtube]Youtube Video Link [/youtube] कोड का उपयोग करे
• टिप्पणी में Smiley's का उपयोग करने के लिए बताये गए कोड को डाले
• टिप्पणी प्रकाशन में कोई परेशानी है तो यहां क्लिक करें..
Regards, Hindi4Tech
:) :-) :)) =)) :( :-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

  1. बहुत ही काम की जानकारी दी है अक्‍सर ये समस्‍या रहती है जो आज आपने हल कर दी है यहा भी पधारे yunik.blogspot.com
    [im]http://www.picturesanimations.com/t/thank_you/thanks008zv.gif[/im]

    ReplyDelete
  2. ब्लोगिंग के बारे में जो आपने जानकारियां दीं हैं वो अपनी मिसाल आप हैं।जब मै पहली बार आपकी ब्लॉग पर आया तो मुझे इतनी पसंद आई की उसी वक्त मैंने आपका ब्लॉग फीड अपनी ब्लोग्स पर शुरू कर लिया,ताकि जब भी आप कोई नई पोस्ट भेजें तो उसी वक्त मुझे अपने ब्लॉग पर ही उसका ज्ञान हो जाये।और ज्वाइन भी की।आपका दिल से शुक्रिया।
    मोहब्बत नामा
    मास्टर्स टेक टिप्स

    ReplyDelete
  3. अच्छी जानकारी......हमने अपने ब्लॉग में इसे सक्रिय कर लिया है..और कोई दिक्कत फिलहाल तो नहीं है...हुई तो आपसे संपर्क करेंगे
    :-)

    अनु

    ReplyDelete