vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Show Thread Enhancements - Ajax Thread (1stPost) Preview 1.5 Gold (https://vborg.vbsupport.ru/showthread.php?t=138461)

SkyCatcher 02-03-2007 10:00 PM

Ajax Thread (1stPost) Preview 1.5 Gold
 
I have abandoned this modification as I find myself lacking time to do any additional modifications to get it 100% stable.

I would highly recommend that you check out this hack by magnus, as this one seems to be 100% AND looks great. I fell in love with it so I am using it myself :o

The only thing it doesn't do is give you a preview of the attachments, so you're welcome to keep the attachments part of this hack and use it in conjunction with magnus' hack.

I may just rewrite the attachments part of this hack and re-release it as a standalone.


Here is the link to his modification:

Collapsable First Post using AJAX (or Last Post!)
https://vborg.vbsupport.ru/showthread.php?t=145187


-Sky-

SkyCatcher 02-04-2007 08:00 PM

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>


projectego 02-04-2007 08:09 PM

Wow, this looks awesome. Thanks, SkyCatcher! ;)

SCRIPT3R 02-04-2007 08:12 PM

Awesome!

Paul M 02-04-2007 08:18 PM

Might I suggest you change the title to "Thread Preview" rather than post, since that is what it is doing. :)

SCRIPT3R 02-04-2007 08:25 PM

suggestions...
  • limit preview to Message BODY only in effort to conserve bandwidth as much as possible.
  • resizeable (AdminCP defineable) popup preview.
  • insert space prior to and edit text "Loading content preview, please wait..."

SkyCatcher 02-04-2007 08:25 PM

Quote:

Originally Posted by Paul M (Post 1174742)
Might I suggest you change the title to "Thread Preview" rather than post, since that is what it is doing. :)

I ... I guess you're previewing the thread... but you're previewing the first post of that thread...um....

Well since you have the pitchfork I suppose I'll take that into considderation :D

bashy 02-04-2007 08:36 PM

great idea, will try this tomoz :)

I would say the title is correct as your only preview 1 post not the thread :p

Terminatoronly 02-04-2007 08:36 PM

Nice Work Mate Really Nice I Will Use It :D

DasCool 02-04-2007 08:44 PM

i am finding a couple of things, i really don't know how to fix it. For some reason i want the Preview to pop up in the middle. However it actually opens all the way to the right and i have to scroll over. I dont know if this is a bug but The time is abit off too. Some times i will get the full 8 seconds and sometimes i will only get a sec of preview. Also, it seems to be Transparent like when i select it if there is a forum name under it then it gets mixed in with the writing


All times are GMT. The time now is 10:00 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.01349 seconds
  • Memory Usage 1,769KB
  • 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
  • (11)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)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