Jump to content

The Ctrl + V Game


Brushfire

Recommended Posts

  • Replies 741
  • Created
  • Last Reply

Morphs.

 

And Frogs.

 

I'm here to show you a deck of each.

Morphtown:

 

Gadget Hauler /1

Slingen /3

Boomboxen /3

Radion /3

Cameran /3

Boarden /3

Celfon /3

Magnen /2

 

Morph Map /3

Morph Accelerator /2

Mist Body /2

Heavy /1

Vortex /1

Roborn /1

Terraforming /1

 

Limit Reverse /3

No Entry!! /2

Torrential /1

Light of Intervention /1

 

Total /40

 

Qu's Buffet:

 

Hydrogeddon /3

Mother Grizzly /3

Submarine Frog /3

Flip-Flop Frog /3

Unifrog /3

Dupe Frog /2

Mobius /2

The Fool /2

 

Qu's Marsh (Wetlands) /3

Terraforming /1

Heavy /1

Vortex /1

Trunade /1

B-Con /1

Shrink /1

Smashing /1

SoRL /1

Salvage /1

 

Graceful Revival /3

Froggy Forcefield/2

Torrential /1

Ultimate Offering /1

Gravity Bind /1

 

And, There you go.

R/F Welcomed.

Try to keep it on a budget, people, and don't suggest anything above Rare.Thanks!

 

 

 

 

Indeed.

.

.

.

.

.

Link to comment
Share on other sites

 

 

Intro

X3

C|------------|------------|------------|------------|------------|x--x--------|

S|------------|------------|---o-----o--|---o-----o--|---o-----o--|---o--oooooo|

F|------------|-------ooo--|o----oo----o|o----oooo-oo|o----oo----o|------------|

B|------------|------------|o--o--o--o--|o--o--o--o--|o--o--o--o--|o--o--o--o--|

 

Verse

C|x-----------|------------|------------|------------|x-----------|------------|

H|---x--x--x--|x--x--x--x--|x--x--x--x--|x--x--X--X--|---x--x--x--|x--x--x--x--|

S|---o-----o--|---o-----o-o|---o-----o--|---o----o--o|---o-----o--|---o-----o-o|

B|o-----o-----|o-----o-o---|o-----o-----|o-----o--o--|o-----o-----|o-----o-o---|

 

C|------------|------------|x-----------|------------|x-----------|x--x--------|

H|x--x--x--x--|x--x--X--X--|---x--x--x--|x--x--x--x--|---x--x--x--|------------|

S|---o-----o--|---o----o--o|---o-----o--|---o-----o--|---o-----o--|---o-ooooooo|

B|o-----o-----|o-----o--o--|o-----o-----|o-----o-o---|o-----o-----|o-o---o--o--|

 

C|x-----------|------------|------------|------------|x-----------|------------|

H|---x--x--x--|x--x--x--x--|x--x--x--x--|x--x--X--X--|---x--x--x--|x--x--x--x--|

S|---o-----o--|---o-----o-o|---o-----o--|---o----o--o|---o-----o--|---o-----o-o|

B|o-----o-----|o-----o-o---|o-----o-----|o-----o--o--|o-----o-----|o-----o-o---|

 

C|x-----------|x--x--------|

H|---x--x--x--|------------|

S|---o-----o-o|---o-ooooooo|

B|o-----o-o---|o-o---o--o--|

 

Chorus

C|x-----------|x-----------|x-----------|x--x-----x--|x-----------|x-----------|

R|---x--x--x--|---x--x--x--|---x--x--x--|------------|---x--x--x--|---x--x--x--|

H|------------|------------|------------|------X-----|------------|------------|

S|---o-----o--|---o-----o--|---o-----o--|---o-o---o--|---o-----o--|---o-----o--|

B|o-----o-o---|o-----o-o---|o-----o-o---|o-o---o-o---|o-----o-o---|o-----o-o---|

 

C|x-----------|x--x--x--x--|------------|

R|---x--x--x--|------------|------------|

S|---o-----o--|---o-o---o-o|F--------F--|

