vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Display Enhancements - Logo Rotation (https://vborg.vbsupport.ru/showthread.php?t=252398)

Liff 07-18-2012 04:39 PM

Quote:

Originally Posted by thunderclap82 (Post 2349294)
Is the image a PNG? Nivo doesn't play nice with PNG so be sure to use JPG.

Nope.. It's deffo a .jpg

http://i46.tinypic.com/14vnxp5.jpg

thunderclap82 07-18-2012 05:40 PM

Quote:

Originally Posted by Liff (Post 2349296)
Nope.. It's deffo a .jpg

http://i46.tinypic.com/14vnxp5.jpg

Can you use an image on your server instead? Maybe there is a problem with using tinypic.

LgsOfChampions 07-21-2012 08:37 PM

is this working for 4.2?

Liff 07-31-2012 01:17 PM

Quote:

Originally Posted by LgsOfChampions (Post 2350251)
is this working for 4.2?

I've spent hours trying and failed miserably.

I would really appreciate it if anyone who has nailed this for 4.2 would mind sharing their success :)

thunderclap82 07-31-2012 06:21 PM

While I don't really support the plug-in as I'm not a programmer by any means (had a lot of help from the community getting it working) I can say it does work with vB 4.2 PL1. That's what we run on our site and the plug-in works fine.

Liff 08-07-2012 01:29 PM

Quote:

Originally Posted by thunderclap82 (Post 2353111)
While I don't really support the plug-in as I'm not a programmer by any means (had a lot of help from the community getting it working) I can say it does work with vB 4.2 PL1. That's what we run on our site and the plug-in works fine.

Tc.. I really like the plugin and while I can't get it to work I appreciate your support.

I've just started again from the very beginning and I have the exact same problem.

The problem for me seems still to be in the plugin as it kills my forum with the 503 error.

Can you confirm the details of the hook location as I've tried the two you've suggested to no avail. Everything else seems fine and it just looks as though it's waiting on the details of the banner rotator in order to work. If you want to see choose the Rotator TNT67 style on my forum: twistsnturns.net and you'll see what I mean. When I get it working I will be using it where my normal banner is, and not in the header, but I'll sort that once it's working :)

Thanks again for your time,

Liffey

thunderclap82 08-07-2012 07:08 PM

I run two sites and those are the took hook locations that work for me. It's possible another plug-in is causing a conflict. Not sure but, again, not a programmer so... *shrugs*

Not sure what else to tell you. Sorry.

Have you tried this mod?

Liff 08-08-2012 07:49 AM

Quote:

Originally Posted by thunderclap82 (Post 2355325)
I run two sites and those are the took hook locations that work for me. It's possible another plug-in is causing a conflict. Not sure but, again, not a programmer so... *shrugs*

Not sure what else to tell you. Sorry.

Have you tried this mod?

Hey TC.. I know you're not a programmer but you have been a great help.

I'm kinda hoping someone else looking in might be able to explain what's going on.. I disabled a bunch of products I no longer use and got it working (Yay!) and then all of a sudden it stopped working in Chrome, but works fine in FF & Safari.

I've cleared my cache etc.., in Chrome but nothing...

Does anyone have any ideas as this is starting to drive me crazy :D

http://twistsnturns.net

Style: Slider TNT67

Liff 08-08-2012 08:08 AM

[Edit] I seem to be getting somewhere.. When I use the 'Parse_Templates' as hook location it works fine on the forum listing page, but not within the forum.

I understand TC might not be able to do this but is there any way to bypass the plug-in requirement of this modification in order to make it work regardless?

I do run a lot of mods on my forum and it's probable that one of them is clashing, but I'm very close to having this work and feel that just a little more and I'll be there :)

[Edit again] OK.. When I disable the parse_templates plug in modification for the Chiplove thumbnails it works fine.. The code for his is a little more complicated than the one for this modification and I would love to run both.. Does anyone have any ideas?

This is the code for the thumbnails hook in:

PHP Code:

