Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Ajax Thread (1stPost) Preview 1.5 Gold Details »»
Ajax Thread (1stPost) Preview 1.5 Gold
Version: 1.5 Gold, by SkyCatcher SkyCatcher is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.4 Rating:
Released: 02-03-2007 Last Update: Never Installs: 101
Uses Plugins Template Edits
Additional Files  
No support by the author.

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

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-

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #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
  #3  
Old 02-04-2007, 08:09 PM
projectego's Avatar
projectego projectego is offline
 
Join Date: Feb 2006
Location: UK
Posts: 724
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, this looks awesome. Thanks, SkyCatcher!
Reply With Quote
  #4  
Old 02-04-2007, 08:12 PM
SCRIPT3R SCRIPT3R is offline
 
Join Date: Jan 2005
Posts: 1,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome!
Reply With Quote
  #5  
Old 02-04-2007, 08:18 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Might I suggest you change the title to "Thread Preview" rather than post, since that is what it is doing.
Reply With Quote
  #6  
Old 02-04-2007, 08:25 PM
SCRIPT3R SCRIPT3R is offline
 
Join Date: Jan 2005
Posts: 1,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..."
Reply With Quote
  #7  
Old 02-04-2007, 08:25 PM
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Location: Germany
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
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
Reply With Quote
  #8  
Old 02-04-2007, 08:36 PM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great idea, will try this tomoz

I would say the title is correct as your only preview 1 post not the thread
Reply With Quote
  #9  
Old 02-04-2007, 08:36 PM
Terminatoronly's Avatar
Terminatoronly Terminatoronly is offline
 
Join Date: Mar 2006
Posts: 313
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice Work Mate Really Nice I Will Use It
Reply With Quote
  #10  
Old 02-04-2007, 08:44 PM
DasCool DasCool is offline
 
Join Date: Jan 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04706 seconds
  • Memory Usage 2,320KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete