vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Show Thread Enhancements - First post on all pages (https://vborg.vbsupport.ru/showthread.php?t=239282)

ry215 04-12-2010 06:47 AM

updated. :D
added 1 option

ijob 04-12-2010 09:05 AM

Quote:

Originally Posted by ry215 (Post 2019789)
updated. :D
added 1 option

Can u explain what this option allows for please? I may just install it after more info :)

AndyP 04-12-2010 11:16 AM

Quote:

Originally Posted by ijob (Post 2019833)
Can u explain what this option allows for please? I may just install it after more info :)

I have just installed the update.

In the settings it has a new field for text entry of the template you want used for the first post. The default is 'postbit'.

Alucard^ 04-12-2010 11:17 AM

I like it but.... if i want to use this on only one subforum or forum? I have to exclude allllllllll the others forums/subforums... you can add an extra option to add the forum you only want to use the plugin? Thanks

ry215 04-12-2010 01:43 PM

Quote:

Originally Posted by Alucard^ (Post 2019882)
I like it but.... if i want to use this on only one subforum or forum? I have to exclude allllllllll the others forums/subforums... you can add an extra option to add the forum you only want to use the plugin? Thanks

open .xml file, search all !in_array and replace with in_array >>> it's became option you wanted

ArtakEVN 04-16-2010 04:27 AM

Quote:

updated.
added 1 option
Thanx ... installed

Greight 04-16-2010 05:40 AM

Can't this be enabled per-thread?

ArtakEVN 04-16-2010 06:08 AM

Quote:

Originally Posted by ry215 (Post 2019789)
updated. :D
added 1 option

I think something wrong with this option. There is no difference what is writen in "Template Name". even if I create a new template and write the new templates name. The first post template is unchanged. But if I edit it (my forum uses postbit_legacy) I get changed only the fist post look.

ry215 04-17-2010 03:11 AM

1 Attachment(s)
Quote:

Originally Posted by ArtakEVN (Post 2022039)
I think something wrong with this option. There is no difference what is writen in "Template Name". even if I create a new template and write the new templates name. The first post template is unchanged. But if I edit it (my forum uses postbit_legacy) I get changed only the fist post look.

I dont know what u did :D
but it's my result (see attach)

ArtakEVN 04-17-2010 07:38 PM

1 Attachment(s)
And here is my situation with product-firstonallpages(3).xml

atzaman 04-18-2010 10:41 PM

I'm having the same problem. Changing the Template Name in the options doesn't seem to change anything :(

atzaman 04-18-2010 11:08 PM

My solution is to edit postbit_legacy with an if condition which calls a plugin for my custom code

PHP Code:

<vb:if condition="$post['postid'] == $thread['firstpostid']">

{
vb:raw customfirstpost}

<
vb:else />

.......

</
vb:if> 


ry215 04-19-2010 05:06 AM

Quote:

Originally Posted by ArtakEVN (Post 2022834)
And here is my situation with product-firstonallpages(3).xml

:D one variable is incorrect, plz re-download (product-firstonallpages(3).xml)

ArtakEVN 04-19-2010 06:21 PM

Thank you. Excellent work!

Dr.osamA 04-19-2010 10:58 PM

thanxxx agen

marshal_ramdev 04-21-2010 04:20 AM

thanks mate :)

ry215 04-22-2010 01:43 PM

i think done 100% :D

ry215 04-24-2010 04:02 AM

Reserved :D

J6488EEA8E90 04-24-2010 05:32 AM

been looking for this for a while. Will check it out.

prevb 04-26-2010 02:28 PM

Good JOB man :D i like it

ArtakEVN 04-27-2010 01:33 PM

