[DEV] CamelMOD 1.1.4

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.
User avatar
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

[DEV] CamelMOD 1.1.4

Post by Xore » Sun Jul 20, 2003 1:29 am

This is a fairly simple mod, but i would like some help developing it.

This is what i have so far, it rests completely as a mod. Does anyone want to help me test it?

Click here for CamelMod 1.1.4 :-) (latest version)
(we suggest you do _not_ use 1.0.0, as it is unworkable with lots of bugs)

Code: Select all

############################################################## 
## MOD Title: Camel Mod
## MOD Author: Xore < xore@azuriah.com > Xore http://forums.azuriah.com
## MOD Description: Camel MOD
## MOD Version: 1.0.0
## 
## Installation Level: Easy
## Installation Time: 1 Minute 
## Files To Edit: common.php, 
## Included Files: includes/camel.php
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: I'd like to thank Pit, who gave me the vision, to make a wonderful mod of this calibre
############################################################## 
## MOD History:
## v1.0.0 First version release. no bugs, i hope :P
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
# 
#-----[ COPY ]------------------------------------------ 
#
copy includes/camel.php to includes/camel.php

# 
#-----[ OPEN ]------------------------------------------ 
#
common.php

# 
#-----[ FIND ]------------------------------------------ 
# 
include($phpbb_root_path . 'includes/db.'.$phpEx);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
include($phpbb_root_path . 'includes/camel.'.$phpEx);

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 

includes/camel.php:

Code: Select all