B|o-----o-o---|o-o---o-o---|------------|

 

Pre Verse

C|------------|------------|------------|o--o--------|

S|---o-----o--|---o-----o--|---o-----o--|---o--oooooo|

F|o----oo----o|o----oooo-oo|o----oo----o|------------|

B|o--o--o--o--|o--o--o--o--|o--o--o--o--|o--o--o--o--|

 

Verse

C|x-----------|------------|------------|------------|x-----------|------------|

H|---x--x--x--|x--x--x--x--|x--x--x--x--|x--x--X--X--|---x--x--x--|x--x--x--x--|

S|---o-----o--|---o-o---o-o|---o-----o--|---o----o--o|---o-----o--|---o-----o--|

B|o-----o-----|o-----o-o---|o-----o-----|o-----o--o--|o-----o-----|o-----o-o---|

 

C|x-----------|x--x--------|x-----------|------------|------------|------------|

H|---x--x--x--|------------|---x--x--x--|x--x--x--x--|x--x--x--x--|x--x--X--X--|

S|---o-----o-o|---o-ooooooo|---o-----o--|---o-o---o-o|---o-----o--|---o----o--o|

B|o-----o-----|o-o---o--o--|o-----o-----|o-----o-o---|o-----o-----|o-----o--o--|

 

C|x-----------|------------|x-----------|x--x--x-----|

H|---x--x--x--|x--x--x--x--|---x--x--x--|------------|

S|---o-----o--|---o-----o-o|---o-----o-o|---o-o---ooo|

B|o-----o-----|o-----o-o---|o-----o-o---|o-o---o-o---|

 

Chorus

C|x-----------|x-----------|x-----------|x--x--x--x--|x-----------|x-----------|

R|---x--x--x--|---x--x--x--|---x--x--x--|------------|---x--x--x--|---x--x--x--|

S|---o-----o--|---o-----o--|---o-----o--|---o-o---o--|---o-----o--|---o-----o--|

B|o-----o-o---|o-----o-o---|o-----o-o---|o-o---o-o---|o-----o-o---|o-----o-o---|

 

C|x-----------|x--x--x--x--|------------|

R|---x--x--x--|------------|------------|

S|---o-----o--|---o-o---o-o|F--------F--|

B|o-----o-o---|o-o---o-o---|------------|

 

Bridge

<<<<<<<<<<<<<<<<<<<<<<< X2

>>>>>>>>>>>>>>>>>>>>>>

C|x--x--x--x--|x--x--x--x--|x--x--x--x--|x--x--x-----|

S|---o-----o--|---o-----o--|---o-----o--|---o--------|

F|------------|------------|------------|-------ooo--|

B|o----oo----o|o-----o-----|o----oo----o|o-----o-----|

 

C|x-----------|x-----------|x-----------|x--x-----x--|x-----------|x-----------|

R|---x--x--x--|---x--x--x--|---x--x--x--|------x-----|---x--x--x--|---x--x--x--|

S|---o-----o--|---o-----o--|---o-----o--|---o-----o--|---o-----o--|---o-----o--|

B|o-----o-o---|o-----o-o---|o-----o-o---|o-----o-o---|o-----o-o---|o-----o-o---|

 

C|x--x-----x--|---x-----x--|x--x--x--x--|------------|

R|------x-----|x-----x-----|------------|------------|

S|---o-----o--|---o-----o--|---o-----o--|oooooooooooo|

B|o-----o-o---|o-o---o-o---|o-----o-----|------------|

 

X6

S|o-----------|------------|---------o--|

B|o--o--o--o--|o--o--o--o--|o--o--o--o--|

 

<<<<<<<<<<< X5 >>>>>>>>>>>

C|------------|------------|------------|x--x--x-----|------------|------------|

S|---o-----o--|---o-----o--|---o-----o--|---o-----o--|---o-----o--|---o-----o--|

F|o----oo----o|o----oooo--o|o----oo----o|------------|o----oo----o|o----oooo-oo|

B|o--o--o--o--|o--o--o--o--|o--o--o--o--|o--o--o--o--|o--o--o--o--|o--o--o--o--|

 

