vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Major Additions - 8WayRun.Com - Media Library (https://vborg.vbsupport.ru/showthread.php?t=240677)

Jaxel 04-23-2010 12:20 AM

Quote:

Originally Posted by Veer (Post 2025657)
Upgraded to 0.4 I got these errors when rebuilding thumbnails:
Code:

Warning: Division by zero in [path]/media/media_functions_builds.php on line 29  Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in [path]/media/media_functions_builds.php on line 37  Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '[path]/customVID/thumbs/1102.jpg' is not a valid JPEG file in [path]/media/media_functions_builds.php on line 37  Warning: imagecopyresampled(): supplied argument is not a valid Image resource in [path]/media/media_functions_builds.php on line 38
After complete I noticed that MegaVideo thumbnails are not created, what to do now?

Interesting... can you replace the contents of the plugin "media ADMIN thumb" with the following code and tell me if that works? I don't actually use MegaVideo, and I know their RSS feed is so out of whack it took me a bit just to get it working...

Code:

if ($_REQUEST['do'] == 'chooser')
{
        print_form_header('misc', 'rebuild_media_thumbs');
        print_table_header("Rebuild Media Thumbnails", 2, 0);
        print_description_row("This function will rebuild the thumbnails in the media library.");
        print_input_row("Number of media to process per cycle", 'perpage', 50);
        print_input_row("Media ID Staring Location", 'startat', 0);
        print_submit_row("Rebuild Media Thumbnails");
}

if ($_REQUEST['do'] == 'rebuild_media_thumbs')
{
        require_once(DIR . '/media/media_functions_builds.php');
        require_once(DIR . '/media/media_functions_hrefs.php');
       
        if (empty($vbulletin->GPC['perpage']))
        {
                $vbulletin->GPC['perpage'] = 50;
        }

        $finishat = $vbulletin->GPC['startat'] + $vbulletin->GPC['perpage'];

        echo '<p>' . "Rebuild Media Thumbnails" . '</p>';

        $medias = $vbulletin->db->query_read_slave("
                SELECT * FROM " . TABLE_PREFIX . "media as media
                LEFT JOIN " . TABLE_PREFIX . "media_service AS media_service ON(media_service.serviceID = media.serviceID)
                WHERE mediaID >= " . $vbulletin->GPC['startat'] . " AND mediaID < $finishat
                ORDER BY mediaID
                ");

        while ($media = $vbulletin->db->fetch_array($medias))
        {
                echo construct_phrase($vbphrase['processing_x'], $media['mediaID']) . " - <a href=\"../" . construct_href_details($media) . "\" target=\"_blank\">" . $media['title'] . "</a><br />"; vbflush();

                if ($media['svcThumb'])
                {
                        if (($media['svcName'] == "LocalVideo") || ($media['svcName'] == "LocalAudio"))
                        {
                                echo ' - LOCAL MEDIA - SKIPPING THUMBNAIL RECONSTRUCTION<br />';
                        }
                        else
                        {
                                $media['feed'] = str_replace('{serviceVAL}', $media['serviceVAL'], $media['svcFeed']);
                                $feed['serviceVAL'] = $media['serviceVAL'];

                                require_once(DIR.'/includes/class_xml.php');
                                require_once(DIR.'/includes/class_vurl.php');

                                $vurl = new vB_vURL($vbulletin);
                                $vurl->set_option(VURL_URL, $media['feed']);
                                $vurl->set_option(VURL_USERAGENT, 'vBulletin/' . FILE_VERSION . ' | Media');
                                $vurl->set_option(VURL_RETURNTRANSFER, 1);
                                $vurl->set_option(VURL_TIMEOUT, 30);
                                $result = $vurl->exec();

                                $xmlobj = new vB_XML_Parser($result);
                                $arr = $xmlobj->parse();
                                eval("\$thu = $media[svcThumb]");

                                if (!$thu)
                                {
                                        echo '<blockquote><br />ERROR CONSTRUCTING THUMBNAIL<br />
                                                <a href="misc.php?' . $vbulletin->session->vars['sessionurl'] . 'do=rebuild_media_thumbs&startat=' . $media['mediaID'] . '&pp=' . $vbulletin->GPC['perpage'] . '">click here to retry from this position</a></blockquote>';
                                        exit;
                                }

                                build_thumbnail($thu, $media['mediaID']);
                        }
                }

                echo '<img src="/'.$vbulletin->options['media_thumb_dir'].'/thumbs/'.$media['mediaID'].'.jpg"><br />';
                vbflush();

                $finishat = ($media['mediaID'] > $finishat ? $media['mediaID'] : $finishat);       
        }

        if ($checkmore = $vbulletin->db->query_first("SELECT mediaID FROM " . TABLE_PREFIX . "media WHERE mediaID >= $finishat LIMIT 1"))
        {
                print_cp_redirect("misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuild_media_thumbs&startat=$finishat&pp=" . $vbulletin->GPC['perpage']);
                echo "<p><a href=\"misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuild_media_thumbs&amp;startat=$finishat&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
        }
       
        define('CP_REDIRECT', 'misc.php');
        print_stop_message('updated_threads_successfully');
}


Veer 04-23-2010 12:29 AM

Quote:

Originally Posted by Jaxel (Post 2025669)
Interesting... can you replace the contents of the plugin "media ADMIN thumb" with the following code and tell me if that works? I don't actually use MegaVideo, and I know their RSS feed is so out of whack it took me a bit just to get it working...

Code:

if ($_REQUEST['do'] == 'chooser')
{
        print_form_header('misc', 'rebuild_media_thumbs');
        print_table_header("Rebuild Media Thumbnails", 2, 0);
        print_description_row("This function will rebuild the thumbnails in the media library.");
        print_input_row("Number of media to process per cycle", 'perpage', 50);
        print_input_row("Media ID Staring Location", 'startat', 0);
        print_submit_row("Rebuild Media Thumbnails");
}

if ($_REQUEST['do'] == 'rebuild_media_thumbs')
{
        require_once(DIR . '/media/media_functions_builds.php');
        require_once(DIR . '/media/media_functions_hrefs.php');
       
        if (empty($vbulletin->GPC['perpage']))
        {
                $vbulletin->GPC['perpage'] = 50;
        }

        $finishat = $vbulletin->GPC['startat'] + $vbulletin->GPC['perpage'];

        echo '<p>' . "Rebuild Media Thumbnails" . '</p>';

        $medias = $vbulletin->db->query_read_slave("
                SELECT * FROM " . TABLE_PREFIX . "media as media
                LEFT JOIN " . TABLE_PREFIX . "media_service AS media_service ON(media_service.serviceID = media.serviceID)
                WHERE mediaID >= " . $vbulletin->GPC['startat'] . " AND mediaID < $finishat
                ORDER BY mediaID
                ");

        while ($media = $vbulletin->db->fetch_array($medias))
        {
                echo construct_phrase($vbphrase['processing_x'], $media['mediaID']) . " - <a href=\"../" . construct_href_details($media) . "\" target=\"_blank\">" . $media['title'] . "</a><br />"; vbflush();

                if ($media['svcThumb'])
                {
                        if (($media['svcName'] == "LocalVideo") || ($media['svcName'] == "LocalAudio"))
                        {
                                echo ' - LOCAL MEDIA - SKIPPING THUMBNAIL RECONSTRUCTION<br />';
                        }
                        else
                        {
                                $media['feed'] = str_replace('{serviceVAL}', $media['serviceVAL'], $media['svcFeed']);
                                $feed['serviceVAL'] = $media['serviceVAL'];

                                require_once(DIR.'/includes/class_xml.php');
                                require_once(DIR.'/includes/class_vurl.php');

                                $vurl = new vB_vURL($vbulletin);
                                $vurl->set_option(VURL_URL, $media['feed']);
                                $vurl->set_option(VURL_USERAGENT, 'vBulletin/' . FILE_VERSION . ' | Media');
                                $vurl->set_option(VURL_RETURNTRANSFER, 1);
                                $vurl->set_option(VURL_TIMEOUT, 30);
                                $result = $vurl->exec();

                                $xmlobj = new vB_XML_Parser($result);
                                $arr = $xmlobj->parse();
                                eval("\$thu = $media[svcThumb]");

                                if (!$thu)
                                {
                                        echo '<blockquote><br />ERROR CONSTRUCTING THUMBNAIL<br />
                                                <a href="misc.php?' . $vbulletin->session->vars['sessionurl'] . 'do=rebuild_media_thumbs&startat=' . $media['mediaID'] . '&pp=' . $vbulletin->GPC['perpage'] . '">click here to retry from this position</a></blockquote>';
                                        exit;
                                }

                                build_thumbnail($thu, $media['mediaID']);
                        }
                }

                echo '<img src="/'.$vbulletin->options['media_thumb_dir'].'/thumbs/'.$media['mediaID'].'.jpg"><br />';
                vbflush();

                $finishat = ($media['mediaID'] > $finishat ? $media['mediaID'] : $finishat);       
        }

        if ($checkmore = $vbulletin->db->query_first("SELECT mediaID FROM " . TABLE_PREFIX . "media WHERE mediaID >= $finishat LIMIT 1"))
        {
                print_cp_redirect("misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuild_media_thumbs&startat=$finishat&pp=" . $vbulletin->GPC['perpage']);
                echo "<p><a href=\"misc.php?" . $vbulletin->session->vars['sessionurl'] . "do=rebuild_media_thumbs&amp;startat=$finishat&amp;pp=" . $vbulletin->GPC['perpage'] . "\">" . $vbphrase['click_here_to_continue_processing'] . "</a></p>";
        }
       
        define('CP_REDIRECT', 'misc.php');
        print_stop_message('updated_threads_successfully');
}


Okay, give me the link to retry from the custom position because I don't wanna rebuild all thumbnails again, these are 1000+ you know :D

Code:

<a href="misc.php?' . $vbulletin->session->vars['sessionurl'] . 'do=rebuild_media_thumbs&startat=' . $media['mediaID'] . '&pp=' . $vbulletin->GPC['perpage'] . '">click here to retry from this position</a>

rotor 04-23-2010 01:16 AM

Upgrade to .4 went fine :D

rebuild all ok :D

comment edit working perfectly :D

all good ..... I guess I'm all smiles lol :D :D :D


Thx for the mod .... it's great!!

Jaxel 04-23-2010 01:34 AM

Quote:

Originally Posted by Veer (Post 2025674)
Okay, give me the link to retry from the custom position because I don't wanna rebuild all thumbnails again, these are 1000+ you know :D

Code:

<a href="misc.php?' . $vbulletin->session->vars['sessionurl'] . 'do=rebuild_media_thumbs&startat=' . $media['mediaID'] . '&pp=' . $vbulletin->GPC['perpage'] . '">click here to retry from this position</a>

You can enter a starting position on the form to start the rebuild process.

Veer 04-23-2010 01:44 AM

Quote:

Originally Posted by Jaxel (Post 2025697)
You can enter a starting position on the form to start the rebuild process.

oh yes, got it working now.

thanks :)

Juggernaut 04-23-2010 01:51 AM

I'm running vBulletin 4.0.3, but the video description editing is not saving the edits :(

Jaxel 04-23-2010 02:37 AM

Quote:

Originally Posted by Destron (Post 2025709)
I'm running vBulletin 4.0.3, but the video description editing is not saving the edits :(

You're the only one having this problem... I can't reproduce it.

Juggernaut 04-23-2010 02:52 AM

Thank you for trying, maybe I'll try a clean install of the latest version and see if that helps. :D

TimberFloorAu 04-23-2010 03:02 AM

Note on Navbar link reads : media.php? instead of media.php

Pedantic but fix would be good.

freni32 04-23-2010 04:39 AM

I have VBSEO so the url-rewrites I want arent working so have to go to the old fashioned thread that doesnt have the keywords in the url, wish someone had a fix for vbseo


All times are GMT. The time now is 06:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06932 seconds
  • Memory Usage 1,807KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete