[BETA] Where's Waldo

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: [ALPHA] Where's Waldo

Post by Jessica »

dellsystem wrote:I'm not quite sure what you're saying - are you suggesting that getting points should be limited to certain, user-defined groups? If so, what would be the benefit of that? Currently, any user who sees Waldo can theoretically receive points from it. A planned feature for a future version is for users to be able to choose which groups are able to see Waldo in the first place - is that what you're looking for?
yes yes that's it. it's just that as owner of a test forum, I haven't received any points for seeing Waldo on my forum (saw it 5 times). don't know why
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
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: [ALPHA] Where's Waldo

Post by dellsystem »

Updated to version 0.0.5

(fixed unnecessary reference to $waldo_link)
darkonia wrote:another bug in conjunction with the Ultimate Points System.

when the waldo is defined with a link and the integration with UPS is on then the user can get points again and again and again, so oft he wants, when he/she get one site back with the browser and etc.
Thanks for pointing that out, I haven't actually tested it with the Ultimate Points System recently. I'll look into that for the next release.
jesschen wrote:yes yes that's it. it's just that as owner of a test forum, I haven't received any points for seeing Waldo on my forum (saw it 5 times). don't know why
The MOD should not discriminate between admins and regular users. Are other users getting points? What are your settings?
Former moderator and website team member | My MODs, and more (GitHub)
User avatar
Wuerzi
Registered User
Posts: 60
Joined: Fri Aug 15, 2008 11:38 pm
Location: Germany/Würzburg
Contact:

Re: [ALPHA] Where's Waldo

Post by Wuerzi »

Hello Dellsystem

1. Can´t save German Umlauts Domains (ÄÖÜß - UTF-8) in ACP

Open includes/acp/acp_waldo.php and find:

Code: Select all

				$new_url_link = request_var('waldo_url_link', '');
Replace with:

Code: Select all

				$new_url_link = utf8_normalize_nfc(request_var('waldo_url_link', '', true));
2. overall_header.html not valide

Find:

Code: Select all

<!-- IF FOUND_WALDO -->
	<div id="waldo" style="position: absolute; top: {RAND_TOP}px; left: {RAND_LEFT}px; z-index: 9001;">
		<!-- IF WALDO_URL --><a href="{WALDO_URL}"><!-- ENDIF --><img src="{WALDO_IMAGE}" title="{WALDO_MOUSEOVER}" /><!-- IF WALDO_URL --></a><!-- ENDIF -->
	</div>
<!-- ENDIF -->
Replace with:

Code: Select all

<!-- IF FOUND_WALDO -->
	<div id="waldo" style="position: absolute; top: {RAND_TOP}px; left: {RAND_LEFT}px; z-index: 9001;">
		<!-- IF WALDO_URL --><a href="{WALDO_URL}"><!-- ENDIF --><img src="{WALDO_IMAGE}" title="{WALDO_MOUSEOVER}" alt="{WALDO_MOUSEOVER}" /><!-- IF WALDO_URL --></a><!-- ENDIF -->
	</div>
<!-- ENDIF -->
Missing alt="" ;)

3. The viewonline have a side refresh. I think it´s not so good given Points in viewonline.php :?

My Idea:

Open includes/functions.php and find:

Code: Select all

	// Begin Where's Waldo MOD
	$waldo_vertical = $config['waldo_vertical'];
	$waldo_horizontal = $config['waldo_horizontal'];
	$probability = $config['waldo_probability'];
	$rand_top = ($probability > 0) ? mt_rand(0, $waldo_vertical / $probability) : 0;
	$rand_left = mt_rand(0, $waldo_horizontal);
	$found_waldo = ($rand_top < $waldo_vertical && $probability > 0) ? true : false;
	
	// If points are to be awarded, award them
	if ($found_waldo && defined('IN_ULTIMATE_POINTS') && $config['waldo_points'] > 0 && $user->data['is_registered'])
	{
		add_points($user->data['user_id'], $config['waldo_points']);
	}
	// End Where's Waldo MOD
Replace with:

