[2.0.18] Cash Mod

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
1036
66%
Very Good
239
15%
Good
121
8%
Fair
36
2%
Poor
126
8%
 
Total votes: 1558

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 »

sparforum wrote: Permision to ask an off the topic question?


it's not like i can stop you, but i reserve the right to not answer...
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
sparforum
Registered User
Posts: 62
Joined: Fri Oct 17, 2003 6:01 am

Post by sparforum »

LoL.. ok,

http://sparforum.com/SPARForum/index.php

On my site it's listing the members twice, which file is this duplicated problem in... I looked through viewonline.php & template, did I miss it?

*Reserve away* ;)
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 »

sparforum wrote: LoL.. ok,

http://sparforum.com/SPARForum/index.php

On my site it's listing the members twice, which file is this duplicated problem in... I looked through viewonline.php & template, did I miss it?

*Reserve away* ;)


page_header.php

a lot of debugging phpbb is knowing both what to look for and where to look for it.
(Edit: and if you don't know where it is, how to track it down
this becomes easier the more coding experience you have)

The problem is either that
  1. when users are being added to the list, it goes through a cycle which is repeated twice (less likely)
  2. the list is just being concatted to itself before outputted to the browser (more likely)
look for

Code: Select all

if ( empty($online_userlist) )
and if you could paste the next 10 or so lines, it'll probably have the error in it. (this is a guess)
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
sparforum
Registered User
Posts: 62
Joined: Fri Oct 17, 2003 6:01 am

Post by sparforum »

10 or so lines you requested:

Code: Select all

	if ( empty($online_userlist) )
	{
		$online_userlist = $lang['None'];
	}
	$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;

	$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;

	if ( $total_online_users > $board_config['record_online_users'])
	{
		$board_config['record_online_users'] = $total_online_users;
		$board_config['record_online_date'] = time();

		$sql = "UPDATE " . CONFIG_TABLE . "
			SET config_value = '$total_online_users'
			WHERE config_name = 'record_online_users'";
		if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);
		}

		$sql = "UPDATE " . CONFIG_TABLE . "
			SET config_value = '" . $board_config['record_online_date'] . "'
			WHERE config_name = 'record_online_date'";
		if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);
		}
	}
<Ok so it was closer to "or so"> :D

Here's where it seemed to be calling it, looks like profile mod may have added a new feature, I may have inadvertantly upgraded incorrectly duplicating the old command what do you think:

Code: Select all

//-- mod : Customizable admin and modérators colors ------------------------------------------------------------------------------
//-- delete
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
//-- mod : profile cp ------------------------------------------------------------------------------
//-- delete
//	'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
//	'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
//-- add
	'L_WHOSONLINE' => get_users_online_color(),
//-- fin mod : profile cp --------------------------------------------------------------------------
//-- add
	'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span class="' . get_user_level_class(ADMIN) . '">', '</span>'),
	'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span class="' . get_user_level_class(MOD) . '">', '</span>'),
//-- fin mod : profile cp --------------------------------------------------------------------------
//-- add
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor5'] . '">', '</span>'),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor6'] . '">', '</span>'),
//-- fin mod : Customizable admin and modérators colors --------------------------------------------------------------------------
What amazes me about the human mind is that you see this as a second (if not closer to first) language. Sure, buts and pieces make sense to me, like 9th grade spanish, but you guys are really impressive...

thanX again,

C
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 »

sparforum wrote: if ( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;


this looks pretty clean.

check for any algorithms before these few lines that contain the variable $online_userlist.
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
Gaurav
Registered User
Posts: 7
Joined: Sun Oct 19, 2003 5:59 am

Post by Gaurav »

Thanx a lot Xore n Sneaky

I got my forums working now and the cash mod is working cool

the only problem I couldnt figure out was the cash configuration page.... :P I hope i ll solve that mystery some day.
ne ways what does that page have? i mean i set up my currency at the seetings page then wot other config am I missing? but I think if I can see the cash + donate it then I dont need any more config :P

If any one has any question abt installing the cash mod on a nukephp then I can hopefully help them :) u can YIM me.

I too have an off topic question if some one knows then plss let me know.

In my forums I have 2 admins one is the God id (the one that was created when i installed phpnuke) and then I made anothewr superuser.
The problem is that when I logint forums with any of them, it doesnt show that orange color for admin whereas it shows [ADMINISTATOR] as orrange.. also I cant edit/delete or see ip of the posters...... all this clearly indicating that phpbb is not reading my admins as admins.....
Do I need to make a usergroup called Admin with similar permissions for that or isit due to the phpnuke ?
Note: I did set their ranks as Site Admin (which was default rank in the phpbb)

