[ABD] Referral MOD With Contests

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
jbarrouk
Registered User
Posts: 218
Joined: Mon May 15, 2006 3:10 am
Contact:

Re: [DEV] Referral MOD With Contests

Post by jbarrouk » Tue Jul 10, 2012 2:07 pm

Perfect. This is exactly what I wanted. The contests feature is a great way to create incentives for people to refer people to your site. Thanks for your hard work.

IronDogg
Registered User
Posts: 130
Joined: Thu Sep 26, 2002 11:47 pm

Re: [DEV] Referral MOD With Contests

Post by IronDogg » Tue Jul 10, 2012 4:04 pm

Are feature requests still open? If so, is there possibility for consideration to make compatible/integrate with Ultimate Points System mod?

Maybe a user gets a certain number of points for sending out a refferal, and then a certain number of points for the refferal being successful, etc.

User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: [DEV] Referral MOD With Contests

Post by Jessica » Tue Jul 10, 2012 5:31 pm

IronDogg wrote:Are feature requests still open? If so, is there possibility for consideration to make compatible/integrate with Ultimate Points System mod?

Maybe a user gets a certain number of points for sending out a refferal, and then a certain number of points for the refferal being successful, etc.
this. and maybe get a certain amount of points for winning a contest (first, second, third place)
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein

_Al
Registered User
Posts: 203
Joined: Mon Oct 20, 2008 9:24 pm
Location: Sweetas - All your friends online
Contact:

Re: [DEV] Referral MOD With Contests

Post by _Al » Wed Jul 11, 2012 1:23 am

Nice work Siropu!
Anyone using this successfully?

User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: [DEV] Referral MOD With Contests

Post by Jessica » Wed Jul 11, 2012 1:34 am

_Al wrote:Nice work Siropu!
Anyone using this successfully?
me.
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein

jbarrouk
Registered User
Posts: 218
Joined: Mon May 15, 2006 3:10 am
Contact:

Re: [DEV] Referral MOD With Contests

Post by jbarrouk » Wed Jul 11, 2012 2:31 pm

IronDogg wrote:Are feature requests still open? If so, is there possibility for consideration to make compatible/integrate with Ultimate Points System mod?

Maybe a user gets a certain number of points for sending out a refferal, and then a certain number of points for the refferal being successful, etc.
I actually hope you do not integrate with other points mods. One of the things I like about this mod is that is simple and does what it is supposed to do. All the other referral mods that are in development and have been abandoned all attempted to integrate other points mods. Then they tried to integrate other mods. They became too complicated and defeated the purpose of the mod. This mod is perfect the way it is.

All in my humble opinion.

User avatar
Siropu
Registered User
Posts: 155
Joined: Mon Nov 16, 2009 6:15 pm
Location: Romania
Contact:

Re: [DEV] Referral MOD With Contests

Post by Siropu » Sat Jul 14, 2012 3:58 pm

IronDogg wrote:Are feature requests still open? If so, is there possibility for consideration to make compatible/integrate with Ultimate Points System mod?
Sorry but I'm not planning to integrate this MOD with other MODs.
Check out my MODs.

2FR3
Registered User
Posts: 7
Joined: Wed Aug 01, 2012 3:29 pm

Re: [DEV] Referral MOD With Contests

Post by 2FR3 » Wed Aug 01, 2012 3:34 pm

Hi & thx for this good work, the mod is French Ready if u want :)

2FR3
Registered User
Posts: 7
Joined: Wed Aug 01, 2012 3:29 pm

Re: [DEV] Referral MOD With Contests

Post by 2FR3 » Fri Aug 03, 2012 10:08 am

Hi,

I think the url sent by this mod is not compatible with SEO optimisation mod. Can u do somethink to resolve this little problem ?

I've got a good error page for any registration but the register is registred

Code: Select all

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 [1064]
(sorry for my english)

If i replace the original ucp_register.php and leave URL rewriting, i have'nt this error. And if i desable my URL rewriting, the mod and the registration work fine.

thx

User avatar
Siropu
Registered User
Posts: 155
Joined: Mon Nov 16, 2009 6:15 pm
Location: Romania
Contact:

Re: [DEV] Referral MOD With Contests

