Author Topic: HOW TO's...  (Read 5320 times)

0 Members and 1 Guest are viewing this topic.

Offline camarosource

  • Newbie
  • *
  • Posts: 10
    • View Profile
HOW TO's...
« on: December 20, 2006, 11:12:35 AM »
1. How can I DISABLE LIGHTBOX for NON ADMIN's?
2. How can I DISABLE the feature to upload THUMBNAILS for NON ADMIN's? I just want them to be able to upload the full size pic and let the script do the thumbnailing..
3. How can I remove that "Receive emails from administrators:" from in the users control panel ?
4. How can I remove that "Hide your online status:" from in the users control panel ?
5. How do I make it so it actually THUMBNAILS the images upon the user uploading it? So it displays the THUMBNAIL online, but can also view the FULL SIZE if they want.. That is what I thought this does? It seems to be uploading the full size and DISPLAYING the FULL size. I do have it set to "Auto-create thumbnail" YES.
6. I originally put the script is a specific TEST directory but want to rename the directory to the correct LIVE folder now where I want it to run from. Where is the install directory configured in the script? Didn't see it in the MYSQL.. ?

Thanks VERY Much!
« Last Edit: December 20, 2006, 12:10:57 PM by camarosource »

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: HOW TO's...
« Reply #1 on: December 20, 2006, 07:26:44 PM »
The bolow requires editing of templates. Make you make a back up of the original file before doing any editing!

Quote
1. How can I DISABLE LIGHTBOX for NON ADMIN's?
Remove {lightbox} from details.html and thumbnail_bit.html templates. Double check your other templates to see if it is listed anywhere else.

Quote
How can I DISABLE the feature to upload THUMBNAILS for NON ADMIN's? I just want them to be able to upload the full size pic and let the script do the thumbnailing..
Delete the thumbnail upload section in member_uploadform.html. After doing this one the admins should use the upload in the ACP if they have a thumbnail they want to load as well as the image.

Quote
3. How can I remove that "Receive emails from administrators:" from in the users control panel ?
4. How can I remove that "Hide your online status:" from in the users control panel ?
You can edit this out by editing the member_editprofile.html

I can not answer as I have no issues with the auto thumbnail. All I can say is double check your settings.
As for the last one that is something I never dealt with before, so maybe a more experienced user would know.
Hopefully the ones I did answer help you out a little.


manurom

  • Guest
Re: HOW TO's...
« Reply #2 on: December 20, 2006, 11:45:37 PM »
Hello;
The bolow requires editing of templates. Make you make a back up of the original file before doing any editing!
A precious advice to keep on mind! Allways backup before moding.


1- Disable Lightbox for non-admins, keeping it for admins:


    Edit your_template/details.html and thumbnail_bit.html and find:
Code: [Select]
{lightbox_button}
    Replace by:
Code: [Select]
{if is_admin}{lightbox_button}{endif is_admin}
    Edit your_template/user_logininfo.html and find:
Code: [Select]
&raquo; <a href="{url_lightbox}">{lang_lightbox}</a><br />
    Replace by:
Code: [Select]
{if is_admin}&raquo; <a href="{url_lightbox}">{lang_lightbox}</a><br />{endif is_admin}
   Using the {if is_admin} and {endif is_admin} tags prevents the non-admin from having lightbox and allow admins to have it.

2- Same thing for the upload form, using the tags {if is_admin} and {endif is_admin}:

    Edit your_template/member_uploadform.html and find:
Code: [Select]
<tr>
            <td class="row1" valign="top">
  <b>{lang_thumb_file}</b><br />
  <span class="smalltext">
  {lang_max_filesize}<b>{max_thumb_filsize}</b><br />
  {lang_max_imagewidth}<b>{max_thumb_imagewidth}</b><br />
  {lang_max_imageheight}<b>{max_thumb_imageheight}</b><br />
  </span>
</td>
            <td class="row1">
              <b>Upload:</b><br />
  <input type="file" name="thumb_file" class="input" /><br />
  <b>URL:</b><br />
  <input type="text" name="remote_thumb_file"  size="30" value="{remote_thumb_file}" class="input" /><br />
  <span class="smalltext"><b>{lang_allowed_file_types}</b> {allowed_thumb_types}</span>
            </td>
          </tr>

    Replace by this:
