[ABD]Hidden Image Mod

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! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
brazaz
Registered User
Posts: 13
Joined: Wed Oct 29, 2003 5:06 am
Contact:

[ABD]Hidden Image Mod

Post by brazaz » Wed Oct 29, 2003 5:03 pm

Simple little game - great way to generate traffic.

[Request]
When someone clicks on it, it would be deleted from that post, and moved to some other random post.

100%
Maybe it could also tabulate the users who click on the image, and display the "score" somewhere.

100%
If possible could a record of who found it, time and what post it was in be kept and it accessable

100%
it is not to appear in restricted forums

0%
Maybe there is a short delay before it reappears?-

0%
it only edits itself into one of the last x posts

100%

download

Configuration

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
randimage.php
# 
#-----[ FIND ]------------------------------------------ 
#
$rand_image_posts=10;
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#it only edits itself into one of the last x posts
$rand_image_posts=YOUR_VALUE
Last edited by brazaz on Wed Oct 29, 2003 7:35 pm, edited 1 time in total.

xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder » Wed Oct 29, 2003 5:31 pm

just installed it now, seems to be working! This mod rocks!!

xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder » Wed Oct 29, 2003 6:26 pm

*edit* my bad, it works fine :D
Last edited by xmulder on Wed Oct 29, 2003 6:40 pm, edited 1 time in total.

Rapid Dr3am
Registered User
Posts: 198
Joined: Sun Jul 13, 2003 4:14 pm
Location: Incommunicado
Contact:

Post by Rapid Dr3am » Wed Oct 29, 2003 6:37 pm

Nice idea, a little feedback is nice also.

Code: Select all

	$sql = "SELECT * FROM phpbb_image ORDER BY id DESC";
	if ( !($result = $db->sql_query($sql)) )
	{
Not everyone uses phpbb_ as thier prefix, so why not substitute this with a defined table defined in includes/constants.php ;)

Also in randimage.tpl i notice this.

Code: Select all

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
Not sure what it's for though.

Also in him_db_update.php i notice you also hardcode the prefix.

Code: Select all

$sql1 = "SELECT * FROM phpbb_posts ORDER BY post_time DESC limit 0,10";
	if ( !($result = $db->sql_query($sql1)) )
	{
		message_die(GENERAL_ERROR, "Could not obtain random images information.", '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$last_post = $row;
$db->sql_freeresult($result);
$last_post_id=$last_post['post_id'];
$sql=array(
'CREATE TABLE phpbb_image (id mediumint(8) NOT NULL auto_increment, post_id mediumint(8) NOT NULL default \'0\',  found tinyint(1) NOT NULL default \'0\',  time int(11) NOT NULL default \'0\',  user_id mediumint(8) NOT NULL default \'0\',  PRIMARY KEY  (id)) TYPE=MyISAM',
'INSERT INTO phpbb_image VALUES (1, '.$last_post_id.', 0, 0, 0)',
'ALTER TABLE phpbb_users ADD user_images MEDIUMINT( 8 ) DEFAULT \'0\' NOT NULL'); 

$mods = array ( 
'Hidden Image Mod'
);
And finally a hardcoded prefix in randimage.php. :)

brazaz
Registered User
Posts: 13
Joined: Wed Oct 29, 2003 5:06 am
Contact:

Post by brazaz » Wed Oct 29, 2003 7:33 pm

ok. thanks for feedbacks :)

2Rapid Dr3am
everything fixed now.

file updated...
download

Jeffrey903
Registered User
Posts: 34
Joined: Thu Apr 10, 2003 8:27 pm

Post by Jeffrey903 » Wed Oct 29, 2003 9:25 pm

I have two things:

change

Code: Select all

//
// That's all Folks!
// -------------------------------------------------
to

Code: Select all

//
// That's all, Folks!
// -------------------------------------------------
and

change

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/overal_header.tpl
to

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/overall_header.tpl
This is just to make it compatible with easymod (the things I just mentioned are spelling errors).

mm3guy
Registered User
Posts: 197
Joined: Tue Oct 14, 2003 8:13 pm

Post by mm3guy » Wed Oct 29, 2003 9:29 pm

This MOD is cool, a treasure hunt! :lol:

Jeffrey903
Registered User
Posts: 34
Joined: Thu Apr 10, 2003 8:27 pm