Post by Siropu » Sat Aug 04, 2012 6:57 pm

2FR3 wrote:Hi & thx for this good work, the mod is French Ready if u want :)
If you don't mind, you can upload the files somewhere and post a download link here. :)

@ 2FR3 , please post a link to this "SEO optimisation mod". When I will have the time, I will take a look at the problem.
Check out my MODs.

2FR3
Registered User
Posts: 7
Joined: Wed Aug 01, 2012 3:29 pm

Re: [DEV] Referral MOD With Contests

Post by 2FR3 » Sat Aug 04, 2012 9:45 pm

Thx Siropu,

phpBB SEO

This mod make url rewriting, and more more...

For the traduction, i want to give u a perfect work 8-)

2FR3
Registered User
Posts: 7
Joined: Wed Aug 01, 2012 3:29 pm

Re: [DEV] Referral MOD With Contests

Post by 2FR3 » Mon Aug 06, 2012 10:50 am

Hi,

For W3C validation, modify index.php, Alt for image is needed

Code: Select all

'CONTEST_POS'       => '<img src="' . $phpbb_root_path . 'images/contest_pos_' . $i++ . '.gif" alt="" />',
And referral_contest.html

Code: Select all

			       <p><span>{L_CONTEST_INFO}:</span> {CONTEST_DESCRIPTION}</p>
			       <p><span>{L_CONTEST_DURATION}:</span> {CONTEST_DURATION}</p>
			       <p><span>{L_CONTEST_START_DATE}:</span> {CONTEST_START_DATE}</p>
			       <p><span>{L_CONTEST_END_DATE}:</span> {CONTEST_END_DATE}</p>
			       <p><span>{L_CONTEST_STATUS}:</span> {CONTEST_STATUS}</p>
The <p> was closed with <p>

User avatar
Siropu
Registered User
Posts: 155
Joined: Mon Nov 16, 2009 6:15 pm
Location: Romania
Contact:

Re: [DEV] Referral MOD With Contests

Post by Siropu » Sat Aug 11, 2012 1:12 pm

I've released version 1.1.2.
Some bugs has been fixed.

To update, follow these instructions:
Replace referral_mod_install.php, includes/ucp/ucp_referral.php and styles/prosilver/template/referral/referral_contest.html

Open includes/ucp/ucp_register.php and search for this line:

Code: Select all

if (isset($rid))
Replace with this:

Code: Select all

if (!empty($rid))
Open index.php and search for this lines:

Code: Select all

'CONTEST_POS'       => '<img src="' . $phpbb_root_path . 'images/contest_pos_' . $i++ . '.gif" />',
    )
);
Replace with this:

Code: Select all

 'CONTEST_POS'       => '<img src="' . $phpbb_root_path . 'images/contest_pos_' . $i . '.gif" alt="' . $i . '" />',
     )
);
$i++;
Run referral_mod_install.php to update the MOD version.
Check out my MODs.

User avatar
wolfkin
Registered User
Posts: 35
Joined: Sun Apr 09, 2006 9:25 pm

Re: [DEV] Referral MOD With Contests

Post by wolfkin » Thu Aug 23, 2012 10:45 am

Great MOD!

However, I found a minor bug.

1 week, 2 weeks, 3 weeks, 1 month... these don't get translated properly. When creating a new contest in ACP, the translation works fine.

However, when watching the list of contents in ACP, the translation isn't happening - instead I see the words in English.

Likewise on index: The translations are missing (again, they are in English).


Also, a request:

Is it possible, somehow, to allow BBCode or HTML in the contest description? What I want is the ability to add to the description a link to a custom page, explaining the workings of your referral system.

Regards

Qwertyip
Registered User
Posts: 30
Joined: Sat Aug 04, 2012 6:47 pm

Re: [DEV] Referral MOD With Contests

Post by Qwertyip » Sat Aug 25, 2012 12:08 am

Hi there.

