Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 11:28 pm EST

Geeklog Forums

mod topiceditor help please


sam

Anonymous
Hello, I am trying to hide the access rights and permissions section when a user adds a new topic. The defaults i have created are all my users need.

I have tried to remove the code 'see below' below from public_html/layout/professional/admin/topic/topiceditor.thtml
but this stops the topic being created due to permission problems.

how would I hide these options but still have my default properties pass on.
Text Formatted Code


                                    <td colspan="2"><hr><td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><b>{lang_accessrights}</b></td>
                                    </tr>
                                    <tr>
                                        <td align="right">{lang_owner}:</td>
                                        <td>{owner_username}<input type="hidden" name="owner_id" value="{owner_id}"></td>
                                    </tr>
                                    <tr>
                                        <td align="right">{lang_group}:</td>
                                        <td>
                                            {group_dropdown}
                                        </td>
                                    <tr>
                                    <tr>
                                        <td colspan="2"><b>{lang_permissions}</b>:</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">{lang_permissions_key}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            {permissions_editor}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><hr><td>
                                    </tr>

 
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512

I don't believe that you can "remove" the permissions checkboxes alltogether because the action page is looking for those post variables. that in mind, just change their type from checkbox to hidden. your users wont see them and the variables still are posted.

Is that what you are looking for?
 Quote

sam

Anonymous
Yes that is what im looking for, but I am really new to php so if someone could take a part of the code below and show me I shall be very greatful.
Text Formatted Code
<tr>
                                        <td colspan="2"><hr></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><b>{lang_accessrights}</b></td>
                                    </tr>
                                    <tr>
                                        <td align="right">{lang_owner}:</td>
                                        <td>{owner_username}<input type="hidden" name="owner_id" value="{owner_id}"></td>
                                    </tr>
                                    <tr>
                                        <td align="right">{lang_group}:</td>
                                        <td>
                                            {group_dropdown}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"> </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><b>{lang_permissions}</b>:</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">{lang_perm_key}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            {permissions_editor}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">{permissions_msg}</td>
                                    </tr>
                                    <tr><td colspan="2"> </td></tr>
                                    <tr>
                                        <td colspan="2">
                                            <input type="submit" value="{lang_save}" name="mode">
                                            <input type="submit" value="{lang_preview}" name="mode">
                                            <input type="submit" value="{lang_cancel}" name="mode">
                                            {delete_option}
                                            {submission_option}
                                            <input type="hidden" name="old_sid" value="{old_story_id}">
                                        </td>
                                    </tr>
 
 Quote

tokyoahead

Anonymous
forget the php. this is a HTML forms matter. Just put into the HTML form the values you want to have as default as a
Text Formatted Code
<input type="hidden"...>
 
instead of what the {...} would insert.

the { } would insert the fields and dropdowns where the user can select. check out the source of the page to see how the variables are named and what their values are. then replace the unneeded { } with something
such as

Text Formatted Code
<input type="hidden" name="group_id" value="1">
 


You need a bit of knowledge how HTML forms are made for this, no PHP skills.
 Quote

sam

Anonymous
thanks tokyoahead.
 Quote

sam

Anonymous
Just a little more help. I have managed to get the pull down box to work but having probs with tick box's.

Source html code

Text Formatted Code
<td colspan="3"><b>Owner</b></td>
<td colspan="3"><b>Group</b></td>
<td><b>Members</b></td>
<td><b>Anonymous</b></td>
</tr>
<tr>
<td align="center"><b>R</b><br><input type="checkbox" name="perm_owner[]" value="2" checked="checked"></td>
<td align="center"><b>E</b><br><input type="checkbox" name="perm_owner[]" value="1" checked="checked"></td>
<td>      </td>
<td align="center"><b>R</b><br><input type="checkbox" name="perm_group[]" value="2" checked="checked"></td>
<td align="center"><b>E</b><br><input type="checkbox" name="perm_group[]" value="1"></td>
<td>      </td>
<td align="center"><b>R</b><br><input type="checkbox" name="perm_members[]" value="2" checked="checked"></td>
<td align="center"><b>R</b><br><input type="checkbox" name="perm_anon[]" value="2" checked="checked"></td>
</tr>
 


This is code I have changed in storyeditor.thtml
Text Formatted Code
<tr>
                                        <td colspan="2">
                                            <input type="hidden" name="perm_owner" value="2">
                                            <input type="hidden" name="perm_owner" value="1">
                                            <input type="hidden" name="perm_group" value="2">
                                            <input type="hidden" name="perm_group" value="1">
                                            <input type="hidden" name="perm_members" value="2">
                                            <input type="hidden" name="perm_anon" value="2">
                                        </td>
 


What am I doing wrong?????
 Quote

sam

Anonymous
Me again.

Or should items like perm_group be re-named to the actual names, perm_group would be Story_admin or something like that..
 Quote

tokyoahead

Anonymous
input types that have [] at the end usually are converted into an array. You have seen that there are several perm_owner[]. The first line will become perm_owner[0], the second one perm_owner[1] etc.

I am not too fit to do this out of my head. if you would put a "echo phpinfo();" into the php-file that is processing the results of the form, you can see the way how the variables arrive after the form is processed. from this you should be able to derive how to set the standard variables.
 Quote

sam

Anonymous
Thanks for help so far, and for putting up with newbi questions.

I put The "echo phpinfo();" that you mentioned in story.php and it listed lots of info but nothing about the permissions.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
the code you want to use lacks the array values.
you must use an array for like named input fields...

to do this you must replace the [] into the input names in order that they will be read as arrays when the form is processed.

for example: name="perm_group[]" instead of name="perm_group"
All those fields in the code you posted are returning arrays to the process. without the [], it wont work properly.
 Quote

sam

Anonymous
Thanks everyone, that seems to work. Going to run a few more tests.

 Quote

All times are EST. The time is now 11:28 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content