Code: Select all

	// Begin Where's Waldo MOD
	$waldo_vertical = $config['waldo_vertical'];
	$waldo_horizontal = $config['waldo_horizontal'];
	$probability = $config['waldo_probability'];
	$rand_top = ($probability > 0) ? mt_rand(0, $waldo_vertical / $probability) : 0;
	$rand_left = mt_rand(0, $waldo_horizontal);
	$found_waldo = ($rand_top < $waldo_vertical && $probability > 0) ? true : false;

	// If points are to be awarded, award them
	if ($found_waldo && defined('IN_ULTIMATE_POINTS') && $config['waldo_points'] > 0 && $user->data['is_registered'] && $config['points_enable'] && $auth->acl_get('u_use_points'))
	{
		// Begin Where's Waldo MOD
		$sql = 'SELECT u.user_id, s.session_page, s.session_user_id
			FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s
			WHERE u.user_id = s.session_user_id";
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$waldo_viewonline = (strpos($row['session_page'], 'viewonline') !== false);

			if (!$waldo_viewonline)
			{
				add_points($user->data['user_id'], $config['waldo_points']);
			}
		}
	}
	// End Where's Waldo MOD
Changed:
- User Permission u_use_points
- Points enable
- Read from Sessions Table if User in viewonline

Or have you a other idea? :?

Best regards from Germany :)
femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [ALPHA] Where's Waldo

Post by femu »

Hi,

a small addition .... You currently can set the possibility to find Waldo between 0 and 1. This should be set between 0 and 100 percent instead. So say only full numbers and convert ie 50% to 0.5 internally. So just an optical issue, but more understandable for the users ;-)

@ Wuerzi: There's something wrong in the code. It adds the whole amount of what the user has and not the defined points.
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]
User avatar
Wuerzi
Registered User
Posts: 60
Joined: Fri Aug 15, 2008 11:38 pm
Location: Germany/Würzburg
Contact:

Re: [ALPHA] Where's Waldo

Post by Wuerzi »

femu wrote:@ Wuerzi: There's something wrong in the code. It adds the whole amount of what the user has and not the defined points.
??? :shock:
I think this is correct in den Code :shock:
User avatar
Wuerzi
Registered User
Posts: 60
Joined: Fri Aug 15, 2008 11:38 pm
Location: Germany/Würzburg
Contact:

Re: [ALPHA] Where's Waldo

Post by Wuerzi »

Aaaaaaaaaaaaaah :shock:

Ok sorry the code is wrong :cry:
aaronfluffy
Registered User
Posts: 23
Joined: Sat Dec 11, 2010 7:18 am

Re: [ALPHA] Where's Waldo

Post by aaronfluffy »

Good idea mate. Though an upload form in the ACP settings would be nice for newbies and the such so when they want to change the image all they have to do is upload the new image.

I and others can do it the manual way but there are people who wouldn't have a clue about adding anything into an FTP using a client system.
User avatar
boy_ofpersia
Registered User
Posts: 88
Joined: Sat Sep 13, 2008 5:58 pm
Location: Tehran, Iran
Name: Arman Pasayandeh
Contact:

Re: [ALPHA] Where's Waldo

Post by boy_ofpersia »

Oh, this is good idea! ;)
Thanks!
"We tie knots & bind up words in double meanings, and then try to untie them"
--Seneca
vaan123
Registered User
Posts: 35
Joined: Mon Jul 04, 2011 3:13 am

Re: [ALPHA] Where's Waldo

Post by vaan123 »

funny mod, thanks :)
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: [ALPHA] Where's Waldo

Post by dellsystem »

aaronfluffy wrote:Good idea mate. Though an upload form in the ACP settings would be nice for newbies and the such so when they want to change the image all they have to do is upload the new image.

I and others can do it the manual way but there are people who wouldn't have a clue about adding anything into an FTP using a client system.
Good idea, I'll include that in the list of planned features. Thanks for the suggestion!
femu wrote:a small addition .... You currently can set the possibility to find Waldo between 0 and 1. This should be set between 0 and 100 percent instead. So say only full numbers and convert ie 50% to 0.5 internally. So just an optical issue, but more understandable for the users ;-)
Makes sense. I've implemented that in the 0.1.0-dev branch, thanks :)

