View Single Post
  #3  
Old 08-13-2003, 10:03 AM
Orphen Orphen is offline
 
Join Date: Aug 2003
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes you can first you need to install.

Paycheck Hack for Lesane's Store by Eander

After that then you need to edit paycheck.php file.

When you edit it put this in you will be able to send it to all the default groups including regular users. If you need to get a certain group that you have added you can edit the file to add that group.


Code:
<?

/* Paycheck Hack By Eander
Save this as paycheck.php and upload it to your admin directory */
require("./global.php");

cpheader();

if (isset($action)==0) {
  echo "Nothing to see here. Have a nice day!";
}

if ($action=="pay1") {
?>
<form method=post action=paycheck.php?action=pay2>
Amount to pay: <input type=text name=amount><br>
Usergroups to pay: 
<ul>
<li><input type=checkbox name=admins value=6 checked>Administrators
<li><input type=checkbox name=regus value=2 checked>Reg users
<li><input type=checkbox name=mods value=7 checked>Moderators
<li><input type=checkbox name=megas value=5 checked>Mega Moderators
</ul>
<input type=submit value="Pay Now">
<?
die;
}
elseif ($action=="pay2") {
	if (!$amount) {
		?>You provided a null amount. <a href=javascript:history.go(-1)>Back</a><?
		die;
	}
	else {
		$who=get_defined_vars();
		if ($who["admins"]==6 or $who["regus"]==2 or $who["mods"]==7 or $who["megas"]==5) {
			$myquery="UPDATE user SET storep=storep+$amount WHERE";
			$myqueryadd="";
			if ($who["admins"]==6) {
				$myqueryadd.=" usergroupid=6";
				$add=" OR";
			}
			if ($who["regus"]==2) {
				$myqueryadd.=$add." usergroupid=2";
				$add=" OR";
			}
			if ($who["mods"]==7) {
				$myqueryadd.=$add." usergroupid=7";
				$add=" OR";
			}
			if ($who["megas"]==5) {
				$myqueryadd.=$add." usergroupid=5";
			}
			$payquery=$DB_site->query($myquery.$myqueryadd);
			$checkquery=$DB_site->query("SELECT userid,username FROM user WHERE" . $myqueryadd);
			for ($x=1;$checkrow=mysql_fetch_array($checkquery);$x++) {
				$pmgivemessage="Dear " . $checkrow[username] . ",\n\nYour paycheck for helping administer these forums has been paid. You have been given $amount store points for your efforts. Keep up the good work!";
				$sendpm=$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,messageread,folderid) VALUES (NULL,'$checkrow[userid]','$checkrow[userid]','$bbuserinfo[userid]','Your Paycheck','".addslashes($pmgivemessage)."',".time().",0,0)");
				echo "PM sent to $checkrow[username] <br>";
			}
			echo "Success.";
			die;
		}
		else {
			echo "You didn't specify a usergroup to pay.";
			die;
		}
	}
}
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01159 seconds
  • Memory Usage 1,774KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete