Thread: Show Thread Enhancements - Ajax Thread (1stPost) Preview 1.5 Gold
View Single Post
  #2  
Old 02-04-2007, 08:00 PM
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Location: Germany
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FAQ


Quote:
Question: How can I reposition the window?
Edit the ajax_postpreview.js file.

Find this bit of code:
Code:
posToCenter = function(elem) {
    var scrollPos = new getScrollPos();
    var pageSize = new getPageSize();
    var emSize = new getElementSize(elem);
    var x = Math.round(pageSize.width/2) - (emSize.width /2) + scrollPos.scrollX;
    var y = Math.round(pageSize.height/2) - (emSize.height /2) + scrollPos.scrollY;    
    elem.style.left = (x+400) +'px';
    elem.style.top = (y+200) +'px';    
}
x = right <-> left
y = up <-> down

You can use + or - values to adjust the position of the preview window.

Example(JUST an example):

Code:
elem.style.left = (x+200) +'px';
elem.style.top = (y-200) +'px';





Quote:
Question: some reason it loads the whole thread! Not just the 1st post
Answer:
This hack will NOT work with vbSEO since it doesn't use showthread.php in the URL anymore.



Quote:
Question: I see the "Click Here to Close" code in the js file.
It there any way to have this shown at the top of the window instead of the bottom?
Answer:
Find in ajax_postpreview.js

Code:
var strHTML = "<div id=\"ibox_w\" style=\"display:none;\"></div>";
    strHTML +=    "<div id=\"ibox_progress\" style=\"display:none;\">";
    strHTML +=  indicator_img_html;
    strHTML +=  "</div>";
    strHTML +=    "<div id=\"ibox_wrapper\" style=\"display:none;\">";
    strHTML +=    "<div id=\"ibox_content\"></div>";
    strHTML +=    "<div id=\"ibox_footer_wrapper\"><div id=\"ibox_close\" style=\"float:right;\">";
    strHTML +=    "<a id=\"ibox_close_a\" href=\"javascript:void(null);\" >Click here to close</a></div>";
    strHTML +=  "<div id=\"ibox_footer\">&nbsp;</div></div></div></div>";
Replace with:
Code:
var strHTML = "<div id=\"ibox_w\" style=\"display:none;\"></div>";
    strHTML +=    "<div id=\"ibox_progress\" style=\"display:none;\">";
    strHTML +=  indicator_img_html;
    strHTML +=  "</div>";
    strHTML +=    "<div id=\"ibox_wrapper\" style=\"display:none;\">";
    strHTML +=    "<a id=\"ibox_close_a\" href=\"javascript:void(null);\" >Click here to close</a>";
    strHTML +=    "<div id=\"ibox_content\"></div></div>";
    strHTML +=    "</div></div>";


Quote:
Question: when I double click in the thread title to involk the AJAX title editting, instead of the title of the thread becoming editable the small mousover image is replaced with an edit window which has the html code
Answer:
If you installed v1.3 before I got to update the zip and you have this problem, follow these steps:


Find in Threadbit:
Code:
<if condition="!is_member_of($vbulletin->userinfo, $postpreviewusergroups) && $vbulletin->options[ajaxpostpreview_enable] == 1 && (!(in_array($forumid, array($vbulletin->options['ajaxpostpreview_forums']))))">
        <td class="alt2"><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]" onmouseover="showIbox('showthread_ajax.php?$session[sessionurl]t=$thread[threadid]',this, true);return false"><img src="$stylevar[imgdir_misc]/menu_open.gif" border="0"></td>
</if>
REPLACE WITH
Code:
<if condition="!is_member_of($vbulletin->userinfo, $postpreviewusergroups) && $vbulletin->options[ajaxpostpreview_enable] == 1 && (!(in_array($forumid, array($vbulletin->options['ajaxpostpreview_forums']))))">
        <td class="alt2"><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" onmouseover="showIbox('showthread_ajax.php?$session[sessionurl]t=$thread[threadid]',this, true);return false"><img src="$stylevar[imgdir_misc]/menu_open.gif" border="0"></td>
</if>


Quote:
Question: Many of my threads are quite long and with auto-resize the user has to scroll the entire main window as it extends far down. If I set a defined size, the window is the proper size but there are no internal scroll bars to scroll down within that window. Am I missing something or is that a limitation?
Answer:

You can define a set height and width here (in the JS file)

Code:
                                        //if(params['height']) {ibox.style.height = params['height']+'px';} 
                    //else {ibox.style.height = '380px';}
                    
                    //if(params['width']) {ibox.style.width = params['width']+'px';} 
                    //else {ibox.style.width = '800px';}
Just change to
Code:
//if(params['height']) {ibox.style.height = params['height']+'px';} 
                    //else {ibox.style.height = '380px';}
                    ibox.style.height = '480px';

                    //if(params['width']) {ibox.style.width = params['width']+'px';} 
                    //else {ibox.style.width = '800px';}
Adding a set height to 480 in the example above. A scrollbar will show for the up/down scrolling if the post is taller than that.


And also set:

height:45%;

in the CSS file for ibox_content






Quote:
Question: Anyway i can change the Click here to close to a GIF button instead?
Answer:

THANK YOU TO RMS-Chef FOR THIS:

I also made the close preview link a button image instead with this alteration (replace images/buttons/preview_close.gif with your own picture):
Code:
var strHTML = "<div id=\"ibox_w\" style=\"display:none;\"></div>";
 strHTML += "<div id=\"ibox_progress\" style=\"display:none;\">";
 strHTML +=  indicator_img_html;
 strHTML +=  "</div>";
 strHTML += "<div id=\"ibox_wrapper\" style=\"display:none;\">";
 strHTML += "<div id=\"ibox_content\"></div>";
 strHTML += "<div id=\"ibox_footer_wrapper\"><div id=\"ibox_close\" style=\"float:right;\">";
 strHTML += "<a id=\"ibox_close_a\" href=\"javascript:void(null);\" ><img src=\"images/buttons/preview_close.gif\" border=\"0\"></a></div>";
 strHTML +=  "<div id=\"ibox_footer\">&nbsp;</div></div></div></div>";


Quote:
Question: How do I change it to click the image in the left column than have it invoked with the mouseover?
Answer: No problem.

In THREADBIT Template find:

Code:
<if condition="!is_member_of($vbulletin->userinfo, $postpreviewusergroups) && $vbulletin->options[ajaxpostpreview_enable] == 1 && (!(in_array($forumid, array($vbulletin->options['ajaxpostpreview_forums']))))">
        <td class="alt2"><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" onmouseover="showIbox('showthread_ajax.php?$session[sessionurl]t=$thread[threadid]',this, true);return false"><img src="$stylevar[imgdir_misc]/menu_open.gif" border="0"></td>
</if>
and REPLACE with:

Code:

<if condition="!is_member_of($vbulletin->userinfo, $postpreviewusergroups) && $vbulletin->options[ajaxpostpreview_enable] == 1 && (!(in_array($forumid, array($vbulletin->options['ajaxpostpreview_forums']))))">
        <td class="alt2"><a href="#nbsp;" onclick="showIbox('showthread_ajax.php?$session[sessionurl]t=$thread[threadid]',this, true);return false"><img src="$stylevar[imgdir_misc]/menu_open.gif" border="0"></a></td>
</if>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01825 seconds
  • Memory Usage 1,814KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code
  • (7)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete