Vote button not updating dynamically

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-15-2008, 01:55 PM
New Pligger
Pligg Version: 9.8
Pligg Template: default
 
Join Date: Nov 2007
Posts: 13
Hello,
I'm using Pligg 9.9 beta with the default yget template. I've modified Pligg to accept anonymous posts and anonymous comments, among other things. One other major alteration I've made is abandoned the "Published/Upcoming" separation: all posts become published automatically upon submission and get filed into category pages, linked to by tabs at the top of the page.

The problem that I'm having is that the vote buttons won't update dynamically when someone votes. When I reload the page they appear correctly (regular vote button if the user hasn't voted yet, grayed out if they have). I'm using Firebug to diagnose the problem and get this message in the Javascript error console:
Code:
$(A) has no properties
in pligg_effects-min.js (line 1)
I'm not too familiar with scriptaculous and the encoding that they did to obfuscate the code makes my eyes cross. Is there another way around this problem so that the vote button updates automatically? I'm surprised this is happening since I haven't altered much (if any) of the backend code related to voting.

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 05:20 PM
New Pligger
Pligg Version: 9.8
Pligg Template: default
 
Join Date: Nov 2007
Posts: 13
I tested the page also when logged in - the votecount increments correctly when a user is logged in, but the "Vote"/"Voted" text itself does not. I'm checking the .../js/xmlhttp.php page, but it seems to be that the $A thing isn't getting defined to update the page dynamically, though all the backend is fine.
Reply With Quote
  #3 (permalink)  
Old 02-15-2008, 05:41 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
So have you modified yget at all? There are a couple template edits that could mess this up easily, specifically in link_summary.tpl.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 05:48 PM
New Pligger
Pligg Version: 9.8
Pligg Template: default
 
Join Date: Nov 2007
Posts: 13
Hi!
Yes, I have modified yget fairly extensively, including link_summary.tpl. The main/biggest edit I made within link_summary.tpl was to the voting method logic, here is what I have now:
Code:
{if $Voting_Method eq 1}
		
		{if $link_shakebox_currentuser_votes eq 0 && $link_shakebox_currentuser_reports eq 0}
			<ul class="news-upcoming2">
			<li class="vote-publish"><a id="xvotes-{$link_shakebox_index}" href="{$story_url}">{$link_shakebox_votes}</a></li>
			<li class="vote" id="xvote-{$link_shakebox_index}">
			<a href="javascript:{$link_shakebox_javascript_vote}">{#PLIGG_Visual_Vote_For_It#}</a>
			</li>
			</ul>
		{else}
			<ul class="news-upcoming">
			<li class="vote-publish"><a id="xvotes-{$link_shakebox_index}" href="{$story_url}">{$link_shakebox_votes}</a></li>
			<li class="vote" id="xvote-{$link_shakebox_index}">
			<span>{#PLIGG_Visual_Vote_Cast#}</span>
			</li>
			</ul>
			
		{/if}
	{/if}
I've preserved all of the id names within link_summary.tpl to the best of my knowledge, so I don't think the dynamic updater is trying to access an element that doesn't exist.
Reply With Quote
  #5 (permalink)  
Old 02-22-2008, 03:24 PM
New Pligger
Pligg Version: 9.8
Pligg Template: default
 
Join Date: Nov 2007
Posts: 13
After some more testing, I went into the /js/xmlhttp.php file and scoured it. In the function changemnmvalues, I commented out the Scriptaculous component and switched it over to a plain ol' target2.innerHTML alteration. Later on I'll be doing more advanced stuff, but for now switching off the Vote link and altering its style to be grayed out is enough. Works fine now, though without firing the javascript library.

Edit: still not sure what the root of this problem was/is, if anybody knows it would be much appreciated!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 04:16 PM
abraxas's Avatar
Pligg Donor
Pligg Version: Plig
Pligg Template: b-Ice
 
Join Date: Feb 2008
Location: Boulder county, CO.
Posts: 100
I haven't figured this out either. I'm using a different template than yget and my link-summary has also been altered quite a bit.

Has anyone come up with solutions for this?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
External Vote Button (EVB) Yankidank Questions and Comments 70 10-09-2010 03:08 PM
Need help with External Vote Button Please! bbrian017 Questions and Comments 10 01-30-2008 06:28 PM
Let Users Embed Vote Button / Original Url Variant dwdesigns Questions and Comments 1 10-16-2007 08:35 PM
Changing the Vote button AshMCairo Questions and Comments 1 08-08-2007 01:35 PM
Vote button links to story page after voted canadaka Questions and Comments 1 04-02-2007 12:12 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development