Ok i run a rapforum. Currently i am having troble getting members to vote for battles. Everyone wants to be heard and wont listen so to speak. What im trying to do is make it so battles are started in a poll. People can then vote and put their reasoning to the vote below. When they press on the vote button they shall recieve a point. To create a topic in battles they must have 3 points. Theoreticly this should mean everyone must vote 3 times to be able to create a battle.

Does anyone know of a way that i can do this (im not really a pro at coding) or another way of doing it. I shall be very pleased if anyone can help me

~Doc~

Dani AI

Generated

A practical way to enforce “vote-before-battle” on an Invision (IPB) board is to add a tiny points table and hook into the poll vote handler so a member earns exactly one “battle point” per poll voted. When the Battles forum checks permissions for creating a new topic it rejects starters with fewer than 3 points. This keeps the familiar poll UI and makes participation the gatekeeper rather than heavy moderation.

Recommended implementation (high level)

  • New table to record awards (one row per member+poll) and a cached counter on the member record.
  • After a poll vote is accepted, insert the award only if that member hasn’t already been awarded for that poll, then increment the member’s battle_points.
  • Before showing the “New Topic” form in the Battles forum, require battle_points >= 3; otherwise show a short message pointing at active polls.

Schema + example (simplified)

CREATE TABLE ibf_battle_awards (
  award_id INT AUTO_INCREMENT PRIMARY KEY,
  member_id INT NOT NULL,
  poll_id INT NOT NULL,
  created INT UNSIGNED NOT NULL,
  UNIQUE KEY member_poll (member_id,poll_id)
);

ALTER TABLE ibf_members ADD COLUMN battle_points SMALLINT UNSIGNED NOT NULL DEFAULT 0;

Pseudo-code (place in the poll-vote handler after vote is stored)

$mid = (int)$member['member_id'];
$pid = (int)$poll['poll_id'];
if (no row exists in ibf_battle_awards for $mid,$pid) {
  INSERT INTO ibf_battle_awards (member_id,poll_id,created) VALUES ($mid,$pid,UNIX_TIMESTAMP());
  UPDATE ibf_members SET battle_points = battle_points + 1 WHERE member_id = $mid;
}

Permission check (forum new-topic code)

if ($forum_id == BATTLES_FORUM_ID && $member['battle_points'] < 3) {
  deny_topic_creation_with_message("Three voting points are required to start a battle.");
}

Operational notes and safeguards

  • Prevent point awards to the poll author and ensure one award per poll (unique key does this).
  • Provide an admin tool to adjust or recount points; add a background script to recalc from ibf_battle_awards if integrity is needed.
  • Non-coding alternatives: require a small minimum post count to start battles or route new-battle topics to moderator approval until participation habits change.

This approach answers the requirement described by and follows ’s point that knowing the forum software matters; it is lightweight, reversible, and keeps voting visible and auditable.

Recommended Answers

All 5 Replies

Ask snoopdog.

PLease be serious!

*Bump*

anyone?

It might be nice to know what forum software you're using... Moving to Building a Community...

invision 1.3

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.