Great Mod, I needed it for a 'Referral:' Box on the registration page, but i liked how simple it is. So i used it and put a referral box on the registration page myself.
(Im not very good with php though, but i think i've done okay.)

I see there was some requests for it, so here's how i did it.

Image

Information:
  • Auto-fill 'Referral' box if you were referred by the referall link.
  • If the referral is edited to a different name, It will over-ride the referal link and use the new name the user entered. E.g, The name is wrong and you want your friend as the Referrer.
  • If the name is deleted out of the textbox, the link referrer still gets credit for the referral.
  • If user wasn't referrer by link, and fills referral box. Named user will get referral credit.
  • If user wasn't referred by link, and leaves box empty. Registration continues as normal.
includes/ucp/ucp_register.php
FIND

Code: Select all

'tz'				=> request_var('tz', (float) $timezone),
ADD BELOW

Code: Select all

'referrer'			=> request_var('referrer', ''),
...
FIND

Code: Select all

		// Check and initialize some variables if needed
		if ($submit)
ADD ABOVE

Code: Select all

		$rid = request_var($config['cookie_name'] . '_referrer_id', '', false, true);

		if (!empty($rid))
		{
			$sql = 'SELECT username, user_referrals
				FROM ' . USERS_TABLE . '
				WHERE user_id = ' . $rid;
			$result = $db->sql_query($sql);
			$row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);
			
			$referrer = $row['username'];
		}
...
FIND

Code: Select all

			if (!sizeof($error))
			{
				if ($data['new_password'] != $data['password_confirm'])
				{
ADD ABOVE

Code: Select all

			/*Referrer input Box*/
			if ($data['referrer']) {
				
				$sql_array_ref = array(
					'username'    => $data['referrer'],
				);
				
				$sql = 'SELECT user_id 
						FROM ' . USERS_TABLE . ' 
						WHERE ' . $db->sql_build_array('SELECT', $sql_array_ref);
				$result = $db->sql_query($sql);
				$row = $db->sql_fetchrow($result);
				$db->sql_freeresult($result);
				
				if (!$row)
				{
					$error[] = $user->lang['NO_REFFERER_WITH_NAME'];
				}
			}
...
FIND

Code: Select all

				// Begin Referral MOD
				$rid = request_var($config['cookie_name'] . '_referrer_id', '', false, true);

				if (!empty($rid))
				{
REPLACE WITH

Code: Select all

				// Begin Referral MOD
				if ($referrer || $data['referrer'])
				{
					if (!$referrer && $data['referrer'] || ($referrer && $data['referrer']) && ($referrer != $data['referrer']))
					{
						$sql_array = array(
							'username'    => $data['referrer'],
						);
						
						$sql = 'SELECT user_id
							FROM ' . USERS_TABLE . '
							WHERE ' . $db->sql_build_array('SELECT', $sql_array);
						$result = $db->sql_query($sql);
						$row = $db->sql_fetchrow($result);
						$db->sql_freeresult($result);
						
						$rid = $row['user_id'];
					}
...
FIND

Code: Select all

'EMAIL_CONFIRM'		=> $data['email_confirm'],
ADD AFTER

Code: Select all

'REFERRER'			=> $data['referrer'] ? $data['referrer'] : $referrer,
------------------------
language/en/common.php
FIND

Code: Select all

'REFERRALS' => 'Referrals',
ADD AFTER

Code: Select all

	'REFERRER'	=> 'Referrer',
	'NO_REFFERER_WITH_NAME'	=> 'Referral: No user with that username',
-------------------------
styles/NAME(prosilver)/template/ucp_register.html
FIND

Code: Select all

	<dl>
		<dt><label for="tz">{L_TIMEZONE}:</label></dt>
		<dd><select name="tz" id="tz" tabindex="6" class="autowidth">{S_TZ_OPTIONS}</select></dd>
	</dl>
ADD ABOVE

Code: Select all

	<dl>
		<dt><label for="referrer">{L_REFERRER}:</label></dt>
		<dd><input type="text" tabindex="5" name="referrer" id="referrer" size="25" maxlength="50" value="{REFERRER}" class="inputbox autowidth" title="{L_REFERRER}" /></dd>
	</dl>

	<hr />

The last edit to the template is purely up to you where you put it, My registration form is heavly modded now so the above 'FIND' may not work for you.

I believe thats all the modifications I made, If anyone has any problems, Just say, i may have missed something, I'm pritty tired :)

-Qwertyip
P.S. Great Mod, Thanks.. Just what i was looking for :)

Locked

Return to “[3.0.x] Abandoned MODs”