Current time: 05-24-2012, 11:38 AM Hello There, Guest! (LoginRegister)


 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] Thumbnails Not Rebuilding [C-Michael83]
09-20-2008, 01:56 AM (This post was last modified: 10-28-2008 01:46 PM by Michael S..)
Post: #1
[F] Thumbnails Not Rebuilding [C-Michael83]
This user has been denied support. This user has been denied support.
Edit: check_proceed for Thumbnnails is certainly not working.

Found 2 typos in the acp_rebuild_attachment_thumbnails function so far:
file: admin/inc/modules/tools/recount_rebuild.php Wrote:function acp_rebuild_attachment_thumbnails()
{
global $db, $mybb, $lang;

$query = $db->simple_select("attachments", "COUNT(aid) as num_attachments");
$num_attachments = $db->fetch_field($query, 'num_attachments');

$page = intval($mybb->input['page']);
$per_page = intval($mybb->input['attachmentthumbs']);
$start = ($page-1) * $per_page;
$end = $start + $per_page;

require_once MYBB_ROOT."inc/functions_image.php";

$query = $db->simple_select("attachments", "*", '', array('order_by' => 'aid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($attachment = $db->fetch_array($query))
{

$ext = my_strtolower(my_substr(strrchr($attachment['filename'], "."), 1));
if($ext == "gif" || $ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "jpe")
{
$thumbname = str_replace(".attach", "_thumb.$ext", $attachment['attachname']);

$thumbnail = generate_thumbnail(MYBB_ROOT."uploads/".$attachment['attachname'], MYBB_ROOT."uploads/", $thumbname, $mybb->settings['attachthumbh'], $mybb->settings['attachthumbw']);

if($thumbnail['code'] == 4)
{
$thumbnail['filename'] = "SMALL";
}
$db->update_query("attachments", array("thumbnail" => $thumbnail['filename']), "aid='{$attachment['aid']}'");
}
}

check_proceed($num_attachments, $end, ++$page, $per_page, "attachmentthumbs", "do_rebuildattachmentthumbs", $lang->success_rebuilt_attachment_thumbnails);
}

One is a path problem where after uploads it needed to be uploads/.
Two is $num_users should be $numb_attachments so that the proceed works.

fyi- I wasn't able to rebuild my thumbnails without manually chmod of 666. Not sure if that's partly my servers safe mode or something mybb isn't doing well. Either way I found two bugs.

Thanks.

New MyBB plugin is "My Awards 2.0".
[Image: 468x60_SF.gif]
Visit this user's website Find all posts by this user
09-25-2008, 01:28 AM
Post: #2
RE: Thumbnails Not Rebuilding
When i change the thumbnails size on ACP it never rebuilds the old, just changes to the ones inserted after that change.

[Image: banner-small-transparent.png]
Find all posts by this user
09-25-2008, 03:38 AM (This post was last modified: 09-25-2008 03:39 AM by labrocca.)
Post: #3
RE: Thumbnails Not Rebuilding
This user has been denied support. This user has been denied support.
Fix the typos I have above and you can rebuild successfully.

I am sure this will be added to bug fixes soon as possible.

New MyBB plugin is "My Awards 2.0".
[Image: 468x60_SF.gif]
Visit this user's website Find all posts by this user
09-27-2008, 01:58 PM
Post: #4
[F] Thumbnails Not Rebuilding
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication