DocsOEngageGamification Engine
Features

Gamification Engine

OEngageorravo.com/docs/oregister/gamification

XP Points & Levels

The gamification engine awards XP for configurable actions.

Default XP events:

EventDefault XP
First login50
Daily login10
Comment posted5
Post published25
Profile completed30
Social account linked15
2FA enabled20
Streak milestone (7 days)50
Badge unlockedVaries

Award XP programmatically:

php// Award XP to a user
oregister_award_xp( int $user_id, int $points, string $event, string $note = '' ): void

// Get user's total XP
oregister_get_xp( int $user_id ): int

// Get user's current level
oregister_get_level( int $user_id ): int

Streaks

A streak increments by 1 each day a user logs in. Broken if a day is missed.

phporegister_get_streak( int $user_id ): int
oregister_record_login( int $user_id ): void  // Called on every login

Badges

Badges are awarded automatically when criteria are met, or manually by admins.

php// Award a badge
oregister_award_badge( int $user_id, string $badge_slug ): bool

// Check if user has a badge
oregister_has_badge( int $user_id, string $badge_slug ): bool

// Get all badges for a user
oregister_get_badges( int $user_id ): array

Leaderboard

phporegister_get_leaderboard( int $limit = 10, string $period = 'all' ): array
// $period: 'all' | '7d' | '30d' | 'this_month'

Shortcode: [oregister_leaderboard limit="10" period="30d"]

Gamification Engine — OEngage Docs — Orravo