Thanx a lot again
Gaurav
sparforum
Registered User
Posts: 62
Joined: Fri Oct 17, 2003 6:01 am

Post by sparforum »

Xore wrote:
sparforum wrote: if ( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;


this looks pretty clean.

check for any algorithms before these few lines that contain the variable $online_userlist.


Code: Select all

		// set the status
		switch ($status)
		{
			case 'guest':
				$guests_online++;
				break;
			case 'offline':
				$logged_hidden_online++;
				break;
			case 'online':
				$logged_visible_online++;
				break;
			case 'hidden':
				$connected[$i]['username'] = '<i>' . $connected[$i]['username'] . '</i>';
				$logged_hidden_online++;
				break;
			default:
		}

		$connected[$i]['status'] = $status;

		// add the user to the online list
		if ( ($status == 'online') || ($status == 'hidden') )
		{
			$online_userlist .= ( $online_userlist != '' ) ? ', ' : '';
			$online_userlist .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $connected[$i]['user_id'] ) . '"' . $connected[$i]['style'] . '>' . $connected[$i]['username'] . '</a>';
		}
	}
//-- fin mod : profile cp --------------------------------------------------------------------------
	// read buddy list
	$buddys = array();
	if (count($user_ids) > 0)
	{
		$s_user_ids = implode(', ', $user_ids);

		// get base info
		$sql = "SELECT * FROM " . BUDDYS_TABLE . " WHERE user_id=" . $userdata['user_id'] . " and buddy_id in ($s_user_ids)";
		if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not obtain buddys information.", '', __LINE__, __FILE__, $sql);
		while ( $row = $db->sql_fetchrow($result) )
		{
			$buddys[ $row['buddy_id'] ]['buddy_ignore'] = $row['buddy_ignore'];
			$buddys[ $row['buddy_id'] ]['buddy_my_friend'] = !$row['buddy_ignore'];
			$buddys[ $row['buddy_id'] ]['buddy_friend'] = false;
			$buddys[ $row['buddy_id'] ]['buddy_visible'] = false;
		}

		// check if in the topic author's friend list and "always visible" status he granted
		$sql = "SELECT * FROM " . BUDDYS_TABLE . " WHERE buddy_id=" . $userdata['user_id'] . " and user_id in ($s_user_ids)";
		if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, "Could not obtain buddys information.", '', __LINE__, __FILE__, $sql);
		while ( $row = $db->sql_fetchrow($result) )
		{
			if ( !isset($buddys[ $row['user_id'] ]) ) $buddys[ $row['user_id'] ]['buddy_ignore'] = false;
			if ( !isset($buddys[ $row['user_id'] ]) ) $buddys[ $row['user_id'] ]['buddy_my_friend'] = false;
			$buddys[ $row['user_id'] ]['buddy_friend'] = !$row['buddy_ignore'];
			$buddys[ $row['user_id'] ]['buddy_visible'] = $row['buddy_visible'];
		}
		$db->sql_freeresult($result);
	}

	// get visible/not visible status
	$user_id = $userdata['user_id'];
	$user_level = $userdata['user_level'];
	$is_admin = is_admin($userdata);

	for ($i=0; $i < count($connected); $i++)
	{
		$view_user_id = $connected[$i]['user_id'];
		$view_is_admin = is_admin($connected[$i]);

		$view_online_set = $connected[$i]['user_allow_viewonline'];

		$view_ignore	= ($is_admin || $view_is_admin || ($view_user_id == $user_id)) ? false : $buddys[$view_user_id]['buddy_ignore'];
		$view_friend	= $buddys[$view_user_id]['buddy_friend'];
		$view_visible	= ($is_admin || ($view_user_id == $user_id)) ? YES : $buddys[$view_user_id]['buddy_visible'];

		// online/offline/hidden icon
		if ($view_user_id == ANONYMOUS)
		{
			$status = 'guest';
		}
		else if ($view_ignore) 
		{
			$status = 'offline';
		}
		else
		{
			switch ($view_online_set)
			{
				case NO:
					$status = ($view_visible) ? 'hidden' : 'offline';
					break;
				case YES:
					$status = 'online';
					break;
				case FRIEND_ONLY:
					$status = ($view_friend || $view_visible) ? 'hidden' : 'offline';
					break;
				default:
					$status = '???';
			}
		}

		// set the status
		switch ($status)
		{
			case 'guest':
				$guests_online++;
				break;
			case 'offline':
				$logged_hidden_online++;
				break;
			case 'online':
				$logged_visible_online++;
				break;
			case 'hidden':
				$connected[$i]['username'] = '<i>' . $connected[$i]['username'] . '</i>';
				$logged_hidden_online++;
				break;
			default:
		}

		$connected[$i]['status'] = $status;

		// add the user to the online list
		if ( ($status == 'online') || ($status == 'hidden') )
		{
			$online_userlist .= ( $online_userlist != '' ) ? ', ' : '';
			$online_userlist .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $connected[$i]['user_id'] ) . '"' . $connected[$i]['style'] . '>' . $connected[$i]['username'] . '</a>';
		}
	}