#<?
if($vbulletin->options['chip_threadthumb_turn'] AND in_array(THIS_SCRIPT, array('forumdisplay', 'search')))
{
    function threadthumbnails_fetch_forums()
    {        
        global $vbulletin;
        list($w, $h) = explode(',', $vbulletin->options['chip_threadthumb_sizedefault']);        
        $lines = preg_split("#(\r\n|\r|\n)#", $vbulletin->options['chip_threadthumb_include']);
        if($vbulletin->options['chip_threadthumb_allforum'])
        {
            foreach( array_keys($vbulletin->forumcache) as $fid)
            {
                $vbulletin->forumcache[$fid]['thumb_w'] = $w;
                $vbulletin->forumcache[$fid]['thumb_h'] = $h;
            }
        }
        
        foreach($lines as $line)
        {
            list($fids, $w_h) = explode('|', $line);
            if($w_h)
            {
                list($w, $h) = array_map('intval', explode(',', $w_h));
            }
            $fids = array_map('intval', explode(',', $fids));
            foreach($fids as $fid)
            {
                if($vbulletin->forumcache[$fid])
                {
                    $vbulletin->forumcache[$fid]['thumb_w'] = $w;
                    $vbulletin->forumcache[$fid]['thumb_h'] = $h;
                }
            }
        }
        
        if ($exclude = explode(',', $vbulletin->options['chip_threadthumb_exclude']))
        {
            foreach($exclude as $fid)
            {
                if($vbulletin->forumcache[$fid]['thumb_w'])
                {
                    unset($vbulletin->forumcache[$fid]['thumb_w']);
                }
            }
        }    
        if ($exclude_groups = array_map('intval', explode(',', $vbulletin->options['chip_threadthumb_excludegroups'])))
        {
            if (in_array($vbulletin->userinfo['usergroupid'], $exclude_groups))
            {
                foreach( array_keys($vbulletin->forumcache) as $fid)
                {
                    unset($vbulletin->forumcache[$fid]['thumb_w']);
                }
            }
        }
    }
    function threadthumbnails_get_thumbnail($thread, $pagetext = '', $query = false)
    {
        global $vbulletin;        
        $thread['thumb'] = $pagetext ? $pagetext : $thread['pagetext'];
        $thread['thumb_src'] = '';
        
        $have_thumb = false;
        //using image of first post + youtube thumbnails
        if ( strpos($vbulletin->options['chip_threadthumb_types'], '1') !== false )
        {
            if (preg_match('#\[IMG\](.+?)\[\/IMG\]#i', $thread['thumb'], $m))
            {
                $thread['thumb_src'] = $m[1];    
                $have_thumb = true;
            }
            elseif (preg_match('#\[YOUTUBE\]([^\[]+?)\[\/YOUTUBE\]#i', $thread['thumb'], $m))    
            {
                $str = preg_replace('#(http.*watch\?v=)?([^"]+?)(&.*)?#', '$2', $m[1]);
                $thread['thumb_src'] = 'http://i4.ytimg.com/vi/'.$str.'/default.jpg';    
                $have_thumb = true;
            }
            elseif (preg_match('#\[video=youtube;([^\]]+?)\]#i', $thread['thumb'], $m)) 
            {
                $thread['thumb_src'] = 'http://i4.ytimg.com/vi/'.$m[1].'/default.jpg';    
                $have_thumb = true;
            }
        }
        //using file attach
        if ( 
            !$have_thumb // have not a thumbnails
            AND $thread['attach'] > 0 //have attach files
            AND (strpos($vbulletin->options['chip_threadthumb_types'], '2') !== false OR strpos($vbulletin->options['chip_threadthumb_types'], '3') !== false) )
        {
            //get attach file - image
            $attach = $vbulletin->db->query_first("
                SELECT attachment.attachmentid, attachment.dateline
                FROM ".TABLE_PREFIX."attachment AS attachment
                ".iif(strpos($vbulletin->options['chip_threadthumb_types'], '3') !== false, "
                    LEFT JOIN ".TABLE_PREFIX."filedata AS filedata ON (filedata.filedataid = attachment.filedataid)")."
                WHERE attachment.contentid = ".$thread['firstpostid']."
                    ".iif(strpos($vbulletin->options['chip_threadthumb_types'], '3') !== false, "AND filedata.extension IN ('png', 'jpg', 'jpeg', 'gif', 'bmp')")."
                LIMIT 1
            ");
            if($attach)
            {
                $thread['thumb_src'] = $vbulletin->options['bburl'].'/attachment.php?attachmentid='.$attach['attachmentid'].'&thumb=1&d='.$attach['dateline'];    
                $have_thumb = true;
            }
        }
        if($query AND !$have_thumb)
        {
            $post = $vbulletin->db->query_first("
                SELECT pagetext FROM ".TABLE_PREFIX."post WHERE threadid = $thread[threadid] AND parentid = 0 
            ");
            return threadthumbnails_get_thumbnail($thread, $post['pagetext']);
        }

        if(!$have_thumb AND $vbulletin->options['chip_threadthumb_useavatar'] AND ($thread['useavatar'] OR THIS_SCRIPT == 'search')) 
        {
            if(THIS_SCRIPT == 'search')
            {
                $useavatar = $vbulletin->db->query_first("
                    SELECT userid FROM ".TABLE_PREFIX."customavatar WHERE userid = ".$thread['postuserid']."
                ");
            }    
            if($useavatar OR $thread['useavatar'])
            {
                return $vbulletin->options['bburl'].'/image.php?' . $vbulletin->session->vars['sessionurl'] . "u=$thread[postuserid]";
            }
        }
        if (!$have_thumb)
        {
            $thread['thumb_src'] = vB_Template_Runtime::fetchStylevar("imgdir_misc").'/'.$vbulletin->options['chip_threadthumb_noimg'];    
        }
        return $thread['thumb_src'];
    }
    
    threadthumbnails_fetch_forums();
    
    
    if ($vbulletin->forumcache[intval($GLOBALS['forumid'])]['thumb_w'] > 0 OR THIS_SCRIPT == 'search')
    {        
        $template_name = iif(THIS_SCRIPT == 'search', 'search_').'threadbit';
        if($vbulletin->options['chip_threadthumb_zoom'])
        {        
            list($zoom_w, $zoom_h) = array_map('intval', explode(',', $vbulletin->options['chip_threadthumb_zoom_wh']));

        //add css
        $template_hook['headinclude_bottom_css'] .= '
<style type="text/css">
/* Chiplove.9xpro - Thread Thumbnails 2.2 */
#preview{position:absolute;border:1px solid #ccc;background:#333;padding:5px;display:none;color:#fff;}
</style>';

$jquery_lib = '';
if($vbulletin->options['chip_threadthumb_jquerypath'])
{
    if(substr($vbulletin->options['chip_threadthumb_jquerypath'], 0, 4) != 'http')
    {
        $jquery_lib = $vbulletin->options['bburl'].'/clientscript/jquery/'.$vbulletin->options['chip_threadthumb_jquerypath'];
    }
    else
    {
        $jquery_lib =& $vbulletin->options['chip_threadthumb_jquerypath']; 
    }
}

$template_hook['footer_javascript'] .= ($jquery_lib ? '<script type="text/javascript" src="'.$jquery_lib.'"></script>' : '').'
<script type="text/javascript">
/* Chiplove.9xpro - Thread Thumbnails 2.2 */
function imagePreview(){    
    xOffset = 30;
    yOffset = 30;
    jQuery("img.preview").hover(function(e){
        this.t = this.title;
        this.title = "";    
        var c = (this.t != "") ? "<br/>" + this.t : "";
        jQuery("body").append("<p id=\'preview\'><img src=\'"+ this.src +"\' style=\''.iif($zoom_w,"width:{$zoom_w}px;").iif($zoom_h,"width:{$zoom_h}px;").'\' alt=\'Image Preview\' />"+ c +"</p>");                                 
        jQuery("#preview")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px")
            .fadeIn("fast");                        
    },
    function(){
        this.title = this.t;    
        jQuery("#preview").remove();
    });    
    jQuery("img.preview").mousemove(function(e){
        jQuery("#preview")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px");
    });            
};
function removeTitle() {
    jQuery(".threadinfo").attr("title", "");
    jQuery(".threadstatus").attr("title", "");
    '.iif(THIS_SCRIPT == 'search', 'var items = jQuery("#searchbits").find(".threadbit");
    jQuery.each(items, function(k, v){
        if(typeof jQuery(items[k]).find("img.preview").attr("src") != "undefined") {
            jQuery(items[k]).find(".threadstatus").attr("title","");
            jQuery(items[k]).find(".threadinfo").attr("title","");
            jQuery(items[k]).find(".threadinfo").attr("title","");
            jQuery(items[k]).attr("title","");
        }
    });').'
}
jQuery(function(){
    imagePreview();
    setTimeout("removeTitle();", 1000);
});
</script>
';        
            $vbulletin->templatecache[$template_name] = str_replace(
                '<a class="title', 
                '<a title="\'.$thread[\'preview\'].\'" class="title', 
                $vbulletin->templatecache[$template_name]
            );
        }

        $vbulletin->templatecache[$template_name] = str_replace(
            '$final_rendered .= \'\' . \'></a>',
            '$final_rendered .= \'\' . iif($thread[\'thumb_src\'], \' style="height:\'.($vbulletin->forumcache[$thread[\'forumid\']][\'thumb_h\']+8).\'px !important;width:\'.($vbulletin->forumcache[$thread[\'forumid\']][\'thumb_w\']+10).\'px !important;'.$vbulletin->options['chip_threadthumb_cssforthumbnails'].iif(
            $vbulletin->options['chip_threadthumb_overwritestatus'], 'padding-left:'.$vbulletin->options['chip_threadthumb_overwritestatus'].'px;', 'background: none !important;'
            ).'">
                <!-- Forum using plugin: Thread Thumbnails 2.0 - Powered by chiplove.9xpro -->
                <img class="preview" src="\'.$thread[\'thumb_src\'].\'" style="width:\'.$vbulletin->forumcache[$thread[\'forumid\']][\'thumb_w\'].\'px;height:\'.$vbulletin->forumcache[$thread[\'forumid\']][\'thumb_h\'].\'px;border:1px solid #c8c8c8;background:#fff;padding:2px;display:block;"\').\' /></a>',
            $vbulletin->templatecache[$template_name]
        );
    }
}


Dragonsys 12-10-2012 05:27 PM

it is working well for me in parse_templates, on vB 4.2 pl3
You can see it here - http://www.lonestarcamaro.com/forums/


All times are GMT. The time now is 05:05 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.01206 seconds
  • Memory Usage 1,820KB
  • 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
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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