I'm aiming towards adding the Disqus comment system to my shop. I want customers to be able to comment on product pages, which means some dynamic urls have to be defined.
The main code is (cut off)
Code:
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'example'; // required: replace example with your forum shortname
// The following are highly recommended additional parameters. Remove the slashes in front to use.
// var disqus_identifier = 'unique_dynamic_id_1234';
// var disqus_url = 'http://example.com/permalink-to-page.html';
If shortname is easy (you define it when creating an account), but identifier and url is a bit more tricky. You are not required to add identifier or url (the window URL will be used if not), but it's highly recommended.
Disqus help states
"IDENTIFIER: Tells the Disqus service how to identify the current page. When the Disqus embed is loaded, the identifier is used to look up the correct thread. If disqus_identifier is undefined, the page's URL will be used. The URL can be unreliable, such as when renaming an article slug or changing domains, so we recommend using your own unique way of identifying a thread."
"URL: Tells the Disqus service the URL of the current page. If undefined, Disqus will take the window.location. This URL is used to look up or create a thread if disqus_identifier is
undefined. In addition, this URL is always saved when a thread is being created so that Disqus knows what page a thread belongs to."
I've extracted a line of php from a Facebook like button
Code:
<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>
When I try this code and uncomment the identifier and url vars, Disqus won't load (it gives an error message, that's all). Furthermore, I'm a bit confused about the difference between the two.
I'm using v.1.3.9h.
Bookmarks