Page 2 of 8

Re: [DEV] Referral MOD With Contests

Posted: Tue Jul 10, 2012 2:07 pm
by jbarrouk
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.

Re: [DEV] Referral MOD With Contests

Posted: Tue Jul 10, 2012 4:04 pm
by IronDogg
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.

Re: [DEV] Referral MOD With Contests

Posted: Tue Jul 10, 2012 5:31 pm
by Jessica
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)

Re: [DEV] Referral MOD With Contests

Posted: Wed Jul 11, 2012 1:23 am
by _Al
Nice work Siropu!
Anyone using this successfully?

Re: [DEV] Referral MOD With Contests

Posted: Wed Jul 11, 2012 1:34 am
by Jessica
_Al wrote:Nice work Siropu!
Anyone using this successfully?
me.

Re: [DEV] Referral MOD With Contests

Posted: Wed Jul 11, 2012 2:31 pm
by jbarrouk
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.

Re: [DEV] Referral MOD With Contests

Posted: Sat Jul 14, 2012 3:58 pm
by Siropu
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.

Re: [DEV] Referral MOD With Contests

Posted: Wed Aug 01, 2012 3:34 pm
by 2FR3
Hi & thx for this good work, the mod is French Ready if u want :)

Re: [DEV] Referral MOD With Contests

Posted: Fri Aug 03, 2012 10:08 am
by 2FR3
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

Re: [DEV] Referral MOD With Contests

Posted: Sat Aug 04, 2012 6:57 pm
by Siropu
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.

Re: [DEV] Referral MOD With Contests

Posted: Sat Aug 04, 2012 9:45 pm
by 2FR3
Thx Siropu,

phpBB SEO

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

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

Re: [DEV] Referral MOD With Contests

Posted: Mon Aug 06, 2012 10:50 am
by 2FR3
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>

Re: [DEV] Referral MOD With Contests

Posted: Sat Aug 11, 2012 1:12 pm
by Siropu
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.

Re: [DEV] Referral MOD With Contests

Posted: Thu Aug 23, 2012 10:45 am
by wolfkin
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

Re: [DEV] Referral MOD With Contests

Posted: Sat Aug 25, 2012 12:08 am
by Qwertyip
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 :)