X2

C|------------|x--x--x-----|------------|------------|------------|

H|------------|---------X--|------------|------------|------------|

S|---o-----o--|---o-----o--|------------|---o-----o--|oooooooooooo|

F|o----oo----o|-----------o|o-oo-oo-oo-o|o-o--oo-o---|------------|

B|o--o--o--o--|o--o--o--o--|o--o--o--o--|o--o--o--o--|------------|

 

Outro

C|x-----------|x-----------|x-----------|x--x--x--x--|x-----------|x-----------|

R|---x--x--x--|---x--x--x--|---x--x--x--|------------|---x--x--x--|---x--x--x--|

S|---o-----o--|---o-----o--|---o-----o--|---o-o---o-o|---o-----o--|---o-----o--|

B|o-----o-o---|o-----o-o---|o-----o-o---|o-o---o-o---|o-----o-o---|o-----o-o---|

 

C|x-----------|x--x-----x--|x-----------|x-----------|x-----------|x--x--x--x--|

R|---x--x--x--|------x-----|---x--x--x--|---x--x--x--|---x--x--x--|------------|

S|---o-----o--|---o-o---o-o|---o-----o--|---o-----o--|---o-----o--|---o-o---o-o|

B|o-----o-o---|o-o---o-o---|o-----o-o---|o-----o-o---|o-----o-o---|o-o---o-o---|

 

X3

C|x-----------|x-----------|x-----------|x--x--x--x--|------------|

R|---x--x--x--|---x--x--x--|---x--x--x--|------------|------------|

S|---o-----o--|---o-----o-o|---o-----o-o|---o-o---o-o|oooooooooooo|

B|o-----o-o---|o-----o-o---|o-----o-o---|o-o---o-o---|------------|

 

C|x-----------|------------|------------|------------|x-----------|------------|

H|---X--X--X--|X--X--X--X--|X--X--X--X--|X--X--X--X--|---X--X--X--|X--X--X--X--|

S|---o-o---o-o|---o-o---o-o|---o-o---o-o|---o-o--o--o|---o-o---o-o|---o-o---o-o|

B|o-----o-----|o-----o-o---|o-----o-----|o-----o--o--|o-----o-----|o-----o-o---|

 

C|------------|x--x--x-----|

H|X--X--X--X--|------------|

S|---o-o---o--|------------|

F|------------|---------ooo|

B|o-----o-----|o--o--o-----|

 

 

^tabs for Holiday

Link to comment
Share on other sites

[spoiler=]function lottery_info(){

return array(

"name" => "Lottery",

"description" => "Add lottery to myplaza",

"website" => "http://www.keyvan.ws/projects/mybb/myplaza_modules",

"author" => "Keyvan fakhri shojaie",

"authorsite" => "http://www.keyvan.ws",

"version" => "1.0.2",

);

}

 

function lottery_lang(){

global $mybb,$lang;

switch($mybb->settings['bblanguage']){

default:

$lang->lottery="Lottery";

$lang->buy_ticket="Buy new ticket ";

$lang->your_ticket="Your tickets";

$lang->ticket_price="Each ticket price";

$lang->lottery_buy_log="You bought a ticket number : %s price: %s";

$lang->enough_money="Sorry, you don\'t have enough money.";

$lang->lottery_rest_time="Lottery is in rest time, please try again later.";

$lang->lottery_ticketbuy_success="Ticket bought successfully.";

$lang->lottery_win_log="Your ticket number %s win %s";

$lang->lottery_countdown="%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds Remain to draw";

$lang->lottery_last_winner='%s earned %s in last term';

$lang->lottery_winner='%s earned %s in this term';

$lang->lottery_win='Winner earn %s';

$lang->winner_ticket='WINNER TICKET';

$lang->winner_ticket_hide='_ _ _ _';

$lang->viewing_Lottery='Viewing Lottery';

$lang->lottery_drawed="Draw is done.";

$lang->lottery_noticket="NO WINNER";

$lang->buy="buy";

$lang->lottery_ticket_bought="%s Ticket Bought ";

$lang->lottery_end="Lottery End : %s";

}

}

 

