2012-07-22, 08:35 PM
2012-07-22, 08:38 PM
I need to have the following:
index.php?module=tools-easyrep&action=addrep
index.php?module=tools-easyrep&action=removerep
so I would have two sub tabs, add and remove. How could I create a form for both of them on the two separate sub tabs?
Thanks
index.php?module=tools-easyrep&action=addrep
index.php?module=tools-easyrep&action=removerep
so I would have two sub tabs, add and remove. How could I create a form for both of them on the two separate sub tabs?
Thanks
2012-07-22, 08:39 PM
You edit the link to be those, and to differentiate between tabs you would check $mybb->input['action'] and decide what form to show and which tab to be active based on that.
2012-07-22, 09:11 PM
What would be the best way of doing that?
I've currently got this:
Any reason why the tab is stuck on Add Rep?
Cheers
I've currently got this:
$page->add_breadcrumb_item("Easy Rep", "index.php?module=tools-easyrep");
$page->output_header("");
$sub_tabs['add_rep'] = array(
'title' => "Add Reputation",
'link' => "index.php?module=tools-easyrep&action=addrep",
'description' => "Add Reputation To Users."
);
$sub_tabs['modify_rep'] = array(
'title' => "Modify Reputation",
'link' => "index.php?module=tools-easyrep&action=modifyrep",
'description' => "Modify User's Reputation."
);
if ($mybb->input['action'] = "addrep") {
$page->output_nav_tabs($sub_tabs, 'add_rep');
//Form 1 Here
}
else if ($mybb->input['action'] = "modifyrep") {
$page->output_nav_tabs($sub_tabs, 'modify_rep');
$modifyform = new Form("index.php?module=tools-easyrep&action=modifyrep", "post", "easyrep");
//Form 2 Here
}
Any reason why the tab is stuck on Add Rep?
Cheers
2012-07-22, 09:23 PM
The same way you made your previous form?
2012-07-22, 09:28 PM
Thanks for the reply
I've made both forms, I just can't figure out why the modify rep sub tab won't open.
It just stays stuck at the add rep sub tab.
The first part is this:
That's working fine.
The second part is:
The Modify Rep tab won't open when clicked, it just stays on the Add Rep tab
Cheers
I've made both forms, I just can't figure out why the modify rep sub tab won't open.
It just stays stuck at the add rep sub tab.
The first part is this:
$page->add_breadcrumb_item("Easy Rep", "index.php?module=tools-easyrep");
$page->output_header("");
$sub_tabs['add_rep'] = array(
'title' => "Add Reputation",
'link' => "index.php?module=tools-easyrep&action=addrep",
'description' => "Add Reputation To Users."
);
$sub_tabs['modify_rep'] = array(
'title' => "Modify Reputation",
'link' => "index.php?module=tools-easyrep&action=modifyrep",
'description' => "Modify User's Reputation."
);
if ($mybb->input['action'] = "addrep") {
$page->output_nav_tabs($sub_tabs, 'add_rep');
$addform = new Form("index.php?module=tools-easyrep&action=addrep", "post", "easyrep");
//Form here
That's working fine.
The second part is:
else if ($mybb->input['action'] = "modifyrep") {
$page->output_nav_tabs($sub_tabs, 'modify_rep');
$modifyform = new Form("index.php?module=tools-easyrep&action=modifyrep", "post", "easyrep");
//Form here
The Modify Rep tab won't open when clicked, it just stays on the Add Rep tab
Cheers
2012-07-22, 09:32 PM
else if ($mybb->input['action'] = "modifyrep") {
should be
else if ($mybb->input['action'] == "modifyrep") {
2012-07-22, 10:14 PM
Thanks euantor! Works perfectly!
One more quick question then I think i'm done!
How can I check all the generate_text_area fields to see if there empty & some can only contain numbers?
Also how can I display either a red or green message, like when the plugin is enabled successfully to show the result?
Thanks!
One more quick question then I think i'm done!
How can I check all the generate_text_area fields to see if there empty & some can only contain numbers?
Also how can I display either a red or green message, like when the plugin is enabled successfully to show the result?
Thanks!
2012-07-22, 10:54 PM
if(!empty($mybb->input['rec_comment'])) to see if it's empty and if(intval($mybb->input['rec_comment'])) for integers.
2012-07-22, 10:59 PM
Thanks!
Any idea how to display a red / green message on success and failure of form submit?
Cheers
Any idea how to display a red / green message on success and failure of form submit?
Cheers