Hello There, Guest! › Register

MySubscriptions 2.2 released.
Looking for a custom plugin for your site? Ask here for a quote.

peeker on custom page in acp
#1

Hi,

I have something like this

PHP Code:
$form_container = new FormContainer($lang->server_add);

    $form_container->output_row($lang->server_type."<em> *</em>",  $lang->server_type_desc$form->generate_select_box('type'$select_list$mybb->input['type'], array('id' => 'type')), 'type');
    $form_container->output_row($lang->server_ip."<em> *</em>"$lang->server_ip_desc$form->generate_text_box('ip'$mybb->input['ip'], array('id' => 'ip')), 'ip');
    $form_container->output_row($lang->server_bf3qport."<em> *</em>",  $lang->server_bf3qport_desc$form->generate_text_box('bf3qport'$mybb->input['bf3qport'], array('id' => 'bf3qport')), 'bf3qport', array(), array('id' => 'row_serversboard_bf3qport'));
    $form_container->output_row($lang->server_bf4qport."<em> *</em>",  $lang->server_bf4qport_desc$form->generate_text_box('bf4qport'$mybb->input['bf4qport'], array('id' => 'bf4qport')), 'bf4qport', array(), array('id' => 'row_serversboard_bf4qport'));
    $form_container->output_row($lang->server_dayzqport."<em> *</em>",  $lang->server_dayzqport_desc$form->generate_text_box('dayzqport'$mybb->input['dayzqport'], array('id' => 'dayzqport')), 'dayzqport', array(), array('id' => 'row_serversboard_dayzqport'));
    $form_container->output_row($lang->server_mtaqport."<em> *</em>",  $lang->server_mtaqport_desc$form->generate_text_box('mtaqport'$mybb->input['mtaqport'], array('id' => 'mtaqport')), 'mtaqport', array(), array('id' => 'row_serversboard_mtaqport'));
    $form_container->output_row($lang->server_mumbleqport."<em> *</em>",  $lang->server_mumbleqport_desc$form->generate_text_box('mumbleqport'$mybb->input['mumbleqport'], array('id' => 'mumbleqport')), 'mumbleqport', array(), array('id' => 'row_serversboard_mumbleqport'));
    $form_container->output_row($lang->server_terrariaqport."<em> *</em>",  $lang->server_terrariaqport_desc$form->generate_text_box('terrariaqport'$mybb->input['terrariaqport'], array('id' => 'terrariaqport')), 'terrariaqport', array(), array('id' => 'row_serversboard_terrariaqport'));
    $form_container->output_row($lang->server_ts3qport."<em> *</em>",  $lang->server_ts3qport_desc$form->generate_text_box('ts3qport'$mybb->input['ts3qport'], array('id' => 'ts3qport')), 'ts3qport', array(), array('id' => 'row_serversboard_ts3qport'));
    $form_container->output_row($lang->server_offlinehostname."<em> *</em>"$lang->server_offlinehostname_desc$form->generate_text_box('offlinehostname'$mybb->input['offlinehostname'], array('id' => 'offlinehostname')), 'offlinehostname');
    $form_container->output_row($lang->server_cuthostname$lang->server_cuthostname_desc$form->generate_numeric_field('cuthostname'$mybb->input['cuthostname'], array('id' => 'cuthostname')), 'cuthostname');
    $form_container->output_row($lang->server_disporder."<em> *</em>"$lang->server_disporder_desc$form->generate_numeric_field('disporder'$mybb->input['disporder'], array('id' => 'disporder')), 'disporder');
    $form_container->output_row($lang->server_field_link$lang->server_field_link_desc$form->generate_text_box('field_link'$mybb->input['field_link'], array('id' => 'field_link')), 'field_link');
    $form_container->output_row($lang->server_field_icon$lang->server_field_icon_desc$form->generate_text_box('field_icon'$mybb->input['field_icon'], array('id' => 'field_icon')), 'field_icon');
    $form_container->output_row($lang->server_owner."<em> *</em>"$lang->server_owner_desc$form->generate_numeric_field('owner'$mybb->input['owner'], array('id' => 'owner')), 'owner');
    $form_container->output_row($lang->server_visible$lang->server_visible_desc$form->generate_yes_no_radio('visible'$mybb->input['visible'], true));
    $form_container->output_row($lang->server_new$lang->server_new_desc$form->generate_yes_no_radio('new'$mybb->input['new'], true), 'new', array(), array('id' => 'new'));
    $form_container->output_row($lang->server_new_color$lang->server_new_color_desc$form->generate_text_box('new_color'$mybb->input['new_color'], array('id' => 'new_color')), 'new_color', array(), array('id' => 'row_serversboard_new_color'));
    $form_container->output_row($lang->server_new_text$lang->server_new_text_desc$form->generate_text_box('new_text'$mybb->input['new_text'], array('id' => 'new_text')), 'new_text', array(), array('id' => 'row_serversboard_new_text'));
    $form_container->output_row($lang->server_forumid$lang->server_forumid_desc$form->generate_forum_select('forumid'$mybb->input['forumid'], array('multiple' => false'size' => 5'id' => 'forumid')), 'forumid');
    //$form_container->output_row($lang->server_buddylist, $lang->server_buddylist_desc, $form->generate_text_area('buddylist', $mybb->input['buddylist'], array('id' => 'buddylist')), 'buddylist');
    $form_container->end();

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

    $form->output_submit_wrapper($buttons);
    $form->end();
    echo '<script type="text/javascript" src="./jscripts/peeker.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var bf3qport_peeker = new Peeker($("#type"), $("#row_serversboard_bf3qport"), /bf3/, false);