Code: [Select]
{if is_admin}          <tr>
            <td class="row1" valign="top">
  <b>{lang_thumb_file}</b><br />
  <span class="smalltext">
  {lang_max_filesize}<b>{max_thumb_filsize}</b><br />
  {lang_max_imagewidth}<b>{max_thumb_imagewidth}</b><br />
  {lang_max_imageheight}<b>{max_thumb_imageheight}</b><br />
  </span>
</td>
            <td class="row1">
              <b>Upload:</b><br />
  <input type="file" name="thumb_file" class="input" /><br />
  <b>URL:</b><br />
  <input type="text" name="remote_thumb_file"  size="30" value="{remote_thumb_file}" class="input" /><br />
  <span class="smalltext"><b>{lang_allowed_file_types}</b> {allowed_thumb_types}</span>
            </td>
          </tr>{endif is_admin}

    I agree with CeJay on points 3 and 4.

5- Redirect members to thumbnail and not image after uploading:
(Auto-thumbnail and member direct upload for categories have to be allowed in ACP)

    Open the file member.php at the root of your 4images installation. Find this, around at the line #671 in version 1.7.4:
Code: [Select]
      $file_extension = get_file_extension($new_name);
      $file = (is_remote($new_name)) ? $new_name : (($direct_upload) ? MEDIA_PATH."/".$cat_id."/".$new_name : MEDIA_TEMP_PATH."/".$new_name);
      $width_height = "";
      if (!is_remote($file) && $imageinfo = @getimagesize($file)) {
        $width_height = " ".$imageinfo[3];
      }
      $media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"\" />";
      $site_template->register_vars(array(
        "media_src" => $file,
        "media_icon" => $media_icon,
        "image_name" => format_text(stripslashes($image_name)),
        "width_height" => $width_height
      ));
      $media = $site_template->parse_template("media/".$file_extension);
      $content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$media."\n</td>\n</tr>\n</table>\n";
    }

    Replace by this:
Code: [Select]
      $file_extension = get_file_extension($new_name);
      $file = (is_remote($new_name)) ? $new_name : (($direct_upload) ? THUMB_PATH."/".$cat_id."/".$new_name : MEDIA_TEMP_PATH."/".$new_name);
      $width_height = "";
      if (!is_remote($file) && $imageinfo = @getimagesize($file)) {
        $width_height = " ".$imageinfo[3];
      }
      $media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"\" />";
      $site_template->register_vars(array(
        "media_src" => $file,
        "media_icon" => $media_icon,
        "image_name" => format_text(stripslashes($image_name)),
        "width_height" => $width_height
      ));
      $media = $site_template->parse_template("media/".$file_extension);
      $content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" >".$media."</a>\n</td>\n</tr>\n</table>\n";
    }

6- At last, you can simply change the name of the folder having the 4images installation in it, unless you have made modifications in your ROOT_PATH.

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: HOW TO's...
« Reply #3 on: December 21, 2006, 12:12:05 AM »
@ manurom
Thanks for posting those codes. I did not know about the is_admin tags. Now I learned as well  :D
Looks like I got some moding to do  :wink:

Offline camarosource

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: HOW TO's...
« Reply #4 on: December 21, 2006, 11:14:08 AM »
WOW!! That was awesome!! THANKS!!!

One small question.. I did find the "Auto-thumbnail" and it is set to YES and the categories are set to Registered.. But still doesn't work. :( It SEEMS that it may be in fact creating a thumbnail as when I go to edit the images, it shows a thumbnail in the thumbnail part. But it DISPLAYS the FULL SIZE image when you view the image.

manurom

  • Guest
Re: HOW TO's...
« Reply #5 on: December 21, 2006, 03:04:39 PM »
Hello,
go to your ACP and then >>Edit categories, and set "Direct Upload" like this, for each category you want member direct upload:


Second,go to Settings >> Upload Settings and select Auto-create thumbnail:



As I said in my previous post: (Auto-thumbnail and member direct upload for each category (oops, I forgotted this) have to be allowed in ACP), elsewhere it does not work in your particular purpose. Both are to be selected!

I have tried my modifications in my webserver, and everytime I upload a picture as regsitered member, and not admin, I get at the end the thumbnail, on which I click takes me to the full picture details display.
Maybe because I'm french, excuse me if my explanation is not clear enough.