//-- fin mod : profile cp --------------------------------------------------------------------------
This is just before the code you requested...

thanX

C
McLR
Registered User
Posts: 95
Joined: Thu Aug 21, 2003 12:51 pm

Post by McLR »

Hi
I want that if new user registering , and he will get a "special" amount of cash automaticly... how i can do this ?
something in database , right ?
tnx :roll:
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 »

sparforum wrote: ...

This is just before the code you requested...

thanX

C


if you look, you'll see that the first maybe 10-20 lines of what you posted is identical to the last 10-20 lines of what you posted. (possibly more, higher than what you posted at the beginning)

probably the easiest fix (although not necessarily the *best* way to fix it...)

is to take the one near the bottom,

Code: Select all

         $online_userlist .= ( $online_userlist != '' ) ? ', ' : ''; 
         $online_userlist .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $connected[$i]['user_id'] ) . '"' . $connected[$i]['style'] . '>' . $connected[$i]['username'] . '</a>'; 
and put // before these two lines.

It should look like

Code: Select all

//         $online_userlist .= ( $online_userlist != '' ) ? ', ' : ''; 
//         $online_userlist .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $connected[$i]['user_id'] ) . '"' . $connected[$i]['style'] . '>' . $connected[$i]['username'] . '</a>'; 
when you are done. Hopefully this should fix your problem.
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
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 »

McLR wrote: Hi
I want that if new user registering , and he will get a "special" amount of cash automaticly... how i can do this ?
something in database , right ?
tnx :roll:


default value, when creating a currency. If it's already created, change the default value for the column the currency is stored in in your database.
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
aka_flowerchild
Registered User
Posts: 28
Joined: Sun Aug 03, 2003 8:13 pm

Post by aka_flowerchild »

Hi! I have what is hopefully a really simple question...

I was considering downloading this mod (great idea!) but I was wondering, can the amount of cash per post be set to 0? So that way the only way to "earn" cash is to have it edited my a mod or admin, or donated by another user?

My apologies for not being willing to look through all 100+ pages of this thread for the answer in case it was posted already. :roll: I did scan several pages btw...

Thanks for your time.
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 »

aka_flowerchild wrote: Hi! I have what is hopefully a really simple question...

I was considering downloading this mod (great idea!) but I was wondering, can the amount of cash per post be set to 0? So that way the only way to "earn" cash is to have it edited my a mod or admin, or donated by another user?

My apologies for not being willing to look through all 100+ pages of this thread for the answer in case it was posted already. :roll: I did scan several pages btw...

Thanks for your time.


Yes. Several people have implemented Warning systems doing just exactly that. (except they turn the donate off)
Camels in the Mist
<noise type="random" source="camel" />
Cash Mod
sparforum
Registered User
Posts: 62
Joined: Fri Oct 17, 2003 6:01 am

Post by sparforum »

The Camel's Master strikes again! You dunit! Thanx again. I am deeply impressed with this community, and it is MOD leaders like you that do the impressing ;)

-thanks-

C
aka_flowerchild
Registered User
Posts: 28
Joined: Sun Aug 03, 2003 8:13 pm

Post by aka_flowerchild »

Xore wrote: Yes. Several people have implemented Warning systems doing just exactly that. (except they turn the donate off)

Awesome. Thanks for the quick response. :D
Kin Kelvin
Registered User
Posts: 34
Joined: Tue Aug 12, 2003 3:09 am

Post by Kin Kelvin »

is there a faq or something to make cash mod compatible with zareths bank mod? that so i dont have top read the 106 pages?
Post Reply

Return to “[2.0.x] MOD Database Releases”