function lottery_lang_admin(){

global $mybb,$lang;

switch($mybb->settings['bblanguage']){

default:

$lang->lottery="Lottery";

$lang->lottery_settings="Lottery settings";

$lang->setting_lottery_draw_frequency="Time between each drawing";

$lang->setting_lottery_draw_frequency_desc="How often (in seconde) the lottery is run";

$lang->setting_lottery_rest="Rest time";

$lang->setting_lottery_rest_desc="Time (in seconds) between each term that the winers are shown and users are not allowed to buy tickets";

$lang->setting_lottery_usepot="Use Lottery Pot";

$lang->setting_lottery_usepot_desc="If yes, the cost of each ticket goes towards the pot of the lottery.";

$lang->setting_lottery_ticket_price="Price of each ticket";

$lang->setting_lottery_win="the money which will be pay to the winners?";

$lang->setting_lottery_win_desc="";

$lang->item_lottery_ticket_name = 'lottery ticket';

$lang->item_lottery_ticket_desc = '';

}

}

 

define('LOTTERY_ADD_TEMPLATE_PLAZAHEADER','

%7B$mybb-{$lang->lottery}');

 

function lottery_modify_plaza_templates()

{

find_replace_myplaza_template('plaza_header','{$lang->plaza_history}', '{$lang->plaza_history}'.LOTTERY_ADD_TEMPLATE_PLAZAHEADER, 'str_replace');

}

 

function lottery_restore_plaza_templates()

{

find_replace_myplaza_template('plaza_header',LOTTERY_ADD_TEMPLATE_PLAZAHEADER,'','str_replace');

}

 

function lottery_add_templates()

{

$new_templates = array();

$new_templates['plaza_lottery'] = '

{$plaza_header}

%7B$mybb-{$lang->viewing_Lottery}

{$lang->buy_ticket}
{$buyticket}

{$lotteryinfo}

{$lang->your_ticket}
{$usertickets}

{$plaza_footer}

';

 

$new_templates['plaza_lottery_buyticket'] = '

{$lang->ticket_price} : {$lottery_ticket_price}

 

';

 

$new_templates['plaza_lottery_info'] = '

 

 

{$lottery_end}

{$lottery_countdown}

{$lottery_win}

 

{$ticket_bought}

 

{$lang->winner_ticket} : {$winner_ticket_number}

 

{$last_winner}

';

 

$new_templates['plaza_lottery_countdown'] = '

CountActive = true;

CountStepper = -1;

LeadingZero = true;

var secs={$lottery_sec};

DisplayFormat = "{$lang->lottery_countdown}";

FinishMessage = "{$lang->lottery_drawed}";

 

function calcage(secs, num1, num2) {

s = ((Math.floor(secs/num1))%num2).toString();

if (LeadingZero && s.length < 2)s = "0" + s;

return "" + s + "";

}

 

function CountBack(secs) {

if (secs < 0) {

document.getElementById("cntdwn").innerHTML = FinishMessage;

location.href="plaza.php?action=page&p=lottery&refresh="+parseInt(Math.random()*(999));

return;

}

DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));

DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));

DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));

DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));

 

document.getElementById("cntdwn").innerHTML = DisplayStr;

if (CountActive){

setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod);

}

}

 

CountStepper = Math.ceil(CountStepper);

if (CountStepper == 0) CountActive = false;

var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;

CountBack(secs);

';

 

add_templates($new_templates);

}

 

function lottery_remove_templates()

{

global $db;

 

$db->delete_query(MY_TABLE_PREFIX.'templates','title IN (\'plaza_lottery\',\'plaza_lottery_buyticket\',\'plaza_lottery_info\') AND sid=\'-1\'');

}

 

function lottery_reconstruct_templates()

{

lottery_remove_templates();

lottery_add_templates();

lottery_restore_plaza_templates();

lottery_modify_plaza_templates();

}

 