var bf4qport_peeker = new Peeker($("#type"), $("#row_serversboard_bf4qport"), /bf4/, false);
var dayzqport_peeker = new Peeker($("#type"), $("#row_serversboard_dayzqport"), /dayz/, false);
var mtaqport_peeker = new Peeker($("#type"), $("#row_serversboard_mtaqport"), /mta/, false);
var mumbleqport_peeker = new Peeker($("#type"), $("#row_serversboard_mumbleqport"), /mumble/, false);
var terrariaqport_peeker = new Peeker($("#type"), $("#row_serversboard_terrariaqport"), /terraria/, false);
var ts3qport_peeker = new Peeker($("#type"), $("#row_serversboard_ts3qport"), /teamspeak3/, false);
var new_peeker = new Peeker($("#new"), $("#row_serversboard_new_color"), /1/, true);
});
</script>'


and peekers works except one (one dont work) 

var new_peeker = new Peeker($("#new"), $("#row_serversboard_new_color"), /1/, true);

Can you tell me why? pleas

Merry christmas
Reply
#2

Hi,

At first glance seems OK to me. Have you checked the Firebug console for any possible errors?
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#3

console is clear (errors)
default "new" setting is 0 (and row_serversboard_new_color is hidden - OK)
when I switch "new" to 1 nothing happens
Reply
#4

I don't think you entered the right ID in the Peeker call.
Code:
Peeker($("#new"), $("#row_serversboard_new_color"), /1/, true);

The first field. Applies to the other ones you used as well.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#5

hmmm i think the IDs is good

look on video





maybe is's MYBB bug
Reply
#6

I don't think it's a bug in MyBB. It seems to work fine for the radio box for GZIP in Server and Optimization group. You should look into that one and compare it with what you did.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#7

I've done it a long time ago

when i use peekers on plugin like this
PHP Code:
$plugins->add_hook("admin_settings_print_peekers""myplugin_settings_peeker"); 
PHP Code:
function myplugin_settings_peeker(&$peekers)
{
    global 
$db$lang$mybb;
    
$lang->load("config_myplugin");

    
$peekers[] = 'new Peeker($(".setting_myplugin_onoff"), $("#row_setting_myplugin_onoff, #row_setting_mypluginve_value, #row_setting_myplugintive_onoff"), /1/, true)';
 


it is work, i have problem to run this only on custom page
Reply
#8

solved !!!

PHP Code:
$form_container->output_row($lang->server_new$lang->server_new_desc$form->generate_yes_no_radio('upsetting[new]'$mybb->input['new'], true, array('id' => 'setting_new_yes''class' => 'setting_new'), array('id' => 'setting_new__no''class' => 'setting_new')), 'new'); 

PHP Code:
var new_peeker = new Peeker($(".setting_new"), $("#row_serversboard_new_color, #row_serversboard_new_text"), /1/, true); 
Reply
#9

What was the problem?
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#10

I realy dont know
I tried so many times I do not know what wos wrong
but still is not good
idk how now made update to db because its to inputs
Reply




Users browsing this thread: 1 Guest(s)