Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 186
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 181
Total: 181

Author Topic: Poll voting not working 1.x  (Read 9063 times)

0 Members and 1 Guest are viewing this topic.

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Poll voting not working 1.x
« on: June 04, 2012, 08:42:55 pm »
I added this to my badgeawards in the right area

Code: [Select]
$badgeAction = 'pollvote';
if (!in_array($badgeAction,$currentBadges))
{
$result = db_query("
SELECT COUNT(*) AS total FROM {$db_prefix}log_polls   
WHERE ID_MEMBER = $memberID
", __FILE__, __LINE__); 
$totalRow = mysql_fetch_assoc($result);

if ($totalRow['total'] > 0)
{
$badgeID = GetBadgeIDByAction($badgeAction);
$ret = AddBadgeToMember($memberID,$badgeID,false);
if ($ret == true)
{
$currentBadges[] = $badgeAction;
$newBadges[]  = $badgeAction;
}
}

}

But members are still not being rewarded for voting... :(

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Poll voting not working 1.x
« Reply #1 on: June 04, 2012, 08:47:29 pm »
Poll starting award works though!

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Poll voting not working 1.x
« Reply #2 on: June 04, 2012, 08:47:55 pm »
Requires an edit to Sources/Poll.php
Find
Code: [Select]
// Return to the post...
redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
}

// Lock the voting for a poll.

Add before
Code: [Select]

// Badge Awards
global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

global $sourcedir, $user_info;
require_once($sourcedir . '/badgeawards.php');
Badges_CheckMember($ID_MEMBER);
}
// End Badge Awards
« Last Edit: June 04, 2012, 08:51:18 pm by SMFHacks »
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Poll voting not working 1.x
« Reply #3 on: June 04, 2012, 08:50:25 pm »
Will the same code work for 2.0.x?  (I figure I better ask now that I know that shuban is running 1.x.x)

Thanks!


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Poll voting not working 1.x
« Reply #4 on: June 04, 2012, 08:52:05 pm »
Edit would be different
But also note i will include this change in the next update as well
Code: [Select]

// Badge Awards
global $sourcedir, $modSettings;
if (!empty($modSettings['badgeawards_enable']))
{

global $sourcedir, $user_info;
require_once($sourcedir . '/badgeawards2.php');
Badges_CheckMember($user_info['id']);
}
// End Badge Awards
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Poll voting not working 1.x
« Reply #5 on: June 04, 2012, 08:54:41 pm »
aren't u lucky frizzle and I are testing this out for you ;)

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Poll voting not working 1.x
« Reply #6 on: June 04, 2012, 08:57:03 pm »
Nope it still didn't work :(

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Poll voting not working 1.x
« Reply #7 on: June 04, 2012, 08:59:48 pm »
Nope it still didn't work :(
Did you add a new vote? If you change a vote that won't pick it up.
Also make sure you used my updated code that had just badgeawards.php

Also that pollvote code needs to be in the badges_checkmember function
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: Poll voting not working 1.x
« Reply #8 on: June 04, 2012, 09:01:35 pm »
Is the plan to include the edits done here in each update?  Will the next update include the location and gender edits as well?  We should probably get on the same page.  I would hate to "update" only to lose functionality already added via edits...

I do not believe the location and gender edits were present in the latest update available (I did manually add them)...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Poll voting not working 1.x
« Reply #9 on: June 04, 2012, 09:06:10 pm »
Possibly might have to have some high quality badges made though.
Or option #2 a way to easily include the changes without modiying the files.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Poll voting not working 1.x
« Reply #10 on: June 04, 2012, 09:06:56 pm »
Code: [Select]
Did you add a new vote? If you change a vote that won't pick it up.
Yes, they are all fresh votes by different people

Here is my badgeaward.php

and poll.php... I added them in the right place and it is enabled as well!
« Last Edit: June 04, 2012, 09:09:36 pm by shuban »

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Poll voting not working 1.x
« Reply #11 on: June 04, 2012, 09:09:07 pm »
It's strange because starting a poll registers like is should, but voting doesn't.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Poll voting not working 1.x
« Reply #12 on: June 04, 2012, 09:11:40 pm »
Code: [Select]
Did you add a new vote? If you change a vote that won't pick it up.
Yes, they are all fresh votes by different people

Here is my badgeaward.php

and poll.php... I added them in the right place and it is enabled as well!
Looks fine. Code is in the Vote function in poll.php
Other than that you must have pollvote as a badge in the badgelist and it's action must be pollvote
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Poll voting not working 1.x
« Reply #13 on: June 04, 2012, 09:14:52 pm »
Man that sucks, here's how it looks like... No kidding, it's all there.

Does it work on your test forum for 1.x?

Offline shuban

  • Hero Member
  • *****
  • Posts: 665
    • View Profile
    • Biology Forums
Re: Poll voting not working 1.x
« Reply #14 on: June 04, 2012, 09:23:24 pm »
It seems to be working now ::)

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
6903 Views
Last post August 19, 2006, 03:35:00 pm
by theunder-ground
1 Replies
5245 Views
Last post March 06, 2008, 03:02:44 pm
by motleypixel
0 Replies
5998 Views
Last post March 13, 2008, 01:05:10 pm
by motleypixel
3 Replies
4728 Views
Last post June 25, 2008, 12:42:17 am
by CG Icon
3 Replies
3107 Views
Last post September 05, 2018, 02:22:14 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal