Forums

Voting is inactive for both super-admin and guests

onetimedude 28 Dec, 2008
Hey there!

Great job on the comment system! I was hooked because of the reply feature which indents several levels deep. I just love that feature alone! I think it's imperative for every comment system out there to have a nice structured view of conversations and an easy way to reply to others.

JomComment (a commercial $35 component!) lacks the above feature - what a shame! End of rant.

Moving on, I'm having this weird issue, I think some script is conflicting because I cannot vote at all. When I click on thumbs up or down I get nothing back - as if the addPlus({comment_id}) and addMinus({comment_id}) functions fail to run. Being logged in as Super-Administrator or viewing the page as a guest makes no difference. My settings are: All groups can vote, guests can vote. Any ideas?


One more thing. When having "Show Comments link in Blog view" enabled, the comments link with the comment count is displayed even on descriptions of sections/categories, which I would like to disable =). How do I do that? ( I checked max's fix but was unable to find any of the code in the plugin. http://www.chronoengine.com/forums.html?cont=posts&f=17&t=11476#p16338 )


Thank you much,
onetimedude
onetimedude 29 Dec, 2008

Hi onetimedude,

try to start from this post :
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=17&t=11476#p16292

let me know!

Regards
Max



Hello Max,

Thanks for taking the time to reply. I have overwritten the php file with the one you attached, and it did include the code I was looking for:
if((JRequest::getVar('option') == 'com_newsfeeds')||(JRequest::getVar('option') == 'com_contact'))return;

Unfortunately, adding the
if(JRequest::getVar('view') == 'category')return;
only acts as the switch in the Parameters, called "Show Comments link in Blog view". In other words, you can either get the "Read <#> Comments... >>" link or you don't. It can't be shown only for articles (which is what I was trying to achieve), and not be shown in the descriptions of Categories.


Going back to my previous post, any clues on why the voting system is not working? I tried to poke around the code, but I have no solid knowledge of either php or java.
onetimedude 30 Dec, 2008
Okay, here's what happened to the voting. I used Safari's Activity window to see the JS executing in the back. I realized that the link it's trying to reach was not there.

I'm currently browsing a category "misc news", and because my sh404SEF settings are placing that section's name in the url, i get http://www.sitename.com/misc-news/news1.html as a result.

Now, when clicking the voting buttons, the javascript code present in "scripts.js", found in /components/com_chronocomments is trying to execute index2.php?option=com_chronocomments&task=rateneg&commentid=[id], which does not exist under /misc-news/, it only exists if requested from the site's main URL - http://www.sitename.com/index2.php?option=com_chronocomments&task=rateneg&commentid=[id]

I took a peak at the source code of the rendered page, and it turns out that some script or even joomla is setting the variable "siteurl" before any of the body of the page is rendered, so you can use that in the scripts.js code to correct the situation and make the voting system work again.

Therefore, here's the modification, in my case (running ChronoComments version 1.2 (Oct 2008), on a J!1.5 with sh404SEF enabled, including category name in the URL, using .htaccess):

Open /components/com_chronocomments/scripts.js and:
replace line 113
var url = "index2.php?option=com_chronocomments&task=ratepos&commentid=" + id;

with
var url = siteurl + "index2.php?option=com_chronocomments&task=ratepos&commentid=" + id;



and further down, replace line 134
var url = "index2.php?option=com_chronocomments&task=rateneg&commentid=" + id;

with
var url = siteurl + "index2.php?option=com_chronocomments&task=rateneg&commentid=" + id;




Also, on line 153 we have the same situation, when trying to unpublish a comment.
var url = "index2.php?option=com_chronocomments&task=unpublish&commentid=" + id;

replace with
var url = siteurl + "index2.php?option=com_chronocomments&task=unpublish&commentid=" + id;


I don't know if this is an oddity of my own setup, but it might be a good idea to change that JS code to always target its request to the site's root, not the current URL. Hope this helps.
Max_admin 30 Dec, 2008
Hi onetimedude,

I answered your first part in the other forum post, for the voting issue, did you try to enable the sh404sef mode in parameters ?

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
onetimedude 30 Dec, 2008
Hello Max,

Thank you for replying.
The sh404SEF mode is enabled and it has always been so from the time I installed ChronoComments.
Max_admin 31 Dec, 2008
Thank you, I will copy this to the bugs then!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.