Post by Jeffrey903 » Wed Oct 29, 2003 9:53 pm

A nice feature would be if the admin is told where the image is.

Jeffrey903
Registered User
Posts: 34
Joined: Thu Apr 10, 2003 8:27 pm

Post by Jeffrey903 » Wed Oct 29, 2003 9:57 pm

Whenever I click on the image...I get this error:
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /homepages/25/d87057890/htdocs/phpBB2/db/mysql4.php on line 318

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /homepages/25/d87057890/htdocs/phpBB2/db/mysql4.php on line 318

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /homepages/25/d87057890/htdocs/phpBB2/db/mysql4.php on line 318

Warning: Cannot add header information - headers already sent by (output started at /homepages/25/d87057890/htdocs/phpBB2/db/mysql4.php:318) in /homepages/25/d87057890/htdocs/phpBB2/includes/functions.php on line 900


If I refresh the page it works.

brazaz
Registered User
Posts: 13
Joined: Wed Oct 29, 2003 5:06 am
Contact:

Post by brazaz » Wed Oct 29, 2003 10:34 pm

2mm3guy 8)
Jeffrey903 wrote: A nice feature would be if the admin is told where the image is.

maybe..but admin could cheat if s/he would know where image is :D
thanks for spelling corrections
[file updated]

what is your cinfiguration? OS, server, MySQL?, phpbb version, etc
could you give me link to your forums?
Last edited by brazaz on Wed Oct 29, 2003 11:13 pm, edited 1 time in total.

Jeffrey903
Registered User
Posts: 34
Joined: Thu Apr 10, 2003 8:27 pm

Post by Jeffrey903 » Wed Oct 29, 2003 10:43 pm

brazaz wrote: 2mm3guy 8)
Jeffrey903 wrote:A nice feature would be if the admin is told where the image is.

maybe..but admin could cheat if s/he would know where image is :D
thanks for spelling corrections

what is your cinfiguration? OS, server, MySQL?, phpbb version, etc
could you give me link to your forums?


http://s87057908.onlinehome.us/phpBB2/

I'm using www.1and1.com for my hosting (its free..with no ads or anything). Also, I know that the forum colors are a little bright...its just a temporary thing.

I'm actually going to use this mod for a contest...so I would like to know where the image is if possible.

The click me image is here right now - http://s87057908.onlinehome.us/phpBB2/v ... c.php?t=97 - it might not be though when you check it.

Something that I just noticed is that it adds a "0" to the page with the image on it (above the topic name).

brazaz
Registered User
Posts: 13
Joined: Wed Oct 29, 2003 5:06 am
Contact:

Post by brazaz » Wed Oct 29, 2003 11:10 pm

i don't know why...but there is a quick fix
open config.php and replace

Code: Select all

$dbms = 'mysql4';
with

Code: Select all

$dbms = 'mysql';
:roll:
this should work

Jeffrey903
Registered User
Posts: 34
Joined: Thu Apr 10, 2003 8:27 pm

Post by Jeffrey903 » Wed Oct 29, 2003 11:30 pm

brazaz wrote: i don't know why...but there is a quick fix
open config.php and replace

Code: Select all

$dbms = 'mysql4';
with

Code: Select all

$dbms = 'mysql';
:roll:
this should work


It works...thanks :-)

I have two things that I think would be useful:

1 - Allow admin to view where the link is
2 - Only show the link to registered users

xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder » Wed Oct 29, 2003 11:43 pm

atm its a bit hard because users have to trawl through loads of posts to find it, it could be somewhere really obscure too! So if they cant find it - there are no clicks and the game grinds to a halt :(

A solution would be to be able to set x number of buttons that would appear in y number of most recent posts, so for instance at any one time there could be 10 buttons floating around in the most reacent 150 posts?

Also a feature to stop it from displaying in certain boards would be most useful. Its still a great mod, and i have had loads of people playing with it today :D

Jeffrey903
Registered User
Posts: 34
Joined: Thu Apr 10, 2003 8:27 pm

Post by Jeffrey903 » Thu Oct 30, 2003 12:33 am

xmulder wrote: atm its a bit hard because users have to trawl through loads of posts to find it, it could be somewhere really obscure too! So if they cant find it - there are no clicks and the game grinds to a halt :(


I have it set to display in the 50 newest posts and I have no problem finding the image in less than 3 minutes.

Locked

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