Author Topic: [MOD] - See other upload images by uploader from details page  (Read 26781 times)

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[MOD] - See other upload images by uploader from details page
« on: November 07, 2007, 04:56:11 AM »
This is MOD for see in details page - all relate upload image of each uploader (relate image of upload).

// Step 1

In details.php file,

find:

Code: [Select]
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name = format_text($image_row['image_name'], 2);
show_image($image_row, $mode, 0, 1);

add after:

Code: [Select]
//-----------------------------------------------------
//--- Show All Related Images By Uploader -------------
//-----------------------------------------------------
$sql1 = "

SELECT i.image_id, i.image_name, i.image_thumb_file, i.image_media_file, i.cat_id" . get_user_table_field(", u.", "user_name") . "
FROM (" . IMAGES_TABLE . " i, " . CATEGORIES_TABLE . " c)
LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)
WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND i.image_id != " . $image_id . " AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))

";

$result = $site_db->query($sql1);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $uploader_related_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $uploader_related_images .= $lang['no_new_images'];
  $uploader_related_images .= "</td></tr></table>";
}
else  {
  $uploader_related_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($uploader_related_images_row = $site_db->fetch_array($result)) {
      $user_name = format_text(trim(ucfirst($uploader_related_images_row[$user_table_fields['user_name']]), 2));
     
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $uploader_related_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $uploader_related_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($uploader_related_images_row);
    $uploader_related_images .= $site_template->parse_template("thumbnail_bit");
    $uploader_related_images .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
      $uploader_related_images .= "</tr>\n";
      $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $uploader_related_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      $uploader_related_images .= "</tr>\n";
    }
  }
  $uploader_related_images .= "</table>\n";
} // end else

$site_template->register_vars("lang_uploader_related_images", preg_replace("/" . $site_template->start . "user_name" . $site_template->end . "/siU", $user_name, $lang['uploader_related_images']));
$site_template->register_vars("uploader_related_images", $uploader_related_images);
unset($uploader_related_images);

// Step 2

In lang/english/main.php file,

add in top ?>:

Code: [Select]
$lang['uploader_related_images'] = "See other images uploaded by {user_name}";

// Step 3

In templates/your_template/details.html file,

find:

Code: [Select]
{admin_links}<br />
                    {endif admin_links}<br />
                    {lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}
</div>
                  <br />

add after:

Code: [Select]
{if uploader_related_images}
  <table width="450" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_uploader_related_images}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="head1">{uploader_related_images}</td>
                    </tr>                       
                  </table>
  <br />
  {endif uploader_related_images}

Finish.
« Last Edit: November 07, 2007, 10:19:25 PM by kai »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #1 on: November 07, 2007, 09:53:26 PM »
I fix step 1 from 1st post (include me - I get trap for this MOD  8O  :oops: :mrgreen:).
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline l1some

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #2 on: November 07, 2007, 11:56:27 PM »
Not working

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #3 on: November 08, 2007, 12:05:46 AM »
Quote
Not working

Please read step 6 of my signature.

Quote
« Last Edit: November 07, 2007, 10:19:25 PM by kai »

I take no responsible for other edit of admin in my post :!:
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline l1some

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #4 on: November 08, 2007, 12:53:19 AM »
??? does the mod work in 1.7.4. can you post your code, this one is not working pretty easy to install but nothing shows up

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #5 on: November 08, 2007, 01:03:57 AM »
Quote
??? does the mod work in 1.7.4.

Yes - is work with v1.7.4.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline l1some

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #6 on: November 08, 2007, 03:04:14 AM »
can you help???

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #7 on: November 08, 2007, 03:11:40 AM »
I test this on fresh 4images install and is work 100%. If install today after my fix post, MOD is work good. If install before, please do step 1 again.
If problem is same, I no can reproduce.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline l1some

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #8 on: November 08, 2007, 03:35:48 AM »
Working, one thing how do I limit the picture to only 4-6

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #9 on: November 08, 2007, 04:07:31 AM »
In details.php file,

find:

Code: [Select]
WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND i.image_id != " . $image_id . " AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))

add after:

Code: [Select]
ORDER BY i.image_date DESC
LIMIT 4

(no space after line).
Change 4 to value limit you want.
« Last Edit: November 08, 2007, 08:44:23 AM by kai »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline l1some

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #10 on: November 08, 2007, 04:35:08 AM »
Thanks for your help :lol:

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #11 on: November 08, 2007, 05:20:01 PM »
Hi Thunderstrike,
I just installed your MOD on a fresh gallery, but it seems not to be working. :roll:
 
We you click on a thumb to view an image, you get only the image you uploaded or it works randomly. That means you get not what you want.

I am working on 1.74.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #12 on: November 08, 2007, 06:11:18 PM »
Quote
you get only the image you uploaded

Is what I say on first post. :?

Quote
it works randomly

Ramdom ... ? I no get ... example ? (Step 4 of my signature)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - See other upload images by uploader from details page
« Reply #13 on: November 08, 2007, 08:28:44 PM »
I will make an example for you. Later  :)

Offline malpa

  • Pre-Newbie
  • Posts: 8
    • View Profile
    • Video center
Re: [MOD] - See other upload images by uploader from details page
« Reply #14 on: November 09, 2007, 03:15:40 PM »
 :x ATTENTION:
Installation of this MODis the best way to kill your server.

Never install this MOD if your 4homepages-site has many visitors.

I did this mistake 10 minutes ago: all websites (not only 4homepages-based) on the hole server were in down.