Jump to content
xisto Community
Sign in to follow this  
Soviet Rathe

Help With A Mod For My Forum

Recommended Posts

Ok I got Thanks Mod Light for my IPB forum and it works fine except for one thing.
When you click thanks and the little loading thing comes up but if you click thanks multiple times before the loading is done your name will show up multiple times that you thanked them

like....
The Following 3 users say Thank You person for this useful post
Soviet Rathe, Soviet Rathe, Soviet Rathe

Heres the code for it

// Thanks Ajax Adaptex By ThiagoInfo - Start		if ($this->ipsclass->vars['thanks_mod_enable'])		{			$thank_pid = $row['pid'];				if ($this->ipsclass->vars['thx_topics_replies'])				{					$row['thanks_button'] = "<a style=\"cursor:pointer;\" id=\"thank_".$thank_pid."b\" onclick=\"thanks_add('thanks', '{$thank_pid}', '{$row['author_name']}','{$row['author_id']}')\"><img src=\"style_images/p_thanks.gif\" alt=\"Thanks\" title=\"Thanks\" /></a>";				}				if ($row['pid'] == $this->topic['topic_firstpost'])				{					$row['thanks_button'] = "<a style=\"cursor:pointer;\" id=\"thank_".$thank_pid."b\" onclick=\"thanks_add('thanks', '{$thank_pid}', '{$row['author_name']}','{$row['author_id']}')\"><img src=\"style_images/p_thanks.gif\" alt=\"Thanks\" title=\"Thanks\" /></a>";				}				if ($this->ipsclass->member['id'] == $row['author_id'] || !$this->ipsclass->member['id'])				{					$row['thanks_button'] = "";				}			$thank_text = "";			$thank_text1 = "";			$tquery = $this->ipsclass->DB->query("SELECT * FROM ibf_post_thanks WHERE postid = '$thank_pid' ORDER BY username ASC");			$thank_tot =  $this->ipsclass->DB->get_num_rows($tquery);			if ($thank_tot)			{				$thank_text1 = "<div class=\"row1\" colspan=\"2\" align=\"top\"><strong>{$this->ipsclass->lang['thx_thanks1']} {$thank_tot} {$this->ipsclass->lang['thx_thanks2']} {$row['author_name']} {$this->ipsclass->lang['thx_thanks3']}:</strong></div>";				while($th_row =$this->ipsclass->DB->fetch_row($tquery))				{					if ($this->ipsclass->member['id'] == $th_row['userid'])					{						$row['thanks_button'] = "";					}					$thank_text .= "<a href=\"index.php?showuser=".$th_row['userid']."\">".$th_row['username']."</a>, ";				}			$thank_text = preg_replace( "/,\s+$/", "" , $thank_text);			}			$row['who_thanks'] = "<tr><td class=\"row2\" colspan=\"2\" align=\"top\"><div id=\"";			$row['who_thanks'] .= "thank_".$thank_pid."\"> \n{$thank_text1} {$thank_text}</div></td></tr>\n";			if ($this->ipsclass->vars['thx_member_display'])			{				$thanksquery = $this->ipsclass->DB->query("SELECT thanks_point FROM ibf_members WHERE id = '{$poster['id']}'");						$thanks = $this->ipsclass->DB->fetch_row($thanksquery);				$poster['thanks_point']  = $this->ipsclass->compiled_templates['skin_topic']->member_thanks_point( $thanks['thanks_point'] );			}		}		//Thanks Ajax Adaptex By ThiagoInfo - End

Now in this bit of code

$row['thanks_button'] = "<a style=\"cursor:pointer;\" id=\"thank_".$thank_pid."b\" onclick=\"thanks_add('thanks', '{$thank_pid}', '{$row['author_name']}','{$row['author_id']}')\"><img src=\"style_images/p_thanks.gif\" alt=\"Thanks\" title=\"Thanks\" /></a>";

thats the actual button you see on the forum

and heres what ive tried to make the button disable after the first click

$row['thanks_button'] = "<a style=\"cursor:pointer;\" id=\"thank_".$thank_pid."b\" onclick=\"this.disabled='disabled';thanks_add('thanks', '{$thank_pid}', '{$row['author_name']}','{$row['author_id']}')\"><img src=\"style_images/p_thanks.gif\" alt=\"Thanks\" title=\"Thanks\" /></a>";tried"this.disabled='disabled'"this.disabled=disabled"this.disabled="disabled""this.disabled = true"this.display='none'

No matter what I do when I try to modify them I eather get a T_STRING error, or when I click the thanks button nothing happens

I'm still learning PHP so I might be using the codes wrong anyway plz help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.