How to Do Checkboxe...
 
Notifications
Clear all

How to Do Checkboxes in Story Submission and Search pages

11 Posts
4 Users
0 Reactions
2,341 Views
(@saharrashadow)
Posts: 9
Active Member
Topic starter
 

URL to your eFiction: www.kmarchive.net
Version of eFiction: 3.5.2
Have you bridged eFiction, if so with what?: Don't think so
Version of PHP: can be found out from your host
Version of MySQL: can be found out from your host
Have you searched for your problem: Yes
If so, what terms did you try: checkboxes
State the nature of your problem: Copy and paste any errors you are receiving.
Do you have a test account for us? ID: testing2 Password: Liswind

I'd like to be able to have checkboxes on the Story submission and search pages instead of the ctrl key for selecting multiple options. i don't mind re-entering all the classifications if doing so would mean that it would automatically add a checkbox to each item I enter in. But first i need to find the answer of whether or not that is even possible. And if so, how to do it. i will be updating to 3.5.3 soon. i did find one topic on it, but it only showed it where it was done. it didn't say how to do it.

http://www.tgfiction.net/eFiction30Beta/search4.php?searchtype=advanced
http://www.tgfiction.net/eFiction30Beta/search2.php?searchtype=advanced

Thank you for any help,
  Shadow


 
Posted : 23/10/2010 6:30 pm
(@tammy)
Posts: 2577
Member Moderator
 

You will need to modify storyform.php and search.php to change the HTML from a SELECT to multiple CHECKBOX fields. 

Moving this thread to the MOD forum.


 
Posted : 23/10/2010 10:34 pm
(@piper)
Posts: 91
Trusted Member
 

Sorry, I will run a diff on my forms and post the information when I can.

-HuGgLeS-
-P/KAF/PT


StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

 
Posted : 13/01/2011 7:21 pm
(@piper)
Posts: 91
Trusted Member
 

In the file: search.php

On or about line 301, change:

 $select .= "<option value="".$class['class_id']."">".$class['class_name']."</option>";

to

$select .= "<input type="checkbox" name="class_".$type['classtype_id']."[]" id="class_".$type['classtype_id']."[]"value="".$class['class_id']."">".$class['class_name']."<br />";

On or about lines 304-307 change:

 <div style="float: left; width: 49%; margin-bottom: 1em;"><label for="class_".$type['classtype_id']."">".$type['classtype_title']." "._INCLUDE.":</label><br />
                                       <select name="class_".$type['classtype_id']."[]" id="class_".$type['classtype_id'].""  style="width: 95%;" multiple size="5">$select</select></div>
                              <div style="float: left; width: 49%; margin-bottom: 1em;"><label for="exclass_".$type['classtype_id']."">".$type['classtype_title']." "._EXCLUDE.":</label><br />
                                       <select name="exclass_".$type['classtype_id']."[]"  id="exclass_".$type['classtype_id'].""  style="width: 95%;" multiple size="5">$select</select></div>

to

<div style="float: left; width: 49%; margin-bottom: 1em;"><fieldset for="class_".$type['classtype_id'].""><legend>".$type['classtype_title']." "._INCLUDE.":</legend><br />
                                       $select</fieldset></div>
                              <div style="float: left; width: 49%; margin-bottom: 1em;"><fieldset for="exclass_".$type['classtype_id'].""><legend>".$type['classtype_title']." "._EXCLUDE.":</legend><br />
                                       $select</fieldset></div>

That should give you the basic check boxes as seen in search2.php @ TGFiction.Net

The collapsing boxes were done using spy widget I included somewhere else -giggles- I will add that information once I sort it all out....

Now for the submission form....  Something isn't working right when I try to diff it, so let me wing it here....

In the file: includes/storyform.php

On or about lines 120-123, change:

                                $select .= "<option value="$class[class_id]"".(is_array($classes) && in_array($class['class_id'], $classes) ? " selected" : "").">$class[class_name]</option>";
               }
               $output .= "<div style="float: ".($count % 2 ? "right" : "left")."; width: 49%; margin-bottom: 1em;"><label for="class_".$type['classtype_id']."">$type[classtype_title]:</label><br />
                                <select name="class_".$type['classtype_id']."[]" id="class_".$type['classtype_id'].""  style="width: 99%;" multiple size="5">$select</select></div>";

to

                        $select .= "<input type="checkbox" value="$class[class_id]"".(is_array($classes) && in_array($class['class_id'], $classes) ? " checked" : "")." name="class_".$type['classtype_id']."[]" id="class_".$type['classtype_id']."">$class[class_name]<br />";
               }
               $output .= "<div style="float: ".($count % 2 ? "right" : "left")."; width: 49%; margin-bottom: 1em;">
                       <fieldset for="class_".$type['classtype_id'].""><legend>".$type['classtype_title'].":</legend><br />
                       $select</FIELDSET></div>";

And I think that's about it...

Let me know if you need more.

-HuGgLES-
-P/KAF/PT


StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

 
Posted : 13/01/2011 8:20 pm
(@undrockroll)
Posts: 41
Eminent Member
 

Hello! This worked beautifully, for everything except Characters and Categories. Any ideas?


 
Posted : 21/01/2011 3:53 pm
(@piper)
Posts: 91
Trusted Member
 

I don't use the Charecters bit on my site, so I didn't bother, and because of the way the categories works I didn't really do it. But when I get a moment I will look into it for you and post the code results. Been busy with the ePubVersion module lately.

-HuGgLeS-
-P/KAF/PT


StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

 
Posted : 21/01/2011 6:47 pm
(@undrockroll)
Posts: 41
Eminent Member
 

no worries. <3 thanks so much!! I really really love the way the other checkboxes turned out! so much easier for the members.


 
Posted : 22/01/2011 1:48 am
(@undrockroll)
Posts: 41
Eminent Member
 

was there any luck with this? πŸ™‚


 
Posted : 03/02/2011 12:02 am
(@piper)
Posts: 91
Trusted Member
 

I've not forgotten about this, but I've been spending a lot of time working on my ePub module.The module is nearly Feature complete, so with luck I will be able to work on this again soon!

-P/KAF/PT


StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

 
Posted : 03/02/2011 12:24 am
(@piper)
Posts: 91
Trusted Member
 

I've done some basic looking into this, and not yet figured it out. I will continue to pick at it here and there and see if I can figure it out for the "categories" selection but I think the sub-categories stuff is going to be an issue.

-P/KAF/PT


StoryPortal Fiction Network - StoryPortal.Net
TG Fiction dot NET | T* Fiction Archive - TGFiction.Net
LG Tales | TG Style Fiction for LG's - LGTales.Com

 
Posted : 07/02/2011 9:01 pm
(@undrockroll)
Posts: 41
Eminent Member
 

Piper - I would just be thrilled to have checkboxes for the characters. πŸ™‚


 
Posted : 08/02/2011 8:46 pm
Share: