vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   First post on every page of thread. (https://vborg.vbsupport.ru/showthread.php?t=93706)

vBintense 08-06-2005 02:57 PM

I will try that in a bit , but looking at the second hook code it looks like should be
PHP Code:

 if ($forum['showfirstpost'])
{
    
$ids .= ",$thread[firstpostid]";
}
    
$postids "post.postid IN (0" $ids ")"
    if (
$thread['hasattach'])
    {
        
$attachments $db->query_read("
            SELECT dateline, thumbnail_dateline, filename, filesize, visible, attachmentid, counter,
                postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize,
                attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow
            FROM " 
TABLE_PREFIX "attachment
            LEFT JOIN " 
TABLE_PREFIX "attachmenttype AS attachmenttype USING (extension)
            WHERE postid IN (-1" 
$ids ")
            ORDER BY attachmentid
        "
);
        
$postattach = array();
        while (
$attachment $db->fetch_array($attachments))
        {
            if (!
$attachment['build_thumbnail'])
            {
                
$attachment['hasthumbnail'] = false;
            }
            
$postattach["$attachment[postid]"]["$attachment[attachmentid]"] = $attachment;
        }      
        
// Restore
        
$thread['attach'] = $thread['hasattach'];
        unset(
$thread['hasattach']);
    


With the first if being closed right off, other wise if it is not a show first post it would not show attachments on normal threads?

Andreas 08-06-2005 03:01 PM

Edited my last post.
The first Hook was missing a check for $forum['showfirstpost']

vBintense 08-06-2005 03:02 PM

kk , may I use your change in my update later?

Andreas 08-06-2005 03:04 PM

Feel free to do whatever you want with the Code :)

vBintense 08-06-2005 03:14 PM

Many thanks (will test it out, then update once I am more awake).

[high]* vBintense bows down to Kirbys hook knowledge and gets ready to invite boofo back into the thread
[/high]

;)

vBintense 08-06-2005 05:40 PM

Update: Thanks to Kirby the file edit is no longer needed, if you have installed before now just simply remove the file edit and upload this xml to 'plugins' not to products.

Now that this does not use file edit maybe a mod can move it to plugins?

The zip has been updated with the new product.

Andreas 08-06-2005 05:47 PM

Moved :)

vBintense 08-06-2005 05:48 PM

I tryed it , via the plug in, they connect to the product (looking at the plugin xml) so it should all tie in should it not?

Andreas 08-06-2005 05:50 PM

Yes. AFAIK older Versions did not export the Product, but this XML contains it and therefore they will attach. Already removed the sentence from my last Post before you posted ;)

vBintense 08-06-2005 05:52 PM

I posted to fast then !! :)

Thanks for moving it Kirby , also for teaching me something new about plugins :)


All times are GMT. The time now is 08: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.01377 seconds
  • Memory Usage 1,746KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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