1 Attachment(s)
There is one more bug. My fistpost template name is "postbit_first". Content of this template is copied from "postbit" template (I'm using legacy). There is free space on firs post on first page. Please see attached images.

P.S. I find, that this is the vbulletin's bug.

ry215 04-29-2010 03:20 PM

it not my mod, it your template
you can edit it

Ronya 05-05-2010 07:59 PM

Great Mod Thank you
But can you make radio button on "Administrative" dropdown menu to enable it for different thread. Idea is to enable not all treads in some forum but just some threads.

i used mod like this on 3.6
Table "Thread" has field named showfirstpost

anyway you can see it on that code:
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="firstpostonall" active="1">
    <title>First Post on every pages 1.0.4</title>
    <description>This will allow you to show the first post on every page of a thread. (Eng. version)</description>
    <version>1.0.4</version>
    <codes>
        <code version="1.0.4">
            <installcode><![CDATA[$db->hide_errors();
$db->query_write("ALTER TABLE `". TABLE_PREFIX ."thread` ADD `showfirstpost` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL");
$db->show_errors();]]></installcode>
            <uninstallcode><![CDATA[$db->hide_errors();
$db->query_write("ALTER TABLE `". TABLE_PREFIX ."thread` DROP `showfirstpost`");
$db->show_errors();]]></uninstallcode>
        </code>
    </codes>
    <templates>
    </templates>
    <plugins>
        <plugin active="1">
            <title>First Post on every pages - postbit display complete</title>
            <hookname>postbit_display_complete</hookname>
            <phpcode><![CDATA[if ($this->thread['showfirstpost']=='1' AND $post['postid']==$this->thread['firstpostid'])
{
  if ($vbulletin->options['legacypostbit']=='1')
  {
    $this->templatename = 'postbit_legacy';
  }
  else
  {
    $this->templatename = 'postbit';
  }
}
$show['firstpostonall'] = true;]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>First Post on every pages - showthread postbit create</title>
            <hookname>showthread_postbit_create</hookname>
            <phpcode><![CDATA[if ($thread['showfirstpost'] AND $vbulletin->GPC['pagenumber'] > 1)
{
    if ($post['postid'] == $thread['firstpostid'])
    {
        $counter--;
        $post['postcount'] = '1';
    }
    else
    {
        $post['postcount']--;
    }
}]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>First Post on every pages - showthread post start</title>
            <hookname>showthread_post_start</hookname>
            <phpcode><![CDATA[if ($thread['showfirstpost']=='1' AND $threadedmode == 0 AND $thread['attach'])
{
    $thread['hasattach'] = $thread['attach'];
    unset($thread['attach']);
}]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>First Post on every pages - showthread query</title>
            <hookname>showthread_query</hookname>
            <phpcode><![CDATA[if ($thread['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;
        }     
        $thread['attach'] = $thread['hasattach'];
        unset($thread['hasattach']);
    }
}]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>First Post on every pages - action switch</title>
            <hookname>threadmanage_action_switch</hookname>
            <phpcode><![CDATA[if ($_REQUEST['do'] == 'stickpost')
{
    $handled_do = true;
    if (!$threadinfo['threadid'])
    {
        eval(standard_error(fetch_error('invalidid', $vbphrase['thread'], $vbulletin->options['contactuslink'])));
    }
}]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>First Post on every pages - main</title>
            <hookname>threadmanage_start</hookname>
            <phpcode><![CDATA[// ##### start stick/unstick post mod by YaR & kerk ######
if ($_POST['do'] == 'stickpost')
{
    if (($threadinfo['isdeleted'] AND !can_moderate($threadinfo['forumid'], 'candeleteposts')) OR (!$threadinfo['visible'] AND !can_moderate($threadinfo['forumid'], 'canmoderateposts')))
    {
        if (can_moderate($threadinfo['forumid']))
        {
            print_no_permission();
        }
        else
        {
            eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink'])));
        }
    }

    if (!can_moderate($threadinfo['forumid'], 'canmanagethreads'))
    {
        print_no_permission();
    }

    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

  $is_sticked    = $threadinfo['showfirstpost'];

    if ($threadinfo['showfirstpost'])
    {
        $db->query_write("UPDATE ".TABLE_PREFIX."thread SET showfirstpost = 0 WHERE  threadid = ". $threadinfo['threadid'] );
        $action = " Done: \"First Post Sticked\"";
    }
    else
    {
        $db->query_write("UPDATE ".TABLE_PREFIX."thread SET showfirstpost = 1 WHERE  threadid = ". $threadinfo['threadid'] );
        $action = " Done: \"First Post Unsticked\"";
    }

    $vbulletin->url = 'showthread.php?goto=newpost&' . $vbulletin->session->vars['sessionurl'] . "t=$threadid";
    eval(print_standard_redirect('redirect_sticky', true, true));
}
// ##### end stick/unstick post mod by YaR & kerk ######]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
        <phrasetype name="Show Thread" fieldname="showthread">
            <phrase name="stick_post"><![CDATA[Stick First Post.]]></phrase>
            <phrase name="unstick_post"><![CDATA[Unstick First Post.]]></phrase>
        </phrasetype>
        <phrasetype name="Front-End Redirect Messages" fieldname="frontredirect">
            <phrase name="stickyp"><![CDATA[$action]]></phrase>
        </phrasetype>
    </phrases>
    <options>
    </options>
</product>


ry215 05-06-2010 07:28 AM

i will try it, now busy T_T

J6488EEA8E90 05-08-2010 01:37 AM

Think this mod could be useful in some threads.
If you are using this mod, how do you find it and does it keep the thread better on course/topic?

ry215 05-08-2010 01:44 AM

Quote:

Originally Posted by J6488EEA8E90 (Post 2033510)
Think this mod could be useful in some threads.
If you are using this mod, how do you find it and does it keep the thread better on course/topic?

Updated: version 1.2 (product-firstonallpages(3).xml)

* Added: Custom First Post Template option


Updated: version 1.1 (product-firstonallpages(2).xml)

* Added: Enable/Disable option
* Added: List forums do not use first post on all pages option

Welshy2008 05-10-2010 01:08 PM

Someone mentioned that they use this in 3.8 - where is it for that please?

RY - Tagged for future use - Thank You.

murekhalir 05-11-2010 05:45 AM

niceee +!

ry215 05-18-2010 02:02 AM

good for all version 4xxx

Medina 05-19-2010 05:35 PM

Is it also possible to have this enabled for only 1 category (example; news section on a forum)

goxy63 06-14-2010 10:32 PM

Is it possible to make it work with vbulletin ad's properly
AdminCP>>>Advertising>>>add new ad>>>thread>>>first post content....
if I place new ad it will be displayed on second post not first one on each page, that is on post 1 advertise will not be displayed :[

cvn 06-15-2010 02:20 AM

Quote:

Originally Posted by Ronya (Post 2032282)
But can you make radio button on "Administrative" dropdown menu to enable it for different thread. Idea is to enable not all treads in some forum but just some threads.

I vote for this function too! Thank you ry215!

ijob 06-15-2010 05:40 AM

If the first post is a particularly long post, does this mod post an 'excerpt' of the first post and not the whole lot?

ry215 07-10-2010 12:48 AM

it working for 4.0.4...

wonderfulwat 07-11-2010 12:59 AM

Awesome!

emath 07-11-2010 05:12 AM

thanks, helpful.

Fraxter 07-12-2010 10:11 PM

Installed.

Would be much easier if i can include the forums which should use the first post addon. I've added over 50 forum id's for exclude. ;)

manutdvn 07-21-2010 05:13 PM

Quote:

Originally Posted by Pander23 (Post 2068277)
Installed.

Would be much easier if i can include the forums which should use the first post addon. I've added over 50 forum id's for exclude. ;)

Totally agree with you. Anyway, very useful. Thank you.

Welshy2008 08-17-2010 11:43 AM

Is this working an vBs 4.0.5 and 4.0.6 please?

AfterWorldForum 08-22-2010 04:17 PM

Quote:

Originally Posted by ijob (Post 2053882)
If the first post is a particularly long post, does this mod post an 'excerpt' of the first post and not the whole lot?

I would also like that option.

Quote:

Originally Posted by Welshy2008 (Post 2085204)
Is this working an vBs 4.0.5 and 4.0.6 please?

Yes, it works fine on 4.0.5 for me.


I tried using the additional first_post template, and was actually surprised to find out that this does not limit itself to only the non-first page of the thread, but also the first. Meaning even the original first post will be different (In my case, I made the colours a bit different and added a note stating this was a repost from the first post. However, it also affected every real first post, so I was forced to revert).

Could there be another option where this can be done? So if the pagenumber is higher than 1, use the alternate template. In all other cases, use the default.

Thanks :)


All times are GMT. The time now is 01:04 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.01486 seconds
  • Memory Usage 1,841KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (12)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
  • (40)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