@Wuerzi: Thanks for the suggestions. I've added the utf8 support for both the image and the hyperlink URL, set the alt tag to the mouseover text and now check for points_enable as well as the u_use_points permission. I'm not sure about the best way to deal with auto-refreshing pages, however, as the user could just as easily refresh manually (or write a script to simulate it) which would amount to the same thing. Perhaps I'll add a timeout and/or maximum points feature (e.g. a user can only earn 100 points per day, or whatever the admin wants).
Former moderator and website team member | My MODs, and more (GitHub)
eaglesfannation
Registered User
Posts: 105
Joined: Sat May 08, 2010 10:29 pm

Re: [ALPHA] Where's Waldo

Post by eaglesfannation »

Would love for this mod to be developed further. Its a great mod and my members love it. The problem is with the points though. below is the list of the issues...

1.) Gives points any time a page is loaded whether wally is on page or not...
2.) Gives points for page view when it should give points only for clicking on wally
3.) Seems to give more points the longer your on the page (before refreshing or switching pages)
4.) Needs to have some kind of security so people just cant browse back to see wally again (if they can)
_Al
Registered User
Posts: 203
Joined: Mon Oct 20, 2008 9:24 pm
Location: Sweetas - All your friends online
Contact:

Re: [ALPHA] Where's Waldo

Post by _Al »

Waldo should be only on some pages randomly**** and the ability to add piont when you click him. if you have piont mod installed

EDIT! i never read any of the above posts lol...
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: [ALPHA] Where's Waldo

Post by dellsystem »

eaglesfannation wrote:Would love for this mod to be developed further. Its a great mod and my members love it. The problem is with the points though. below is the list of the issues...

1.) Gives points any time a page is loaded whether wally is on page or not...
2.) Gives points for page view when it should give points only for clicking on wally
3.) Seems to give more points the longer your on the page (before refreshing or switching pages)
4.) Needs to have some kind of security so people just cant browse back to see wally again (if they can)
Hi,

I don't have the ultimate points MOD installed right now, so I can't work on this at the moment. I'll see if I have time to work on this tomorrow, though. In the meantime, re: your list of issues:

1) That shouldn't be happening. Are you sure about this?
2) I haven't implemented that yet - it's still an open issue on Github. I'll update the issue when I've made progress on it.
3) That shouldn't be happening either - I don't see how it could. Do you have an example of this?
4) They can "see" Waldo again, but it won't add the points again. There's no good way of preventing users from seeing Waldo again without using Javascript, and I don't think it's necessary in any case.

If you're having issues with the points system, you can temporarily disable the points feature by setting it to 0.

I've also added the ability to prevent Waldo from showing up on certain pages, e.g. the viewonline page as Wuerzi brought up. I've pushed this to the 0.1.0-dev branch (technically not stable, but everything seems to work for me so far, if you want to test it out). I'll test out the Ultimate Points MOD integration and will try to get a release of 0.1.0 in the next few days.
Former moderator and website team member | My MODs, and more (GitHub)
eaglesfannation
Registered User
Posts: 105
Joined: Sat May 08, 2010 10:29 pm

Re: [ALPHA] Where's Waldo

Post by eaglesfannation »

1 and 3 are really happening. maybe it's a mod conflict where another mod is making it load or give more again and again? At any rate by having some kind of way to where you ONLY get points for clicking on Waldo should fix those issue for me any way right? So
User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: [ALPHA] Where's Waldo

Post by dellsystem »

1 and 3 are really happening. maybe it's a mod conflict where another mod is making it load or give more again and again?
What do your edits to includes/functions.php look like?
At any rate by having some kind of way to where you ONLY get points for clicking on Waldo should fix those issue for me any way right?
Well, theoretically, but that method is easily open to abuse unless properly secured. I'd have to think about the correct way to implement it.
Former moderator and website team member | My MODs, and more (GitHub)
Locked

Return to “[3.0.x] MODs in Development”