<?php
/***************************************************************************
 *                                camel.php
 *                            -------------------
 *   begin                : Saturday, Jul 19, 2003
 *   copyright            : (C) 2003 Xore
 *   email                : xore@azuriah.com
 *
 *   $Id: camel.php,v 1.0.0.0 2003/07/19 17:56:35 Xore Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
}

$activate = (rand(1,100) == 1);

if($activate)
{
	$messages = array();
	$messages[] = "The camel strikes again";
	$messages[] = "You have been pwned by the camel";
	$messages[] = "Camels are bad for your heath";
	$messages[] = "The Camel demands fresh prawns from Alabama!";
	$messages[] = "The SDC kicks the Technology Camel in the<br />[content edited for quality control]";
	$messages[] = "ph34r teh Camel";
	$messages[] = "The Camel wants <b>You</b> for the phpBB army!";
	$messages[] = "The camel makes random camel noises";
	$messages[] = "When the Camel comes out of it's shed and sees it's shadow,<br />we all know that the summer will last longer";
	$messages[] = "The camel accepts your generous donation of hay";
	$messages[] = "[insert odd camel noises here]";
	$messages[] = "Have you seen your camel today?";
	$messages[] = "If you haven't got your camel... you haven't got... anything";
	$messages[] = "C.A.M.E.L.s? Oh, i don't believe they exist.";
	$messages[] = "A camel in need is a camel indeed";
	$messages[] = "Life is like a box of Camels, you never know what you're going to get";
	$messages[] = "\"We discovered, to our error, that we were to late. The Camels had already been here\"<br /><i>fragment discovered in ancient Egypt, author unknown";
	$messages[] = "When life hands you camels, make Camelaid!";
	$messages[] = "All Camels go to heaven";
	$messages[] = "Beware of Camel";
	$messagenum = rand(0,count($messages));
	message_die(GENERAL_MESSAGE, $messages[$messagenum]);

}
?>
Last edited by Xore on Tue Sep 02, 2003 8:37 pm, edited 5 times in total.
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34447
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Post by A_Jelly_Doughnut » Sun Jul 20, 2003 2:14 am

Uh, why would I want to add a MOD telling about camels on my forum exactly?
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

User avatar
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore » Sun Jul 20, 2003 2:49 am

1.1.4 Fix

1.1.1:
(If camelage is set to 1, this will completely and utterly bork your forum.
This is what we call 'Camel Overdrive'
It is recomended you not set your camelage to anything less than 4)

This fix is in the adminCP, where it ensures that camelage is greater than 1

1.1.2: fixed a parse error. Thanks to Ksilebo for discovering this bug :-)

1.1.3: fixed a running error. Once again, thanks to Ksilebo for helping to fix this

1.1.4: fixed some more minor errrors. Thank you, Twizter :-)

Code: Select all

############################################################## 
## MOD Title: Camel Mod
## MOD Author: Xore < xore@azuriah.com > Xore http://forums.azuriah.com
## MOD Description: Camel MOD
## MOD Version: 1.1.4
## 
## Installation Level: Easy
## Installation Time: 1 Minute 
## Files To Edit: common.php
## Included Files: includes/camel.php,
##                 admin/admin_camel.php,
##                 templates/subSilver/admin/admin_camel.tpl
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: I'd like to thank Pit, who gave me the vision, to make a wonderful mod of this calibur
############################################################## 
## MOD History:
## v1.1.4 Indexing fix, as well as ampersand listing errors
## v1.1.3 Runtime Fix
## v1.1.2 Parse Error Bug Fix
## v1.1.1 Camelage Overdrive Bug Fix
## v1.1.0 Added an admin control panel :-)
## v1.0.0 First version release. no bugs, i hope :P
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
# 
#-----[ SQL ]------------------------------------------ 
# 
#   If you have a different table prefix then change this command accordingly. 
#   I have used the default table prefix! 
# 
INSERT INTO phpbb_config (config_name, config_value) VALUES ('camelage','100');

# 
#-----[ COPY ]------------------------------------------ 
#
copy includes/camel.php                        to includes/camel.php
copy admin/admin_camel.php                     to admin/admin_camel.php
copy templates/subSilver/admin/admin_camel.tpl to templates/subSilver/admin/admin_camel.tpl

# 
#-----[ OPEN ]------------------------------------------ 
#
common.php

# 
#-----[ FIND ]------------------------------------------ 
# 
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
include($phpbb_root_path . 'includes/camel.'.$phpEx);

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 

admin/admin_camel.php

Code: Select all

<?php
/***************************************************************************
 *                              admin_camel.php
 *                            -------------------
 *   begin                : Saturday, Apr 19, 2003
 *   copyright            : (C) 2003 Xore
 *   email                : xore@azuriah.com
 *
 *   $Id: admin_camel.php,v 1.0.0.0 2003/07/19 19:16:26 Xore $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', 1);

if ( !empty($setmodules) )
{
	$file = basename(__FILE__);
	$module['Camel Mod']['Camel Mod Configuration'] = "$file?mode=config";
	return;
}

//
// Let's set the root dir for phpBB
//
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);

$sql = "SELECT *
	FROM " . CONFIG_TABLE;
if ( !$result = $db->sql_query($sql) )
{
	message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}
$allowed_array = array( 'camelage' => true);
while ( $row = $db->sql_fetchrow($result) )
{
	$config_name = $row['config_name'];
	$config_value = $row['config_value'];
	$default_config[$config_name] = $config_value;
	
	$new[$config_name] = $default_config[$config_name];

	if ( $allowed_array[$config_name] &&
		 isset($HTTP_POST_VARS['submit']) &&
		 isset($HTTP_POST_VARS[$config_name]) )
	{
		if ( ($config_name == 'camelage') && ($HTTP_POST_VARS[$config_name] < 2) )
		{
			$HTTP_POST_VARS[$config_name] = 2;
		}
		$new[$config_name] = stripslashes($HTTP_POST_VARS[$config_name]);
		$sql = "UPDATE " . CONFIG_TABLE . " SET
			config_value = '" . addslashes($new[$config_name]) . "'
			WHERE config_name = '$config_name'";
		if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, "Failed to update Camel Mod configuration", "", __LINE__, __FILE__, $sql);
		}
	}
}

if ( isset($HTTP_POST_VARS['submit']) )
{
	$message = "Camel Mod updated<br /><br />Click <a href=\"" . append_sid("admin_camel.$phpEx") . "\">here</a>to return to Camel Mod configuration<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");

	message_die(GENERAL_MESSAGE, $message);
}

$template->set_filenames(array(
	"body" => "admin/admin_camel.tpl")
);

$template->assign_vars(array(
	"S_CAMEL_ACTION" => append_sid("admin_camel.$phpEx"),

	"L_CAMEL_TITLE" => "Camel Configuration",
	"L_CAMEL_EXPLAIN" => "This is where you can set your options for Camel Mod",

	"L_CAMEL_SETTINGS" => "Camel MOD Settings",

	"L_CAMELAGE" => "Camelage",
	"L_CAMELAGE_EXPLAIN" => "This is where you set your camelage",

	"L_SUBMIT" => $lang['Submit'], 
	"L_RESET" => $lang['Reset'],

	"CAMELAGE" => $new['camelage'])
);

$template->pparse("body");

include('./page_footer_admin.'.$phpEx);

?>
templates/subSilver/admin/admin_camel.tpl

Code: Select all

<h1>{L_CAMEL_TITLE}</h1>

<p>{L_CAMEL_EXPLAIN}</p>

<form action="{S_CAMEL_ACTION}" method="post"><table width="99%" cellpadding="4" cellspacing="1" border="0" align="center" class="forumline">
	<tr>
	  <th class="thHead" colspan="2">{L_CAMEL_SETTINGS}</th>
	</tr>
	<tr>
		<td class="row1">{L_CAMELAGE}<br /><span class="gensmall">{L_CAMELAGE_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" maxlength="255" size="40" name="camelage" value="{CAMELAGE}" /></td>
	</tr>
	<tr>
		<td class="catBottom" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" class="liteoption" />
		</td>
	</tr>
</table></form>

<br clear="all" />

includes/camel.php:

Code: Select all

<?php
/***************************************************************************
 *                                camel.php
 *                            -------------------
 *   begin                : Saturday, Jul 19, 2003
 *   copyright            : (C) 2003 Xore
 *   email                : xore@azuriah.com
 *
 *   $Id: camel.php,v 1.1.1.0 2003/09/01 18:11:00 Xore Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
}

//
// Get Camelage
//
$sql = "SELECT config_value FROM " . CONFIG_TABLE . " WHERE config_name = 'camelage'";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Could not obtain Camelage.", '', __LINE__, __FILE__, $sql);
}
$camelage = 1;
if ( $row = $db->sql_fetchrow($result) )
{
	$camelage = $row['config_value'];
}

if ( rand(1,$camelage) == 1 )
{
	$userdata = session_pagestart($user_ip, PAGE_INDEX);
	init_userprefs($userdata);

	$messages = array();
	
	$messages[] = "The camel strikes again";
	$messages[] = "You have been pwned by the camel";
	$messages[] = "Camels are bad for your heath";
	$messages[] = "The Camel demands fresh prawns from Alabama!";
	$messages[] = "The SDC kicks the Technology Camel in the<br />[content edited for quality control]";
	$messages[] = "ph34r teh Camel";
	$messages[] = "The Camel wants <b>You</b> for the phpBB army!";
	$messages[] = "The camel makes random camel noises";
	$messages[] = "When the Camel comes out of it's shed and sees it's shadow,<br />we all know that the summer will last longer";
	$messages[] = "The camel accepts your generous donation of hay";
	$messages[] = "[insert odd camel noises here]";
	$messages[] = "Have you seen your camel today?";
	$messages[] = "If you haven't got your camel... you haven't got... anything";
	$messages[] = "C.A.M.E.L.s? Oh, i don't believe they exist.";
	$messages[] = "A camel in need is a camel indeed";
	$messages[] = "Life is like a box of Camels, you never know what you're going to get";
	$messages[] = "\"We discovered, to our error, that we were to late. The Camels had already been here\"<br /><i>fragment discovered in ancient Egypt, author unknown";
	$messages[] = "When life hands you camels, make Camelaid!";
	$messages[] = "All Camels go to heaven";
	$messages[] = "Beware of Camel";
	$messages[] = "Everybody needs a Camel sometime";
	$messages[] = "Got Camel?";
	
	message_die(GENERAL_MESSAGE, $messages[rand(0,count($messages)-1)]);

}
?>
Last edited by Xore on Tue Sep 02, 2003 1:08 am, edited 7 times in total.
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod

User avatar
Alabama HS Sports
Registered User
Posts: 422
Joined: Tue Mar 11, 2003 12:11 am
Location: Mobile, Alabama
Contact:

Post by Alabama HS Sports » Sun Jul 20, 2003 3:18 am

what is this mod exactly??
NO!! I am not a male. I'm female. Stop asking.

theanimewizard
Registered User
Posts: 646
Joined: Tue Jul 08, 2003 9:24 pm
Contact:

Post by theanimewizard » Sun Jul 20, 2003 3:26 am

does it display a random message ?

where, when?

i want this mod ^^

if would be cool if its a randm pop-up thing =P

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll » Sun Jul 20, 2003 8:56 am

I don't think popups are the best idea

and if you look at the notes you will notice that it is pit inspired :P

theanimewizard
Registered User
Posts: 646
Joined: Tue Jul 08, 2003 9:24 pm
Contact:

Post by theanimewizard » Sun Jul 20, 2003 9:13 am

David, wat does Pit inspired mean... xore can u tell us what this does xP

User avatar
vze3k59w
Registered User
Posts: 485
Joined: Fri May 09, 2003 1:09 am

Post by vze3k59w » Sun Jul 20, 2003 1:55 pm

Pit is a great person around phpbb
Wanna join a very advanced OO based modular port of phpBB? PM me :)

R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 » Sun Jul 20, 2003 2:00 pm

This has to be one of the must well thought out mods ever created. ^_^

A feature to add would be to have it edit people's posts and throw in random lines.

User avatar
pepitonet
Registered User
Posts: 106
Joined: Thu May 22, 2003 10:43 pm
Contact:

Post by pepitonet » Sun Jul 20, 2003 8:24 pm

XORE can you explaion what does this mod do,people keep babletting about it but no one says something about what it actually does .
<don't know why people do that>

User avatar
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore » Sun Jul 20, 2003 8:50 pm

Bugfix:

We have had instances by our users of less than average intelligence using this mod experience something we call 'Camel Overdrive'

This occurs when you set your Camelage to 1

While considerably amusing, it is recommended you do not set your camelage to 1, as Camel Overdrive will completely bork your forum. Do not do this to yourself.

I have replaced the code of 1.1.0 with 1.1.1, which fixes the problem. the only file you need to replace is the admin_camel.php

Enjoy !

:-)
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod

User avatar
ChristianWeb
Registered User
Posts: 42
Joined: Wed Nov 13, 2002 6:24 pm
Contact:

Post by ChristianWeb » Sun Jul 20, 2003 9:26 pm

I think he's gone off the deep end. LOL Just kidding. What kinda mod is this? :?: 8O 8O 8O

User avatar
pollix
Registered User
Posts: 153
Joined: Tue Jul 23, 2002 6:29 pm
Location: Ridgecrest, CA
Contact:

Post by pollix » Sun Jul 20, 2003 11:27 pm

:lol: ahhhh.... what does this mod do?????

User avatar
Xore
Former Team Member
Posts: 2594
Joined: Wed Apr 16, 2003 7:42 pm
Location: the wastelands between insomnia and clairvoyance
Contact:

Post by Xore » Sun Jul 20, 2003 11:45 pm

/me smiles mysteriously
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod

User avatar
leon2ky
Registered User
Posts: 93
Joined: Mon Mar 03, 2003 9:13 pm

Post by leon2ky » Mon Jul 21, 2003 6:50 am

jesus tell us wtf this thing does :evil:

Post Reply

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

Who is online

Users browsing this forum: No registered users and 14 guests

cron