Author Topic: [Patch] Have an editor - a normal user who can change the keywords/description  (Read 12362 times)

0 Members and 1 Guest are viewing this topic.

Offline bigbluevan

  • Pre-Newbie
  • Posts: 6
    • View Profile
Sorry for earlier errors, the changed files are CORRECTLY attached now. Thanks


An editor is a user who can modify the keywords or description of an image.

1. Modify user table so a user may be flagged as an editor (replace 4images_ with whatever prefix you are using):
Code: [Select]
ALTER TABLE `4images_users` ADD `user_editor` TINYINT( 1 ) NOT NULL DEFAULT '0';
2. Apply the attached patch, 4images_editor.patch (total of 9 affected files)

Example, after uploading the patch to the 4images directory, run this command from the shell (modify for your setup):
Code: [Select]
patch -p1 -i 4images_editor.patch -d /path/to/4images/
3. Go to the admin area to edit a user

4. Use the radio button to choose whether the user should be an editor

5. Report in this thread if you experience any bugs.

Comments

I didn't know Deutsch so the following variables will in lang/deutsch/(main.php,admin.php) need to be corrected for those of you who are:
Code: [Select]
$lang['field_editor']   = admin text for Editor
$lang['editor']         = header on table on frontend
$lang['post_editor']    = submit button on frontend

I won't be maintaining this patch unless there any glaring issues.  Have a nice day.  Hopefully someone can move this to the proper forum.


OR

use editor.tar.gz to only download the modified files.  you can use a tool such as winmerge to merge into any existing modified files: http://winmerge.org/

and I added a screenshot
« Last Edit: January 05, 2007, 03:38:29 PM by bigbluevan »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
... for which version of 4images we can use these patch_file ... ?
... can we use the patch_file in a modifyed version of 4images ... ?

... if someone modified its 4images gallery successfully with this patch_file ... please let me know ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline bigbluevan

  • Pre-Newbie
  • Posts: 6
    • View Profile
... for which version of 4images we can use these patch_file ... ?
1.7.4

Quote
... can we use the patch_file in a modifyed version of 4images ... ?
Could be possible.  Depends how heavily modified.

I can post the individually changed files in a zip file so someone can use a tool like winmerge to merge or use them on their own.

Offline bigbluevan

  • Pre-Newbie
  • Posts: 6
    • View Profile
I uploaded just the changed files and there was an issue in the diff I had posted so that is re-upped.  use winmerge(http://winmerge.org/) if you are on windows to merge the files into an already modified 4images setup

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Theres only 1 file in your zip..

the folders are empty

Offline bigbluevan

  • Pre-Newbie
  • Posts: 6
    • View Profile
thanks for pointing that out(not used to zip on the shell).. it should be good now.  and, I posted a screenshot..

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
I still only see 1 file (details.php) in the 4images_editor_changed.zip

Offline bigbluevan

  • Pre-Newbie
  • Posts: 6
    • View Profile
argh, wtf! I hate using macs.. give me a few moments

Offline bigbluevan

  • Pre-Newbie
  • Posts: 6
    • View Profile
it is updated, can someone please confirm that this works for them so I don't have to keep revisiting this thread ;) ?

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
That has the files  :wink:

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Anyone Try this yet?


Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
I added this mod to a unmodded 1.7.4 gallery.. and it seemed to work fine.

Do you know of any reason this wouldnt work on a 1.7.1 gallery?

also you didnt include a details.html file in the changed folder. Took me a minute to figure out why nothing was showing on my details page. But figured it out right away when i looked at the patch file.

Here is the code that needs to be added to the details.html
Code: [Select]
{if user_editor}
                    <br />
                <form name="editorform" action="{self}" method="post">
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">{lang_editor}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_description}</b></td>

                            <td valign="top" class="row1"><textarea name="editor_image_description" rows="10" cols="30">{editor_image_description}</textarea></td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_keywords}</b></td>
                            <td valign="top" class="row2"><textarea name="editor_image_keywords" rows="10" cols="30">{editor_image_keywords}</textarea></td>

                          </tr>
                            <tr>
                              <td width="90" valign="top" class="row1">&nbsp;</td>
                              <td class="row1">
                                <input type="hidden" name="action" value="posteditor" />
                                <input type="hidden" name="id" value="{image_id}" />
                                <input type="submit" name="postbutton" value="{lang_post_editor}" class="button" />
                              </td>
                            </tr>
                        </table>
                        </td>
                    </tr>
                    </table>
                </form>
                    {endif user_editor}

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
I was able to read the Patch file and modify my files for 1.7.1

I its working just fine  8)

Good mod , should help alot  :D