function lottery_activate(){

global $lang,$cache;

db_create_table('plaza_lottery_tickets', array(

'ticket_id' => array('type' => 'int' , 'not_null' => true, 'auto_increment' => true),

'term_id' => array('type' => 'bigint', 'size' => 30, 'not_null' => true),

'uid' => array('type' => 'int', 'size' => 5, 'not_null' => true),

'dateline' => array('type' => 'bigint', 'size' => 30, 'not_null' => true)

), array(

array('type' => 'primary', 'fields' => 'ticket_id'),

array('type' => 'key', 'fields' => 'uid')

));

db_create_table('plaza_lottery_term', array(

'term_id' => array('type' => 'int', 'not_null' => true, 'auto_increment' => true),

'winner_uid' => array('type' => 'int', 'size' => 5, 'not_null' => true),

'winner_ticket_number' => array('type' => 'varchar', 'size' => 150, 'not_null' => true),

'ticket_count' => array('type' => 'int', 'size' => 8, 'not_null' => true),

'money' => array('type' => 'decimal', 'size' => '20,2', 'not_null' => true),

'start_time' => array('type' => 'bigint', 'size' => 30, 'not_null' => true),

'end_time' => array('type' => 'bigint', 'size' => 30, 'not_null' => true)

), array(array('type' => 'primary', 'fields' => 'term_id')));

 

myplaza_langload('lottery',true);

 

lottery_add_templates();

lottery_modify_plaza_templates();

 

plugins_add_passive_hook('myplaza_admin_myplaza_reconstruct_templates', 'lottery_modify_plaza_templates', 20, true);

 

plugins_add_passive_hook('plaza_start','lottery_loadlang');

 

myplaza_add_item(array(

"idname" => 'lottery_ticket',

"cost" => 0,

"visible" => MY_NO,

"htmlextra" => 'This item cannot be purchased from the plaza.'

));

 

add_settings(array(

array(

"name" => 'lottery_ticket_price',

"optionscode" => 'text',

"value" => 100,

),

array(

"name" => 'lottery_draw_frequency',

"optionscode" => 'text',

"value" => 604800,

),

array(

"name" => 'lottery_win',

"optionscode" => 'text',

"value" => 1000,

),

array(

"name" => 'lottery_rest',

"optionscode" => 'text',

"value" => 7200,

),

array(

"name" => 'lottery_usepot',

"optionscode" => 'yesno',

"value" => MY_NO,

)

));

$cache->update('lottery_term',1);

$cache->update('lottery_pot',0);

$row=array(array(

'ticket_id'=>rand(1024,1321),

'term_id '=>0,

'uid'=>0,

'dateline'=>0

));

db_insert_rows('plaza_lottery_tickets',$row);

$row=array(array(

'term_id'=>1,

'start_time'=>time(),

));

db_insert_rows('plaza_lottery_term',$row);

my_rebuild_settings();

}

 

function lottery_deactivate(){

global $db;

db_drop_tables(array('plaza_lottery_tickets','plaza_lottery_term'));

 

lottery_restore_plaza_templates();

lottery_remove_templates();

 

$db->delete_query(MY_TABLE_PREFIX.'settings', 'name IN (\'lottery_on\',\'lottery_ticket_price\',\'lottery_draw_frequency\',\'lottery_rest\',\'lottery_usepot\')');

myplaza_remove_module_items();

plugins_remove_passive_hooks();

my_rebuild_settings();

}

 

 

function lottery_plugin(){

global $plugins;

$plugins->add_hook('global_start','lottery_execute');

 

}

 

