vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Alternate First Post (https://vborg.vbsupport.ru/showthread.php?t=177709)

Digital Jedi 05-01-2008 10:00 AM

Alternate First Post
 
When trying to change the HTML of the fist post so you get a different look for the initial post (like they do for the mods section here), I've been using:

PHP Code:

<if condition="($post[postcount]=>1)"


But I don't think that's the best way to do this. And I've been searching for hours now, but postbit is such a common term here, that I can't really make any headway. What's the best way to achieve the look that they use here on vb.org? I'm using an alternate style to accomplish this. But I want the first post to be the only thing different.

valdet 05-01-2008 10:07 AM

Is this what you are looking for..?

https://vborg.vbsupport.ru/showthread.php?t=156141



Good luck.

Digital Jedi 05-01-2008 10:21 AM

Perhaps even more then I was looking for. Didn't expect to find something that kept the post on every page. Thanks. I'll consider it.

But, I was hoping to be able to do the editing manually. Something more along the lines of some basic <if> conditionals and where to put them.

Lynne 05-01-2008 03:25 PM

I'm playing with this on my test site. I only wanted to change the first post for one of my forums though. I created a plugin at "postbit_display_complete" and put in:

PHP Code:

 if ($this->forum['forumid']==xx AND $post['postid']==$this->thread['firstpostid'])
{
$this->templatename 'postbit_new';


In this example, xx is the forum I am using this in and I copied the postbit_legacy template and modified it and named it 'postbit_new'. It's very simple and works just fine.

Digital Jedi 05-03-2008 05:08 AM

I was hoping for something straightforward just like that. I'll give it a try and post back. Thanks a bunch.

Digital Jedi 05-04-2008 07:40 AM

Hrm, seems I get one of those repetitive Parse error: syntax error, unexpected '{' in FILE PATH/includes/class_postbit.php(296) : eval()'d code on line 207 at the top of the page. No changes either. Should I have made a file edit to postbit.php as well?


EDIT: Hrm, it appears there was a parenthesis missing in the plugin code. At the very least, changing this [firstpostid]) to this [firstpostid])) took care of my problem. <perplexed> :D

--------------- Added 04 May 2008 at 05:20 ---------------

Another quick question, if you don't mind. Do I need to create a separate plugin for each forum ID, or can I separate forum IDs in the plugin code just by separating them with a comma?

Opserty 05-04-2008 12:01 PM

Quote:

Originally Posted by Digital Jedi (Post 1507787)
Another quick question, if you don't mind. Do I need to create a separate plugin for each forum ID, or can I separate forum IDs in the plugin code just by separating them with a comma?

Use:
PHP Code:

if(in_array($this->forum['forumid'], array(XXYYZZ)) AND $post['postid'] == $this->thread['firstpostid'])
{
    
$this->templatename 'postbit_new';



Lynne 05-04-2008 03:13 PM

Quote:

Originally Posted by Digital Jedi (Post 1507787)
EDIT: Hrm, it appears there was a parenthesis missing in the plugin code. At the very least, changing this [firstpostid]) to this [firstpostid])) took care of my problem. <perplexed> :D

Whoops. Looks like when I copied the code from my template and erased part of it, I left an extra parenthesis in there. Sorry about that. I fixed it above. If you want it for several forums, see Opserty's post to use the array for forumids.

Digital Jedi 05-06-2008 11:35 AM

Heheh, that's okay. Seems to be working perfectly for me. Many thanks to both of you. I created a template called postbit_articles with the custom HTML, and it's working just the way I had hoped. The only minor little thing I ran into is a small null is not an object error after editing a post in the full editor. Is it possible I left something out in the recreation of the postbit?

Lynne 05-06-2008 01:54 PM

Quote:

Originally Posted by Digital Jedi (Post 1510300)
Heheh, that's okay. Seems to be working perfectly for me. Many thanks to both of you. I created a template called postbit_articles with the custom HTML, and it's working just the way I had hoped. The only minor little thing I ran into is a small null is not an object error after editing a post in the full editor. Is it possible I left something out in the recreation of the postbit?

It's possible, but what I would do is do a bit of investigation. If you get that error every time you edit, then try turning off the plugin that uses this new template and then go to edit it again (it will then be using the old template) and see if you still get the error.


All times are GMT. The time now is 03:28 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.01015 seconds
  • Memory Usage 1,748KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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