Author Topic: {if admin comment} ...  (Read 10114 times)

0 Members and 1 Guest are viewing this topic.

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
{if admin comment} ...
« on: May 19, 2003, 07:52:43 PM »
hello

i've been thinking in creating some secret fields in image description and in member profile, in a way that only admin would be able to fill that info.

for ex:
"this image was winner of contest Nature (May 2003"

or:
"this member was member of the month in May 2003"

Administrators would set this info in Control Panel and users wouldn't be able to edit it.
i think it should be something like this
Code: [Select]
{if admin comment} {admin comment} {endif admin comment}

any way that this could be done?
thanks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
{if admin comment} ...
« Reply #1 on: May 19, 2003, 08:20:08 PM »
just an idea how it would work:
in functions.php find:
Code: [Select]
"image_description" => $description,replace with:
Code: [Select]
"image_description" => $description.($user_info['user_level'] == ADMIN) ? "<br />blah blah blah, whatever u want" : "",

I bet it not what u wanted...but...;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
{if admin comment} ...
« Reply #2 on: May 19, 2003, 08:24:26 PM »
but this would change every images right?
i just want to have this info in some pics, the best ones, the ones who won awards...

 :roll:

and what about the info in member profile?

anyway, thanks for your quick answer
hope that someone can help me on this :)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
{if admin comment} ...
« Reply #3 on: May 19, 2003, 08:38:13 PM »
ah, just realised...it's actualy pretty simple ;)
first, add new field in 4images_images table for example image_extra (it must has prefix image_ )
then, in /includes/db_field_definitions.php add this:
$additional_image_fields['image_extra'] = array("tra-la-la", "text", 0);
and last, in details.php add:
$image_row['image_description'] = $image_row['image_description']."<br />".$image_row['image_extra'];
before:
show_image($image_row, $mode, 0, 1, 1, 1);
now, u'll have new field when u edit your images in ACP.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
{if admin comment} ...
« Reply #4 on: May 19, 2003, 10:04:09 PM »
thanks V@no! worked just great

just one little thing, how can i have more than 1 row field in the admin edit image? Cause sometimes i want to make paragraphs and i can't, do i have to use html codes to do it? such as <br> or <p>

and i would like to know, how can i add this extra field to members profile, with other info and stuff, like i told in my first post.

thanks for your help
 :wink:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
{if admin comment} ...
« Reply #5 on: May 19, 2003, 10:08:24 PM »
ah, yes, try change "text" to "textarea":
$additional_image_fields['image_extra'] = array("tra-la-la", "textarea", 0);
for the user profile, do same thing, but use this in db_field_definitions.php:
$additional_user_fields['user_extra'] = array("tra-la-la", "textarea", 0);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
{if admin comment} ...
« Reply #6 on: May 20, 2003, 12:47:32 AM »
all done and working perfectly :)
just one little thing, with the additional user_field, where should i insert the code? I want to show it bellow {user_icq}

should it be something like this:
Code: [Select]
<td height="22" colspan="2" class="row1"><b>{lang_homepage}</b></td>
          <td class="row1">{if user_homepage}<a href="{user_homepage}" target="_blank">{user_homepage}</a>{endif
            user_homepage}</td>
        </tr>
        <tr>
          <td height="22" colspan="2" class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a>
            (<b>{user_icq_status}</b>){endif user_icq}</td>
       </tr>
        <tr>
<td height="22" colspan="2" class="row1"><b>{lang_homepage}</b></td>
          <td class="row1">{if user_extrar}<a href="{user_extra}" target="_blank">{user_extra}</a>{endif
            user_extra}</td>


or is it somewhere member.php?
thanks

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
{if admin comment} ...
« Reply #7 on: May 20, 2003, 02:32:28 AM »
looks good to me...exept u made typo in {if user_extrar}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
{if admin comment} ...
« Reply #8 on: May 21, 2003, 01:26:31 AM »
thanks man
can i create a list of awards in this filed?

for ex:
this user has won:
- bla bla bla on November 2003
- award award on January 2004
...

and so on
is this possible, or is there any limit of typing?

thanks for all your help man!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
{if admin comment} ...
« Reply #9 on: May 21, 2003, 01:33:01 AM »
no, no limits (well, dont know actualy the limits of MySQL per field).
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)