function lottery_admin($process){

if($process){

myplaza_process_settings(array('lottery_ticket_price','lottery_win','lottery_draw_frequency','lottery_rest','lottery_usepot'));

 

return 1; // must return 1 here to display the flash message "success" in Admin CP

}else{

global $lang, $page;

global $lang, $plugins, $myplaza_in_module;

$plugins->run_hooks('myplaza_admin_module_cpheader', $myplaza_in_module);

 

module_tabs();

 

$form = new Form("index.php?module=myplaza/myplaza&action=do_module", "post", "do_module");

$hiddencode = makehiddencode("moduleaction", 'do_options');

$hiddencode .= makehiddencode("modname", 'lottery');

$hiddencode .= makehiddencode('dir', $mybb->input['dir']);

$hiddencode .= makehiddencode("updated", 'yes');

echo $hiddencode;

 

 

$table = new Table;

$setting_array = array();

$setting_array = new_myplaza_generate_settings_code(array('lottery_ticket_price','lottery_win','lottery_draw_frequency','lottery_rest','lottery_usepot'));

 

$array_elem = count(array('lottery_ticket_price','lottery_win','lottery_draw_frequency','lottery_rest','lottery_usepot'))-1;

 

$table->construct_header($lang->lottery_settings, array('width' => '60%'));

$table->construct_header("", array('width' => '40%'));

 

for($i=0;$i<=$array_elem;$i++)

{

$table->construct_cell("{$setting_array[$i]['title']}

{$setting_array[$i]['description']}", array('width' => '60%'));

$table->construct_cell($setting_array[$i]['code'], array('width' => '40%'));

$table->construct_row();

}

 

$table->output($lang->lottery);

 

$buttons = "";

$buttons[] = $form->generate_submit_button($lang->submit_changes);

$buttons[] = $form->generate_reset_button($lang->reset_button);

$form->output_submit_wrapper($buttons);

$form->end();

 

$page->output_footer();

}

}

 

function lottery_page(){

global $templates,$cache,$lang,$db,$title,$mybb,$ticket_bought,$usertickets,$buyticket,$lotteryinfo,$lottery_end,$lottery_countdown,$last_winner,$lottery_win,$winner_ticket_number;

if(!$mybb->user['uid']){

error_no_permission();

}else{

if($mybb->input['refresh']){

lottery_execute();

redirect('plaza.php?action=page&p=lottery');

}

$term_id=$cache->read('lottery_term');

$term=$db->fetch_array($db->simple_select(MY_TABLE_PREFIX.'plaza_lottery_term','*','term_id='.$term_id));

if($mybb->input['invaction']=='buy'){

if($term['start_time']

if($mybb->settings['lottery_ticket_price']>$mybb->user[MYPLAZA_MONEY_COLUMN]){

redirect('plaza.php?action=page&p=lottery',$lang->enough_money);

}else{

user_change_money($mybb->user,-$mybb->settings['lottery_ticket_price']);

if($mybb->settings['lottery_usepot']=="yes"){

$pot=$cache->read('lottery_pot')+$mybb->settings['lottery_ticket_price'];

$cache->update('lottery_pot',$pot);

}

$row=array(array(

'term_id '=>$term['term_id'],

'uid'=>$mybb->user['uid'],

'dateline'=>time()

));

db_insert_rows('plaza_lottery_tickets',$row);

$ticketid=$db->insert_id();

$item=$db->fetch_array($db->simple_select(MY_TABLE_PREFIX."plaza_items","*","idname='lottery_ticket'"));

$db->insert_query(MY_TABLE_PREFIX.'plaza_buylog',array(

'iid'=>$item['iid'],

'uid'=>$mybb->user['uid'],

'description'=>$db->escape_string(sprintf($lang->lottery_buy_log,$ticketid,my_format_money($mybb->settings['lottery_ticket_price']))),

'dateline'=>time()

));

db_update("plaza_lottery_term",array('ticket_count'=>'ticket_count+1'),'term_id='.$term['term_id']);

redirect('plaza.php?action=page&p=lottery',$lang->lottery_ticketbuy_success);

}

}else{

redirect('plaza.php?action=page&p=lottery',$lang->lottery_rest_time);

}

}

 

if($term_id>1){

$last_term=$db->fetch_array($db->simple_select(MY_TABLE_PREFIX.'plaza_lottery_term','*','term_id='.($term_id-1)));

if($last_term['winner_uid']){

$last_winner_user=get_user($last_term['winner_uid']);

$last_winner=sprintf($lang->lottery_last_winner,$last_winner_user['uid'],$last_winner_user['username'],my_format_money($last_term['money']));

}

}

 

if($term['start_time']

$winner_ticket_number=$lang->winner_ticket_hide;

$lottery_end=sprintf($lang->lottery_end,my_date("Y/m/d h:i:s",$term['start_time']+$mybb->settings['lottery_draw_frequency']));

$lottery_sec=($term['start_time']+$mybb->settings['lottery_draw_frequency'])-time();

$lottery_win=sprintf($lang->lottery_win,my_format_money(lottery_money()));

$ticket_bought=sprintf($lang->lottery_ticket_bought,$term['ticket_count']);

eval('$lottery_countdown .= "'.$templates->get('plaza_lottery_countdown').'";');

}else{

if($last_term['winner_uid']){

$winner_ticket_number=$last_term['winner_ticket_number'];

$last_winner=sprintf($lang->lottery_winner,$last_winner_user['uid'],$last_winner_user['username'],my_format_money($last_term['money']));

}else{

$winner_ticket_number=$lang->lottery_noticket;

}

$lottery_countdown=$lang->lottery_drawed;

}

eval('$lotteryinfo .= "'.$templates->get('plaza_lottery_info').'";');

 

$usertickets='';

$comma='';

$query = $db->simple_select(MY_TABLE_PREFIX.'plaza_lottery_tickets','*','uid='.$mybb->user['uid'].' AND term_id='.$term_id);

while($ticket=$db->fetch_array($query)){

$usertickets.=$comma.$ticket['ticket_id'];

$comma=' , ';

}

 

global $lottery_ticket_price;

 

$lottery_ticket_price = my_format_money($mybb->settings['lottery_ticket_price']);

 

eval('$buyticket .= "'.$templates->get('plaza_lottery_buyticket').'";');

$title = strip_tags($lang->viewing_Lottery);

return $templates->get('plaza_lottery');

}

}

 

function lottery_execute(){

global $db,$cache,$mybb,$lang;

$term_id=$cache->read('lottery_term');

$term=$db->fetch_array($db->simple_select(MY_TABLE_PREFIX.'plaza_lottery_term','*','term_id='.$term_id));

if($term['start_time']+$mybb->settings['lottery_draw_frequency']

$winner_ticket=$db->fetch_array($db->simple_select(MY_TABLE_PREFIX.'plaza_lottery_tickets','*','term_id='.$term_id,array('order_by'=>'rand()','limit'=>1)));

if($winner_ticket){

 

$user = $db->fetch_array($db->simple_select(MY_TABLE_PREFIX.'users','*','uid='.$winner_ticket['uid']));

 

user_change_money($user,lottery_money());

$item=$db->fetch_array($db->simple_select(MY_TABLE_PREFIX."plaza_items","*","idname='lottery_ticket'"));

myplaza_langload('lottery');

$db->insert_query(MY_TABLE_PREFIX.'plaza_buylog',array(

'iid'=>$item['iid'],

'uid'=>$winner_ticket['uid'],

'description'=>$db->escape_string(sprintf($lang->lottery_win_log,$winner_ticket['ticket_id'],my_format_money(lottery_money()))),

'dateline'=>time()

));

$row=array(

'winner_uid'=>$winner_ticket['uid'],

'winner_ticket_number'=>$winner_ticket['ticket_id'],

'money' =>lottery_money(),

'end_time'=>time()

);

db_update("plaza_lottery_term",$row,'term_id='.$term_id);

}

$row=array(array(

'start_time'=>(time()+$mybb->settings['lottery_rest'])

));

db_insert_rows('plaza_lottery_term',$row);

$cache->update('lottery_term',$term_id+1);

$cache->update('lottery_pot',0);

}

}

 

function lottery_loadlang(){

myplaza_langload('lottery');

}

 

function lottery_money(){

global $mybb,$cache;

if($mybb->settings['lottery_usepot']=="yes"){

$money=$mybb->settings['lottery_win']+$cache->read('lottery_pot');

}else{

$money=$mybb->settings['lottery_win'];

}

return $money;

}

?>

 

 

 

its a bit long, i was adding something to my forum <_<

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...